@nextclaw/ui 0.5.44 → 0.5.46
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/.eslintrc.cjs +9 -1
- package/CHANGELOG.md +12 -0
- package/dist/assets/{ChannelsList-kdz_pQRQ.js → ChannelsList-C5IzoBSZ.js} +1 -1
- package/dist/assets/{ChatPage-vmfB4StI.js → ChatPage-BEBmDqtw.js} +16 -16
- package/dist/assets/{CronConfig-D8QiHntw.js → CronConfig-BdLVPoNw.js} +1 -1
- package/dist/assets/{DocBrowser-BdKFjf2T.js → DocBrowser-DzsZUzgQ.js} +1 -1
- package/dist/assets/{MarketplacePage-jT2Cj2FS.js → MarketplacePage-DmDTJ27k.js} +1 -1
- package/dist/assets/ModelConfig-DQ1d3Dtn.js +1 -0
- package/dist/assets/{ProvidersList-au9Q8xIL.js → ProvidersList-snuzM5CK.js} +1 -1
- package/dist/assets/{RuntimeConfig-Djcfoecg.js → RuntimeConfig-BSDP51k6.js} +1 -1
- package/dist/assets/{SecretsConfig-Bs8bO57w.js → SecretsConfig-DlNYyu9I.js} +1 -1
- package/dist/assets/{SessionsConfig-CeOH3Vh9.js → SessionsConfig-Dt9heKTD.js} +1 -1
- package/dist/assets/{card-C2jKo5tE.js → card-KmfXQ4Bm.js} +1 -1
- package/dist/assets/chat-message-pw9oafI4.js +5 -0
- package/dist/assets/index-BhpPLO5K.js +2 -0
- package/dist/assets/{label-BURcXxZp.js → label-iF47BkaM.js} +1 -1
- package/dist/assets/{logos-DoS5bu0G.js → logos-C8Yako2a.js} +1 -1
- package/dist/assets/{page-layout-DMUp0jHP.js → page-layout-sZk-HtoA.js} +1 -1
- package/dist/assets/{switch-DM8pekb5.js → switch-BnYsX3uS.js} +1 -1
- package/dist/assets/{tabs-custom-ejQWwM4d.js → tabs-custom-BEBNjTRA.js} +1 -1
- package/dist/assets/{useConfig-D13AjhG4.js → useConfig-DJ_KEVx0.js} +1 -1
- package/dist/assets/{useConfirmDialog-_e4rID-G.js → useConfirmDialog-BwqRK1uy.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/components/chat/ChatPage.tsx +7 -2
- package/src/components/chat/ChatThread.tsx +23 -16
- package/src/components/config/ModelConfig.tsx +1 -1
- package/src/lib/chat-message.ts +89 -65
- package/src/lib/i18n.ts +4 -0
- package/dist/assets/ModelConfig-BK0XQV_V.js +0 -1
- package/dist/assets/chat-message-D0s61C4e.js +0 -5
- package/dist/assets/index-Cya-J8N_.js +0 -2
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import{U as Rr,j as k,r as $,W as Qi,X as Yi,Y as jr,Z as Xi,_ as _r,a0 as Gi,a1 as Ji,a2 as Zi,a3 as el,a4 as Ln,a5 as zn,a6 as Fn,a7 as tl,a8 as nl}from"./vendor-DfLizrKM.js";import{u as rl,d as il,e as ll,f as ol,s as al,I as sl}from"./useConfig-D13AjhG4.js";import{u as ul}from"./useConfirmDialog-_e4rID-G.js";import{P as cl,a as fl,B as Ue}from"./page-layout-DMUp0jHP.js";import{f as Or,c as de,t as M,S as Rn,a as jn,b as _n,d as On,e as Ft}from"./index-Cya-J8N_.js";import{b as hl,n as pl,e as ml,a as dl,c as gl}from"./chat-message-D0s61C4e.js";function xl(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const yl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bl={};function Mn(e,n){return(bl.jsx?kl:yl).test(e)}const wl=/[ \t\n\f\r]/g;function Sl(e){return typeof e=="object"?e.type==="text"?Bn(e.value):!1:Bn(e)}function Bn(e){return e.replace(wl,"")===""}class mt{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}mt.prototype.normal={};mt.prototype.property={};mt.prototype.space=void 0;function Mr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new mt(t,r,n)}function Zt(e){return e.toLowerCase()}class ce{constructor(n,t){this.attribute=t,this.property=n}}ce.prototype.attribute="";ce.prototype.booleanish=!1;ce.prototype.boolean=!1;ce.prototype.commaOrSpaceSeparated=!1;ce.prototype.commaSeparated=!1;ce.prototype.defined=!1;ce.prototype.mustUseProperty=!1;ce.prototype.number=!1;ce.prototype.overloadedBoolean=!1;ce.prototype.property="";ce.prototype.spaceSeparated=!1;ce.prototype.space=void 0;let Cl=0;const O=Be(),te=Be(),en=Be(),I=Be(),G=Be(),Ke=Be(),me=Be();function Be(){return 2**++Cl}const tn=Object.freeze(Object.defineProperty({__proto__:null,boolean:O,booleanish:te,commaOrSpaceSeparated:me,commaSeparated:Ke,number:I,overloadedBoolean:en,spaceSeparated:G},Symbol.toStringTag,{value:"Module"})),Rt=Object.keys(tn);class mn extends ce{constructor(n,t,r,i){let o=-1;if(super(n,t),Hn(this,"space",i),typeof r=="number")for(;++o<Rt.length;){const l=Rt[o];Hn(this,Rt[o],(r&tn[l])===tn[l])}}}mn.prototype.defined=!0;function Hn(e,n,t){t&&(e[n]=t)}function Ye(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new mn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[Zt(r)]=r,t[Zt(o.attribute)]=r}return new mt(n,t,e.space)}const Br=Ye({properties:{ariaActiveDescendant:null,ariaAtomic:te,ariaAutoComplete:null,ariaBusy:te,ariaChecked:te,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:G,ariaCurrent:null,ariaDescribedBy:G,ariaDetails:null,ariaDisabled:te,ariaDropEffect:G,ariaErrorMessage:null,ariaExpanded:te,ariaFlowTo:G,ariaGrabbed:te,ariaHasPopup:null,ariaHidden:te,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:G,ariaLevel:I,ariaLive:null,ariaModal:te,ariaMultiLine:te,ariaMultiSelectable:te,ariaOrientation:null,ariaOwns:G,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:te,ariaReadOnly:te,ariaRelevant:null,ariaRequired:te,ariaRoleDescription:G,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:te,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Hr(e,n){return n in e?e[n]:n}function qr(e,n){return Hr(e,n.toLowerCase())}const El=Ye({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ke,acceptCharset:G,accessKey:G,action:null,allow:null,allowFullScreen:O,allowPaymentRequest:O,allowUserMedia:O,alt:null,as:null,async:O,autoCapitalize:null,autoComplete:G,autoFocus:O,autoPlay:O,blocking:G,capture:null,charSet:null,checked:O,cite:null,className:G,cols:I,colSpan:null,content:null,contentEditable:te,controls:O,controlsList:G,coords:I|Ke,crossOrigin:null,data:null,dateTime:null,decoding:null,default:O,defer:O,dir:null,dirName:null,disabled:O,download:en,draggable:te,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:O,formTarget:null,headers:G,height:I,hidden:en,high:I,href:null,hrefLang:null,htmlFor:G,httpEquiv:G,id:null,imageSizes:null,imageSrcSet:null,inert:O,inputMode:null,integrity:null,is:null,isMap:O,itemId:null,itemProp:G,itemRef:G,itemScope:O,itemType:G,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:O,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:O,muted:O,name:null,nonce:null,noModule:O,noValidate:O,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:O,optimum:I,pattern:null,ping:G,placeholder:null,playsInline:O,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:O,referrerPolicy:null,rel:G,required:O,reversed:O,rows:I,rowSpan:I,sandbox:G,scope:null,scoped:O,seamless:O,selected:O,shadowRootClonable:O,shadowRootDelegatesFocus:O,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:te,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:O,useMap:null,value:te,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:G,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:O,declare:O,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:O,noHref:O,noShade:O,noWrap:O,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:te,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:O,disableRemotePlayback:O,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:qr}),Il=Ye({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:me,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:G,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:O,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:Ke,g2:Ke,glyphName:Ke,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:me,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:G,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:me,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:me,rev:me,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:me,requiredFeatures:me,requiredFonts:me,requiredFormats:me,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:me,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:me,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:me,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Hr}),Ur=Ye({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()}}),$r=Ye({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:qr}),Vr=Ye({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),vl={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"},Al=/[A-Z]/g,qn=/-[a-z]/g,Tl=/^data[-\w.:]+$/i;function Pl(e,n){const t=Zt(n);let r=n,i=ce;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Tl.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(qn,Nl);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!qn.test(o)){let l=o.replace(Al,Dl);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=mn}return new i(r,n)}function Dl(e){return"-"+e.toLowerCase()}function Nl(e){return e.charAt(1).toUpperCase()}const Ll=Mr([Br,El,Ur,$r,Vr],"html"),dn=Mr([Br,Il,Ur,$r,Vr],"svg");function zl(e){return e.join(" ").trim()}var $e={},jt,Un;function Fl(){if(Un)return jt;Un=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
|
|
2
|
-
`,u="/",f="*",c="",p="comment",h="declaration";function g(C,x){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];x=x||{};var v=1,E=1;function j(L){var T=L.match(n);T&&(v+=T.length);var B=L.lastIndexOf(s);E=~B?L.length-B:E+L.length}function F(){var L={line:v,column:E};return function(T){return T.position=new b(L),U(),T}}function b(L){this.start=L,this.end={line:v,column:E},this.source=x.source}b.prototype.content=C;function _(L){var T=new Error(x.source+":"+v+":"+E+": "+L);if(T.reason=L,T.filename=x.source,T.line=v,T.column=E,T.source=C,!x.silent)throw T}function W(L){var T=L.exec(C);if(T){var B=T[0];return j(B),C=C.slice(B.length),T}}function U(){W(t)}function y(L){var T;for(L=L||[];T=N();)T!==!1&&L.push(T);return L}function N(){var L=F();if(!(u!=C.charAt(0)||f!=C.charAt(1))){for(var T=2;c!=C.charAt(T)&&(f!=C.charAt(T)||u!=C.charAt(T+1));)++T;if(T+=2,c===C.charAt(T-1))return _("End of comment missing");var B=C.slice(2,T-2);return E+=2,j(B),C=C.slice(T),E+=2,L({type:p,comment:B})}}function D(){var L=F(),T=W(r);if(T){if(N(),!W(i))return _("property missing ':'");var B=W(o),X=L({type:h,property:S(T[0].replace(e,c)),value:B?S(B[0].replace(e,c)):c});return W(l),X}}function K(){var L=[];y(L);for(var T;T=D();)T!==!1&&(L.push(T),y(L));return L}return U(),K()}function S(C){return C?C.replace(a,c):c}return jt=g,jt}var $n;function Rl(){if($n)return $e;$n=1;var e=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0}),$e.default=t;const n=e(Fl());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:f}=s;a?i(u,f,s):f&&(o=o||{},o[u]=f)}),o}return $e}var rt={},Vn;function jl(){if(Vn)return rt;Vn=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,l))};return rt.camelCase=s,rt}var it,Wn;function _l(){if(Wn)return it;Wn=1;var e=it&&it.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Rl()),t=jl();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,s){a&&s&&(l[(0,t.camelCase)(a,o)]=s)}),l}return r.default=r,it=r,it}var Ol=_l();const Ml=Rr(Ol),Wr=Kr("end"),gn=Kr("start");function Kr(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 Qr(e){const n=gn(e),t=Wr(e);if(n&&t)return{start:n,end:t}}function at(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Kn(e.position):"start"in e||"end"in e?Kn(e):"line"in e||"column"in e?nn(e):""}function nn(e){return Qn(e&&e.line)+":"+Qn(e&&e.column)}function Kn(e){return nn(e&&e.start)+"-"+nn(e&&e.end)}function Qn(e){return e&&typeof e=="number"?e:1}class le extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=at(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}le.prototype.file="";le.prototype.name="";le.prototype.reason="";le.prototype.message="";le.prototype.stack="";le.prototype.column=void 0;le.prototype.line=void 0;le.prototype.ancestors=void 0;le.prototype.cause=void 0;le.prototype.fatal=void 0;le.prototype.place=void 0;le.prototype.ruleId=void 0;le.prototype.source=void 0;const xn={}.hasOwnProperty,Bl=new Map,Hl=/[A-Z]/g,ql=new Set(["table","tbody","thead","tfoot","tr"]),Ul=new Set(["td","th"]),Yr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $l(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=Jl(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=Gl(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"?dn:Ll,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=Xr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Xr(e,n,t){if(n.type==="element")return Vl(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Wl(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ql(e,n,t);if(n.type==="mdxjsEsm")return Kl(e,n);if(n.type==="root")return Yl(e,n,t);if(n.type==="text")return Xl(e,n)}function Vl(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=dn,e.schema=i),e.ancestors.push(n);const o=Jr(e,n.tagName,!1),l=Zl(e,n);let a=kn(e,n);return ql.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Sl(s):!0})),Gr(e,l,o,n),yn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Wl(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 Kl(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ct(e,n.position)}function Ql(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=dn,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Jr(e,n.name,!0),l=eo(e,n),a=kn(e,n);return Gr(e,l,o,n),yn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Yl(e,n,t){const r={};return yn(r,kn(e,n)),e.create(n,e.Fragment,r,t)}function Xl(e,n){return n.value}function Gr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function yn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Gl(e,n,t){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?t:n;return a?u(o,l,a):u(o,l)}}function Jl(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),s=gn(r);return n(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Zl(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&xn.call(n.properties,i)){const o=to(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Ul.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function eo(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else ct(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else ct(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function kn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Bl;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){const u=i.get(s)||0;l=s+"-"+u,i.set(s,u+1)}}const a=Xr(e,o,l);a!==void 0&&t.push(a)}return t}function to(e,n,t){const r=Pl(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?xl(t):zl(t)),r.property==="style"){let i=typeof t=="object"?t:no(e,String(t));return e.stylePropertyNameCase==="css"&&(i=ro(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?vl[r.property]||r.property:r.attribute,t]}}function no(e,n){try{return Ml(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new le("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Yr+"#cannot-parse-style-attribute",i}}function Jr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=Mn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Mn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return xn.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 le("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Yr+"#cannot-handle-mdx-estrees-without-createevaluater",t}function ro(e){const n={};let t;for(t in e)xn.call(e,t)&&(n[io(t)]=e[t]);return n}function io(e){let n=e.replace(Hl,lo);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function lo(e){return"-"+e.toLowerCase()}const _t={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"]},oo={};function bn(e,n){const t=oo,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Zr(e,r,i)}function Zr(e,n,t){if(ao(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 Yn(e.children,n,t)}return Array.isArray(e)?Yn(e,n,t):""}function Yn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Zr(e[i],n,t);return r.join("")}function ao(e){return!!(e&&typeof e=="object")}const Xn=document.createElement("i");function wn(e){const n="&"+e+";";Xn.innerHTML=n;const t=Xn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ge(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function xe(e,n){return e.length>0?(ge(e,e.length,0,n),e):n}const Gn={}.hasOwnProperty;function ei(e){const n={};let t=-1;for(;++t<e.length;)so(n,e[t]);return n}function so(e,n){let t;for(t in n){const i=(Gn.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){Gn.call(i,l)||(i[l]=[]);const a=o[l];uo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function uo(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ge(e,0,0,r)}function ti(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 we(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ae=ze(/[A-Za-z]/),ie=ze(/[\dA-Za-z]/),co=ze(/[#-'*+\--9=?A-Z^-~]/);function vt(e){return e!==null&&(e<32||e===127)}const rn=ze(/\d/),fo=ze(/[\dA-Fa-f]/),ho=ze(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}const Pt=ze(new RegExp("\\p{P}|\\p{S}","u")),Me=ze(/\s/);function ze(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Xe(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&ie(e.charCodeAt(t+1))&&ie(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function V(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return q(s)?(e.enter(t),a(s)):n(s)}function a(s){return q(s)&&o++<i?(e.consume(s),a):(e.exit(t),n(s))}}const po={tokenize:mo};function mo(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),V(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const go={tokenize:xo},Jn={tokenize:yo};function xo(e){const n=this,t=[];let r=0,i,o,l;return a;function a(E){if(r<t.length){const j=t[r];return n.containerState=j[1],e.attempt(j[0].continuation,s,u)(E)}return u(E)}function s(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const j=n.events.length;let F=j,b;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){b=n.events[F][1].end;break}x(r);let _=j;for(;_<n.events.length;)n.events[_][1].end={...b},_++;return ge(n.events,F+1,0,n.events.slice(j)),n.events.length=_,u(E)}return a(E)}function u(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Jn,f,c)(E)}function f(E){return i&&v(),x(r),p(E)}function c(E){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(E)}function p(E){return n.containerState={},e.attempt(Jn,h,g)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function g(E){if(E===null){i&&v(),x(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(E)}function S(E){if(E===null){C(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return z(E)?(e.consume(E),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),S)}function C(E,j){const F=n.sliceStream(E);if(j&&F.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(F),n.parser.lazy[E.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const _=n.events.length;let W=_,U,y;for(;W--;)if(n.events[W][0]==="exit"&&n.events[W][1].type==="chunkFlow"){if(U){y=n.events[W][1].end;break}U=!0}for(x(r),b=_;b<n.events.length;)n.events[b][1].end={...y},b++;ge(n.events,W+1,0,n.events.slice(_)),n.events.length=b}}function x(E){let j=t.length;for(;j-- >E;){const F=t[j];n.containerState=F[1],F[0].exit.call(n,e)}t.length=E}function v(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function yo(e,n,t){return V(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qe(e){if(e===null||Y(e)||Me(e))return 1;if(Pt(e))return 2}function Dt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const ln={name:"attention",resolveAll:ko,tokenize:bo};function ko(e,n){let t=-1,r,i,o,l,a,s,u,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};Zn(c,-s),Zn(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=xe(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=xe(u,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),u=xe(u,Dt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=xe(u,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,u=xe(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,ge(e,r-1,t-r+3,u),t=r+u.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function bo(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Qe(r);let o;return l;function l(s){return o=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===o)return e.consume(s),a;const u=e.exit("attentionSequence"),f=Qe(s),c=!f||f===2&&i||t.includes(s),p=!i||i===2&&f||t.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),n(s)}}function Zn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const wo={name:"autolink",tokenize:So};function So(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ae(h)?(e.consume(h),l):h===64?t(h):u(h)}function l(h){return h===43||h===45||h===46||ie(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||ie(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function s(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||vt(h)?t(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),f):co(h)?(e.consume(h),u):t(h)}function f(h){return ie(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||ie(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const dt={partial:!0,tokenize:Co};function Co(e,n,t){return r;function r(o){return q(o)?V(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?n(o):t(o)}}const ni={continuation:{tokenize:Io},exit:vo,name:"blockQuote",tokenize:Eo};function Eo(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return q(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function Io(e,n,t){const r=this;return i;function i(l){return q(l)?V(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(ni,n,t)(l)}}function vo(e){e.exit("blockQuote")}const ri={name:"characterEscape",tokenize:Ao};function Ao(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return ho(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ii={name:"characterReference",tokenize:To};function To(e,n,t){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),s}function s(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=ie,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=fo,f):(e.enter("characterReferenceValue"),o=7,l=rn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===ie&&!wn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const er={partial:!0,tokenize:Do},tr={concrete:!0,name:"codeFenced",tokenize:Po};function Po(e,n,t){const r=this,i={partial:!0,tokenize:F};let o=0,l=0,a;return s;function s(b){return u(b)}function u(b){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?t(b):(e.exit("codeFencedFenceSequence"),q(b)?V(e,c,"whitespace")(b):c(b))}function c(b){return b===null||z(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(er,S,j)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):q(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(b)):b===96&&b===a?t(b):(e.consume(b),p)}function h(b){return b===null||z(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?t(b):(e.consume(b),g)}function S(b){return e.attempt(i,j,C)(b)}function C(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),x}function x(b){return o>0&&q(b)?V(e,v,"linePrefix",o+1)(b):v(b)}function v(b){return b===null||z(b)?e.check(er,S,j)(b):(e.enter("codeFlowValue"),E(b))}function E(b){return b===null||z(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),E)}function j(b){return e.exit("codeFenced"),n(b)}function F(b,_,W){let U=0;return y;function y(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),N}function N(T){return b.enter("codeFencedFence"),q(T)?V(b,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):D(T)}function D(T){return T===a?(b.enter("codeFencedFenceSequence"),K(T)):W(T)}function K(T){return T===a?(U++,b.consume(T),K):U>=l?(b.exit("codeFencedFenceSequence"),q(T)?V(b,L,"whitespace")(T):L(T)):W(T)}function L(T){return T===null||z(T)?(b.exit("codeFencedFence"),_(T)):W(T)}}}function Do(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const Ot={name:"codeIndented",tokenize:Lo},No={partial:!0,tokenize:zo};function Lo(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):t(u)}function l(u){return u===null?s(u):z(u)?e.attempt(No,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function zo(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):V(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):z(l)?i(l):t(l)}}const Fo={name:"codeText",previous:jo,resolve:Ro,tokenize:_o};function Ro(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 jo(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _o(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),s(c))}function s(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),s):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||z(c)?(e.exit("codeTextData"),s(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",u(c))}}class Oo{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&<(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),lt(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),lt(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);lt(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);lt(this.left,t.reverse())}}}function lt(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 li(e){const n={};let t=-1,r,i,o,l,a,s,u;const f=new Oo(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Mo(f,t)),t=n[t],u=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return ge(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Mo(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,s=[],u={};let f,c,p=-1,h=t,g=0,S=0;const C=[S];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(S=p+1,C.push(S),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):C.pop(),p=C.length;p--;){const x=a.slice(C[p],C[p+1]),v=o.pop();s.push([v,v+x.length-1]),e.splice(v,2,x)}for(s.reverse(),p=-1;++p<s.length;)u[g+s[p][0]]=g+s[p][1],g+=s[p][1]-s[p][0]-1;return u}const Bo={resolve:qo,tokenize:Uo},Ho={partial:!0,tokenize:$o};function qo(e){return li(e),e}function Uo(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?e.check(Ho,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function $o(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),V(e,o,"linePrefix")}function o(l){if(l===null||z(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function oi(e,n,t,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||vt(x)?t(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),S(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||z(x)?t(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function S(x){return!f&&(x===null||x===41||Y(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(x)):f<u&&x===40?(e.consume(x),f++,S):x===41?(e.consume(x),f--,S):x===null||x===32||x===40||vt(x)?t(x):(e.consume(x),x===92?C:S)}function C(x){return x===40||x===41||x===92?(e.consume(x),S):S(x)}}function ai(e,n,t,r,i,o){const l=this;let a=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),s||(s=!q(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function si(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):t(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?t(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function st(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):q(i)?V(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Vo={name:"definition",tokenize:Ko},Wo={partial:!0,tokenize:Qo};function Ko(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return ai.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):t(h)}function s(h){return Y(h)?st(e,u)(h):u(h)}function u(h){return oi(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Wo,c,c)(h)}function c(h){return q(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Qo(e,n,t){return r;function r(a){return Y(a)?st(e,i)(a):t(a)}function i(a){return si(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return q(a)?V(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?n(a):t(a)}}const Yo={name:"hardBreakEscape",tokenize:Xo};function Xo(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Go={name:"headingAtx",resolve:Jo,tokenize:Zo};function Jo(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ge(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function Zo(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||Y(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||z(f)?(e.exit("atxHeading"),n(f)):q(f)?V(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||Y(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const ea=["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"],nr=["pre","script","style","textarea"],ta={concrete:!0,name:"htmlFlow",resolveTo:ia,tokenize:la},na={partial:!0,tokenize:aa},ra={partial:!0,tokenize:oa};function ia(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 la(e,n,t){const r=this;let i,o,l,a,s;return u;function u(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,S):d===63?(e.consume(d),i=3,r.interrupt?n:m):ae(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ae(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const Z="CDATA[";return d===Z.charCodeAt(a++)?(e.consume(d),a===Z.length?r.interrupt?n:D:g):t(d)}function S(d){return ae(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function C(d){if(d===null||d===47||d===62||Y(d)){const Z=d===47,Ie=l.toLowerCase();return!Z&&!o&&nr.includes(Ie)?(i=1,r.interrupt?n(d):D(d)):ea.includes(l.toLowerCase())?(i=6,Z?(e.consume(d),x):r.interrupt?n(d):D(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?v(d):E(d))}return d===45||ie(d)?(e.consume(d),l+=String.fromCharCode(d),C):t(d)}function x(d){return d===62?(e.consume(d),r.interrupt?n:D):t(d)}function v(d){return q(d)?(e.consume(d),v):y(d)}function E(d){return d===47?(e.consume(d),y):d===58||d===95||ae(d)?(e.consume(d),j):q(d)?(e.consume(d),E):y(d)}function j(d){return d===45||d===46||d===58||d===95||ie(d)?(e.consume(d),j):F(d)}function F(d){return d===61?(e.consume(d),b):q(d)?(e.consume(d),F):E(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),s=d,_):q(d)?(e.consume(d),b):W(d)}function _(d){return d===s?(e.consume(d),s=null,U):d===null||z(d)?t(d):(e.consume(d),_)}function W(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||Y(d)?F(d):(e.consume(d),W)}function U(d){return d===47||d===62||q(d)?E(d):t(d)}function y(d){return d===62?(e.consume(d),N):t(d)}function N(d){return d===null||z(d)?D(d):q(d)?(e.consume(d),N):t(d)}function D(d){return d===45&&i===2?(e.consume(d),B):d===60&&i===1?(e.consume(d),X):d===62&&i===4?(e.consume(d),fe):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),ye):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(na,oe,K)(d)):d===null||z(d)?(e.exit("htmlFlowData"),K(d)):(e.consume(d),D)}function K(d){return e.check(ra,L,oe)(d)}function L(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?K(d):(e.enter("htmlFlowData"),D(d))}function B(d){return d===45?(e.consume(d),m):D(d)}function X(d){return d===47?(e.consume(d),l="",se):D(d)}function se(d){if(d===62){const Z=l.toLowerCase();return nr.includes(Z)?(e.consume(d),fe):D(d)}return ae(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),se):D(d)}function ye(d){return d===93?(e.consume(d),m):D(d)}function m(d){return d===62?(e.consume(d),fe):d===45&&i===2?(e.consume(d),m):D(d)}function fe(d){return d===null||z(d)?(e.exit("htmlFlowData"),oe(d)):(e.consume(d),fe)}function oe(d){return e.exit("htmlFlow"),n(d)}}function oa(e,n,t){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function aa(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(dt,n,t)}}const sa={name:"htmlText",tokenize:ua};function ua(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),E):ae(m)?(e.consume(m),W):t(m)}function u(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):ae(m)?(e.consume(m),v):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):z(m)?(l=c,X(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?B(m):m===45?p(m):c(m)}function g(m){const fe="CDATA[";return m===fe.charCodeAt(o++)?(e.consume(m),o===fe.length?S:g):t(m)}function S(m){return m===null?t(m):m===93?(e.consume(m),C):z(m)?(l=S,X(m)):(e.consume(m),S)}function C(m){return m===93?(e.consume(m),x):S(m)}function x(m){return m===62?B(m):m===93?(e.consume(m),x):S(m)}function v(m){return m===null||m===62?B(m):z(m)?(l=v,X(m)):(e.consume(m),v)}function E(m){return m===null?t(m):m===63?(e.consume(m),j):z(m)?(l=E,X(m)):(e.consume(m),E)}function j(m){return m===62?B(m):E(m)}function F(m){return ae(m)?(e.consume(m),b):t(m)}function b(m){return m===45||ie(m)?(e.consume(m),b):_(m)}function _(m){return z(m)?(l=_,X(m)):q(m)?(e.consume(m),_):B(m)}function W(m){return m===45||ie(m)?(e.consume(m),W):m===47||m===62||Y(m)?U(m):t(m)}function U(m){return m===47?(e.consume(m),B):m===58||m===95||ae(m)?(e.consume(m),y):z(m)?(l=U,X(m)):q(m)?(e.consume(m),U):B(m)}function y(m){return m===45||m===46||m===58||m===95||ie(m)?(e.consume(m),y):N(m)}function N(m){return m===61?(e.consume(m),D):z(m)?(l=N,X(m)):q(m)?(e.consume(m),N):U(m)}function D(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,K):z(m)?(l=D,X(m)):q(m)?(e.consume(m),D):(e.consume(m),L)}function K(m){return m===i?(e.consume(m),i=void 0,T):m===null?t(m):z(m)?(l=K,X(m)):(e.consume(m),K)}function L(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||Y(m)?U(m):(e.consume(m),L)}function T(m){return m===47||m===62||Y(m)?U(m):t(m)}function B(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function X(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),se}function se(m){return q(m)?V(e,ye,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ye(m)}function ye(m){return e.enter("htmlTextData"),l(m)}}const Sn={name:"labelEnd",resolveAll:pa,resolveTo:ma,tokenize:da},ca={tokenize:ga},fa={tokenize:xa},ha={tokenize:ya};function pa(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&&ge(e,0,e.length,t),e}function ma(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=xe(a,e.slice(o+1,o+r+3)),a=xe(a,[["enter",f,n]]),a=xe(a,Dt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=xe(a,[["exit",f,n],e[l-2],e[l-1],["exit",u,n]]),a=xe(a,e.slice(l+1)),a=xe(a,[["exit",s,n]]),ge(e,o,e.length,a),e}function da(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(we(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):t(p)}function s(p){return p===40?e.attempt(ca,f,l?f:c)(p):p===91?e.attempt(fa,f,l?u:c)(p):l?f(p):c(p)}function u(p){return e.attempt(ha,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function ga(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 Y(c)?st(e,o)(c):o(c)}function o(c){return c===41?f(c):oi(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return Y(c)?st(e,s)(c):f(c)}function a(c){return t(c)}function s(c){return c===34||c===39||c===40?si(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Y(c)?st(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function xa(e,n,t){const r=this;return i;function i(a){return ai.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function ya(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ka={name:"labelStartImage",resolveAll:Sn.resolveAll,tokenize:ba};function ba(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const wa={name:"labelStartLink",resolveAll:Sn.resolveAll,tokenize:Sa};function Sa(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Mt={name:"lineEnding",tokenize:Ca};function Ca(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,n,"linePrefix")}}const It={name:"thematicBreak",tokenize:Ea};function Ea(e,n,t){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||z(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),q(u)?V(e,a,"whitespace")(u):a(u))}}const ue={continuation:{tokenize:Ta},exit:Da,name:"list",tokenize:Aa},Ia={partial:!0,tokenize:Na},va={partial:!0,tokenize:Pa};function Aa(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:rn(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(It,t,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return t(h)}function s(h){return rn(h)&&++l<10?(e.consume(h),s):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):t(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(dt,r.interrupt?t:f,e.attempt(Ia,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return q(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Ta(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(dt,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!q(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(va,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(ue,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Pa(e,n,t){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function Da(e){e.exit(this.containerState.type)}function Na(e,n,t){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!q(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const rr={name:"setextUnderline",resolveTo:La,tokenize:za};function La(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function za(e,n,t){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):t(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),q(u)?V(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Fa={tokenize:Ra};function Ra(e){const n=this,t=e.attempt(dt,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Bo,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const ja={resolveAll:ci()},_a=ui("string"),Oa=ui("text");function ui(e){return{resolveAll:ci(e==="text"?Ma:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return u(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),s}function s(f){return u(f)?(t.exit("data"),o(f)):(t.consume(f),s)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ci(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function Ma(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,s;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(u===-2)s=!0,a++;else if(u!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const Ba={42:ue,43:ue,45:ue,48:ue,49:ue,50:ue,51:ue,52:ue,53:ue,54:ue,55:ue,56:ue,57:ue,62:ni},Ha={91:Vo},qa={[-2]:Ot,[-1]:Ot,32:Ot},Ua={35:Go,42:It,45:[rr,It],60:ta,61:rr,95:It,96:tr,126:tr},$a={38:ii,92:ri},Va={[-5]:Mt,[-4]:Mt,[-3]:Mt,33:ka,38:ii,42:ln,60:[wo,sa],91:wa,92:[Yo,ri],93:Sn,95:ln,96:Fo},Wa={null:[ln,ja]},Ka={null:[42,95]},Qa={null:[]},Ya=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ka,contentInitial:Ha,disable:Qa,document:Ba,flow:Ua,flowInitial:qa,insideSpan:Wa,string:$a,text:Va},Symbol.toStringTag,{value:"Module"}));function Xa(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const s={attempt:_(F),check:_(b),consume:v,enter:E,exit:j,interrupt:_(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:S,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(u,s);return n.resolveAll&&o.push(n),u;function c(N){return l=xe(l,N),C(),l[l.length-1]!==null?[]:(W(n,0),u.events=Dt(o,u.events,u),u.events)}function p(N,D){return Ja(h(N),D)}function h(N){return Ga(l,N)}function g(){const{_bufferIndex:N,_index:D,line:K,column:L,offset:T}=r;return{_bufferIndex:N,_index:D,line:K,column:L,offset:T}}function S(N){i[N.line]=N.column,y()}function C(){let N;for(;r._index<l.length;){const D=l[r._index];if(typeof D=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<D.length;)x(D.charCodeAt(r._bufferIndex));else x(D)}}function x(N){f=f(N)}function v(N){z(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,y()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=N}function E(N,D){const K=D||{};return K.type=N,K.start=g(),u.events.push(["enter",K,u]),a.push(K),K}function j(N){const D=a.pop();return D.end=g(),u.events.push(["exit",D,u]),D}function F(N,D){W(N,D.from)}function b(N,D){D.restore()}function _(N,D){return K;function K(L,T,B){let X,se,ye,m;return Array.isArray(L)?oe(L):"tokenize"in L?oe([L]):fe(L);function fe(ee){return Se;function Se(ke){const De=ke!==null&&ee[ke],ve=ke!==null&&ee.null,He=[...Array.isArray(De)?De:De?[De]:[],...Array.isArray(ve)?ve:ve?[ve]:[]];return oe(He)(ke)}}function oe(ee){return X=ee,se=0,ee.length===0?B:d(ee[se])}function d(ee){return Se;function Se(ke){return m=U(),ye=ee,ee.partial||(u.currentConstruct=ee),ee.name&&u.parser.constructs.disable.null.includes(ee.name)?Ie():ee.tokenize.call(D?Object.assign(Object.create(u),D):u,s,Z,Ie)(ke)}}function Z(ee){return N(ye,m),T}function Ie(ee){return m.restore(),++se<X.length?d(X[se]):B}}}function W(N,D){N.resolveAll&&!o.includes(N)&&o.push(N),N.resolve&&ge(u.events,D,u.events.length-D,N.resolve(u.events.slice(D),u)),N.resolveTo&&(u.events=N.resolveTo(u.events,u))}function U(){const N=g(),D=u.previous,K=u.currentConstruct,L=u.events.length,T=Array.from(a);return{from:L,restore:B};function B(){r=N,u.previous=D,u.currentConstruct=K,u.events.length=L,a=T,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ga(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Ja(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
1
|
+
import{U as zr,j as k,r as U,W as Qi,X as Yi,Y as Fr,Z as Xi,_ as Rr,a0 as Gi,a1 as Ji,a2 as Zi,a3 as el,a4 as Dn,a5 as Nn,a6 as Ln,a7 as tl,a8 as nl}from"./vendor-DfLizrKM.js";import{u as rl,d as il,e as ll,f as ol,s as al,I as sl}from"./useConfig-DJ_KEVx0.js";import{u as ul}from"./useConfirmDialog-BwqRK1uy.js";import{P as cl,a as fl,B as Ue}from"./page-layout-sZk-HtoA.js";import{f as _r,c as ye,t as M,S as zn,a as Fn,b as Rn,d as _n,e as Ft}from"./index-BhpPLO5K.js";import{b as hl,n as pl,e as ml,a as dl,c as gl}from"./chat-message-pw9oafI4.js";function xl(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const yl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bl={};function jn(e,n){return(bl.jsx?kl:yl).test(e)}const wl=/[ \t\n\f\r]/g;function Sl(e){return typeof e=="object"?e.type==="text"?On(e.value):!1:On(e)}function On(e){return e.replace(wl,"")===""}class dt{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}dt.prototype.normal={};dt.prototype.property={};dt.prototype.space=void 0;function jr(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new dt(t,r,n)}function Zt(e){return e.toLowerCase()}class ce{constructor(n,t){this.attribute=t,this.property=n}}ce.prototype.attribute="";ce.prototype.booleanish=!1;ce.prototype.boolean=!1;ce.prototype.commaOrSpaceSeparated=!1;ce.prototype.commaSeparated=!1;ce.prototype.defined=!1;ce.prototype.mustUseProperty=!1;ce.prototype.number=!1;ce.prototype.overloadedBoolean=!1;ce.prototype.property="";ce.prototype.spaceSeparated=!1;ce.prototype.space=void 0;let Cl=0;const O=Be(),ne=Be(),en=Be(),I=Be(),J=Be(),Ke=Be(),de=Be();function Be(){return 2**++Cl}const tn=Object.freeze(Object.defineProperty({__proto__:null,boolean:O,booleanish:ne,commaOrSpaceSeparated:de,commaSeparated:Ke,number:I,overloadedBoolean:en,spaceSeparated:J},Symbol.toStringTag,{value:"Module"})),Rt=Object.keys(tn);class hn extends ce{constructor(n,t,r,i){let o=-1;if(super(n,t),Mn(this,"space",i),typeof r=="number")for(;++o<Rt.length;){const l=Rt[o];Mn(this,Rt[o],(r&tn[l])===tn[l])}}}hn.prototype.defined=!0;function Mn(e,n,t){t&&(e[n]=t)}function Ye(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const o=new hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),n[r]=o,t[Zt(r)]=r,t[Zt(o.attribute)]=r}return new dt(n,t,e.space)}const Or=Ye({properties:{ariaActiveDescendant:null,ariaAtomic:ne,ariaAutoComplete:null,ariaBusy:ne,ariaChecked:ne,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:J,ariaCurrent:null,ariaDescribedBy:J,ariaDetails:null,ariaDisabled:ne,ariaDropEffect:J,ariaErrorMessage:null,ariaExpanded:ne,ariaFlowTo:J,ariaGrabbed:ne,ariaHasPopup:null,ariaHidden:ne,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:J,ariaLevel:I,ariaLive:null,ariaModal:ne,ariaMultiLine:ne,ariaMultiSelectable:ne,ariaOrientation:null,ariaOwns:J,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:ne,ariaReadOnly:ne,ariaRelevant:null,ariaRequired:ne,ariaRoleDescription:J,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:ne,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 Mr(e,n){return n in e?e[n]:n}function Br(e,n){return Mr(e,n.toLowerCase())}const El=Ye({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ke,acceptCharset:J,accessKey:J,action:null,allow:null,allowFullScreen:O,allowPaymentRequest:O,allowUserMedia:O,alt:null,as:null,async:O,autoCapitalize:null,autoComplete:J,autoFocus:O,autoPlay:O,blocking:J,capture:null,charSet:null,checked:O,cite:null,className:J,cols:I,colSpan:null,content:null,contentEditable:ne,controls:O,controlsList:J,coords:I|Ke,crossOrigin:null,data:null,dateTime:null,decoding:null,default:O,defer:O,dir:null,dirName:null,disabled:O,download:en,draggable:ne,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:O,formTarget:null,headers:J,height:I,hidden:en,high:I,href:null,hrefLang:null,htmlFor:J,httpEquiv:J,id:null,imageSizes:null,imageSrcSet:null,inert:O,inputMode:null,integrity:null,is:null,isMap:O,itemId:null,itemProp:J,itemRef:J,itemScope:O,itemType:J,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:O,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:O,muted:O,name:null,nonce:null,noModule:O,noValidate:O,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:O,optimum:I,pattern:null,ping:J,placeholder:null,playsInline:O,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:O,referrerPolicy:null,rel:J,required:O,reversed:O,rows:I,rowSpan:I,sandbox:J,scope:null,scoped:O,seamless:O,selected:O,shadowRootClonable:O,shadowRootDelegatesFocus:O,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:ne,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:O,useMap:null,value:ne,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:J,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:O,declare:O,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:O,noHref:O,noShade:O,noWrap:O,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:ne,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:O,disableRemotePlayback:O,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:Br}),Il=Ye({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:de,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:J,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:O,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:Ke,g2:Ke,glyphName:Ke,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:de,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:J,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:de,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:de,rev:de,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:de,requiredFeatures:de,requiredFonts:de,requiredFormats:de,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:de,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:de,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:de,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:Mr}),Hr=Ye({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()}}),qr=Ye({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Br}),Ur=Ye({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),vl={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"},Al=/[A-Z]/g,Bn=/-[a-z]/g,Tl=/^data[-\w.:]+$/i;function Pl(e,n){const t=Zt(n);let r=n,i=ce;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Tl.test(n)){if(n.charAt(4)==="-"){const o=n.slice(5).replace(Bn,Nl);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=n.slice(4);if(!Bn.test(o)){let l=o.replace(Al,Dl);l.charAt(0)!=="-"&&(l="-"+l),n="data"+l}}i=hn}return new i(r,n)}function Dl(e){return"-"+e.toLowerCase()}function Nl(e){return e.charAt(1).toUpperCase()}const Ll=jr([Or,El,Hr,qr,Ur],"html"),pn=jr([Or,Il,Hr,qr,Ur],"svg");function zl(e){return e.join(" ").trim()}var $e={},_t,Hn;function Fl(){if(Hn)return _t;Hn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
|
|
2
|
+
`,u="/",f="*",c="",p="comment",h="declaration";function g(C,x){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];x=x||{};var v=1,E=1;function _(L){var P=L.match(n);P&&(v+=P.length);var H=L.lastIndexOf(s);E=~H?L.length-H:E+L.length}function F(){var L={line:v,column:E};return function(P){return P.position=new b(L),$(),P}}function b(L){this.start=L,this.end={line:v,column:E},this.source=x.source}b.prototype.content=C;function j(L){var P=new Error(x.source+":"+v+":"+E+": "+L);if(P.reason=L,P.filename=x.source,P.line=v,P.column=E,P.source=C,!x.silent)throw P}function W(L){var P=L.exec(C);if(P){var H=P[0];return _(H),C=C.slice(H.length),P}}function $(){W(t)}function y(L){var P;for(L=L||[];P=N();)P!==!1&&L.push(P);return L}function N(){var L=F();if(!(u!=C.charAt(0)||f!=C.charAt(1))){for(var P=2;c!=C.charAt(P)&&(f!=C.charAt(P)||u!=C.charAt(P+1));)++P;if(P+=2,c===C.charAt(P-1))return j("End of comment missing");var H=C.slice(2,P-2);return E+=2,_(H),C=C.slice(P),E+=2,L({type:p,comment:H})}}function D(){var L=F(),P=W(r);if(P){if(N(),!W(i))return j("property missing ':'");var H=W(o),X=L({type:h,property:S(P[0].replace(e,c)),value:H?S(H[0].replace(e,c)):c});return W(l),X}}function K(){var L=[];y(L);for(var P;P=D();)P!==!1&&(L.push(P),y(L));return L}return $(),K()}function S(C){return C?C.replace(a,c):c}return _t=g,_t}var qn;function Rl(){if(qn)return $e;qn=1;var e=$e&&$e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($e,"__esModule",{value:!0}),$e.default=t;const n=e(Fl());function t(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,n.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:f}=s;a?i(u,f,s):f&&(o=o||{},o[u]=f)}),o}return $e}var it={},Un;function _l(){if(Un)return it;Un=1,Object.defineProperty(it,"__esModule",{value:!0}),it.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||t.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,l))};return it.camelCase=s,it}var lt,$n;function jl(){if($n)return lt;$n=1;var e=lt&<.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Rl()),t=_l();function r(i,o){var l={};return!i||typeof i!="string"||(0,n.default)(i,function(a,s){a&&s&&(l[(0,t.camelCase)(a,o)]=s)}),l}return r.default=r,lt=r,lt}var Ol=jl();const Ml=zr(Ol),$r=Vr("end"),mn=Vr("start");function Vr(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 Wr(e){const n=mn(e),t=$r(e);if(n&&t)return{start:n,end:t}}function st(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vn(e.position):"start"in e||"end"in e?Vn(e):"line"in e||"column"in e?nn(e):""}function nn(e){return Wn(e&&e.line)+":"+Wn(e&&e.column)}function Vn(e){return nn(e&&e.start)+"-"+nn(e&&e.end)}function Wn(e){return e&&typeof e=="number"?e:1}class le extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",o={},l=!1;if(t&&("line"in t&&"column"in t?o={place:t}:"start"in t&&"end"in t?o={place:t}:"type"in t?o={ancestors:[t],place:t.position}:o={...t}),typeof n=="string"?i=n:!o.cause&&n&&(l=!0,i=n.message,o.cause=n),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=st(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}le.prototype.file="";le.prototype.name="";le.prototype.reason="";le.prototype.message="";le.prototype.stack="";le.prototype.column=void 0;le.prototype.line=void 0;le.prototype.ancestors=void 0;le.prototype.cause=void 0;le.prototype.fatal=void 0;le.prototype.place=void 0;le.prototype.ruleId=void 0;le.prototype.source=void 0;const dn={}.hasOwnProperty,Bl=new Map,Hl=/[A-Z]/g,ql=new Set(["table","tbody","thead","tfoot","tr"]),Ul=new Set(["td","th"]),Kr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $l(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=Jl(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=Gl(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:Ll,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},o=Qr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Qr(e,n,t){if(n.type==="element")return Vl(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Wl(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Ql(e,n,t);if(n.type==="mdxjsEsm")return Kl(e,n);if(n.type==="root")return Yl(e,n,t);if(n.type==="text")return Xl(e,n)}function Vl(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=pn,e.schema=i),e.ancestors.push(n);const o=Xr(e,n.tagName,!1),l=Zl(e,n);let a=xn(e,n);return ql.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Sl(s):!0})),Yr(e,l,o,n),gn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Wl(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)}ft(e,n.position)}function Kl(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);ft(e,n.position)}function Ql(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=pn,e.schema=i),e.ancestors.push(n);const o=n.name===null?e.Fragment:Xr(e,n.name,!0),l=eo(e,n),a=xn(e,n);return Yr(e,l,o,n),gn(l,a),e.ancestors.pop(),e.schema=r,e.create(n,o,l,t)}function Yl(e,n,t){const r={};return gn(r,xn(e,n)),e.create(n,e.Fragment,r,t)}function Xl(e,n){return n.value}function Yr(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function gn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Gl(e,n,t){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?t:n;return a?u(o,l,a):u(o,l)}}function Jl(e,n){return t;function t(r,i,o,l){const a=Array.isArray(o.children),s=mn(r);return n(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Zl(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&dn.call(n.properties,i)){const o=to(e,i,n.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Ul.has(n.tagName)?r=a:t[l]=a}}if(r){const o=t.style||(t.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function eo(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else ft(e,n.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else ft(e,n.position);else o=r.value===null?!0:r.value;t[i]=o}return t}function xn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Bl;for(;++r<n.children.length;){const o=n.children[r];let l;if(e.passKeys){const s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){const u=i.get(s)||0;l=s+"-"+u,i.set(s,u+1)}}const a=Qr(e,o,l);a!==void 0&&t.push(a)}return t}function to(e,n,t){const r=Pl(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?xl(t):zl(t)),r.property==="style"){let i=typeof t=="object"?t:no(e,String(t));return e.stylePropertyNameCase==="css"&&(i=ro(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?vl[r.property]||r.property:r.attribute,t]}}function no(e,n){try{return Ml(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new le("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=Kr+"#cannot-parse-style-attribute",i}}function Xr(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let o=-1,l;for(;++o<i.length;){const a=jn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=jn(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);ft(e)}function ft(e,n){const t=new le("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=Kr+"#cannot-handle-mdx-estrees-without-createevaluater",t}function ro(e){const n={};let t;for(t in e)dn.call(e,t)&&(n[io(t)]=e[t]);return n}function io(e){let n=e.replace(Hl,lo);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function lo(e){return"-"+e.toLowerCase()}const jt={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oo={};function yn(e,n){const t=oo,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Gr(e,r,i)}function Gr(e,n,t){if(ao(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Kn(e.children,n,t)}return Array.isArray(e)?Kn(e,n,t):""}function Kn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Gr(e[i],n,t);return r.join("")}function ao(e){return!!(e&&typeof e=="object")}const Qn=document.createElement("i");function kn(e){const n="&"+e+";";Qn.innerHTML=n;const t=Qn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ge(e,n,t,r){const i=e.length;let o=0,l;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)l=Array.from(r),l.unshift(n,t),e.splice(...l);else for(t&&e.splice(n,t);o<r.length;)l=r.slice(o,o+1e4),l.unshift(n,0),e.splice(...l),o+=1e4,n+=1e4}function xe(e,n){return e.length>0?(ge(e,e.length,0,n),e):n}const Yn={}.hasOwnProperty;function Jr(e){const n={};let t=-1;for(;++t<e.length;)so(n,e[t]);return n}function so(e,n){let t;for(t in n){const i=(Yn.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let l;if(o)for(l in o){Yn.call(i,l)||(i[l]=[]);const a=o[l];uo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function uo(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ge(e,0,0,r)}function Zr(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 we(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ae=ze(/[A-Za-z]/),ie=ze(/[\dA-Za-z]/),co=ze(/[#-'*+\--9=?A-Z^-~]/);function It(e){return e!==null&&(e<32||e===127)}const rn=ze(/\d/),fo=ze(/[\dA-Fa-f]/),ho=ze(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}const Tt=ze(new RegExp("\\p{P}|\\p{S}","u")),Me=ze(/\s/);function ze(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Xe(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const o=e.charCodeAt(t);let l="";if(o===37&&ie(e.charCodeAt(t+1))&&ie(e.charCodeAt(t+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(n.push(e.slice(r,t),encodeURIComponent(l)),r=t+i+1,l=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function V(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return q(s)?(e.enter(t),a(s)):n(s)}function a(s){return q(s)&&o++<i?(e.consume(s),a):(e.exit(t),n(s))}}const po={tokenize:mo};function mo(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),V(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const go={tokenize:xo},Xn={tokenize:yo};function xo(e){const n=this,t=[];let r=0,i,o,l;return a;function a(E){if(r<t.length){const _=t[r];return n.containerState=_[1],e.attempt(_[0].continuation,s,u)(E)}return u(E)}function s(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const _=n.events.length;let F=_,b;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){b=n.events[F][1].end;break}x(r);let j=_;for(;j<n.events.length;)n.events[j][1].end={...b},j++;return ge(n.events,F+1,0,n.events.slice(_)),n.events.length=j,u(E)}return a(E)}function u(E){if(r===t.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Xn,f,c)(E)}function f(E){return i&&v(),x(r),p(E)}function c(E){return n.parser.lazy[n.now().line]=r!==t.length,l=n.now().offset,g(E)}function p(E){return n.containerState={},e.attempt(Xn,h,g)(E)}function h(E){return r++,t.push([n.currentConstruct,n.containerState]),p(E)}function g(E){if(E===null){i&&v(),x(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(E)}function S(E){if(E===null){C(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return z(E)?(e.consume(E),C(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),S)}function C(E,_){const F=n.sliceStream(E);if(_&&F.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(F),n.parser.lazy[E.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const j=n.events.length;let W=j,$,y;for(;W--;)if(n.events[W][0]==="exit"&&n.events[W][1].type==="chunkFlow"){if($){y=n.events[W][1].end;break}$=!0}for(x(r),b=j;b<n.events.length;)n.events[b][1].end={...y},b++;ge(n.events,W+1,0,n.events.slice(j)),n.events.length=b}}function x(E){let _=t.length;for(;_-- >E;){const F=t[_];n.containerState=F[1],F[0].exit.call(n,e)}t.length=E}function v(){i.write([null]),o=void 0,i=void 0,n.containerState._closeFlow=void 0}}function yo(e,n,t){return V(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qe(e){if(e===null||Y(e)||Me(e))return 1;if(Tt(e))return 2}function Pt(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const ln={name:"attention",resolveAll:ko,tokenize:bo};function ko(e,n){let t=-1,r,i,o,l,a,s,u,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[t][1].start};Gn(c,-s),Gn(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=xe(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=xe(u,[["enter",i,n],["enter",l,n],["exit",l,n],["enter",o,n]]),u=xe(u,Pt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=xe(u,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,u=xe(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,ge(e,r-1,t-r+3,u),t=r+u.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function bo(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Qe(r);let o;return l;function l(s){return o=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===o)return e.consume(s),a;const u=e.exit("attentionSequence"),f=Qe(s),c=!f||f===2&&i||t.includes(s),p=!i||i===2&&f||t.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),n(s)}}function Gn(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const wo={name:"autolink",tokenize:So};function So(e,n,t){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return ae(h)?(e.consume(h),l):h===64?t(h):u(h)}function l(h){return h===43||h===45||h===46||ie(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||ie(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function s(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||It(h)?t(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),f):co(h)?(e.consume(h),u):t(h)}function f(h){return ie(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):p(h)}function p(h){if((h===45||ie(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return t(h)}}const gt={partial:!0,tokenize:Co};function Co(e,n,t){return r;function r(o){return q(o)?V(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?n(o):t(o)}}const ei={continuation:{tokenize:Io},exit:vo,name:"blockQuote",tokenize:Eo};function Eo(e,n,t){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return t(l)}function o(l){return q(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(l))}}function Io(e,n,t){const r=this;return i;function i(l){return q(l)?V(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(ei,n,t)(l)}}function vo(e){e.exit("blockQuote")}const ti={name:"characterEscape",tokenize:Ao};function Ao(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return ho(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ni={name:"characterReference",tokenize:To};function To(e,n,t){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),s}function s(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=ie,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=fo,f):(e.enter("characterReferenceValue"),o=7,l=rn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===ie&&!kn(r.sliceSerialize(p))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return l(c)&&i++<o?(e.consume(c),f):t(c)}}const Jn={partial:!0,tokenize:Do},Zn={concrete:!0,name:"codeFenced",tokenize:Po};function Po(e,n,t){const r=this,i={partial:!0,tokenize:F};let o=0,l=0,a;return s;function s(b){return u(b)}function u(b){const j=r.events[r.events.length-1];return o=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?t(b):(e.exit("codeFencedFenceSequence"),q(b)?V(e,c,"whitespace")(b):c(b))}function c(b){return b===null||z(b)?(e.exit("codeFencedFence"),r.interrupt?n(b):e.check(Jn,S,_)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):q(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(b)):b===96&&b===a?t(b):(e.consume(b),p)}function h(b){return b===null||z(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?t(b):(e.consume(b),g)}function S(b){return e.attempt(i,_,C)(b)}function C(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),x}function x(b){return o>0&&q(b)?V(e,v,"linePrefix",o+1)(b):v(b)}function v(b){return b===null||z(b)?e.check(Jn,S,_)(b):(e.enter("codeFlowValue"),E(b))}function E(b){return b===null||z(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),E)}function _(b){return e.exit("codeFenced"),n(b)}function F(b,j,W){let $=0;return y;function y(P){return b.enter("lineEnding"),b.consume(P),b.exit("lineEnding"),N}function N(P){return b.enter("codeFencedFence"),q(P)?V(b,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):D(P)}function D(P){return P===a?(b.enter("codeFencedFenceSequence"),K(P)):W(P)}function K(P){return P===a?($++,b.consume(P),K):$>=l?(b.exit("codeFencedFenceSequence"),q(P)?V(b,L,"whitespace")(P):L(P)):W(P)}function L(P){return P===null||z(P)?(b.exit("codeFencedFence"),j(P)):W(P)}}}function Do(e,n,t){const r=this;return i;function i(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}const Ot={name:"codeIndented",tokenize:Lo},No={partial:!0,tokenize:zo};function Lo(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):t(u)}function l(u){return u===null?s(u):z(u)?e.attempt(No,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function zo(e,n,t){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?t(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):V(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):z(l)?i(l):t(l)}}const Fo={name:"codeText",previous:_o,resolve:Ro,tokenize:jo};function Ro(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 _o(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jo(e,n,t){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),s(c))}function s(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),s):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||z(c)?(e.exit("codeTextData"),s(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",u(c))}}class Oo{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ot(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),ot(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),ot(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);ot(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);ot(this.left,t.reverse())}}}function ot(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 ri(e){const n={};let t=-1,r,i,o,l,a,s,u;const f=new Oo(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Mo(f,t)),t=n[t],u=!0);else if(r[1]._container){for(o=t,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,t),a.unshift(r),f.splice(i,t-i+1,a))}}return ge(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Mo(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const o=[];let l=t._tokenizer;l||(l=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,s=[],u={};let f,c,p=-1,h=t,g=0,S=0;const C=[S];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(S=p+1,C.push(S),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):C.pop(),p=C.length;p--;){const x=a.slice(C[p],C[p+1]),v=o.pop();s.push([v,v+x.length-1]),e.splice(v,2,x)}for(s.reverse(),p=-1;++p<s.length;)u[g+s[p][0]]=g+s[p][1],g+=s[p][1]-s[p][0]-1;return u}const Bo={resolve:qo,tokenize:Uo},Ho={partial:!0,tokenize:$o};function qo(e){return ri(e),e}function Uo(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?e.check(Ho,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function l(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function $o(e,n,t){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),V(e,o,"linePrefix")}function o(l){if(l===null||z(l))return t(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(l):e.interrupt(r.parser.constructs.flow,t,n)(l)}}function ii(e,n,t,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||It(x)?t(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),S(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||z(x)?t(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function S(x){return!f&&(x===null||x===41||Y(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),n(x)):f<u&&x===40?(e.consume(x),f++,S):x===41?(e.consume(x),f--,S):x===null||x===32||x===40||It(x)?t(x):(e.consume(x),x===92?C:S)}function C(x){return x===40||x===41||x===92?(e.consume(x),S):S(x)}}function li(e,n,t,r,i,o){const l=this;let a=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?t(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),s||(s=!q(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function oi(e,n,t,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):t(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?t(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function ut(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):q(i)?V(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Vo={name:"definition",tokenize:Ko},Wo={partial:!0,tokenize:Qo};function Ko(e,n,t){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return li.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):t(h)}function s(h){return Y(h)?ut(e,u)(h):u(h)}function u(h){return ii(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Wo,c,c)(h)}function c(h){return q(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),n(h)):t(h)}}function Qo(e,n,t){return r;function r(a){return Y(a)?ut(e,i)(a):t(a)}function i(a){return oi(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return q(a)?V(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?n(a):t(a)}}const Yo={name:"hardBreakEscape",tokenize:Xo};function Xo(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Go={name:"headingAtx",resolve:Jo,tokenize:Zo};function Jo(e,n){let t=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ge(e,r,t-r+1,[["enter",i,n],["enter",o,n],["exit",o,n],["exit",i,n]])),e}function Zo(e,n,t){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||Y(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||z(f)?(e.exit("atxHeading"),n(f)):q(f)?V(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||Y(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const ea=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],er=["pre","script","style","textarea"],ta={concrete:!0,name:"htmlFlow",resolveTo:ia,tokenize:la},na={partial:!0,tokenize:aa},ra={partial:!0,tokenize:oa};function ia(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 la(e,n,t){const r=this;let i,o,l,a,s;return u;function u(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,S):d===63?(e.consume(d),i=3,r.interrupt?n:m):ae(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):ae(d)?(e.consume(d),i=4,r.interrupt?n:m):t(d)}function h(d){return d===45?(e.consume(d),r.interrupt?n:m):t(d)}function g(d){const ee="CDATA[";return d===ee.charCodeAt(a++)?(e.consume(d),a===ee.length?r.interrupt?n:D:g):t(d)}function S(d){return ae(d)?(e.consume(d),l=String.fromCharCode(d),C):t(d)}function C(d){if(d===null||d===47||d===62||Y(d)){const ee=d===47,Ee=l.toLowerCase();return!ee&&!o&&er.includes(Ee)?(i=1,r.interrupt?n(d):D(d)):ea.includes(l.toLowerCase())?(i=6,ee?(e.consume(d),x):r.interrupt?n(d):D(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):o?v(d):E(d))}return d===45||ie(d)?(e.consume(d),l+=String.fromCharCode(d),C):t(d)}function x(d){return d===62?(e.consume(d),r.interrupt?n:D):t(d)}function v(d){return q(d)?(e.consume(d),v):y(d)}function E(d){return d===47?(e.consume(d),y):d===58||d===95||ae(d)?(e.consume(d),_):q(d)?(e.consume(d),E):y(d)}function _(d){return d===45||d===46||d===58||d===95||ie(d)?(e.consume(d),_):F(d)}function F(d){return d===61?(e.consume(d),b):q(d)?(e.consume(d),F):E(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),s=d,j):q(d)?(e.consume(d),b):W(d)}function j(d){return d===s?(e.consume(d),s=null,$):d===null||z(d)?t(d):(e.consume(d),j)}function W(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||Y(d)?F(d):(e.consume(d),W)}function $(d){return d===47||d===62||q(d)?E(d):t(d)}function y(d){return d===62?(e.consume(d),N):t(d)}function N(d){return d===null||z(d)?D(d):q(d)?(e.consume(d),N):t(d)}function D(d){return d===45&&i===2?(e.consume(d),H):d===60&&i===1?(e.consume(d),X):d===62&&i===4?(e.consume(d),fe):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),ke):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(na,oe,K)(d)):d===null||z(d)?(e.exit("htmlFlowData"),K(d)):(e.consume(d),D)}function K(d){return e.check(ra,L,oe)(d)}function L(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),P}function P(d){return d===null||z(d)?K(d):(e.enter("htmlFlowData"),D(d))}function H(d){return d===45?(e.consume(d),m):D(d)}function X(d){return d===47?(e.consume(d),l="",se):D(d)}function se(d){if(d===62){const ee=l.toLowerCase();return er.includes(ee)?(e.consume(d),fe):D(d)}return ae(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),se):D(d)}function ke(d){return d===93?(e.consume(d),m):D(d)}function m(d){return d===62?(e.consume(d),fe):d===45&&i===2?(e.consume(d),m):D(d)}function fe(d){return d===null||z(d)?(e.exit("htmlFlowData"),oe(d)):(e.consume(d),fe)}function oe(d){return e.exit("htmlFlow"),n(d)}}function oa(e,n,t){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):t(l)}function o(l){return r.parser.lazy[r.now().line]?t(l):n(l)}}function aa(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(gt,n,t)}}const sa={name:"htmlText",tokenize:ua};function ua(e,n,t){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),E):ae(m)?(e.consume(m),W):t(m)}function u(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):ae(m)?(e.consume(m),v):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),p):z(m)?(l=c,X(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?H(m):m===45?p(m):c(m)}function g(m){const fe="CDATA[";return m===fe.charCodeAt(o++)?(e.consume(m),o===fe.length?S:g):t(m)}function S(m){return m===null?t(m):m===93?(e.consume(m),C):z(m)?(l=S,X(m)):(e.consume(m),S)}function C(m){return m===93?(e.consume(m),x):S(m)}function x(m){return m===62?H(m):m===93?(e.consume(m),x):S(m)}function v(m){return m===null||m===62?H(m):z(m)?(l=v,X(m)):(e.consume(m),v)}function E(m){return m===null?t(m):m===63?(e.consume(m),_):z(m)?(l=E,X(m)):(e.consume(m),E)}function _(m){return m===62?H(m):E(m)}function F(m){return ae(m)?(e.consume(m),b):t(m)}function b(m){return m===45||ie(m)?(e.consume(m),b):j(m)}function j(m){return z(m)?(l=j,X(m)):q(m)?(e.consume(m),j):H(m)}function W(m){return m===45||ie(m)?(e.consume(m),W):m===47||m===62||Y(m)?$(m):t(m)}function $(m){return m===47?(e.consume(m),H):m===58||m===95||ae(m)?(e.consume(m),y):z(m)?(l=$,X(m)):q(m)?(e.consume(m),$):H(m)}function y(m){return m===45||m===46||m===58||m===95||ie(m)?(e.consume(m),y):N(m)}function N(m){return m===61?(e.consume(m),D):z(m)?(l=N,X(m)):q(m)?(e.consume(m),N):$(m)}function D(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),i=m,K):z(m)?(l=D,X(m)):q(m)?(e.consume(m),D):(e.consume(m),L)}function K(m){return m===i?(e.consume(m),i=void 0,P):m===null?t(m):z(m)?(l=K,X(m)):(e.consume(m),K)}function L(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||Y(m)?$(m):(e.consume(m),L)}function P(m){return m===47||m===62||Y(m)?$(m):t(m)}function H(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function X(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),se}function se(m){return q(m)?V(e,ke,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ke(m)}function ke(m){return e.enter("htmlTextData"),l(m)}}const bn={name:"labelEnd",resolveAll:pa,resolveTo:ma,tokenize:da},ca={tokenize:ga},fa={tokenize:xa},ha={tokenize:ya};function pa(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&&ge(e,0,e.length,t),e}function ma(e,n){let t=e.length,r=0,i,o,l,a;for(;t--;)if(i=e[t][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=t);const s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=xe(a,e.slice(o+1,o+r+3)),a=xe(a,[["enter",f,n]]),a=xe(a,Pt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),n)),a=xe(a,[["exit",f,n],e[l-2],e[l-1],["exit",u,n]]),a=xe(a,e.slice(l+1)),a=xe(a,[["exit",s,n]]),ge(e,o,e.length,a),e}function da(e,n,t){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(we(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):t(p)}function s(p){return p===40?e.attempt(ca,f,l?f:c)(p):p===91?e.attempt(fa,f,l?u:c)(p):l?f(p):c(p)}function u(p){return e.attempt(ha,f,c)(p)}function f(p){return n(p)}function c(p){return o._balanced=!0,t(p)}}function ga(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 Y(c)?ut(e,o)(c):o(c)}function o(c){return c===41?f(c):ii(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return Y(c)?ut(e,s)(c):f(c)}function a(c){return t(c)}function s(c){return c===34||c===39||c===40?oi(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Y(c)?ut(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 xa(e,n,t){const r=this;return i;function i(a){return li.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(we(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function l(a){return t(a)}}function ya(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ka={name:"labelStartImage",resolveAll:bn.resolveAll,tokenize:ba};function ba(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):t(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const wa={name:"labelStartLink",resolveAll:bn.resolveAll,tokenize:Sa};function Sa(e,n,t){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(l):n(l)}}const Mt={name:"lineEnding",tokenize:Ca};function Ca(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,n,"linePrefix")}}const Et={name:"thematicBreak",tokenize:Ea};function Ea(e,n,t){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||z(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),q(u)?V(e,a,"whitespace")(u):a(u))}}const ue={continuation:{tokenize:Ta},exit:Da,name:"list",tokenize:Aa},Ia={partial:!0,tokenize:Na},va={partial:!0,tokenize:Pa};function Aa(e,n,t){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:rn(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Et,t,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return t(h)}function s(h){return rn(h)&&++l<10?(e.consume(h),s):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):t(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(gt,r.interrupt?t:f,e.attempt(Ia,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return q(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):t(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function Ta(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(gt,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!q(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(va,n,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(ue,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Pa(e,n,t){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?n(o):t(o)}}function Da(e){e.exit(this.containerState.type)}function Na(e,n,t){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!q(o)&&l&&l[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const tr={name:"setextUnderline",resolveTo:La,tokenize:za};function La(e,n){let t=e.length,r,i,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,n]),e}function za(e,n,t){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):t(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),q(u)?V(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Fa={tokenize:Ra};function Ra(e){const n=this,t=e.attempt(gt,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Bo,i)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const _a={resolveAll:si()},ja=ai("string"),Oa=ai("text");function ai(e){return{resolveAll:si(e==="text"?Ma:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],o=t.attempt(i,l,a);return l;function l(f){return u(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),s}function s(f){return u(f)?(t.exit("data"),o(f)):(t.consume(f),s)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function si(e){return n;function n(t,r){let i=-1,o;for(;++i<=t.length;)o===void 0?t[i]&&t[i][1].type==="data"&&(o=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==o+2&&(t[o][1].end=t[i-1][1].end,t.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(t,r):t}}function Ma(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let o=i.length,l=-1,a=0,s;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(u===-2)s=!0,a++;else if(u!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const Ba={42:ue,43:ue,45:ue,48:ue,49:ue,50:ue,51:ue,52:ue,53:ue,54:ue,55:ue,56:ue,57:ue,62:ei},Ha={91:Vo},qa={[-2]:Ot,[-1]:Ot,32:Ot},Ua={35:Go,42:Et,45:[tr,Et],60:ta,61:tr,95:Et,96:Zn,126:Zn},$a={38:ni,92:ti},Va={[-5]:Mt,[-4]:Mt,[-3]:Mt,33:ka,38:ni,42:ln,60:[wo,sa],91:wa,92:[Yo,ti],93:bn,95:ln,96:Fo},Wa={null:[ln,_a]},Ka={null:[42,95]},Qa={null:[]},Ya=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ka,contentInitial:Ha,disable:Qa,document:Ba,flow:Ua,flowInitial:qa,insideSpan:Wa,string:$a,text:Va},Symbol.toStringTag,{value:"Module"}));function Xa(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},o=[];let l=[],a=[];const s={attempt:j(F),check:j(b),consume:v,enter:E,exit:_,interrupt:j(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:S,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=n.tokenize.call(u,s);return n.resolveAll&&o.push(n),u;function c(N){return l=xe(l,N),C(),l[l.length-1]!==null?[]:(W(n,0),u.events=Pt(o,u.events,u),u.events)}function p(N,D){return Ja(h(N),D)}function h(N){return Ga(l,N)}function g(){const{_bufferIndex:N,_index:D,line:K,column:L,offset:P}=r;return{_bufferIndex:N,_index:D,line:K,column:L,offset:P}}function S(N){i[N.line]=N.column,y()}function C(){let N;for(;r._index<l.length;){const D=l[r._index];if(typeof D=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<D.length;)x(D.charCodeAt(r._bufferIndex));else x(D)}}function x(N){f=f(N)}function v(N){z(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,y()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=N}function E(N,D){const K=D||{};return K.type=N,K.start=g(),u.events.push(["enter",K,u]),a.push(K),K}function _(N){const D=a.pop();return D.end=g(),u.events.push(["exit",D,u]),D}function F(N,D){W(N,D.from)}function b(N,D){D.restore()}function j(N,D){return K;function K(L,P,H){let X,se,ke,m;return Array.isArray(L)?oe(L):"tokenize"in L?oe([L]):fe(L);function fe(Z){return Pe;function Pe(he){const Ie=he!==null&&Z[he],De=he!==null&&Z.null,Fe=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(De)?De:De?[De]:[]];return oe(Fe)(he)}}function oe(Z){return X=Z,se=0,Z.length===0?H:d(Z[se])}function d(Z){return Pe;function Pe(he){return m=$(),ke=Z,Z.partial||(u.currentConstruct=Z),Z.name&&u.parser.constructs.disable.null.includes(Z.name)?Ee():Z.tokenize.call(D?Object.assign(Object.create(u),D):u,s,ee,Ee)(he)}}function ee(Z){return N(ke,m),P}function Ee(Z){return m.restore(),++se<X.length?d(X[se]):H}}}function W(N,D){N.resolveAll&&!o.includes(N)&&o.push(N),N.resolve&&ge(u.events,D,u.events.length-D,N.resolve(u.events.slice(D),u)),N.resolveTo&&(u.events=N.resolveTo(u.events,u))}function $(){const N=g(),D=u.previous,K=u.currentConstruct,L=u.events.length,P=Array.from(a);return{from:L,restore:H};function H(){r=N,u.previous=D,u.currentConstruct=K,u.events.length=L,a=P,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ga(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,o=n.end._bufferIndex;let l;if(t===i)l=[e[t].slice(r,o)];else{if(l=e.slice(t,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Ja(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const o=e[t];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
3
3
|
`;break}case-3:{l=`\r
|
|
4
|
-
`;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Za(e){const r={constructs:ei([Ya,...(e||{}).extensions||[]]),content:i(po),defined:[],document:i(go),flow:i(Fa),lazy:{},string:i(_a),text:i(Oa)};return r;function i(o){return l;function l(a){return Xa(r,o,a)}}}function es(e){for(;!li(e););return e}const ir=/[\0\t\n\r]/g;function ts(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const s=[];let u,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(ir.lastIndex=c,u=ir.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){n=o.slice(c);break}if(h===10&&c===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<p&&(s.push(o.slice(c,p)),e+=p-c),h){case 0:{s.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,s.push(-2);e++<f;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const ns=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rs(e){return e.replace(ns,is)}function is(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return ti(t.slice(o?2:1),o?16:10)}return wn(t)||e}const fi={}.hasOwnProperty;function ls(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),os(t)(es(Za(t).document().write(ts()(e,n,!0))))}function os(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(re),autolinkProtocol:U,autolinkEmail:U,atxHeading:o(Je),blockQuote:o(ve),characterEscape:U,characterReference:U,codeFenced:o(He),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(He,l),codeText:o(Ge,l),codeTextData:U,data:U,codeFlowValue:U,definition:o(yt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(kt),hardBreakEscape:o(P),hardBreakTrailing:o(P),htmlFlow:o(J,l),htmlFlowData:U,htmlText:o(J,l),htmlTextData:U,image:o(ne),label:l,link:o(re),listItem:o(Ze),listItemValue:p,listOrdered:o(Fe,c),listUnordered:o(Fe),paragraph:o(et),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Je),strong:o(he),thematicBreak:o(bt)},exit:{atxHeading:s(),atxHeadingSequence:F,autolink:s(),autolinkEmail:De,autolinkProtocol:ke,blockQuote:s(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:ee,characterReference:Se,codeFenced:s(C),codeFencedFence:S,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:s(x),codeText:s(T),codeTextData:y,data:y,definition:s(),definitionDestinationString:j,definitionLabelString:v,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(D),hardBreakTrailing:s(D),htmlFlow:s(K),htmlFlowData:y,htmlText:s(L),htmlTextData:y,image:s(X),label:ye,labelText:se,lineEnding:N,link:s(B),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:Z,resourceDestinationString:m,resourceTitleString:fe,resource:oe,setextHeading:s(W),setextHeadingLineSequence:_,setextHeadingText:b,strong:s(),thematicBreak:s()}};hi(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(w){let A={type:"root",children:[]};const R={stack:[A],tokenStack:[],config:n,enter:a,exit:u,buffer:l,resume:f,data:t},H=[];let Q=-1;for(;++Q<w.length;)if(w[Q][1].type==="listOrdered"||w[Q][1].type==="listUnordered")if(w[Q][0]==="enter")H.push(Q);else{const be=H.pop();Q=i(w,be,Q)}for(Q=-1;++Q<w.length;){const be=n[w[Q][0]];fi.call(be,w[Q][1].type)&&be[w[Q][1].type].call(Object.assign({sliceSerialize:w[Q][2].sliceSerialize},R),w[Q][1])}if(R.tokenStack.length>0){const be=R.tokenStack[R.tokenStack.length-1];(be[1]||lr).call(R,void 0,be[0])}for(A.position={start:Ne(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:Ne(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<n.transforms.length;)A=n.transforms[Q](A)||A;return A}function i(w,A,R){let H=A-1,Q=-1,be=!1,je,Ae,tt,nt;for(;++H<=R;){const pe=w[H];switch(pe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pe[0]==="enter"?Q++:Q--,nt=void 0;break}case"lineEndingBlank":{pe[0]==="enter"&&(je&&!nt&&!Q&&!tt&&(tt=H),nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:nt=void 0}if(!Q&&pe[0]==="enter"&&pe[1].type==="listItemPrefix"||Q===-1&&pe[0]==="exit"&&(pe[1].type==="listUnordered"||pe[1].type==="listOrdered")){if(je){let qe=H;for(Ae=void 0;qe--;){const Te=w[qe];if(Te[1].type==="lineEnding"||Te[1].type==="lineEndingBlank"){if(Te[0]==="exit")continue;Ae&&(w[Ae][1].type="lineEndingBlank",be=!0),Te[1].type="lineEnding",Ae=qe}else if(!(Te[1].type==="linePrefix"||Te[1].type==="blockQuotePrefix"||Te[1].type==="blockQuotePrefixWhitespace"||Te[1].type==="blockQuoteMarker"||Te[1].type==="listItemIndent"))break}tt&&(!Ae||tt<Ae)&&(je._spread=!0),je.end=Object.assign({},Ae?w[Ae][1].start:pe[1].end),w.splice(Ae||H,0,["exit",je,pe[2]]),H++,R++}if(pe[1].type==="listItemPrefix"){const qe={type:"listItem",_spread:!1,start:Object.assign({},pe[1].start),end:void 0};je=qe,w.splice(H,0,["enter",qe,pe[2]]),H++,R++,tt=void 0,nt=!0}}}return w[A][1]._spread=be,R}function o(w,A){return R;function R(H){a.call(this,w(H),H),A&&A.call(this,H)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(w,A,R){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([A,R||void 0]),w.position={start:Ne(A.start),end:void 0}}function s(w){return A;function A(R){w&&w.call(this,R),u.call(this,R)}}function u(w,A){const R=this.stack.pop(),H=this.tokenStack.pop();if(H)H[0].type!==w.type&&(A?A.call(this,w,H[0]):(H[1]||lr).call(this,w,H[0]));else throw new Error("Cannot close `"+w.type+"` ("+at({start:w.start,end:w.end})+"): it’s not open");R.position.end=Ne(w.end)}function f(){return bn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(w){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function h(){const w=this.resume(),A=this.stack[this.stack.length-1];A.lang=w}function g(){const w=this.resume(),A=this.stack[this.stack.length-1];A.meta=w}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w.replace(/(\r?\n|\r)$/g,"")}function v(w){const A=this.resume(),R=this.stack[this.stack.length-1];R.label=A,R.identifier=we(this.sliceSerialize(w)).toLowerCase()}function E(){const w=this.resume(),A=this.stack[this.stack.length-1];A.title=w}function j(){const w=this.resume(),A=this.stack[this.stack.length-1];A.url=w}function F(w){const A=this.stack[this.stack.length-1];if(!A.depth){const R=this.sliceSerialize(w).length;A.depth=R}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function _(w){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function U(w){const R=this.stack[this.stack.length-1].children;let H=R[R.length-1];(!H||H.type!=="text")&&(H=Re(),H.position={start:Ne(w.start),end:void 0},R.push(H)),this.stack.push(H)}function y(w){const A=this.stack.pop();A.value+=this.sliceSerialize(w),A.position.end=Ne(w.end)}function N(w){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const R=A.children[A.children.length-1];R.position.end=Ne(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(A.type)&&(U.call(this,w),y.call(this,w))}function D(){this.data.atHardBreak=!0}function K(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function L(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function T(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function B(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=A,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function X(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=A,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function se(w){const A=this.sliceSerialize(w),R=this.stack[this.stack.length-2];R.label=rs(A),R.identifier=we(A).toLowerCase()}function ye(){const w=this.stack[this.stack.length-1],A=this.resume(),R=this.stack[this.stack.length-1];if(this.data.inReference=!0,R.type==="link"){const H=w.children;R.children=H}else R.alt=A}function m(){const w=this.resume(),A=this.stack[this.stack.length-1];A.url=w}function fe(){const w=this.resume(),A=this.stack[this.stack.length-1];A.title=w}function oe(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function Z(w){const A=this.resume(),R=this.stack[this.stack.length-1];R.label=A,R.identifier=we(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Ie(w){this.data.characterReferenceType=w.type}function ee(w){const A=this.sliceSerialize(w),R=this.data.characterReferenceType;let H;R?(H=ti(A,R==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):H=wn(A);const Q=this.stack[this.stack.length-1];Q.value+=H}function Se(w){const A=this.stack.pop();A.position.end=Ne(w.end)}function ke(w){y.call(this,w);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(w)}function De(w){y.call(this,w);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(w)}function ve(){return{type:"blockquote",children:[]}}function He(){return{type:"code",lang:null,meta:null,value:""}}function Ge(){return{type:"inlineCode",value:""}}function yt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kt(){return{type:"emphasis",children:[]}}function Je(){return{type:"heading",depth:0,children:[]}}function P(){return{type:"break"}}function J(){return{type:"html",value:""}}function ne(){return{type:"image",title:null,url:"",alt:null}}function re(){return{type:"link",title:null,url:"",children:[]}}function Fe(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function Ze(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function et(){return{type:"paragraph",children:[]}}function he(){return{type:"strong",children:[]}}function Re(){return{type:"text",value:""}}function bt(){return{type:"thematicBreak"}}}function Ne(e){return{line:e.line,column:e.column,offset:e.offset}}function hi(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?hi(e,r):as(e,r)}}function as(e,n){let t;for(t in n)if(fi.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 lr(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 ss(e){const n=this;n.parser=t;function t(r){return ls(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function us(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 cs(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
|
4
|
+
`;break}case-2:{l=n?" ":" ";break}case-1:{if(!n&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Za(e){const r={constructs:Jr([Ya,...(e||{}).extensions||[]]),content:i(po),defined:[],document:i(go),flow:i(Fa),lazy:{},string:i(ja),text:i(Oa)};return r;function i(o){return l;function l(a){return Xa(r,o,a)}}}function es(e){for(;!ri(e););return e}const nr=/[\0\t\n\r]/g;function ts(){let e=1,n="",t=!0,r;return i;function i(o,l,a){const s=[];let u,f,c,p,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(nr.lastIndex=c,u=nr.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){n=o.slice(c);break}if(h===10&&c===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<p&&(s.push(o.slice(c,p)),e+=p-c),h){case 0:{s.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,s.push(-2);e++<f;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const ns=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rs(e){return e.replace(ns,is)}function is(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),o=i===120||i===88;return Zr(t.slice(o?2:1),o?16:10)}return kn(t)||e}const ui={}.hasOwnProperty;function ls(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),os(t)(es(Za(t).document().write(ts()(e,n,!0))))}function os(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(te),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(Je),blockQuote:o(De),characterEscape:$,characterReference:$,codeFenced:o(Fe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Fe,l),codeText:o(zt,l),codeTextData:$,data:$,codeFlowValue:$,definition:o(Ge),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(kt),hardBreakEscape:o(Ze),hardBreakTrailing:o(Ze),htmlFlow:o(T,l),htmlFlowData:$,htmlText:o(T,l),htmlTextData:$,image:o(G),label:l,link:o(te),listItem:o(He),listItemValue:p,listOrdered:o(re,c),listUnordered:o(re),paragraph:o(et),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Je),strong:o(tt),thematicBreak:o(Re)},exit:{atxHeading:s(),atxHeadingSequence:F,autolink:s(),autolinkEmail:Ie,autolinkProtocol:he,blockQuote:s(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Ee,characterReferenceMarkerNumeric:Ee,characterReferenceValue:Z,characterReference:Pe,codeFenced:s(C),codeFencedFence:S,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:s(x),codeText:s(P),codeTextData:y,data:y,definition:s(),definitionDestinationString:_,definitionLabelString:v,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(D),hardBreakTrailing:s(D),htmlFlow:s(K),htmlFlowData:y,htmlText:s(L),htmlTextData:y,image:s(X),label:ke,labelText:se,lineEnding:N,link:s(H),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:ee,resourceDestinationString:m,resourceTitleString:fe,resource:oe,setextHeading:s(W),setextHeadingLineSequence:j,setextHeadingText:b,strong:s(),thematicBreak:s()}};ci(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(w){let A={type:"root",children:[]};const R={stack:[A],tokenStack:[],config:n,enter:a,exit:u,buffer:l,resume:f,data:t},B=[];let Q=-1;for(;++Q<w.length;)if(w[Q][1].type==="listOrdered"||w[Q][1].type==="listUnordered")if(w[Q][0]==="enter")B.push(Q);else{const be=B.pop();Q=i(w,be,Q)}for(Q=-1;++Q<w.length;){const be=n[w[Q][0]];ui.call(be,w[Q][1].type)&&be[w[Q][1].type].call(Object.assign({sliceSerialize:w[Q][2].sliceSerialize},R),w[Q][1])}if(R.tokenStack.length>0){const be=R.tokenStack[R.tokenStack.length-1];(be[1]||rr).call(R,void 0,be[0])}for(A.position={start:Ne(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:Ne(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<n.transforms.length;)A=n.transforms[Q](A)||A;return A}function i(w,A,R){let B=A-1,Q=-1,be=!1,_e,ve,nt,rt;for(;++B<=R;){const me=w[B];switch(me[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{me[0]==="enter"?Q++:Q--,rt=void 0;break}case"lineEndingBlank":{me[0]==="enter"&&(_e&&!rt&&!Q&&!nt&&(nt=B),rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rt=void 0}if(!Q&&me[0]==="enter"&&me[1].type==="listItemPrefix"||Q===-1&&me[0]==="exit"&&(me[1].type==="listUnordered"||me[1].type==="listOrdered")){if(_e){let qe=B;for(ve=void 0;qe--;){const Ae=w[qe];if(Ae[1].type==="lineEnding"||Ae[1].type==="lineEndingBlank"){if(Ae[0]==="exit")continue;ve&&(w[ve][1].type="lineEndingBlank",be=!0),Ae[1].type="lineEnding",ve=qe}else if(!(Ae[1].type==="linePrefix"||Ae[1].type==="blockQuotePrefix"||Ae[1].type==="blockQuotePrefixWhitespace"||Ae[1].type==="blockQuoteMarker"||Ae[1].type==="listItemIndent"))break}nt&&(!ve||nt<ve)&&(_e._spread=!0),_e.end=Object.assign({},ve?w[ve][1].start:me[1].end),w.splice(ve||B,0,["exit",_e,me[2]]),B++,R++}if(me[1].type==="listItemPrefix"){const qe={type:"listItem",_spread:!1,start:Object.assign({},me[1].start),end:void 0};_e=qe,w.splice(B,0,["enter",qe,me[2]]),B++,R++,nt=void 0,rt=!0}}}return w[A][1]._spread=be,R}function o(w,A){return R;function R(B){a.call(this,w(B),B),A&&A.call(this,B)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(w,A,R){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([A,R||void 0]),w.position={start:Ne(A.start),end:void 0}}function s(w){return A;function A(R){w&&w.call(this,R),u.call(this,R)}}function u(w,A){const R=this.stack.pop(),B=this.tokenStack.pop();if(B)B[0].type!==w.type&&(A?A.call(this,w,B[0]):(B[1]||rr).call(this,w,B[0]));else throw new Error("Cannot close `"+w.type+"` ("+st({start:w.start,end:w.end})+"): it’s not open");R.position.end=Ne(w.end)}function f(){return yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(w){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function h(){const w=this.resume(),A=this.stack[this.stack.length-1];A.lang=w}function g(){const w=this.resume(),A=this.stack[this.stack.length-1];A.meta=w}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w.replace(/(\r?\n|\r)$/g,"")}function v(w){const A=this.resume(),R=this.stack[this.stack.length-1];R.label=A,R.identifier=we(this.sliceSerialize(w)).toLowerCase()}function E(){const w=this.resume(),A=this.stack[this.stack.length-1];A.title=w}function _(){const w=this.resume(),A=this.stack[this.stack.length-1];A.url=w}function F(w){const A=this.stack[this.stack.length-1];if(!A.depth){const R=this.sliceSerialize(w).length;A.depth=R}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function j(w){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function $(w){const R=this.stack[this.stack.length-1].children;let B=R[R.length-1];(!B||B.type!=="text")&&(B=pe(),B.position={start:Ne(w.start),end:void 0},R.push(B)),this.stack.push(B)}function y(w){const A=this.stack.pop();A.value+=this.sliceSerialize(w),A.position.end=Ne(w.end)}function N(w){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const R=A.children[A.children.length-1];R.position.end=Ne(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(A.type)&&($.call(this,w),y.call(this,w))}function D(){this.data.atHardBreak=!0}function K(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function L(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function P(){const w=this.resume(),A=this.stack[this.stack.length-1];A.value=w}function H(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=A,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function X(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=A,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function se(w){const A=this.sliceSerialize(w),R=this.stack[this.stack.length-2];R.label=rs(A),R.identifier=we(A).toLowerCase()}function ke(){const w=this.stack[this.stack.length-1],A=this.resume(),R=this.stack[this.stack.length-1];if(this.data.inReference=!0,R.type==="link"){const B=w.children;R.children=B}else R.alt=A}function m(){const w=this.resume(),A=this.stack[this.stack.length-1];A.url=w}function fe(){const w=this.resume(),A=this.stack[this.stack.length-1];A.title=w}function oe(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ee(w){const A=this.resume(),R=this.stack[this.stack.length-1];R.label=A,R.identifier=we(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Ee(w){this.data.characterReferenceType=w.type}function Z(w){const A=this.sliceSerialize(w),R=this.data.characterReferenceType;let B;R?(B=Zr(A,R==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):B=kn(A);const Q=this.stack[this.stack.length-1];Q.value+=B}function Pe(w){const A=this.stack.pop();A.position.end=Ne(w.end)}function he(w){y.call(this,w);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(w)}function Ie(w){y.call(this,w);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(w)}function De(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function zt(){return{type:"inlineCode",value:""}}function Ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function kt(){return{type:"emphasis",children:[]}}function Je(){return{type:"heading",depth:0,children:[]}}function Ze(){return{type:"break"}}function T(){return{type:"html",value:""}}function G(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function re(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function He(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function et(){return{type:"paragraph",children:[]}}function tt(){return{type:"strong",children:[]}}function pe(){return{type:"text",value:""}}function Re(){return{type:"thematicBreak"}}}function Ne(e){return{line:e.line,column:e.column,offset:e.offset}}function ci(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?ci(e,r):as(e,r)}}function as(e,n){let t;for(t in n)if(ui.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function rr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+st({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+st({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+st({start:n.start,end:n.end})+") is still open")}function ss(e){const n=this;n.parser=t;function t(r){return ls(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function us(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 cs(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
|
5
5
|
`}]}function fs(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 o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function hs(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ps(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ms(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Xe(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(n,u),e.applyData(n,u)}function ds(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 gs(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function
|
|
6
|
+
`:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(o.data={meta:n.meta}),e.patch(n,o),o=e.applyData(n,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(n,o),o}function hs(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ps(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ms(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=Xe(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(n,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(n,u),e.applyData(n,u)}function ds(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 gs(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function fi(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function xs(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return fi(e,n);const i={src:Xe(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,o),e.applyData(n,o)}function ys(e,n){const t={src:Xe(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 ks(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 bs(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return fi(e,n);const i={href:Xe(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,o),e.applyData(n,o)}function ws(e,n){const t={href:Xe(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 Ss(e,n,t){const r=e.all(n),i=t?Cs(t):hi(n),o={},l=[];if(typeof n.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
7
7
|
`}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const s=r[r.length-1];s&&(i||s.type!=="element"||s.tagName!=="p")&&l.push({type:"text",value:`
|
|
8
|
-
`});const u={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,u),e.applyData(n,u)}function Cs(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=
|
|
8
|
+
`});const u={type:"element",tagName:"li",properties:o,children:l};return e.patch(n,u),e.applyData(n,u)}function Cs(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=hi(t[r])}return n}function hi(e){const n=e.spread;return n??e.children.length>1}function Es(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const o={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,o),e.applyData(n,o)}function Is(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function vs(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function As(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Ts(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],l),i.push(l)}if(t.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=mn(n.children[1]),s=$r(n.children[n.children.length-1]);a&&s&&(l.position={start:a,end:s}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,o),e.applyData(n,o)}function Ps(e,n,t){const r=t?t.children:void 0,o=(r?r.indexOf(n):1)===0?"th":"td",l=t&&t.type==="table"?t.align:void 0,a=l?l.length:n.children.length;let s=-1;const u=[];for(;++s<a;){const c=n.children[s],p={},h=l?l[s]:void 0;h&&(p.align=h);let g={type:"element",tagName:o,properties:p,children:[]};c&&(g.children=e.all(c),e.patch(c,g),g=e.applyData(c,g)),u.push(g)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,f),e.applyData(n,f)}function Ds(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ir=9,lr=32;function Ns(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const o=[];for(;r;)o.push(or(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return o.push(or(n.slice(i),i>0,!1)),o.join("")}function or(e,n,t){let r=0,i=e.length;if(n){let o=e.codePointAt(r);for(;o===ir||o===lr;)r++,o=e.codePointAt(r)}if(t){let o=e.codePointAt(i-1);for(;o===ir||o===lr;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Ls(e,n){const t={type:"text",value:Ns(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function zs(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Fs={blockquote:us,break:cs,code:fs,delete:hs,emphasis:ps,footnoteReference:ms,heading:ds,html:gs,imageReference:xs,image:ys,inlineCode:ks,linkReference:bs,link:ws,listItem:Ss,list:Es,paragraph:Is,root:vs,strong:As,table:Ts,tableCell:Ds,tableRow:Ps,text:Ls,thematicBreak:zs,toml:bt,yaml:bt,definition:bt,footnoteDefinition:bt};function bt(){}const pi=-1,Dt=0,ct=1,vt=2,wn=3,Sn=4,Cn=5,En=6,mi=7,di=8,ar=typeof self=="object"?self:globalThis,Rs=(e,n)=>{const t=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=n[i];switch(o){case Dt:case pi:return t(l,i);case ct:{const a=t([],i);for(const s of l)a.push(r(s));return a}case vt:{const a=t({},i);for(const[s,u]of l)a[r(s)]=r(u);return a}case wn:return t(new Date(l),i);case Sn:{const{source:a,flags:s}=l;return t(new RegExp(a,s),i)}case Cn:{const a=t(new Map,i);for(const[s,u]of l)a.set(r(s),r(u));return a}case En:{const a=t(new Set,i);for(const s of l)a.add(r(s));return a}case mi:{const{name:a,message:s}=l;return t(new ar[a](s),i)}case di:return t(BigInt(l),i);case"BigInt":return t(Object(BigInt(l)),i);case"ArrayBuffer":return t(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return t(new DataView(a),l)}}return t(new ar[o](l),i)};return r},sr=e=>Rs(new Map,e)(0),Ve="",{toString:_s}={},{keys:js}=Object,at=e=>{const n=typeof e;if(n!=="object"||!e)return[Dt,n];const t=_s.call(e).slice(8,-1);switch(t){case"Array":return[ct,Ve];case"Object":return[vt,Ve];case"Date":return[wn,Ve];case"RegExp":return[Sn,Ve];case"Map":return[Cn,Ve];case"Set":return[En,Ve];case"DataView":return[ct,t]}return t.includes("Array")?[ct,t]:t.includes("Error")?[mi,t]:[vt,t]},wt=([e,n])=>e===Dt&&(n==="function"||n==="symbol"),Os=(e,n,t,r)=>{const i=(l,a)=>{const s=r.push(l)-1;return t.set(a,s),s},o=l=>{if(t.has(l))return t.get(l);let[a,s]=at(l);switch(a){case Dt:{let f=l;switch(s){case"bigint":a=di,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);f=null;break;case"undefined":return i([pi],l)}return i([a,f],l)}case ct:{if(s){let p=l;return s==="DataView"?p=new Uint8Array(l.buffer):s==="ArrayBuffer"&&(p=new Uint8Array(l)),i([s,[...p]],l)}const f=[],c=i([a,f],l);for(const p of l)f.push(o(p));return c}case vt:{if(s)switch(s){case"BigInt":return i([s,l.toString()],l);case"Boolean":case"Number":case"String":return i([s,l.valueOf()],l)}if(n&&"toJSON"in l)return o(l.toJSON());const f=[],c=i([a,f],l);for(const p of js(l))(e||!wt(at(l[p])))&&f.push([o(p),o(l[p])]);return c}case wn:return i([a,l.toISOString()],l);case Sn:{const{source:f,flags:c}=l;return i([a,{source:f,flags:c}],l)}case Cn:{const f=[],c=i([a,f],l);for(const[p,h]of l)(e||!(wt(at(p))||wt(at(h))))&&f.push([o(p),o(h)]);return c}case En:{const f=[],c=i([a,f],l);for(const p of l)(e||!wt(at(p)))&&f.push(o(p));return c}}const{message:u}=l;return i([a,{name:s,message:u}],l)};return o},ur=(e,{json:n,lossy:t}={})=>{const r=[];return Os(!(n||t),!!n,new Map,r)(e),r},ht=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?sr(ur(e,n)):structuredClone(e):(e,n)=>sr(ur(e,n));function Ms(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 Bs(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Hs(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Ms,r=e.options.footnoteBackLabel||Bs,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let s=-1;for(;++s<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[s]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),p=Xe(c.toLowerCase());let h=0;const g=[],S=e.footnoteCounts.get(c);for(;S!==void 0&&++h<=S;){g.length>0&&g.push({type:"text",value:" "});let v=typeof t=="string"?t:t(s,h);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(s,h),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const C=f[f.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const v=C.children[C.children.length-1];v&&v.type==="text"?v.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...g)}else f.push(...g);const x={type:"element",tagName:"li",properties:{id:n+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ht(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
9
9
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
10
|
-
`}]}}const
|
|
10
|
+
`}]}}const Nt=(function(e){if(e==null)return Vs;if(typeof e=="function")return Lt(e);if(typeof e=="object")return Array.isArray(e)?qs(e):Us(e);if(typeof e=="string")return $s(e);throw new Error("Expected function, string, or object as test")});function qs(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=Nt(e[t]);return Lt(r);function r(...i){let o=-1;for(;++o<n.length;)if(n[o].apply(this,i))return!0;return!1}}function Us(e){const n=e;return Lt(t);function t(r){const i=r;let o;for(o in e)if(i[o]!==n[o])return!1;return!0}}function $s(e){return Lt(n);function n(t){return t&&t.type===e}}function Lt(e){return n;function n(t,r,i){return!!(Ws(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function Vs(){return!0}function Ws(e){return e!==null&&typeof e=="object"&&"type"in e}const gi=[],Ks=!0,on=!1,Qs="skip";function xi(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const o=Nt(i),l=r?-1:1;a(e,void 0,[])();function a(s,u,f){const c=s&&typeof s=="object"?s:{};if(typeof c.type=="string"){const h=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(s.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=gi,g,S,C;if((!n||o(s,u,f[f.length-1]||void 0))&&(h=Ys(t(s,f)),h[0]===on))return h;if("children"in s&&s.children){const x=s;if(x.children&&h[0]!==Qs)for(S=(r?x.children.length:-1)+l,C=f.concat(x);S>-1&&S<x.children.length;){const v=x.children[S];if(g=a(v,S,C)(),g[0]===on)return g;S=typeof g[1]=="number"?g[1]:S+l}}return h}}}function Ys(e){return Array.isArray(e)?e:typeof e=="number"?[Ks,e]:e==null?gi:[e]}function In(e,n,t,r){let i,o,l;typeof n=="function"&&typeof t!="function"?(o=void 0,l=n,i=t):(o=n,l=t,i=r),xi(e,o,a,i);function a(s,u){const f=u[u.length-1],c=f?f.children.indexOf(s):void 0;return l(s,c,f)}}const an={}.hasOwnProperty,Xs={};function Gs(e,n){const t=n||Xs,r=new Map,i=new Map,o=new Map,l={...Fs,...t.handlers},a={all:u,applyData:Zs,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:s,options:t,patch:Js,wrap:tu};return In(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();c.has(p)||c.set(p,f)}}),a;function s(f,c){const p=f.type,h=a.handlers[p];if(an.call(a.handlers,p)&&h)return h(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:S,...C}=f,x=ht(C);return x.children=a.all(f),x}return ht(f)}return(a.options.unknownHandler||eu)(a,f,c)}function u(f){const c=[];if("children"in f){const p=f.children;let h=-1;for(;++h<p.length;){const g=a.one(p[h],f);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=cr(g.value)),!Array.isArray(g)&&g.type==="element")){const S=g.children[0];S&&S.type==="text"&&(S.value=cr(S.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function Js(e,n){e.position&&(n.position=Wr(e))}function Zs(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const l="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:l}}t.type==="element"&&o&&Object.assign(t.properties,ht(o)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function eu(e,n){const t=n.data||{},r="value"in n&&!(an.call(t,"hProperties")||an.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 tu(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
|
|
11
11
|
`});++r<e.length;)r&&t.push({type:"text",value:`
|
|
12
12
|
`}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
|
|
13
|
-
`}),t}function
|
|
14
|
-
`},i),o}function nu(e,n){return e&&"run"in e?async function(t,r){const i=pr(t,{file:r,...n});await e.run(i,r)}:function(t,r){return pr(t,{file:r,...e||n})}}function mr(e){if(e)throw e}var Bt,dr;function ru(){if(dr)return Bt;dr=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},o=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),c=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!c)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},l=function(u,f){t&&f.name==="__proto__"?t(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},a=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return Bt=function s(){var u,f,c,p,h,g,S=arguments[0],C=1,x=arguments.length,v=!1;for(typeof S=="boolean"&&(v=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<x;++C)if(u=arguments[C],u!=null)for(f in u)c=a(S,f),p=a(u,f),S!==p&&(v&&p&&(o(p)||(h=i(p)))?(h?(h=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},l(S,{name:f,newValue:s(v,g,p)})):typeof p<"u"&&l(S,{name:f,newValue:p}));return S},Bt}var iu=ru();const Ht=Rr(iu);function sn(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 lu(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(s,...u){const f=e[++o];let c=-1;if(s){l(s);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?ou(f,a)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function ou(e,n){let t;return r;function r(...l){const a=e.length>l.length;let s;a&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(a&&t)throw f;return i(f)}a||(s&&s.then&&typeof s.then=="function"?s.then(o,i):s instanceof Error?i(s):o(s))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const Ce={basename:au,dirname:su,extname:uu,join:cu,sep:"/"};function au(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');gt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function su(e){if(gt(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 uu(e){gt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function cu(...e){let n=-1,t;for(;++n<e.length;)gt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":fu(t)}function fu(e){gt(e);const n=e.codePointAt(0)===47;let t=hu(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function hu(e,n){let t="",r=0,i=-1,o=0,l=-1,a,s;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",r=0):(t=t.slice(0,s),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function gt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pu={cwd:mu};function mu(){return"/"}function un(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function du(e){if(typeof e=="string")e=new URL(e);else if(!un(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return gu(e)}function gu(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 qt=["history","path","basename","stem","extname","dirname"];class bi{constructor(n){let t;n?un(n)?t={path:n}:typeof n=="string"||xu(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":pu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qt.length;){const o=qt[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)qt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?Ce.basename(this.path):void 0}set basename(n){$t(n,"basename"),Ut(n,"basename"),this.path=Ce.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Ce.dirname(this.path):void 0}set dirname(n){gr(this.basename,"dirname"),this.path=Ce.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Ce.extname(this.path):void 0}set extname(n){if(Ut(n,"extname"),gr(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=Ce.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){un(n)&&(n=du(n)),$t(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Ce.basename(this.path,this.extname):void 0}set stem(n){$t(n,"stem"),Ut(n,"stem"),this.path=Ce.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 le(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 Ut(e,n){if(e&&e.includes(Ce.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Ce.sep+"`")}function $t(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function gr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function xu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yu=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),ku={}.hasOwnProperty;class Tn extends yu{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=lu()}copy(){const n=new Tn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Ht(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Kt("data",this.frozen),this.namespace[n]=t,this):ku.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Kt("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=Ct(n),r=this.parser||this.Parser;return Vt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Vt("process",this.parser||this.Parser),Wt("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=Ct(n),s=r.parse(a);r.run(s,a,function(f,c,p){if(f||!c||!p)return u(f);const h=c,g=r.stringify(h,p);Su(g)?p.value=g:p.result=g,u(f,p)});function u(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Vt("processSync",this.parser||this.Parser),Wt("processSync",this.compiler||this.Compiler),this.process(n,i),yr("processSync","process",t),r;function i(o,l){t=!0,mr(o),r=l}}run(n,t,r){xr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const s=Ct(t);i.run(n,s,u);function u(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),yr("runSync","run",r),i;function o(l,a){mr(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=Ct(t),i=this.compiler||this.Compiler;return Wt("stringify",i),xr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Kt("use",this.frozen),n!=null)if(typeof n=="function")s(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;s(f,c)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=Ht(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[h,...g]=f;const S=r[p][1];sn(S)&&sn(h)&&(h=Ht(!0,S,h)),r[p]=[u,h,...g]}}}}const bu=new Tn().freeze();function Vt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Kt(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 xr(e){if(!sn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ct(e){return wu(e)?e:new bi(e)}function wu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Su(e){return typeof e=="string"||Cu(e)}function Cu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Eu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",kr=[],br={allowDangerousHtml:!0},Iu=/^(https?|ircs?|mailto|xmpp)$/i,vu=[{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 Au(e){const n=Tu(e),t=Pu(e);return Du(n.runSync(n.parse(t),t),e)}function Tu(e){const n=e.rehypePlugins||kr,t=e.remarkPlugins||kr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...br}:br;return bu().use(ss).use(t).use(nu,r).use(n)}function Pu(e){const n=e.children||"",t=new bi;return typeof n=="string"&&(t.value=n),t}function Du(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,a=n.unwrapDisallowed,s=n.urlTransform||Nu;for(const f of vu)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Eu+f.id,void 0);return An(e,u),$l(e,{Fragment:k.Fragment,components:i,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function u(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in _t)if(Object.hasOwn(_t,h)&&Object.hasOwn(f.properties,h)){const g=f.properties[h],S=_t[h];(S===null||S.includes(f.tagName))&&(f.properties[h]=s(String(g||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Nu(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||Iu.test(e.slice(0,n))?e:""}const _e=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],wr={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 Lu(e,n){let t={type:"root",children:[]};const r={schema:n?{...wr,...n}:wr,stack:[]},i=wi(r,e);return i&&(Array.isArray(i)?i.length===1?t=i[0]:t.children=i:t=i),t}function wi(e,n){if(n&&typeof n=="object"){const t=n;switch(typeof t.type=="string"?t.type:""){case"comment":return zu(e,t);case"doctype":return Fu(e,t);case"element":return Ru(e,t);case"root":return ju(e,t);case"text":return _u(e,t)}}}function zu(e,n){if(e.schema.allowComments){const t=typeof n.value=="string"?n.value:"",r=t.indexOf("-->"),o={type:"comment",value:r<0?t:t.slice(0,r)};return xt(o,n),o}}function Fu(e,n){if(e.schema.allowDoctypes){const t={type:"doctype"};return xt(t,n),t}}function Ru(e,n){const t=typeof n.tagName=="string"?n.tagName:"";e.stack.push(t);const r=Si(e,n.children),i=Ou(e,n.properties);e.stack.pop();let o=!1;if(t&&t!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(t))&&(o=!0,e.schema.ancestors&&Le.call(e.schema.ancestors,t))){const a=e.schema.ancestors[t];let s=-1;for(o=!1;++s<a.length;)e.stack.includes(a[s])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(t)?r:void 0;const l={type:"element",tagName:t,properties:i,children:r};return xt(l,n),l}function ju(e,n){const r={type:"root",children:Si(e,n.children)};return xt(r,n),r}function _u(e,n){const r={type:"text",value:typeof n.value=="string"?n.value:""};return xt(r,n),r}function Si(e,n){const t=[];if(Array.isArray(n)){const r=n;let i=-1;for(;++i<r.length;){const o=wi(e,r[i]);o&&(Array.isArray(o)?t.push(...o):t.push(o))}}return t}function Ou(e,n){const t=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,o=r&&Le.call(r,t)?r[t]:void 0,l=r&&Le.call(r,"*")?r["*"]:void 0,a=n&&typeof n=="object"?n:{},s={};let u;for(u in a)if(Le.call(a,u)){const f=a[u];let c=Sr(e,Cr(o,u),u,f);c==null&&(c=Sr(e,Cr(l,u),u,f)),c!=null&&(s[u]=c)}if(i&&Le.call(i,t)){const f=i[t];for(u in f)Le.call(f,u)&&!Le.call(s,u)&&(s[u]=f[u])}return s}function Sr(e,n,t,r){return n?Array.isArray(r)?Mu(e,n,t,r):Ci(e,n,t,r):void 0}function Mu(e,n,t,r){let i=-1;const o=[];for(;++i<r.length;){const l=Ci(e,n,t,r[i]);(typeof l=="number"||typeof l=="string")&&o.push(l)}return o}function Ci(e,n,t,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Bu(e,t,r)){if(typeof n=="object"&&n.length>1){let i=!1,o=0;for(;++o<n.length;){const l=n[o];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){i=!0;break}}else if(l===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 Bu(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),o=i.indexOf(":"),l=i.indexOf("?"),a=i.indexOf("#"),s=i.indexOf("/");if(o<0||s>-1&&o>s||l>-1&&o>l||a>-1&&o>a)return!0;let u=-1;for(;++u<r.length;){const f=r[u];if(o===f.length&&i.slice(0,f.length)===f)return!0}return!1}function xt(e,n){const t=Qr(n);n.data&&(e.data=ft(n.data)),t&&(e.position=t)}function Cr(e,n){let t,r=-1;if(e)for(;++r<e.length;){const i=e[r],o=typeof i=="string"?i:i[0];if(o===n)return i;o==="data*"&&(t=i)}if(n.length>4&&n.slice(0,4).toLowerCase()==="data")return t}function Hu(e){return function(n){return Lu(n,e)}}function Er(e,n){const t=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+n.length);return r}function qu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Uu(e,n,t){const i=Lt((t||{}).ignore||[]),o=$u(n);let l=-1;for(;++l<o.length;)ki(e,"text",a);function a(u,f){let c=-1,p;for(;++c<f.length;){const h=f[c],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return s(u,f)}function s(u,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let g=0;const C=c.children.indexOf(u);let x=!1,v=[];p.lastIndex=0;let E=p.exec(u.value);for(;E;){const j=E.index,F={index:E.index,input:E.input,stack:[...f,u]};let b=h(...E,F);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?p.lastIndex=j+1:(g!==j&&v.push({type:"text",value:u.value.slice(g,j)}),Array.isArray(b)?v.push(...b):b&&v.push(b),g=j+E[0].length,x=!0),!p.global)break;E=p.exec(u.value)}return x?(g<u.value.length&&v.push({type:"text",value:u.value.slice(g)}),c.children.splice(C,1,...v)):v=[u],C+v.length}}function $u(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([Vu(i[0]),Wu(i[1])])}return n}function Vu(e){return typeof e=="string"?new RegExp(qu(e),"g"):e}function Wu(e){return typeof e=="function"?e:function(){return e}}const Qt="phrasing",Yt=["autolink","link","image","label"];function Ku(){return{transforms:[ec],enter:{literalAutolink:Yu,literalAutolinkEmail:Xt,literalAutolinkHttp:Xt,literalAutolinkWww:Xt},exit:{literalAutolink:Zu,literalAutolinkEmail:Ju,literalAutolinkHttp:Xu,literalAutolinkWww:Gu}}}function Qu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qt,notInConstruct:Yt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qt,notInConstruct:Yt},{character:":",before:"[ps]",after:"\\/",inConstruct:Qt,notInConstruct:Yt}]}}function Yu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xt(e){this.config.enter.autolinkProtocol.call(this,e)}function Xu(e){this.config.exit.autolinkProtocol.call(this,e)}function Gu(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 Ju(e){this.config.exit.autolinkEmail.call(this,e)}function Zu(e){this.exit(e)}function ec(e){Uu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nc]],{ignore:["link","linkReference"]})}function tc(e,n,t,r,i){let o="";if(!Ei(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!rc(t)))return!1;const l=ic(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function nc(e,n,t,r){return!Ei(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function rc(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 ic(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let t=n[0],r=t.indexOf(")");const i=Er(e,"(");let o=Er(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function Ei(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Me(t)||Pt(t))&&(!n||t!==47)}Ii.peek=pc;function lc(){this.buffer()}function oc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ac(){this.buffer()}function sc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function uc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=we(this.sliceSerialize(e)).toLowerCase(),t.label=n}function cc(e){this.exit(e)}function fc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=we(this.sliceSerialize(e)).toLowerCase(),t.label=n}function hc(e){this.exit(e)}function pc(){return"["}function Ii(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function mc(){return{enter:{gfmFootnoteCallString:lc,gfmFootnoteCall:oc,gfmFootnoteDefinitionLabelString:ac,gfmFootnoteDefinition:sc},exit:{gfmFootnoteCallString:uc,gfmFootnoteCall:cc,gfmFootnoteDefinitionLabelString:fc,gfmFootnoteDefinition:hc}}}function dc(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Ii},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let s=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return s+=a.move(o.safe(o.associationId(r),{before:s,after:"]"})),f(),s+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),s+=a.move((n?`
|
|
15
|
-
`:" ")+o.indentLines(o.containerFlow(r,a.current()),n?
|
|
16
|
-
`)}function Ic(e){return e==null?"":String(e)}function
|
|
13
|
+
`}),t}function cr(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function fr(e,n){const t=Gs(e,n),r=t.one(e,void 0),i=Hs(t),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
14
|
+
`},i),o}function nu(e,n){return e&&"run"in e?async function(t,r){const i=fr(t,{file:r,...n});await e.run(i,r)}:function(t,r){return fr(t,{file:r,...e||n})}}function hr(e){if(e)throw e}var Bt,pr;function ru(){if(pr)return Bt;pr=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},o=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),c=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!c)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},l=function(u,f){t&&f.name==="__proto__"?t(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},a=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return Bt=function s(){var u,f,c,p,h,g,S=arguments[0],C=1,x=arguments.length,v=!1;for(typeof S=="boolean"&&(v=S,S=arguments[1]||{},C=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});C<x;++C)if(u=arguments[C],u!=null)for(f in u)c=a(S,f),p=a(u,f),S!==p&&(v&&p&&(o(p)||(h=i(p)))?(h?(h=!1,g=c&&i(c)?c:[]):g=c&&o(c)?c:{},l(S,{name:f,newValue:s(v,g,p)})):typeof p<"u"&&l(S,{name:f,newValue:p}));return S},Bt}var iu=ru();const Ht=zr(iu);function sn(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 lu(){const e=[],n={run:t,use:r};return n;function t(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(s,...u){const f=e[++o];let c=-1;if(s){l(s);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?ou(f,a)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function ou(e,n){let t;return r;function r(...l){const a=e.length>l.length;let s;a&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(a&&t)throw f;return i(f)}a||(s&&s.then&&typeof s.then=="function"?s.then(o,i):s instanceof Error?i(s):o(s))}function i(l,...a){t||(t=!0,n(l,...a))}function o(l){i(null,l)}}const Se={basename:au,dirname:su,extname:uu,join:cu,sep:"/"};function au(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');xt(e);let t=0,r=-1,i=e.length,o;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let l=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){t=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return t===r?r=l:r<0&&(r=e.length),e.slice(t,r)}function su(e){if(xt(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 uu(e){xt(e);let n=e.length,t=-1,r=0,i=-1,o=0,l;for(;n--;){const a=e.codePointAt(n);if(a===47){if(l){r=n+1;break}continue}t<0&&(l=!0,t=n+1),a===46?i<0?i=n:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||t<0||o===0||o===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function cu(...e){let n=-1,t;for(;++n<e.length;)xt(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":fu(t)}function fu(e){xt(e);const n=e.codePointAt(0)===47;let t=hu(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function hu(e,n){let t="",r=0,i=-1,o=0,l=-1,a,s;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",r=0):(t=t.slice(0,s),r=t.length-1-t.lastIndexOf("/")),i=l,o=0;continue}}else if(t.length>0){t="",r=0,i=l,o=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,l):t=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return t}function xt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const pu={cwd:mu};function mu(){return"/"}function un(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function du(e){if(typeof e=="string")e=new URL(e);else if(!un(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return gu(e)}function gu(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 qt=["history","path","basename","stem","extname","dirname"];class yi{constructor(n){let t;n?un(n)?t={path:n}:typeof n=="string"||xu(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":pu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qt.length;){const o=qt[r];o in t&&t[o]!==void 0&&t[o]!==null&&(this[o]=o==="history"?[...t[o]]:t[o])}let i;for(i in t)qt.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?Se.basename(this.path):void 0}set basename(n){$t(n,"basename"),Ut(n,"basename"),this.path=Se.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?Se.dirname(this.path):void 0}set dirname(n){mr(this.basename,"dirname"),this.path=Se.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?Se.extname(this.path):void 0}set extname(n){if(Ut(n,"extname"),mr(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Se.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){un(n)&&(n=du(n)),$t(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?Se.basename(this.path,this.extname):void 0}set stem(n){$t(n,"stem"),Ut(n,"stem"),this.path=Se.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 le(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 Ut(e,n){if(e&&e.includes(Se.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+Se.sep+"`")}function $t(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function mr(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function xu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yu=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),ku={}.hasOwnProperty;class vn extends yu{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=lu()}copy(){const n=new vn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(Ht(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(Kt("data",this.frozen),this.namespace[n]=t,this):ku.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Kt("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=St(n),r=this.parser||this.Parser;return Vt("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),Vt("process",this.parser||this.Parser),Wt("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(o,l){const a=St(n),s=r.parse(a);r.run(s,a,function(f,c,p){if(f||!c||!p)return u(f);const h=c,g=r.stringify(h,p);Su(g)?p.value=g:p.result=g,u(f,p)});function u(f,c){f||!c?l(f):o?o(c):t(void 0,c)}}}processSync(n){let t=!1,r;return this.freeze(),Vt("processSync",this.parser||this.Parser),Wt("processSync",this.compiler||this.Compiler),this.process(n,i),gr("processSync","process",t),r;function i(o,l){t=!0,hr(o),r=l}}run(n,t,r){dr(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const s=St(t);i.run(n,s,u);function u(f,c,p){const h=c||n;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(n,t){let r=!1,i;return this.run(n,t,o),gr("runSync","run",r),i;function o(l,a){hr(l),i=a,r=!0}}stringify(n,t){this.freeze();const r=St(t),i=this.compiler||this.Compiler;return Wt("stringify",i),dr(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(Kt("use",this.frozen),n!=null)if(typeof n=="function")s(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):l(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;s(f,c)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=Ht(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===u){p=c;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[h,...g]=f;const S=r[p][1];sn(S)&&sn(h)&&(h=Ht(!0,S,h)),r[p]=[u,h,...g]}}}}const bu=new vn().freeze();function Vt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wt(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Kt(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dr(e){if(!sn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function gr(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function St(e){return wu(e)?e:new yi(e)}function wu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Su(e){return typeof e=="string"||Cu(e)}function Cu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Eu="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",xr=[],yr={allowDangerousHtml:!0},Iu=/^(https?|ircs?|mailto|xmpp)$/i,vu=[{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 Au(e){const n=Tu(e),t=Pu(e);return Du(n.runSync(n.parse(t),t),e)}function Tu(e){const n=e.rehypePlugins||xr,t=e.remarkPlugins||xr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...yr}:yr;return bu().use(ss).use(t).use(nu,r).use(n)}function Pu(e){const n=e.children||"",t=new yi;return typeof n=="string"&&(t.value=n),t}function Du(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,o=n.disallowedElements,l=n.skipHtml,a=n.unwrapDisallowed,s=n.urlTransform||Nu;for(const f of vu)Object.hasOwn(n,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Eu+f.id,void 0);return In(e,u),$l(e,{Fragment:k.Fragment,components:i,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function u(f,c,p){if(f.type==="raw"&&p&&typeof c=="number")return l?p.children.splice(c,1):p.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let h;for(h in jt)if(Object.hasOwn(jt,h)&&Object.hasOwn(f.properties,h)){const g=f.properties[h],S=jt[h];(S===null||S.includes(f.tagName))&&(f.properties[h]=s(String(g||""),h,f))}}if(f.type==="element"){let h=t?!t.includes(f.tagName):o?o.includes(f.tagName):!1;if(!h&&r&&typeof c=="number"&&(h=!r(f,c,p)),h&&p&&typeof c=="number")return a&&f.children?p.children.splice(c,1,...f.children):p.children.splice(c,1),c}}}function Nu(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||Iu.test(e.slice(0,n))?e:""}const je=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],kr={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...je,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...je],h2:[["className","sr-only"]],img:[...je,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...je,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...je],table:[...je],ul:[...je,["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 Lu(e,n){let t={type:"root",children:[]};const r={schema:n?{...kr,...n}:kr,stack:[]},i=ki(r,e);return i&&(Array.isArray(i)?i.length===1?t=i[0]:t.children=i:t=i),t}function ki(e,n){if(n&&typeof n=="object"){const t=n;switch(typeof t.type=="string"?t.type:""){case"comment":return zu(e,t);case"doctype":return Fu(e,t);case"element":return Ru(e,t);case"root":return _u(e,t);case"text":return ju(e,t)}}}function zu(e,n){if(e.schema.allowComments){const t=typeof n.value=="string"?n.value:"",r=t.indexOf("-->"),o={type:"comment",value:r<0?t:t.slice(0,r)};return yt(o,n),o}}function Fu(e,n){if(e.schema.allowDoctypes){const t={type:"doctype"};return yt(t,n),t}}function Ru(e,n){const t=typeof n.tagName=="string"?n.tagName:"";e.stack.push(t);const r=bi(e,n.children),i=Ou(e,n.properties);e.stack.pop();let o=!1;if(t&&t!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(t))&&(o=!0,e.schema.ancestors&&Le.call(e.schema.ancestors,t))){const a=e.schema.ancestors[t];let s=-1;for(o=!1;++s<a.length;)e.stack.includes(a[s])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(t)?r:void 0;const l={type:"element",tagName:t,properties:i,children:r};return yt(l,n),l}function _u(e,n){const r={type:"root",children:bi(e,n.children)};return yt(r,n),r}function ju(e,n){const r={type:"text",value:typeof n.value=="string"?n.value:""};return yt(r,n),r}function bi(e,n){const t=[];if(Array.isArray(n)){const r=n;let i=-1;for(;++i<r.length;){const o=ki(e,r[i]);o&&(Array.isArray(o)?t.push(...o):t.push(o))}}return t}function Ou(e,n){const t=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,o=r&&Le.call(r,t)?r[t]:void 0,l=r&&Le.call(r,"*")?r["*"]:void 0,a=n&&typeof n=="object"?n:{},s={};let u;for(u in a)if(Le.call(a,u)){const f=a[u];let c=br(e,wr(o,u),u,f);c==null&&(c=br(e,wr(l,u),u,f)),c!=null&&(s[u]=c)}if(i&&Le.call(i,t)){const f=i[t];for(u in f)Le.call(f,u)&&!Le.call(s,u)&&(s[u]=f[u])}return s}function br(e,n,t,r){return n?Array.isArray(r)?Mu(e,n,t,r):wi(e,n,t,r):void 0}function Mu(e,n,t,r){let i=-1;const o=[];for(;++i<r.length;){const l=wi(e,n,t,r[i]);(typeof l=="number"||typeof l=="string")&&o.push(l)}return o}function wi(e,n,t,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&Bu(e,t,r)){if(typeof n=="object"&&n.length>1){let i=!1,o=0;for(;++o<n.length;){const l=n[o];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(r))){i=!0;break}}else if(l===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 Bu(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),o=i.indexOf(":"),l=i.indexOf("?"),a=i.indexOf("#"),s=i.indexOf("/");if(o<0||s>-1&&o>s||l>-1&&o>l||a>-1&&o>a)return!0;let u=-1;for(;++u<r.length;){const f=r[u];if(o===f.length&&i.slice(0,f.length)===f)return!0}return!1}function yt(e,n){const t=Wr(n);n.data&&(e.data=ht(n.data)),t&&(e.position=t)}function wr(e,n){let t,r=-1;if(e)for(;++r<e.length;){const i=e[r],o=typeof i=="string"?i:i[0];if(o===n)return i;o==="data*"&&(t=i)}if(n.length>4&&n.slice(0,4).toLowerCase()==="data")return t}function Hu(e){return function(n){return Lu(n,e)}}function Sr(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 qu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Uu(e,n,t){const i=Nt((t||{}).ignore||[]),o=$u(n);let l=-1;for(;++l<o.length;)xi(e,"text",a);function a(u,f){let c=-1,p;for(;++c<f.length;){const h=f[c],g=p?p.children:void 0;if(i(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return s(u,f)}function s(u,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let g=0;const C=c.children.indexOf(u);let x=!1,v=[];p.lastIndex=0;let E=p.exec(u.value);for(;E;){const _=E.index,F={index:E.index,input:E.input,stack:[...f,u]};let b=h(...E,F);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?p.lastIndex=_+1:(g!==_&&v.push({type:"text",value:u.value.slice(g,_)}),Array.isArray(b)?v.push(...b):b&&v.push(b),g=_+E[0].length,x=!0),!p.global)break;E=p.exec(u.value)}return x?(g<u.value.length&&v.push({type:"text",value:u.value.slice(g)}),c.children.splice(C,1,...v)):v=[u],C+v.length}}function $u(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([Vu(i[0]),Wu(i[1])])}return n}function Vu(e){return typeof e=="string"?new RegExp(qu(e),"g"):e}function Wu(e){return typeof e=="function"?e:function(){return e}}const Qt="phrasing",Yt=["autolink","link","image","label"];function Ku(){return{transforms:[ec],enter:{literalAutolink:Yu,literalAutolinkEmail:Xt,literalAutolinkHttp:Xt,literalAutolinkWww:Xt},exit:{literalAutolink:Zu,literalAutolinkEmail:Ju,literalAutolinkHttp:Xu,literalAutolinkWww:Gu}}}function Qu(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Qt,notInConstruct:Yt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Qt,notInConstruct:Yt},{character:":",before:"[ps]",after:"\\/",inConstruct:Qt,notInConstruct:Yt}]}}function Yu(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Xt(e){this.config.enter.autolinkProtocol.call(this,e)}function Xu(e){this.config.exit.autolinkProtocol.call(this,e)}function Gu(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 Ju(e){this.config.exit.autolinkEmail.call(this,e)}function Zu(e){this.exit(e)}function ec(e){Uu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,tc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),nc]],{ignore:["link","linkReference"]})}function tc(e,n,t,r,i){let o="";if(!Si(i)||(/^w/i.test(n)&&(t=n+t,n="",o="http://"),!rc(t)))return!1;const l=ic(t+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+n+l[0],children:[{type:"text",value:n+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function nc(e,n,t,r){return!Si(r,!0)||/[-\d_]$/.test(t)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+t,children:[{type:"text",value:n+"@"+t}]}}function rc(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 ic(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=Sr(e,"(");let o=Sr(e,")");for(;r!==-1&&i>o;)e+=t.slice(0,r+1),t=t.slice(r+1),r=t.indexOf(")"),o++;return[e,t]}function Si(e,n){const t=e.input.charCodeAt(e.index-1);return(e.index===0||Me(t)||Tt(t))&&(!n||t!==47)}Ci.peek=pc;function lc(){this.buffer()}function oc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ac(){this.buffer()}function sc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function uc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=we(this.sliceSerialize(e)).toLowerCase(),t.label=n}function cc(e){this.exit(e)}function fc(e){const n=this.resume(),t=this.stack[this.stack.length-1];t.type,t.identifier=we(this.sliceSerialize(e)).toLowerCase(),t.label=n}function hc(e){this.exit(e)}function pc(){return"["}function Ci(e,n,t,r){const i=t.createTracker(r);let o=i.move("[^");const l=t.enter("footnoteReference"),a=t.enter("reference");return o+=i.move(t.safe(t.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function mc(){return{enter:{gfmFootnoteCallString:lc,gfmFootnoteCall:oc,gfmFootnoteDefinitionLabelString:ac,gfmFootnoteDefinition:sc},exit:{gfmFootnoteCallString:uc,gfmFootnoteCall:cc,gfmFootnoteDefinitionLabelString:fc,gfmFootnoteDefinition:hc}}}function dc(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:t,footnoteReference:Ci},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function t(r,i,o,l){const a=o.createTracker(l);let s=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return s+=a.move(o.safe(o.associationId(r),{before:s,after:"]"})),f(),s+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),s+=a.move((n?`
|
|
15
|
+
`:" ")+o.indentLines(o.containerFlow(r,a.current()),n?Ei:gc))),u(),s}}function gc(e,n,t){return n===0?e:Ei(e,n,t)}function Ei(e,n,t){return(t?"":" ")+e}const xc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ii.peek=Sc;function yc(){return{canContainEols:["delete"],enter:{strikethrough:bc},exit:{strikethrough:wc}}}function kc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:xc}],handlers:{delete:Ii}}}function bc(e){this.enter({type:"delete",children:[]},e)}function wc(e){this.exit(e)}function Ii(e,n,t,r){const i=t.createTracker(r),o=t.enter("strikethrough");let l=i.move("~~");return l+=t.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Sc(){return"~"}function Cc(e){return e.length}function Ec(e,n){const t=n||{},r=(t.align||[]).concat(),i=t.stringLength||Cc,o=[],l=[],a=[],s=[];let u=0,f=-1;for(;++f<e.length;){const S=[],C=[];let x=-1;for(e[f].length>u&&(u=e[f].length);++x<e[f].length;){const v=Ic(e[f][x]);if(t.alignDelimiters!==!1){const E=i(v);C[x]=E,(s[x]===void 0||E>s[x])&&(s[x]=E)}S.push(v)}l[f]=S,a[f]=C}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=Cr(r[c]);else{const S=Cr(r);for(;++c<u;)o[c]=S}c=-1;const p=[],h=[];for(;++c<u;){const S=o[c];let C="",x="";S===99?(C=":",x=":"):S===108?C=":":S===114&&(x=":");let v=t.alignDelimiters===!1?1:Math.max(1,s[c]-C.length-x.length);const E=C+"-".repeat(v)+x;t.alignDelimiters!==!1&&(v=C.length+v+x.length,v>s[c]&&(s[c]=v),h[c]=v),p[c]=E}l.splice(1,0,p),a.splice(1,0,h),f=-1;const g=[];for(;++f<l.length;){const S=l[f],C=a[f];c=-1;const x=[];for(;++c<u;){const v=S[c]||"";let E="",_="";if(t.alignDelimiters!==!1){const F=s[c]-(C[c]||0),b=o[c];b===114?E=" ".repeat(F):b===99?F%2?(E=" ".repeat(F/2+.5),_=" ".repeat(F/2-.5)):(E=" ".repeat(F/2),_=E):_=" ".repeat(F)}t.delimiterStart!==!1&&!c&&x.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||c)&&x.push(" "),t.alignDelimiters!==!1&&x.push(E),x.push(v),t.alignDelimiters!==!1&&x.push(_),t.padding!==!1&&x.push(" "),(t.delimiterEnd!==!1||c!==u-1)&&x.push("|")}g.push(t.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
|
|
16
|
+
`)}function Ic(e){return e==null?"":String(e)}function Cr(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 vc(e,n,t,r){const i=t.enter("blockquote"),o=t.createTracker(r);o.move("> "),o.shift(2);const l=t.indentLines(t.containerFlow(e,o.current()),Ac);return i(),l}function Ac(e,n,t){return">"+(t?"":" ")+e}function Tc(e,n){return Er(e,n.inConstruct,!0)&&!Er(e,n.notInConstruct,!1)}function Er(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 Ir(e,n,t,r){let i=-1;for(;++i<t.unsafe.length;)if(t.unsafe[i].character===`
|
|
17
17
|
`&&Tc(t.stack,t.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
18
18
|
`}function Pc(e,n){const t=String(e);let r=t.indexOf(n),i=r,o=0,l=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+n.length,r=t.indexOf(n,i);return l}function Dc(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 Nc(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 Lc(e,n,t,r){const i=Nc(t),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(Dc(e,t)){const c=t.enter("codeIndented"),p=t.indentLines(o,zc);return c(),p}const a=t.createTracker(r),s=i.repeat(Math.max(Pc(o,i)+1,3)),u=t.enter("codeFenced");let f=a.move(s);if(e.lang){const c=t.enter(`codeFencedLang${l}`);f+=a.move(t.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=t.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(t.safe(e.meta,{before:f,after:`
|
|
19
19
|
`,encode:["`"],...a.current()})),c()}return f+=a.move(`
|
|
20
20
|
`),o&&(f+=a.move(o+`
|
|
21
|
-
`)),f+=a.move(s),u(),f}function zc(e,n,t){return(t?"":" ")+e}function
|
|
22
|
-
`,...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),l(),u}function Rc(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
|
|
21
|
+
`)),f+=a.move(s),u(),f}function zc(e,n,t){return(t?"":" ")+e}function An(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function Fc(e,n,t,r){const i=An(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("definition");let a=t.enter("label");const s=t.createTracker(r);let u=s.move("[");return u+=s.move(t.safe(t.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":`
|
|
22
|
+
`,...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),l(),u}function Rc(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 pt(e){return"&#x"+e.toString(16).toUpperCase()+";"}function At(e,n,t){const r=Qe(e),i=Qe(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}}vi.peek=_c;function vi(e,n,t,r){const i=Rc(t),o=t.enter("emphasis"),l=t.createTracker(r),a=l.move(i);let s=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=At(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=pt(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=At(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+pt(c));const h=l.move(i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function _c(e,n,t){return t.options.emphasis||"*"}function jc(e,n){let t=!1;return In(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return t=!0,on}),!!((!e.depth||e.depth<3)&&yn(e)&&(n.options.setext||t))}function Oc(e,n,t,r){const i=Math.max(Math.min(6,e.depth||1),1),o=t.createTracker(r);if(jc(e,t)){const f=t.enter("headingSetext"),c=t.enter("phrasing"),p=t.containerPhrasing(e,{...o.current(),before:`
|
|
23
23
|
`,after:`
|
|
24
24
|
`});return c(),f(),p+`
|
|
25
25
|
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
26
26
|
`))+1))}const l="#".repeat(i),a=t.enter("headingAtx"),s=t.enter("phrasing");o.move(l+" ");let u=t.containerPhrasing(e,{before:"# ",after:`
|
|
27
|
-
`,...o.current()});return/^[\t ]/.test(u)&&(u=
|
|
27
|
+
`,...o.current()});return/^[\t ]/.test(u)&&(u=pt(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,t.options.closeAtx&&(u+=" "+l),s(),a(),u}Ai.peek=Mc;function Ai(e){return e.value||""}function Mc(){return"<"}Ti.peek=Bc;function Ti(e,n,t,r){const i=An(t),o=i==='"'?"Quote":"Apostrophe",l=t.enter("image");let a=t.enter("label");const s=t.createTracker(r);let u=s.move("![");return u+=s.move(t.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=t.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(t.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=t.enter("destinationRaw"),u+=s.move(t.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),a(),e.title&&(a=t.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(t.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),u+=s.move(")"),l(),u}function Bc(){return"!"}Pi.peek=Hc;function Pi(e,n,t,r){const i=e.referenceType,o=t.enter("imageReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("![");const u=t.safe(e.alt,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function Hc(){return"!"}Di.peek=qc;function Di(e,n,t){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<t.unsafe.length;){const l=t.unsafe[o],a=t.compilePattern(l);let s;if(l.atBreak)for(;s=a.exec(r);){let u=s.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(s.index+1)}}return i+r+i}function qc(){return"`"}function Ni(e,n){const t=yn(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(t===e.url||"mailto:"+t===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Li.peek=Uc;function Li(e,n,t,r){const i=An(t),o=i==='"'?"Quote":"Apostrophe",l=t.createTracker(r);let a,s;if(Ni(e,t)){const f=t.stack;t.stack=[],a=t.enter("autolink");let c=l.move("<");return c+=l.move(t.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),t.stack=f,c}a=t.enter("link"),s=t.enter("label");let u=l.move("[");return u+=l.move(t.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=t.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(t.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=t.enter("destinationRaw"),u+=l.move(t.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=t.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(t.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),a(),u}function Uc(e,n,t){return Ni(e,t)?"<":"["}zi.peek=$c;function zi(e,n,t,r){const i=e.referenceType,o=t.enter("linkReference");let l=t.enter("label");const a=t.createTracker(r);let s=a.move("[");const u=t.containerPhrasing(e,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=t.stack;t.stack=[],l=t.enter("reference");const c=t.safe(t.associationId(e),{before:s,after:"]",...a.current()});return l(),t.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function $c(){return"["}function Tn(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 Vc(e){const n=Tn(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 Wc(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 Fi(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function Kc(e,n,t,r){const i=t.enter("list"),o=t.bulletCurrent;let l=e.ordered?Wc(t):Tn(t);const a=e.ordered?l==="."?")":".":Vc(t);let s=n&&t.bulletLastUsed?l===t.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&t.stack[t.stack.length-1]==="list"&&t.stack[t.stack.length-2]==="listItem"&&t.stack[t.stack.length-3]==="list"&&t.stack[t.stack.length-4]==="listItem"&&t.indexStack[t.indexStack.length-1]===0&&t.indexStack[t.indexStack.length-2]===0&&t.indexStack[t.indexStack.length-3]===0&&(s=!0),Fi(t)===l&&f){let c=-1;for(;++c<e.children.length;){const p=e.children[c];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(l=a),t.bulletCurrent=l;const u=t.containerFlow(e,r);return t.bulletLastUsed=l,t.bulletCurrent=o,i(),u}function Qc(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 Yc(e,n,t,r){const i=Qc(t);let o=t.bulletCurrent||Tn(t);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(t.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=t.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const s=t.enter("listItem"),u=t.indentLines(t.containerFlow(e,a.current()),f);return s(),u;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function Xc(e,n,t,r){const i=t.enter("paragraph"),o=t.enter("phrasing"),l=t.containerPhrasing(e,r);return o(),i(),l}const Gc=Nt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Jc(e,n,t,r){return(e.children.some(function(l){return Gc(l)})?t.containerPhrasing:t.containerFlow).call(t,e,r)}function Zc(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}Ri.peek=ef;function Ri(e,n,t,r){const i=Zc(t),o=t.enter("strong"),l=t.createTracker(r),a=l.move(i+i);let s=l.move(t.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=At(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=pt(u)+s.slice(1));const c=s.charCodeAt(s.length-1),p=At(r.after.charCodeAt(0),c,i);p.inside&&(s=s.slice(0,-1)+pt(c));const h=l.move(i+i);return o(),t.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+s+h}function ef(e,n,t){return t.options.strong||"*"}function tf(e,n,t,r){return t.safe(e.value,r)}function nf(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 rf(e,n,t){const r=(Fi(t)+(t.options.ruleSpaces?" ":"")).repeat(nf(t));return t.options.ruleSpaces?r.slice(0,-1):r}const _i={blockquote:vc,break:Ir,code:Lc,definition:Fc,emphasis:vi,hardBreak:Ir,heading:Oc,html:Ai,image:Ti,imageReference:Pi,inlineCode:Di,link:Li,linkReference:zi,list:Kc,listItem:Yc,paragraph:Xc,root:Jc,strong:Ri,text:tf,thematicBreak:rf};function lf(){return{enter:{table:of,tableData:vr,tableHeader:vr,tableRow:sf},exit:{codeText:uf,table:af,tableData:Gt,tableHeader:Gt,tableRow:Gt}}}function of(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 af(e){this.exit(e),this.data.inTable=void 0}function sf(e){this.enter({type:"tableRow",children:[]},e)}function Gt(e){this.exit(e)}function vr(e){this.enter({type:"tableCell",children:[]},e)}function uf(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,cf));const t=this.stack[this.stack.length-1];t.type,t.value=n,this.exit(e)}function cf(e,n){return n==="|"?n:e}function ff(e){const n=e||{},t=n.tableCellPadding,r=n.tablePipeAlign,i=n.stringLength,o=t?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
28
28
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:s,tableRow:a}};function l(h,g,S,C){return u(f(h,S,C),h.align)}function a(h,g,S,C){const x=c(h,S,C),v=u([x]);return v.slice(0,v.indexOf(`
|
|
29
|
-
`))}function s(h,g,S,C){const x=S.enter("tableCell"),v=S.enter("phrasing"),E=S.containerPhrasing(h,{...C,before:o,after:o});return v(),x(),E}function u(h,g){return Ec(h,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function f(h,g,S){const C=h.children;let x=-1;const v=[],E=g.enter("table");for(;++x<C.length;)v[x]=c(C[x],g,S);return E(),v}function c(h,g,S){const C=h.children;let x=-1;const v=[],E=g.enter("tableRow");for(;++x<C.length;)v[x]=s(C[x],h,g,S);return E(),v}function p(h,g,S){let C=Oi.inlineCode(h,g,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function hf(){return{exit:{taskListCheckValueChecked:Pr,taskListCheckValueUnchecked:Pr,paragraph:mf}}}function pf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:df}}}function Pr(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function mf(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function df(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let s=Oi.listItem(e,n,t,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(f){return f+l}}function gf(){return[Ku(),mc(),yc(),lf(),hf()]}function xf(e){return{extensions:[Qu(),dc(e),kc(),ff(e),pf()]}}const yf={tokenize:Ef,partial:!0},Mi={tokenize:If,partial:!0},Bi={tokenize:vf,partial:!0},Hi={tokenize:Af,partial:!0},kf={tokenize:Tf,partial:!0},qi={name:"wwwAutolink",tokenize:Sf,previous:$i},Ui={name:"protocolAutolink",tokenize:Cf,previous:Vi},Pe={name:"emailAutolink",tokenize:wf,previous:Wi},Ee={};function bf(){return{text:Ee}}let Oe=48;for(;Oe<123;)Ee[Oe]=Pe,Oe++,Oe===58?Oe=65:Oe===91&&(Oe=97);Ee[43]=Pe;Ee[45]=Pe;Ee[46]=Pe;Ee[95]=Pe;Ee[72]=[Pe,Ui];Ee[104]=[Pe,Ui];Ee[87]=[Pe,qi];Ee[119]=[Pe,qi];function wf(e,n,t){const r=this;let i,o;return l;function l(c){return!cn(c)||!Wi.call(r,r.previous)||Nn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return cn(c)?(e.consume(c),a):c===64?(e.consume(c),s):t(c)}function s(c){return c===46?e.check(kf,f,u)(c):c===45||c===95||ie(c)?(o=!0,e.consume(c),s):f(c)}function u(c){return e.consume(c),i=!0,s}function f(c){return o&&i&&ae(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function Sf(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!$i.call(r,r.previous)||Nn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(yf,e.attempt(Mi,e.attempt(Bi,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function Cf(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&Vi.call(r,r.previous)&&!Nn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(ae(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),s}return t(c)}function s(c){return c===47?(e.consume(c),o?u:(o=!0,s)):t(c)}function u(c){return c===null||vt(c)||Y(c)||Me(c)||Pt(c)?t(c):e.attempt(Mi,e.attempt(Bi,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Ef(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function If(e,n,t){let r,i,o;return l;function l(u){return u===46||u===95?e.check(Hi,s,a)(u):u===null||Y(u)||Me(u)||u!==45&&Pt(u)?s(u):(o=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function s(u){return i||r||!o?t(u):n(u)}}function vf(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Hi,n,o)(l):l===null||Y(l)||Me(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Af(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Y(a)||Me(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||Y(a)||Me(a)?n(a):r(a)}function o(a){return ae(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):ae(a)?(e.consume(a),l):t(a)}}function Tf(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return ie(o)?t(o):n(o)}}function $i(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Y(e)}function Vi(e){return!ae(e)}function Wi(e){return!(e===47||cn(e))}function cn(e){return e===43||e===45||e===46||e===95||ie(e)}function Nn(e){let n=e.length,t=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){t=!0;break}if(r._gfmAutolinkLiteralWalkedInto){t=!1;break}}return e.length>0&&!t&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),t}const Pf={tokenize:_f,partial:!0};function Df(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ff,continuation:{tokenize:Rf},exit:jf}},text:{91:{name:"gfmFootnoteCall",tokenize:zf},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Nf,resolveTo:Lf}}}}function Nf(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const s=r.events[i][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return a;function a(s){if(!l||!l._balanced)return t(s);const u=we(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?t(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),n(s))}}function Lf(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function zf(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!l||c===null||c===91||Y(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(we(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return Y(c)||(l=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function Ff(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return s;function s(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(g)}function f(g){if(l>999||g===93&&!a||g===null||g===91||Y(g))return t(g);if(g===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=we(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Y(g)||(a=!0),l++,e.consume(g),g===92?c:f}function c(g){return g===91||g===92||g===93?(e.consume(g),l++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),V(e,h,"gfmFootnoteDefinitionWhitespace")):t(g)}function h(g){return n(g)}}function Rf(e,n,t){return e.check(dt,n,e.attempt(Pf,n,t))}function jf(e){e.exit("gfmFootnoteDefinition")}function _f(e,n,t){const r=this;return V(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function Of(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let s=-1;for(;++s<l.length;)if(l[s][0]==="enter"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._close){let u=s;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[s][1].end.offset-l[s][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[s][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[s][1].end)},c={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[s][1].start)},p=[["enter",f,a],["enter",l[u][1],a],["exit",l[u][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&ge(p,p.length,0,Dt(h,l.slice(u+1,s),a)),ge(p,p.length,0,[["exit",c,a],["enter",l[s][1],a],["exit",l[s][1],a],["exit",f,a]]),ge(l,u-1,s-u+3,p),s=u+p.length-2;break}}for(s=-1;++s<l.length;)l[s][1].type==="strikethroughSequenceTemporary"&&(l[s][1].type="data");return l}function o(l,a,s){const u=this.previous,f=this.events;let c=0;return p;function p(g){return u===126&&f[f.length-1][1].type!=="characterEscape"?s(g):(l.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const S=Qe(u);if(g===126)return c>1?s(g):(l.consume(g),c++,h);if(c<2&&!t)return s(g);const C=l.exit("strikethroughSequenceTemporary"),x=Qe(g);return C._open=!x||x===2&&!!S,C._close=!S||S===2&&!!x,a(g)}}}class Mf{constructor(){this.map=[]}add(n,t,r){Bf(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0}}function Bf(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 Hf(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function qf(){return{flow:{null:{name:"table",tokenize:Uf,resolveAll:$f}}}}function Uf(e,n,t){const r=this;let i=0,o=0,l;return a;function a(y){let N=r.events.length-1;for(;N>-1;){const L=r.events[N][1].type;if(L==="lineEnding"||L==="linePrefix")N--;else break}const D=N>-1?r.events[N][1].type:null,K=D==="tableHead"||D==="tableRow"?b:s;return K===b&&r.parser.lazy[r.now().line]?t(y):K(y)}function s(y){return e.enter("tableHead"),e.enter("tableRow"),u(y)}function u(y){return y===124||(l=!0,o+=1),f(y)}function f(y){return y===null?t(y):z(y)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):t(y):q(y)?V(e,f,"whitespace")(y):(o+=1,l&&(l=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(y)))}function c(y){return y===null||y===124||Y(y)?(e.exit("data"),f(y)):(e.consume(y),y===92?p:c)}function p(y){return y===92||y===124?(e.consume(y),c):c(y)}function h(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(y):(e.enter("tableDelimiterRow"),l=!1,q(y)?V(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):g(y))}function g(y){return y===45||y===58?C(y):y===124?(l=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),S):F(y)}function S(y){return q(y)?V(e,C,"whitespace")(y):C(y)}function C(y){return y===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),x):y===45?(o+=1,x(y)):y===null||z(y)?j(y):F(y)}function x(y){return y===45?(e.enter("tableDelimiterFiller"),v(y)):F(y)}function v(y){return y===45?(e.consume(y),v):y===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(y))}function E(y){return q(y)?V(e,j,"whitespace")(y):j(y)}function j(y){return y===124?g(y):y===null||z(y)?!l||i!==o?F(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(y)):F(y)}function F(y){return t(y)}function b(y){return e.enter("tableRow"),_(y)}function _(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),_):y===null||z(y)?(e.exit("tableRow"),n(y)):q(y)?V(e,_,"whitespace")(y):(e.enter("data"),W(y))}function W(y){return y===null||y===124||Y(y)?(e.exit("data"),_(y)):(e.consume(y),y===92?U:W)}function U(y){return y===92||y===124?(e.consume(y),W):W(y)}}function $f(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,f,c;const p=new Mf;for(;++t<e.length;){const h=e[t],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,s!==0&&(Dr(p,n,s,u,f),f=void 0,s=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",u,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",f,n]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=Et(p,n,o,i,void 0,c),o=[0,0,0,0]),l[2]=t)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=Et(p,n,o,i,void 0,c)),o=l,l=[o[1],t,0,0])):g.type==="tableHead"?(a=!0,s=t):g.type==="tableRow"||g.type==="tableDelimiterRow"?(s=t,o[1]!==0?(l[0]=l[1],c=Et(p,n,o,i,t,c)):l[1]!==0&&(c=Et(p,n,l,i,t,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(l[3]=t)}for(s!==0&&Dr(p,n,s,u,f),p.consume(n.events),t=-1;++t<n.events.length;){const h=n.events[t];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Hf(n.events,t))}return e}function Et(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(o.end=Object.assign({},We(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const s=We(n.events,t[1]);if(o={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const u=We(n.events,t[2]),f=We(n.events,t[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const p=n.events[t[2]],h=n.events[t[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const g=t[2]+1,S=t[3]-t[2]-1;e.add(g,S,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(o.end=Object.assign({},We(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function Dr(e,n,t,r,i){const o=[],l=We(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function We(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Vf={name:"tasklistCheck",tokenize:Kf};function Wf(){return{text:{91:Vf}}}function Kf(e,n,t){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return Y(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):t(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(s)}function a(s){return z(s)?n(s):q(s)?e.check({tokenize:Qf},n,t)(s):t(s)}}function Qf(e,n,t){return V(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Yf(e){return ei([bf(),Df(),Of(e),qf(),Wf()])}const Xf={};function Gf(e){const n=this,t=e||Xf,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Yf(t)),o.push(gf()),l.push(xf(t))}const Nr=14e4,Lr=220;function Jf(e){return e.length<=Nr?e:`${e.slice(0,Nr)}
|
|
29
|
+
`))}function s(h,g,S,C){const x=S.enter("tableCell"),v=S.enter("phrasing"),E=S.containerPhrasing(h,{...C,before:o,after:o});return v(),x(),E}function u(h,g){return Ec(h,{align:g,alignDelimiters:r,padding:t,stringLength:i})}function f(h,g,S){const C=h.children;let x=-1;const v=[],E=g.enter("table");for(;++x<C.length;)v[x]=c(C[x],g,S);return E(),v}function c(h,g,S){const C=h.children;let x=-1;const v=[],E=g.enter("tableRow");for(;++x<C.length;)v[x]=s(C[x],h,g,S);return E(),v}function p(h,g,S){let C=_i.inlineCode(h,g,S);return S.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function hf(){return{exit:{taskListCheckValueChecked:Ar,taskListCheckValueUnchecked:Ar,paragraph:mf}}}function pf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:df}}}function Ar(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function mf(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const t=this.stack[this.stack.length-1];t.type;const r=t.children[0];if(r&&r.type==="text"){const i=n.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===t&&(r.value=r.value.slice(1),r.value.length===0?t.children.shift():t.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,t.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function df(e,n,t,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=t.createTracker(r);o&&a.move(l);let s=_i.listItem(e,n,t,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(f){return f+l}}function gf(){return[Ku(),mc(),yc(),lf(),hf()]}function xf(e){return{extensions:[Qu(),dc(e),kc(),ff(e),pf()]}}const yf={tokenize:Ef,partial:!0},ji={tokenize:If,partial:!0},Oi={tokenize:vf,partial:!0},Mi={tokenize:Af,partial:!0},kf={tokenize:Tf,partial:!0},Bi={name:"wwwAutolink",tokenize:Sf,previous:qi},Hi={name:"protocolAutolink",tokenize:Cf,previous:Ui},Te={name:"emailAutolink",tokenize:wf,previous:$i},Ce={};function bf(){return{text:Ce}}let Oe=48;for(;Oe<123;)Ce[Oe]=Te,Oe++,Oe===58?Oe=65:Oe===91&&(Oe=97);Ce[43]=Te;Ce[45]=Te;Ce[46]=Te;Ce[95]=Te;Ce[72]=[Te,Hi];Ce[104]=[Te,Hi];Ce[87]=[Te,Bi];Ce[119]=[Te,Bi];function wf(e,n,t){const r=this;let i,o;return l;function l(c){return!cn(c)||!$i.call(r,r.previous)||Pn(r.events)?t(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return cn(c)?(e.consume(c),a):c===64?(e.consume(c),s):t(c)}function s(c){return c===46?e.check(kf,f,u)(c):c===45||c===95||ie(c)?(o=!0,e.consume(c),s):f(c)}function u(c){return e.consume(c),i=!0,s}function f(c){return o&&i&&ae(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):t(c)}}function Sf(e,n,t){const r=this;return i;function i(l){return l!==87&&l!==119||!qi.call(r,r.previous)||Pn(r.events)?t(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(yf,e.attempt(ji,e.attempt(Oi,o),t),t)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(l)}}function Cf(e,n,t){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&Ui.call(r,r.previous)&&!Pn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):t(c)}function a(c){if(ae(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(c),s}return t(c)}function s(c){return c===47?(e.consume(c),o?u:(o=!0,s)):t(c)}function u(c){return c===null||It(c)||Y(c)||Me(c)||Tt(c)?t(c):e.attempt(ji,e.attempt(Oi,f),t)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Ef(e,n,t){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):t(l)}function o(l){return l===null?t(l):n(l)}}function If(e,n,t){let r,i,o;return l;function l(u){return u===46||u===95?e.check(Mi,s,a)(u):u===null||Y(u)||Me(u)||u!==45&&Tt(u)?s(u):(o=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function s(u){return i||r||!o?t(u):n(u)}}function vf(e,n){let t=0,r=0;return i;function i(l){return l===40?(t++,e.consume(l),i):l===41&&r<t?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Mi,n,o)(l):l===null||Y(l)||Me(l)?n(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function Af(e,n,t){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||Y(a)||Me(a)?n(a):t(a)}function i(a){return a===null||a===40||a===91||Y(a)||Me(a)?n(a):r(a)}function o(a){return ae(a)?l(a):t(a)}function l(a){return a===59?(e.consume(a),r):ae(a)?(e.consume(a),l):t(a)}}function Tf(e,n,t){return r;function r(o){return e.consume(o),i}function i(o){return ie(o)?t(o):n(o)}}function qi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Y(e)}function Ui(e){return!ae(e)}function $i(e){return!(e===47||cn(e))}function cn(e){return e===43||e===45||e===46||e===95||ie(e)}function Pn(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 Pf={tokenize:jf,partial:!0};function Df(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Ff,continuation:{tokenize:Rf},exit:_f}},text:{91:{name:"gfmFootnoteCall",tokenize:zf},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Nf,resolveTo:Lf}}}}function Nf(e,n,t){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const s=r.events[i][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return a;function a(s){if(!l||!l._balanced)return t(s);const u=we(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?t(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),n(s))}}function Lf(e,n){let t=e.length;for(;t--;)if(e[t][1].type==="labelImage"&&e[t][0]==="enter"){e[t][1];break}e[t+1][1].type="data",e[t+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[t+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[t+3][1].end),end:Object.assign({},e[t+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[t+1],e[t+2],["enter",r,n],e[t+3],e[t+4],["enter",i,n],["exit",i,n],["enter",o,n],["enter",l,n],["exit",l,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(t,e.length-t+1,...a),e}function zf(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(c){return c!==94?t(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!l||c===null||c===91||Y(c))return t(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(we(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):t(c)}return Y(c)||(l=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function Ff(e,n,t){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return s;function s(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):t(g)}function f(g){if(l>999||g===93&&!a||g===null||g===91||Y(g))return t(g);if(g===93){e.exit("chunkString");const S=e.exit("gfmFootnoteDefinitionLabelString");return o=we(r.sliceSerialize(S)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Y(g)||(a=!0),l++,e.consume(g),g===92?c:f}function c(g){return g===91||g===92||g===93?(e.consume(g),l++,f):f(g)}function p(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(o)||i.push(o),V(e,h,"gfmFootnoteDefinitionWhitespace")):t(g)}function h(g){return n(g)}}function Rf(e,n,t){return e.check(gt,n,e.attempt(Pf,n,t))}function _f(e){e.exit("gfmFootnoteDefinition")}function jf(e,n,t){const r=this;return V(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?n(o):t(o)}}function Of(e){let t=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return t==null&&(t=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let s=-1;for(;++s<l.length;)if(l[s][0]==="enter"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._close){let u=s;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[s][1].end.offset-l[s][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[s][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[s][1].end)},c={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[s][1].start)},p=[["enter",f,a],["enter",l[u][1],a],["exit",l[u][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&ge(p,p.length,0,Pt(h,l.slice(u+1,s),a)),ge(p,p.length,0,[["exit",c,a],["enter",l[s][1],a],["exit",l[s][1],a],["exit",f,a]]),ge(l,u-1,s-u+3,p),s=u+p.length-2;break}}for(s=-1;++s<l.length;)l[s][1].type==="strikethroughSequenceTemporary"&&(l[s][1].type="data");return l}function o(l,a,s){const u=this.previous,f=this.events;let c=0;return p;function p(g){return u===126&&f[f.length-1][1].type!=="characterEscape"?s(g):(l.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const S=Qe(u);if(g===126)return c>1?s(g):(l.consume(g),c++,h);if(c<2&&!t)return s(g);const C=l.exit("strikethroughSequenceTemporary"),x=Qe(g);return C._open=!x||x===2&&!!S,C._close=!S||S===2&&!!x,a(g)}}}class Mf{constructor(){this.map=[]}add(n,t,r){Bf(this,n,t,r)}consume(n){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let t=this.map.length;const r=[];for(;t>0;)t-=1,r.push(n.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),n.length=this.map[t][0];r.push(n.slice()),n.length=0;let i=r.pop();for(;i;){for(const o of i)n.push(o);i=r.pop()}this.map.length=0}}function Bf(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 Hf(e,n){let t=!1;const r=[];for(;n<e.length;){const i=e[n];if(t){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(t=!0);n+=1}return r}function qf(){return{flow:{null:{name:"table",tokenize:Uf,resolveAll:$f}}}}function Uf(e,n,t){const r=this;let i=0,o=0,l;return a;function a(y){let N=r.events.length-1;for(;N>-1;){const L=r.events[N][1].type;if(L==="lineEnding"||L==="linePrefix")N--;else break}const D=N>-1?r.events[N][1].type:null,K=D==="tableHead"||D==="tableRow"?b:s;return K===b&&r.parser.lazy[r.now().line]?t(y):K(y)}function s(y){return e.enter("tableHead"),e.enter("tableRow"),u(y)}function u(y){return y===124||(l=!0,o+=1),f(y)}function f(y){return y===null?t(y):z(y)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):t(y):q(y)?V(e,f,"whitespace")(y):(o+=1,l&&(l=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(y)))}function c(y){return y===null||y===124||Y(y)?(e.exit("data"),f(y)):(e.consume(y),y===92?p:c)}function p(y){return y===92||y===124?(e.consume(y),c):c(y)}function h(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?t(y):(e.enter("tableDelimiterRow"),l=!1,q(y)?V(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):g(y))}function g(y){return y===45||y===58?C(y):y===124?(l=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),S):F(y)}function S(y){return q(y)?V(e,C,"whitespace")(y):C(y)}function C(y){return y===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),x):y===45?(o+=1,x(y)):y===null||z(y)?_(y):F(y)}function x(y){return y===45?(e.enter("tableDelimiterFiller"),v(y)):F(y)}function v(y){return y===45?(e.consume(y),v):y===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(y))}function E(y){return q(y)?V(e,_,"whitespace")(y):_(y)}function _(y){return y===124?g(y):y===null||z(y)?!l||i!==o?F(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(y)):F(y)}function F(y){return t(y)}function b(y){return e.enter("tableRow"),j(y)}function j(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),j):y===null||z(y)?(e.exit("tableRow"),n(y)):q(y)?V(e,j,"whitespace")(y):(e.enter("data"),W(y))}function W(y){return y===null||y===124||Y(y)?(e.exit("data"),j(y)):(e.consume(y),y===92?$:W)}function $(y){return y===92||y===124?(e.consume(y),W):W(y)}}function $f(e,n){let t=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,f,c;const p=new Mf;for(;++t<e.length;){const h=e[t],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,s!==0&&(Tr(p,n,s,u,f),f=void 0,s=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",u,n]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,t+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(t,0,[["enter",f,n]])),i=g.type==="tableDelimiterRow"?2:f?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=Ct(p,n,o,i,void 0,c),o=[0,0,0,0]),l[2]=t)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=Ct(p,n,o,i,void 0,c)),o=l,l=[o[1],t,0,0])):g.type==="tableHead"?(a=!0,s=t):g.type==="tableRow"||g.type==="tableDelimiterRow"?(s=t,o[1]!==0?(l[0]=l[1],c=Ct(p,n,o,i,t,c)):l[1]!==0&&(c=Ct(p,n,l,i,t,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(l[3]=t)}for(s!==0&&Tr(p,n,s,u,f),p.consume(n.events),t=-1;++t<n.events.length;){const h=n.events[t];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=Hf(n.events,t))}return e}function Ct(e,n,t,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";t[0]!==0&&(o.end=Object.assign({},We(n.events,t[0])),e.add(t[0],0,[["exit",o,n]]));const s=We(n.events,t[1]);if(o={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(t[1],0,[["enter",o,n]]),t[2]!==0){const u=We(n.events,t[2]),f=We(n.events,t[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(t[2],0,[["enter",c,n]]),r!==2){const p=n.events[t[2]],h=n.events[t[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",t[3]>t[2]+1){const g=t[2]+1,S=t[3]-t[2]-1;e.add(g,S,[])}}e.add(t[3]+1,0,[["exit",c,n]])}return i!==void 0&&(o.end=Object.assign({},We(n.events,i)),e.add(i,0,[["exit",o,n]]),o=void 0),o}function Tr(e,n,t,r,i){const o=[],l=We(n.events,t);i&&(i.end=Object.assign({},l),o.push(["exit",i,n])),r.end=Object.assign({},l),o.push(["exit",r,n]),e.add(t+1,0,o)}function We(e,n){const t=e[n],r=t[0]==="enter"?"start":"end";return t[1][r]}const Vf={name:"tasklistCheck",tokenize:Kf};function Wf(){return{text:{91:Vf}}}function Kf(e,n,t){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?t(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return Y(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):t(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):t(s)}function a(s){return z(s)?n(s):q(s)?e.check({tokenize:Qf},n,t)(s):t(s)}}function Qf(e,n,t){return V(e,r,"whitespace");function r(i){return i===null?t(i):n(i)}}function Yf(e){return Jr([bf(),Df(),Of(e),qf(),Wf()])}const Xf={};function Gf(e){const n=this,t=e||Xf,r=n.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Yf(t)),o.push(gf()),l.push(xf(t))}const Pr=14e4,Dr=220;function Jf(e){return e.length<=Pr?e:`${e.slice(0,Pr)}
|
|
30
30
|
|
|
31
|
-
…`}function Zf(e){return e==="user"?M("chatRoleUser"):e==="assistant"?M("chatRoleAssistant"):e==="tool"?M("chatRoleTool"):e==="system"?M("chatRoleSystem"):M("chatRoleMessage")}function eh(e){const n=e.toLowerCase();return n.includes("exec")||n.includes("shell")||n.includes("command")?k.jsx(Xi,{className:"h-3.5 w-3.5"}):n.includes("search")?k.jsx(
|
|
32
|
-
`),i=r?`${t.slice(0,Lr)}…`:t,o=e.kind==="result"||e.hasResult;return k.jsxs("div",{className:"rounded-xl border border-amber-200/80 bg-amber-50/60 px-3 py-2.5",children:[k.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-800 font-semibold",children:[eh(e.name),k.jsx("span",{children:n}),k.jsx("span",{className:"font-mono text-[11px] text-amber-900/80",children:e.name})]}),e.detail&&k.jsx("div",{className:"mt-1 text-[11px] text-amber-800/90 font-mono break-words",children:e.detail}),o&&k.jsx("div",{className:"mt-2",children:t?r?k.jsxs("details",{className:"group",children:[k.jsx("summary",{className:"cursor-pointer text-[11px] text-amber-700",children:M("chatToolOutput")}),k.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})]}):k.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}):k.jsx("div",{className:"text-[11px] text-amber-700/80",children:M("chatToolNoOutput")})})]})}function hn({reasoning:e,isUser:n}){return k.jsxs("details",{className:"mt-3",children:[k.jsx("summary",{className:de("cursor-pointer text-xs",n?"text-primary-100":"text-gray-500"),children:M("chatReasoning")}),k.jsx("pre",{className:de("mt-2 text-[11px] whitespace-pre-wrap break-words rounded-lg p-2",n?"bg-primary-700/60":"bg-gray-100"),children:e})]})}function th({message:e}){const n=pl(e),t=ml(e.content).trim(),r=typeof e.reasoning_content=="string"?e.reasoning_content.trim():"",i=dl(e),o=n==="user",l=!!t&&!(n==="tool"&&i.length>0);return k.jsxs("div",{className:de("rounded-2xl border px-4 py-3 shadow-sm",o?"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:[l&&k.jsx(fn,{text:t,role:n}),r&&k.jsx(hn,{reasoning:r,isUser:o}),i.length>0&&k.jsx("div",{className:de("space-y-2",(l||r)&&"mt-3"),children:i.map((a,s)=>k.jsx(Ki,{card:a},`${a.kind}-${a.name}-${a.callId??s}`))})]})}function nh({item:e}){return k.jsxs("div",{className:"rounded-2xl border px-4 py-3 shadow-sm bg-white text-gray-900 border-gray-200",children:[e.primaryText&&k.jsx(fn,{text:e.primaryText,role:"assistant"}),e.primaryReasoning&&k.jsx(hn,{reasoning:e.primaryReasoning,isUser:!1}),e.toolCards.length>0&&k.jsx("div",{className:de("space-y-2",(e.primaryText||e.primaryReasoning)&&"mt-3"),children:e.toolCards.map((n,t)=>k.jsx(Ki,{card:n},`${n.kind}-${n.name}-${n.callId??t}`))}),e.followupReasoning&&k.jsx(hn,{reasoning:e.followupReasoning,isUser:!1}),e.followupText&&k.jsx("div",{className:"mt-3",children:k.jsx(fn,{text:e.followupText,role:"assistant"})})]})}function rh({events:e,isSending:n,className:t}){const r=$.useMemo(()=>hl(e),[e]);return k.jsxs("div",{className:de("space-y-5",t),children:[r.map(i=>{const o=i.kind==="assistant_flow"?"assistant":i.role,l=o==="user";return k.jsxs("div",{className:de("flex gap-3",l?"justify-end":"justify-start"),children:[!l&&k.jsx(Jt,{role:o}),k.jsxs("div",{className:de("max-w-[88%] min-w-[280px] space-y-2",l&&"flex flex-col items-end"),children:[i.kind==="assistant_flow"?k.jsx(nh,{item:i}):k.jsx(th,{message:i.message}),k.jsxs("div",{className:de("text-[11px] px-1",l?"text-primary-300":"text-gray-400"),children:[Zf(o)," · ",Or(i.timestamp)]})]}),l&&k.jsx(Jt,{role:o})]},i.key)}),n&&k.jsxs("div",{className:"flex gap-3 justify-start",children:[k.jsx(Jt,{role:"assistant"}),k.jsx("div",{className:"rounded-2xl border border-gray-200 bg-white px-4 py-3 text-sm text-gray-500 shadow-sm",children:M("chatTyping")})]})]})}const pn="nextclaw.ui.chat.activeSession",pt="__unknown_channel__";function ih(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(pn);return e&&e.trim().length>0?e:null}catch{return null}}function lh(e){if(!(typeof window>"u"))try{if(!e){window.localStorage.removeItem(pn);return}window.localStorage.setItem(pn,e)}catch{}}function oh(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 zr(e){const n=Math.random().toString(36).slice(2,8);return`agent:${e}:ui:direct:web-${Date.now().toString(36)}${n}`}function ah(e){if(e.label&&e.label.trim())return e.label.trim();const n=e.key.split(":");return n[n.length-1]||e.key}function Fr(e){const n=e.indexOf(":");return n<=0?pt:e.slice(0,n).trim()||pt}function sh(e){return e===pt?M("sessionsUnknownChannel"):e}function dh(){var kt,Je;const[e,n]=$.useState(""),[t,r]=$.useState("all"),[i,o]=$.useState(""),[l,a]=$.useState(()=>ih()),[s,u]=$.useState("main"),[f,c]=$.useState(null),[p,h]=$.useState([]),[g,S]=$.useState(""),[C,x]=$.useState(null),[v,E]=$.useState(!1),[j,F]=$.useState(!1),[b,_]=$.useState([]),{confirm:W,ConfirmDialog:U}=ul(),y=$.useRef(null),N=$.useRef(!1),D=$.useRef(0),K=$.useRef(0),L=$.useRef(l),T=rl(),B=il({q:e.trim()||void 0,limit:120,activeMinutes:0}),X=ll(l,300),se=ol(),ye=$.useMemo(()=>{var ne;const P=((ne=T.data)==null?void 0:ne.agents.list)??[],J=new Set(["main"]);for(const re of P)typeof re.id=="string"&&re.id.trim().length>0&&J.add(re.id.trim().toLowerCase());return Array.from(J)},[(kt=T.data)==null?void 0:kt.agents.list]),m=$.useMemo(()=>{var P;return((P=B.data)==null?void 0:P.sessions)??[]},[(Je=B.data)==null?void 0:Je.sessions]),fe=$.useMemo(()=>{const P=new Set;for(const J of m)P.add(Fr(J.key));return Array.from(P).sort((J,ne)=>J===pt?1:ne===pt?-1:J.localeCompare(ne))},[m]),oe=$.useMemo(()=>t==="all"?m:m.filter(P=>Fr(P.key)===t),[t,m]),d=$.useMemo(()=>m.find(P=>P.key===l)??null,[l,m]),Z=X.data,Ie=(Z==null?void 0:Z.messages)??[],ee=Z!=null&&Z.events&&Z.events.length>0?Z.events:gl(Ie),Se=$.useMemo(()=>{const P=[...ee];if(f&&P.push(f),P.push(...p),g.trim()){const J=P.reduce((ne,re)=>{const Fe=Number.isFinite(re.seq)?re.seq:0;return Fe>ne?Fe:ne},0);P.push({seq:J+1,type:"stream.assistant_delta",timestamp:C??new Date().toISOString(),message:{role:"assistant",content:g,timestamp:C??new Date().toISOString()}})}return P},[ee,f,g,C,p]);$.useEffect(()=>{!l&&oe.length>0&&a(oe[0].key)},[oe,l]),$.useEffect(()=>{lh(l)},[l]),$.useEffect(()=>{const P=l?oh(l):null;P&&s!==P&&u(P)},[s,l]),$.useEffect(()=>{L.current=l,N.current=!1},[l]);const ke=$.useCallback(()=>{const P=y.current;return P?P.scrollHeight-P.scrollTop-P.clientHeight<50:!0},[]),De=$.useCallback(()=>{ke()?N.current=!1:N.current=!0},[ke]);$.useEffect(()=>{const P=y.current;P&&(N.current||(P.scrollTop=P.scrollHeight))},[Se,v]),$.useEffect(()=>()=>{D.current+=1},[]);const ve=()=>{D.current+=1,E(!1),_([]),c(null),h([]),S(""),x(null),F(!1);const P=zr(s);a(P)},He=async()=>{!l||!await W({title:M("chatDeleteSessionConfirm"),variant:"destructive",confirmLabel:M("delete")})||se.mutate({key:l},{onSuccess:async()=>{D.current+=1,E(!1),_([]),c(null),h([]),S(""),x(null),F(!1),a(null),await B.refetch()}})},Ge=$.useCallback(async(P,J)=>{D.current+=1;const ne=D.current;h([]),S(""),x(null),c({seq:0,type:"message.user.optimistic",timestamp:new Date().toISOString(),message:{role:"user",content:P.message,timestamp:new Date().toISOString()}}),E(!0),F(!0);try{let re="";const Fe=new Date().toISOString();x(Fe);const Ze=await al({message:P.message,sessionKey:P.sessionKey,agentId:P.agentId,channel:"ui",chatId:"web-ui"},{onReady:he=>{ne===D.current&&he.sessionKey&&a(Re=>Re===he.sessionKey?Re:he.sessionKey)},onDelta:he=>{ne===D.current&&(re+=he.delta,S(re),F(!1))},onSessionEvent:he=>{var Re,bt;ne===D.current&&(((Re=he.data.message)==null?void 0:Re.role)==="user"&&c(null),h(w=>{const A=[...w],R=A.findIndex(H=>H.seq===he.data.seq);return R>=0?A[R]=he.data:A.push(he.data),A}),((bt=he.data.message)==null?void 0:bt.role)==="assistant"&&(S(""),F(!1)))}});if(ne!==D.current)return;c(null),Ze.sessionKey!==P.sessionKey&&a(Ze.sessionKey),await B.refetch();const et=L.current;(!et||et===P.sessionKey||et===Ze.sessionKey)&&await X.refetch(),h([]),S(""),x(null),F(!1),E(!1)}catch{if(ne!==D.current)return;D.current+=1,E(!1),c(null),h([]),S(""),x(null),F(!1),J!=null&&J.restoreDraftOnError&&o(re=>re.trim().length===0?P.message:re)}},[X,B]);$.useEffect(()=>{if(v||b.length===0)return;const[P,...J]=b;_(J),Ge(P,{restoreDraftOnError:!0})},[v,b,Ge]);const yt=async()=>{const P=i.trim();if(!P)return;const J=l??zr(s);l||a(J),o(""),K.current+=1;const ne={id:K.current,message:P,sessionKey:J,agentId:s};if(v){_(re=>[...re,ne]);return}await Ge(ne,{restoreDraftOnError:!0})};return k.jsxs(cl,{fullHeight:!0,children:[k.jsx(fl,{title:M("chatPageTitle"),description:M("chatPageDescription"),actions:k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsxs(Ue,{variant:"outline",size:"sm",onClick:()=>X.refetch(),className:"rounded-lg",children:[k.jsx(Ln,{className:de("h-3.5 w-3.5 mr-1.5",X.isFetching&&"animate-spin")}),M("chatRefresh")]}),k.jsxs(Ue,{variant:"primary",size:"sm",onClick:ve,className:"rounded-lg",children:[k.jsx(zn,{className:"h-3.5 w-3.5 mr-1.5"}),M("chatNewSession")]})]})}),k.jsxs("div",{className:"flex-1 min-h-0 flex gap-4 max-lg:flex-col",children:[k.jsxs("aside",{className:"w-[320px] max-lg:w-full shrink-0 rounded-2xl border border-gray-200 bg-white shadow-card flex flex-col min-h-0",children:[k.jsxs("div",{className:"p-4 border-b border-gray-100 space-y-3",children:[k.jsxs("div",{className:"relative",children:[k.jsx(_r,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),k.jsx(sl,{value:e,onChange:P=>n(P.target.value),placeholder:M("chatSearchSessionPlaceholder"),className:"pl-8 h-9 rounded-lg text-xs"})]}),k.jsxs(Rn,{value:t,onValueChange:r,children:[k.jsx(jn,{className:"h-9 rounded-lg text-xs",children:k.jsx(_n,{placeholder:M("sessionsAllChannels")})}),k.jsxs(On,{children:[k.jsx(Ft,{value:"all",children:M("sessionsAllChannels")}),fe.map(P=>k.jsx(Ft,{value:P,children:sh(P)},P))]})]}),k.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[k.jsxs(Ue,{variant:"outline",size:"sm",className:"rounded-lg",onClick:()=>B.refetch(),children:[k.jsx(Ln,{className:de("h-3.5 w-3.5 mr-1.5",B.isFetching&&"animate-spin")}),M("chatRefresh")]}),k.jsxs(Ue,{variant:"subtle",size:"sm",className:"rounded-lg",onClick:ve,children:[k.jsx(zn,{className:"h-3.5 w-3.5 mr-1.5"}),M("chatNewSession")]})]})]}),k.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar p-2",children:B.isLoading?k.jsx("div",{className:"text-sm text-gray-500 p-4",children:M("sessionsLoading")}):oe.length===0?k.jsxs("div",{className:"p-5 m-2 rounded-xl border border-dashed border-gray-200 text-center text-sm text-gray-500",children:[k.jsx(Fn,{className:"h-7 w-7 mx-auto mb-2 text-gray-300"}),M("sessionsEmpty")]}):k.jsx("div",{className:"space-y-1",children:oe.map(P=>{const J=l===P.key;return k.jsxs("button",{onClick:()=>a(P.key),className:de("w-full rounded-xl border px-3 py-2.5 text-left transition-all",J?"border-primary/30 bg-primary/5":"border-transparent hover:border-gray-200 hover:bg-gray-50"),children:[k.jsx("div",{className:"text-sm font-semibold text-gray-900 truncate",children:ah(P)}),k.jsx("div",{className:"mt-1 text-[11px] text-gray-500 truncate",children:P.key}),k.jsxs("div",{className:"mt-1 text-[11px] text-gray-400",children:[P.messageCount," · ",Or(P.updatedAt)]})]},P.key)})})})]}),k.jsxs("section",{className:"flex-1 min-h-0 rounded-2xl border border-gray-200 bg-gradient-to-b from-gray-50/60 to-white shadow-card flex flex-col overflow-hidden",children:[k.jsx("div",{className:"px-5 py-4 border-b border-gray-200/80 bg-white/80 backdrop-blur-sm",children:k.jsxs("div",{className:"grid gap-3 lg:grid-cols-[minmax(220px,300px)_minmax(0,1fr)_auto] items-end",children:[k.jsxs("div",{className:"min-w-0",children:[k.jsx("div",{className:"text-[11px] text-gray-500 mb-1",children:M("chatAgentLabel")}),k.jsxs(Rn,{value:s,onValueChange:u,children:[k.jsx(jn,{className:"h-9 rounded-lg",children:k.jsx(_n,{placeholder:M("chatSelectAgent")})}),k.jsx(On,{children:ye.map(P=>k.jsx(Ft,{value:P,children:P},P))})]})]}),k.jsxs("div",{className:"min-w-0",children:[k.jsx("div",{className:"text-[11px] text-gray-500 mb-1",children:M("chatSessionLabel")}),k.jsx("div",{className:"h-9 rounded-lg border border-gray-200 bg-white px-3 text-xs text-gray-600 flex items-center truncate",children:l??M("chatNoSession")})]}),k.jsxs(Ue,{variant:"outline",className:"rounded-lg",onClick:He,disabled:!d||se.isPending,children:[k.jsx(tl,{className:"h-3.5 w-3.5 mr-1.5"}),M("chatDeleteSession")]})]})}),k.jsx("div",{ref:y,onScroll:De,className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar px-5 py-5",children:l?X.isLoading&&Se.length===0&&!v&&!j&&!g.trim()?k.jsx("div",{className:"text-sm text-gray-500",children:M("chatHistoryLoading")}):k.jsx(k.Fragment,{children:Se.length===0?k.jsx("div",{className:"text-sm text-gray-500",children:M("chatNoMessages")}):k.jsx(rh,{events:Se,isSending:v&&j})}):k.jsx("div",{className:"h-full flex items-center justify-center",children:k.jsxs("div",{className:"text-center text-gray-500",children:[k.jsx(Fn,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),k.jsx("div",{className:"text-sm font-medium",children:M("chatNoSession")}),k.jsx("div",{className:"text-xs mt-1",children:M("chatNoSessionHint")})]})})}),k.jsx("div",{className:"border-t border-gray-200 bg-white p-4",children:k.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-2",children:[k.jsx("textarea",{value:i,onChange:P=>o(P.target.value),onKeyDown:P=>{P.key==="Enter"&&!P.shiftKey&&(P.preventDefault(),yt())},placeholder:M("chatInputPlaceholder"),className:"w-full min-h-[68px] max-h-[220px] resize-y bg-transparent outline-none text-sm px-2 py-1.5 text-gray-800 placeholder:text-gray-400"}),k.jsxs("div",{className:"flex items-center justify-between px-2 pb-1",children:[k.jsx("div",{className:"text-[11px] text-gray-400",children:v&&b.length>0?`${M("chatQueuedHintPrefix")} ${b.length} ${M("chatQueuedHintSuffix")}`:M("chatInputHint")}),k.jsxs(Ue,{size:"sm",className:"rounded-lg",onClick:()=>void yt(),disabled:i.trim().length===0,children:[k.jsx(nl,{className:"h-3.5 w-3.5 mr-1.5"}),v?M("chatQueueSend"):M("chatSend")]})]})]})})]})]}),k.jsx(U,{})]})}export{dh as ChatPage};
|
|
31
|
+
…`}function Zf(e){return e==="user"?M("chatRoleUser"):e==="assistant"?M("chatRoleAssistant"):e==="tool"?M("chatRoleTool"):e==="system"?M("chatRoleSystem"):M("chatRoleMessage")}function eh(e){const n=e.toLowerCase();return n.includes("exec")||n.includes("shell")||n.includes("command")?k.jsx(Xi,{className:"h-3.5 w-3.5"}):n.includes("search")?k.jsx(Rr,{className:"h-3.5 w-3.5"}):n.includes("fetch")||n.includes("http")||n.includes("web")?k.jsx(Gi,{className:"h-3.5 w-3.5"}):n.includes("read")||n.includes("file")?k.jsx(Ji,{className:"h-3.5 w-3.5"}):n.includes("message")||n.includes("send")?k.jsx(Zi,{className:"h-3.5 w-3.5"}):n.includes("cron")||n.includes("schedule")?k.jsx(el,{className:"h-3.5 w-3.5"}):k.jsx(Fr,{className:"h-3.5 w-3.5"})}function Jt({role:e}){return e==="user"?k.jsx("div",{className:"h-8 w-8 rounded-full bg-primary text-white flex items-center justify-center shadow-sm",children:k.jsx(Qi,{className:"h-4 w-4"})}):e==="assistant"?k.jsx("div",{className:"h-8 w-8 rounded-full bg-slate-900 text-white flex items-center justify-center shadow-sm",children:k.jsx(Yi,{className:"h-4 w-4"})}):k.jsx("div",{className:"h-8 w-8 rounded-full bg-amber-100 text-amber-700 flex items-center justify-center shadow-sm",children:k.jsx(Fr,{className:"h-4 w-4"})})}function Vi({text:e,role:n}){const t=n==="user";return k.jsx("div",{className:ye("chat-markdown",t?"chat-markdown-user":"chat-markdown-assistant"),children:k.jsx(Au,{remarkPlugins:[Gf],rehypePlugins:[Hu],components:{a:({...r})=>k.jsx("a",{...r,target:"_blank",rel:"noreferrer noopener"})},children:Jf(e)})})}function Wi({card:e}){var l;const n=e.kind==="call"?M("chatToolCall"):M("chatToolResult"),t=((l=e.text)==null?void 0:l.trim())??"",r=t.length>Dr||t.includes(`
|
|
32
|
+
`),i=r?`${t.slice(0,Dr)}…`:t,o=e.kind==="result"||e.hasResult;return k.jsxs("div",{className:"rounded-xl border border-amber-200/80 bg-amber-50/60 px-3 py-2.5",children:[k.jsxs("div",{className:"flex items-center gap-2 text-xs text-amber-800 font-semibold",children:[eh(e.name),k.jsx("span",{children:n}),k.jsx("span",{className:"font-mono text-[11px] text-amber-900/80",children:e.name})]}),e.detail&&k.jsx("div",{className:"mt-1 text-[11px] text-amber-800/90 font-mono break-words",children:e.detail}),o&&k.jsx("div",{className:"mt-2",children:t?r?k.jsxs("details",{className:"group",children:[k.jsx("summary",{className:"cursor-pointer text-[11px] text-amber-700",children:M("chatToolOutput")}),k.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})]}):k.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}):k.jsx("div",{className:"text-[11px] text-amber-700/80",children:M("chatToolNoOutput")})})]})}function Ki({reasoning:e,isUser:n}){return k.jsxs("details",{className:"mt-3",children:[k.jsx("summary",{className:ye("cursor-pointer text-xs",n?"text-primary-100":"text-gray-500"),children:M("chatReasoning")}),k.jsx("pre",{className:ye("mt-2 text-[11px] whitespace-pre-wrap break-words rounded-lg p-2",n?"bg-primary-700/60":"bg-gray-100"),children:e})]})}function th({message:e}){const n=pl(e),t=ml(e.content).trim(),r=typeof e.reasoning_content=="string"?e.reasoning_content.trim():"",i=dl(e),o=n==="user",l=!!t&&!(n==="tool"&&i.length>0);return k.jsxs("div",{className:ye("rounded-2xl border px-4 py-3 shadow-sm",o?"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:[l&&k.jsx(Vi,{text:t,role:n}),r&&k.jsx(Ki,{reasoning:r,isUser:o}),i.length>0&&k.jsx("div",{className:ye("space-y-2",(l||r)&&"mt-3"),children:i.map((a,s)=>k.jsx(Wi,{card:a},`${a.kind}-${a.name}-${a.callId??s}`))})]})}function nh({item:e}){return k.jsx("div",{className:"rounded-2xl border px-4 py-3 shadow-sm bg-white text-gray-900 border-gray-200",children:k.jsx("div",{className:"space-y-3",children:e.segments.map((n,t)=>{if(n.kind==="assistant_message"){const r=!!n.text,i=!!n.reasoning;return!r&&!i?null:k.jsxs("div",{children:[r&&k.jsx(Vi,{text:n.text,role:"assistant"}),i&&k.jsx(Ki,{reasoning:n.reasoning,isUser:!1})]},`${n.key}-${t}`)}return k.jsx(Wi,{card:n.card},`${n.key}-${t}`)})})})}function rh({events:e,isSending:n,className:t}){const r=U.useMemo(()=>hl(e),[e]);return k.jsxs("div",{className:ye("space-y-5",t),children:[r.map(i=>{const o=i.kind==="assistant_turn"?"assistant":i.role,l=o==="user";return k.jsxs("div",{className:ye("flex gap-3",l?"justify-end":"justify-start"),children:[!l&&k.jsx(Jt,{role:o}),k.jsxs("div",{className:ye("max-w-[88%] min-w-[280px] space-y-2",l&&"flex flex-col items-end"),children:[i.kind==="assistant_turn"?k.jsx(nh,{item:i}):k.jsx(th,{message:i.message}),k.jsxs("div",{className:ye("text-[11px] px-1",l?"text-primary-300":"text-gray-400"),children:[Zf(o)," · ",_r(i.timestamp)]})]}),l&&k.jsx(Jt,{role:o})]},i.key)}),n&&k.jsxs("div",{className:"flex gap-3 justify-start",children:[k.jsx(Jt,{role:"assistant"}),k.jsx("div",{className:"rounded-2xl border border-gray-200 bg-white px-4 py-3 text-sm text-gray-500 shadow-sm",children:M("chatTyping")})]})]})}const fn="nextclaw.ui.chat.activeSession",mt="__unknown_channel__";function ih(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(fn);return e&&e.trim().length>0?e:null}catch{return null}}function lh(e){if(!(typeof window>"u"))try{if(!e){window.localStorage.removeItem(fn);return}window.localStorage.setItem(fn,e)}catch{}}function oh(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 Nr(e){const n=Math.random().toString(36).slice(2,8);return`agent:${e}:ui:direct:web-${Date.now().toString(36)}${n}`}function ah(e){if(e.label&&e.label.trim())return e.label.trim();const n=e.key.split(":");return n[n.length-1]||e.key}function Lr(e){const n=e.indexOf(":");return n<=0?mt:e.slice(0,n).trim()||mt}function sh(e){return e===mt?M("sessionsUnknownChannel"):e}function dh(){var Je,Ze;const[e,n]=U.useState(""),[t,r]=U.useState("all"),[i,o]=U.useState(""),[l,a]=U.useState(()=>ih()),[s,u]=U.useState("main"),[f,c]=U.useState(null),[p,h]=U.useState([]),[g,S]=U.useState(""),[C,x]=U.useState(null),[v,E]=U.useState(!1),[_,F]=U.useState(!1),[b,j]=U.useState([]),{confirm:W,ConfirmDialog:$}=ul(),y=U.useRef(null),N=U.useRef(!1),D=U.useRef(0),K=U.useRef(0),L=U.useRef(l),P=rl(),H=il({q:e.trim()||void 0,limit:120,activeMinutes:0}),X=ll(l,300),se=ol(),ke=U.useMemo(()=>{var te;const T=((te=P.data)==null?void 0:te.agents.list)??[],G=new Set(["main"]);for(const re of T)typeof re.id=="string"&&re.id.trim().length>0&&G.add(re.id.trim().toLowerCase());return Array.from(G)},[(Je=P.data)==null?void 0:Je.agents.list]),m=U.useMemo(()=>{var T;return((T=H.data)==null?void 0:T.sessions)??[]},[(Ze=H.data)==null?void 0:Ze.sessions]),fe=U.useMemo(()=>{const T=new Set;for(const G of m)T.add(Lr(G.key));return Array.from(T).sort((G,te)=>G===mt?1:te===mt?-1:G.localeCompare(te))},[m]),oe=U.useMemo(()=>t==="all"?m:m.filter(T=>Lr(T.key)===t),[t,m]),d=U.useMemo(()=>m.find(T=>T.key===l)??null,[l,m]),ee=X.data,Ee=(ee==null?void 0:ee.messages)??[],Z=ee!=null&&ee.events&&ee.events.length>0?ee.events:gl(Ee),Pe=U.useMemo(()=>Z.reduce((T,G)=>Number.isFinite(G.seq)?Math.max(T,G.seq):T,0)+1,[Z]),he=U.useMemo(()=>{const T=[...Z];if(f&&T.push(f),T.push(...p),g.trim()){const G=T.reduce((te,re)=>{const He=Number.isFinite(re.seq)?re.seq:0;return He>te?He:te},0);T.push({seq:G+1,type:"stream.assistant_delta",timestamp:C??new Date().toISOString(),message:{role:"assistant",content:g,timestamp:C??new Date().toISOString()}})}return T},[Z,f,g,C,p]);U.useEffect(()=>{!l&&oe.length>0&&a(oe[0].key)},[oe,l]),U.useEffect(()=>{lh(l)},[l]),U.useEffect(()=>{const T=l?oh(l):null;T&&s!==T&&u(T)},[s,l]),U.useEffect(()=>{L.current=l,N.current=!1},[l]);const Ie=U.useCallback(()=>{const T=y.current;return T?T.scrollHeight-T.scrollTop-T.clientHeight<50:!0},[]),De=U.useCallback(()=>{Ie()?N.current=!1:N.current=!0},[Ie]);U.useEffect(()=>{const T=y.current;T&&(N.current||(T.scrollTop=T.scrollHeight))},[he,v]),U.useEffect(()=>()=>{D.current+=1},[]);const Fe=()=>{D.current+=1,E(!1),j([]),c(null),h([]),S(""),x(null),F(!1);const T=Nr(s);a(T)},zt=async()=>{!l||!await W({title:M("chatDeleteSessionConfirm"),variant:"destructive",confirmLabel:M("delete")})||se.mutate({key:l},{onSuccess:async()=>{D.current+=1,E(!1),j([]),c(null),h([]),S(""),x(null),F(!1),a(null),await H.refetch()}})},Ge=U.useCallback(async(T,G)=>{D.current+=1;const te=D.current;h([]),S(""),x(null),c({seq:Pe,type:"message.user.optimistic",timestamp:new Date().toISOString(),message:{role:"user",content:T.message,timestamp:new Date().toISOString()}}),E(!0),F(!0);try{let re="";const He=new Date().toISOString();x(He);const et=await al({message:T.message,sessionKey:T.sessionKey,agentId:T.agentId,channel:"ui",chatId:"web-ui"},{onReady:pe=>{te===D.current&&pe.sessionKey&&a(Re=>Re===pe.sessionKey?Re:pe.sessionKey)},onDelta:pe=>{te===D.current&&(re+=pe.delta,S(re),F(!1))},onSessionEvent:pe=>{var Re,w;te===D.current&&(((Re=pe.data.message)==null?void 0:Re.role)==="user"&&c(null),h(A=>{const R=[...A],B=R.findIndex(Q=>Q.seq===pe.data.seq);return B>=0?R[B]=pe.data:R.push(pe.data),R}),((w=pe.data.message)==null?void 0:w.role)==="assistant"&&(re="",S(""),F(!1)))}});if(te!==D.current)return;c(null),et.sessionKey!==T.sessionKey&&a(et.sessionKey),await H.refetch();const tt=L.current;(!tt||tt===T.sessionKey||tt===et.sessionKey)&&await X.refetch(),h([]),S(""),x(null),F(!1),E(!1)}catch{if(te!==D.current)return;D.current+=1,E(!1),c(null),h([]),S(""),x(null),F(!1),G!=null&&G.restoreDraftOnError&&o(re=>re.trim().length===0?T.message:re)}},[X,Pe,H]);U.useEffect(()=>{if(v||b.length===0)return;const[T,...G]=b;j(G),Ge(T,{restoreDraftOnError:!0})},[v,b,Ge]);const kt=async()=>{const T=i.trim();if(!T)return;const G=l??Nr(s);l||a(G),o(""),K.current+=1;const te={id:K.current,message:T,sessionKey:G,agentId:s};if(v){j(re=>[...re,te]);return}await Ge(te,{restoreDraftOnError:!0})};return k.jsxs(cl,{fullHeight:!0,children:[k.jsx(fl,{title:M("chatPageTitle"),description:M("chatPageDescription"),actions:k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsxs(Ue,{variant:"outline",size:"sm",onClick:()=>X.refetch(),className:"rounded-lg",children:[k.jsx(Dn,{className:ye("h-3.5 w-3.5 mr-1.5",X.isFetching&&"animate-spin")}),M("chatRefresh")]}),k.jsxs(Ue,{variant:"primary",size:"sm",onClick:Fe,className:"rounded-lg",children:[k.jsx(Nn,{className:"h-3.5 w-3.5 mr-1.5"}),M("chatNewSession")]})]})}),k.jsxs("div",{className:"flex-1 min-h-0 flex gap-4 max-lg:flex-col",children:[k.jsxs("aside",{className:"w-[320px] max-lg:w-full shrink-0 rounded-2xl border border-gray-200 bg-white shadow-card flex flex-col min-h-0",children:[k.jsxs("div",{className:"p-4 border-b border-gray-100 space-y-3",children:[k.jsxs("div",{className:"relative",children:[k.jsx(Rr,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),k.jsx(sl,{value:e,onChange:T=>n(T.target.value),placeholder:M("chatSearchSessionPlaceholder"),className:"pl-8 h-9 rounded-lg text-xs"})]}),k.jsxs(zn,{value:t,onValueChange:r,children:[k.jsx(Fn,{className:"h-9 rounded-lg text-xs",children:k.jsx(Rn,{placeholder:M("sessionsAllChannels")})}),k.jsxs(_n,{children:[k.jsx(Ft,{value:"all",children:M("sessionsAllChannels")}),fe.map(T=>k.jsx(Ft,{value:T,children:sh(T)},T))]})]}),k.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[k.jsxs(Ue,{variant:"outline",size:"sm",className:"rounded-lg",onClick:()=>H.refetch(),children:[k.jsx(Dn,{className:ye("h-3.5 w-3.5 mr-1.5",H.isFetching&&"animate-spin")}),M("chatRefresh")]}),k.jsxs(Ue,{variant:"subtle",size:"sm",className:"rounded-lg",onClick:Fe,children:[k.jsx(Nn,{className:"h-3.5 w-3.5 mr-1.5"}),M("chatNewSession")]})]})]}),k.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar p-2",children:H.isLoading?k.jsx("div",{className:"text-sm text-gray-500 p-4",children:M("sessionsLoading")}):oe.length===0?k.jsxs("div",{className:"p-5 m-2 rounded-xl border border-dashed border-gray-200 text-center text-sm text-gray-500",children:[k.jsx(Ln,{className:"h-7 w-7 mx-auto mb-2 text-gray-300"}),M("sessionsEmpty")]}):k.jsx("div",{className:"space-y-1",children:oe.map(T=>{const G=l===T.key;return k.jsxs("button",{onClick:()=>a(T.key),className:ye("w-full rounded-xl border px-3 py-2.5 text-left transition-all",G?"border-primary/30 bg-primary/5":"border-transparent hover:border-gray-200 hover:bg-gray-50"),children:[k.jsx("div",{className:"text-sm font-semibold text-gray-900 truncate",children:ah(T)}),k.jsx("div",{className:"mt-1 text-[11px] text-gray-500 truncate",children:T.key}),k.jsxs("div",{className:"mt-1 text-[11px] text-gray-400",children:[T.messageCount," · ",_r(T.updatedAt)]})]},T.key)})})})]}),k.jsxs("section",{className:"flex-1 min-h-0 rounded-2xl border border-gray-200 bg-gradient-to-b from-gray-50/60 to-white shadow-card flex flex-col overflow-hidden",children:[k.jsx("div",{className:"px-5 py-4 border-b border-gray-200/80 bg-white/80 backdrop-blur-sm",children:k.jsxs("div",{className:"grid gap-3 lg:grid-cols-[minmax(220px,300px)_minmax(0,1fr)_auto] items-end",children:[k.jsxs("div",{className:"min-w-0",children:[k.jsx("div",{className:"text-[11px] text-gray-500 mb-1",children:M("chatAgentLabel")}),k.jsxs(zn,{value:s,onValueChange:u,children:[k.jsx(Fn,{className:"h-9 rounded-lg",children:k.jsx(Rn,{placeholder:M("chatSelectAgent")})}),k.jsx(_n,{children:ke.map(T=>k.jsx(Ft,{value:T,children:T},T))})]})]}),k.jsxs("div",{className:"min-w-0",children:[k.jsx("div",{className:"text-[11px] text-gray-500 mb-1",children:M("chatSessionLabel")}),k.jsx("div",{className:"h-9 rounded-lg border border-gray-200 bg-white px-3 text-xs text-gray-600 flex items-center truncate",children:l??M("chatNoSession")})]}),k.jsxs(Ue,{variant:"outline",className:"rounded-lg",onClick:zt,disabled:!d||se.isPending,children:[k.jsx(tl,{className:"h-3.5 w-3.5 mr-1.5"}),M("chatDeleteSession")]})]})}),k.jsx("div",{ref:y,onScroll:De,className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar px-5 py-5",children:l?X.isLoading&&he.length===0&&!v&&!_&&!g.trim()?k.jsx("div",{className:"text-sm text-gray-500",children:M("chatHistoryLoading")}):k.jsx(k.Fragment,{children:he.length===0?k.jsx("div",{className:"text-sm text-gray-500",children:M("chatNoMessages")}):k.jsx(rh,{events:he,isSending:v&&_})}):k.jsx("div",{className:"h-full flex items-center justify-center",children:k.jsxs("div",{className:"text-center text-gray-500",children:[k.jsx(Ln,{className:"h-8 w-8 mx-auto mb-2 text-gray-300"}),k.jsx("div",{className:"text-sm font-medium",children:M("chatNoSession")}),k.jsx("div",{className:"text-xs mt-1",children:M("chatNoSessionHint")})]})})}),k.jsx("div",{className:"border-t border-gray-200 bg-white p-4",children:k.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-2",children:[k.jsx("textarea",{value:i,onChange:T=>o(T.target.value),onKeyDown:T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),kt())},placeholder:M("chatInputPlaceholder"),className:"w-full min-h-[68px] max-h-[220px] resize-y bg-transparent outline-none text-sm px-2 py-1.5 text-gray-800 placeholder:text-gray-400"}),k.jsxs("div",{className:"flex items-center justify-between px-2 pb-1",children:[k.jsx("div",{className:"text-[11px] text-gray-400",children:v&&b.length>0?`${M("chatQueuedHintPrefix")} ${b.length} ${M("chatQueuedHintSuffix")}`:M("chatInputHint")}),k.jsxs(Ue,{size:"sm",className:"rounded-lg",onClick:()=>void kt(),disabled:i.trim().length===0,children:[k.jsx(nl,{className:"h-3.5 w-3.5 mr-1.5"}),v?M("chatQueueSend"):M("chatSend")]})]})]})})]})]}),k.jsx($,{})]})}export{dh as ChatPage};
|