UNPKG

@rcb-plugins/markdown-renderer

Version:

A simple plugin for rendering markdown messages in React ChatBotify.

2 lines 119 kB
"use strict";const dr=require("react"),te=require("react-chatbotify"),ee=require("react/jsx-runtime");function gr(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const yr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kr={};function jn(e,n){return(kr.jsx?xr:yr).test(e)}const br=/[ \t\n\f\r]/g;function wr(e){return typeof e=="object"?e.type==="text"?Hn(e.value):!1:Hn(e)}function Hn(e){return e.replace(br,"")===""}class je{constructor(n,t,r){this.property=n,this.normal=t,r&&(this.space=r)}}je.prototype.property={};je.prototype.normal={};je.prototype.space=null;function Et(e,n){const t={},r={};let i=-1;for(;++i<e.length;)Object.assign(t,e[i].property),Object.assign(r,e[i].normal);return new je(t,r,n)}function fn(e){return e.toLowerCase()}class ie{constructor(n,t){this.property=n,this.attribute=t}}ie.prototype.space=null;ie.prototype.boolean=!1;ie.prototype.booleanish=!1;ie.prototype.overloadedBoolean=!1;ie.prototype.number=!1;ie.prototype.commaSeparated=!1;ie.prototype.spaceSeparated=!1;ie.prototype.commaOrSpaceSeparated=!1;ie.prototype.mustUseProperty=!1;ie.prototype.defined=!1;let Sr=0;const D=we(),$=we(),Ct=we(),k=we(),U=we(),Pe=we(),Z=we();function we(){return 2**++Sr}const hn=Object.freeze(Object.defineProperty({__proto__:null,boolean:D,booleanish:$,commaOrSpaceSeparated:Z,commaSeparated:Pe,number:k,overloadedBoolean:Ct,spaceSeparated:U},Symbol.toStringTag,{value:"Module"})),Je=Object.keys(hn);class wn extends ie{constructor(n,t,r,i){let l=-1;if(super(n,t),Un(this,"space",i),typeof r=="number")for(;++l<Je.length;){const o=Je[l];Un(this,Je[l],(r&hn[o])===hn[o])}}}wn.prototype.defined=!0;function Un(e,n,t){t&&(e[n]=t)}const Er={}.hasOwnProperty;function ze(e){const n={},t={};let r;for(r in e.properties)if(Er.call(e.properties,r)){const i=e.properties[r],l=new wn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[fn(r)]=r,t[fn(l.attribute)]=r}return new je(n,t,e.space)}const It=ze({space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),At=ze({space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Pt(e,n){return n in e?e[n]:n}function Tt(e,n){return Pt(e,n.toLowerCase())}const zt=ze({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Tt,properties:{xmlns:null,xmlnsXLink:null}}),Lt=ze({transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:$,ariaAutoComplete:null,ariaBusy:$,ariaChecked:$,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:$,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:$,ariaFlowTo:U,ariaGrabbed:$,ariaHasPopup:null,ariaHidden:$,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:k,ariaLive:null,ariaModal:$,ariaMultiLine:$,ariaMultiSelectable:$,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:$,ariaReadOnly:$,ariaRelevant:null,ariaRequired:$,ariaRoleDescription:U,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:$,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null}}),Cr=ze({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Tt,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pe,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:D,allowPaymentRequest:D,allowUserMedia:D,alt:null,as:null,async:D,autoCapitalize:null,autoComplete:U,autoFocus:D,autoPlay:D,blocking:U,capture:null,charSet:null,checked:D,cite:null,className:U,cols:k,colSpan:null,content:null,contentEditable:$,controls:D,controlsList:U,coords:k|Pe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:D,defer:D,dir:null,dirName:null,disabled:D,download:Ct,draggable:$,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:D,formTarget:null,headers:U,height:k,hidden:D,high:k,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:D,inputMode:null,integrity:null,is:null,isMap:D,itemId:null,itemProp:U,itemRef:U,itemScope:D,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:D,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:D,muted:D,name:null,nonce:null,noModule:D,noValidate:D,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:D,optimum:k,pattern:null,ping:U,placeholder:null,playsInline:D,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:D,referrerPolicy:null,rel:U,required:D,reversed:D,rows:k,rowSpan:k,sandbox:U,scope:null,scoped:D,seamless:D,selected:D,shadowRootClonable:D,shadowRootDelegatesFocus:D,shadowRootMode:null,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:$,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:D,useMap:null,value:$,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:D,declare:D,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:D,noHref:D,noShade:D,noWrap:D,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:$,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:D,disableRemotePlayback:D,prefix:null,property:null,results:k,security:null,unselectable:null}}),Ir=ze({space:"svg",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"},transform:Pt,properties:{about:Z,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:U,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:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:D,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,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:Pe,g2:Pe,glyphName:Pe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:Z,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,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:k,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:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Z,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Z,rev:Z,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Z,requiredFeatures:Z,requiredFonts:Z,requiredFormats:Z,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:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:Z,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Z,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Z,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Ar=/^data[-\w.:]+$/i,Vn=/-[a-z]/g,Pr=/[A-Z]/g;function Tr(e,n){const t=fn(n);let r=n,i=ie;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Ar.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Vn,Lr);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Vn.test(l)){let o=l.replace(Pr,zr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=wn}return new i(r,n)}function zr(e){return"-"+e.toLowerCase()}function Lr(e){return e.charAt(1).toUpperCase()}const vr={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"},Or=Et([At,It,zt,Lt,Cr],"html"),Sn=Et([At,It,zt,Lt,Ir],"svg");function Dr(e){return e.join(" ").trim()}function vt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ie={},Ze,qn;function Rr(){if(qn)return Ze;qn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",c="*",f="",d="comment",p="declaration";Ze=function(w,A){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];A=A||{};var x=1,E=1;function C(T){var I=T.match(n);I&&(x+=I.length);var v=T.lastIndexOf(s);E=~v?T.length-v:E+T.length}function N(){var T={line:x,column:E};return function(I){return I.position=new R(T),q(),I}}function R(T){this.start=T,this.end={line:x,column:E},this.source=A.source}R.prototype.content=w;function y(T){var I=new Error(A.source+":"+x+":"+E+": "+T);if(I.reason=T,I.filename=A.source,I.line=x,I.column=E,I.source=w,!A.silent)throw I}function F(T){var I=T.exec(w);if(I){var v=I[0];return C(v),w=w.slice(v.length),I}}function q(){F(t)}function B(T){var I;for(T=T||[];I=j();)I!==!1&&T.push(I);return T}function j(){var T=N();if(!(u!=w.charAt(0)||c!=w.charAt(1))){for(var I=2;f!=w.charAt(I)&&(c!=w.charAt(I)||u!=w.charAt(I+1));)++I;if(I+=2,f===w.charAt(I-1))return y("End of comment missing");var v=w.slice(2,I-2);return E+=2,C(v),w=w.slice(I),E+=2,T({type:d,comment:v})}}function z(){var T=N(),I=F(r);if(I){if(j(),!F(i))return y("property missing ':'");var v=F(l),W=T({type:p,property:b(I[0].replace(e,f)),value:v?b(v[0].replace(e,f)):f});return F(o),W}}function P(){var T=[];B(T);for(var I;I=z();)I!==!1&&(T.push(I),B(T));return T}return q(),P()};function b(w){return w?w.replace(a,f):f}return Ze}var $n;function Fr(){if($n)return Ie;$n=1;var e=Ie&&Ie.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.default=t;var n=e(Rr());function t(r,i){var l=null;if(!r||typeof r!="string")return l;var o=(0,n.default)(r),a=typeof i=="function";return o.forEach(function(s){if(s.type==="declaration"){var u=s.property,c=s.value;a?i(u,c,s):c&&(l=l||{},l[u]=c)}}),l}return Ie}var Nr=Fr();const Wn=vt(Nr),Mr=Wn.default||Wn,Ot=Dt("end"),En=Dt("start");function Dt(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 _r(e){const n=En(e),t=Ot(e);if(n&&t)return{start:n,end:t}}function Ne(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Yn(e.position):"start"in e||"end"in e?Yn(e):"line"in e||"column"in e?mn(e):""}function mn(e){return Qn(e&&e.line)+":"+Qn(e&&e.column)}function Yn(e){return mn(e&&e.start)+"-"+mn(e&&e.end)}function Qn(e){return e&&typeof e=="number"?e:1}class X extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?l.ruleId=r:(l.source=r.slice(0,s),l.ruleId=r.slice(s+1))}if(!l.place&&l.ancestors&&l.ancestors){const s=l.ancestors[l.ancestors.length-1];s&&(l.place=s.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=Ne(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual,this.expected,this.note,this.url}}X.prototype.file="";X.prototype.name="";X.prototype.reason="";X.prototype.message="";X.prototype.stack="";X.prototype.column=void 0;X.prototype.line=void 0;X.prototype.ancestors=void 0;X.prototype.cause=void 0;X.prototype.fatal=void 0;X.prototype.place=void 0;X.prototype.ruleId=void 0;X.prototype.source=void 0;const Cn={}.hasOwnProperty,Br=new Map,jr=/[A-Z]/g,Hr=/-([a-z])/g,Ur=new Set(["table","tbody","thead","tfoot","tr"]),Vr=new Set(["td","th"]),Rt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qr(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=Jr(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=Gr(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"?Sn:Or,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Ft(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Ft(e,n,t){if(n.type==="element")return $r(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Wr(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Qr(e,n,t);if(n.type==="mdxjsEsm")return Yr(e,n);if(n.type==="root")return Xr(e,n,t);if(n.type==="text")return Kr(e,n)}function $r(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Sn,e.schema=i),e.ancestors.push(n);const l=Mt(e,n.tagName,!1),o=Zr(e,n);let a=An(e,n);return Ur.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!wr(s):!0})),Nt(e,o,l,n),In(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Wr(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)}Be(e,n.position)}function Yr(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Be(e,n.position)}function Qr(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Sn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Mt(e,n.name,!0),o=ei(e,n),a=An(e,n);return Nt(e,o,l,n),In(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Xr(e,n,t){const r={};return In(r,An(e,n)),e.create(n,e.Fragment,r,t)}function Kr(e,n){return n.value}function Nt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function In(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Gr(e,n,t){return r;function r(i,l,o,a){const u=Array.isArray(o.children)?t:n;return a?u(l,o,a):u(l,o)}}function Jr(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),s=En(r);return n(i,l,o,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Zr(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Cn.call(n.properties,i)){const l=ni(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Vr.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function ei(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else Be(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else Be(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function An(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Br;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const s=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(s){const u=i.get(s)||0;o=s+"-"+u,i.set(s,u+1)}}const a=Ft(e,l,o);a!==void 0&&t.push(a)}return t}function ni(e,n,t){const r=Tr(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?gr(t):Dr(t)),r.property==="style"){let i=typeof t=="object"?t:ti(e,String(t));return e.stylePropertyNameCase==="css"&&(i=ri(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?vr[r.property]||r.property:r.attribute,t]}}function ti(e,n){const t={};try{Mr(n,r)}catch(i){if(!e.ignoreInvalidStyle){const l=i,o=new X("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Rt+"#cannot-parse-style-attribute",o}}return t;function r(i,l){let o=i;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(Hr,li)),t[o]=l}}function Mt(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,o;for(;++l<i.length;){const a=jn(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}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 Cn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Be(e)}function Be(e,n){const t=new X("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=Rt+"#cannot-handle-mdx-estrees-without-createevaluater",t}function ri(e){const n={};let t;for(t in e)Cn.call(e,t)&&(n[ii(t)]=e[t]);return n}function ii(e){let n=e.replace(jr,oi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function li(e,n){return n.toUpperCase()}function oi(e){return"-"+e.toLowerCase()}const en={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"]},ai={};function ui(e,n){const t=ai,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return _t(e,r,i)}function _t(e,n,t){if(si(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 Xn(e.children,n,t)}return Array.isArray(e)?Xn(e,n,t):""}function Xn(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=_t(e[i],n,t);return r.join("")}function si(e){return!!(e&&typeof e=="object")}const Kn=document.createElement("i");function Pn(e){const n="&"+e+";";Kn.innerHTML=n;const t=Kn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function pe(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function re(e,n){return e.length>0?(pe(e,e.length,0,n),e):n}const Gn={}.hasOwnProperty;function ci(e){const n={};let t=-1;for(;++t<e.length;)pi(n,e[t]);return n}function pi(e,n){let t;for(t in n){const i=(Gn.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){Gn.call(i,o)||(i[o]=[]);const a=l[o];fi(i[o],Array.isArray(a)?a:a?[a]:[])}}}function fi(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);pe(e,0,0,r)}function Bt(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 Te(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ce=xe(/[A-Za-z]/),ne=xe(/[\dA-Za-z]/),hi=xe(/[#-'*+\--9=?A-Z^-~]/);function dn(e){return e!==null&&(e<32||e===127)}const gn=xe(/\d/),mi=xe(/[\dA-Fa-f]/),di=xe(/[!-/:-@[-`{-~]/);function L(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function _(e){return e===-2||e===-1||e===32}const gi=xe(new RegExp("\\p{P}|\\p{S}","u")),yi=xe(/\s/);function xe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Le(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&ne(e.charCodeAt(t+1))&&ne(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),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 l=0;return o;function o(s){return _(s)?(e.enter(t),a(s)):n(s)}function a(s){return _(s)&&l++<i?(e.consume(s),a):(e.exit(t),n(s))}}const xi={tokenize:ki};function ki(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"),l(a)}function l(a){const s=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=s),t=s,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return L(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const bi={tokenize:wi},Jn={tokenize:Si};function wi(e){const n=this,t=[];let r=0,i,l,o;return a;function a(C){if(r<t.length){const N=t[r];return n.containerState=N[1],e.attempt(N[0].continuation,s,u)(C)}return u(C)}function s(C){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&E();const N=n.events.length;let R=N,y;for(;R--;)if(n.events[R][0]==="exit"&&n.events[R][1].type==="chunkFlow"){y=n.events[R][1].end;break}x(r);let F=N;for(;F<n.events.length;)n.events[F][1].end={...y},F++;return pe(n.events,R+1,0,n.events.slice(N)),n.events.length=F,u(C)}return a(C)}function u(C){if(r===t.length){if(!i)return d(C);if(i.currentConstruct&&i.currentConstruct.concrete)return b(C);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Jn,c,f)(C)}function c(C){return i&&E(),x(r),d(C)}function f(C){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,b(C)}function d(C){return n.containerState={},e.attempt(Jn,p,b)(C)}function p(C){return r++,t.push([n.currentConstruct,n.containerState]),d(C)}function b(C){if(C===null){i&&E(),x(0),e.consume(C);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),w(C)}function w(C){if(C===null){A(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return L(C)?(e.consume(C),A(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(C),w)}function A(C,N){const R=n.sliceStream(C);if(N&&R.push(null),C.previous=l,l&&(l.next=C),l=C,i.defineSkip(C.start),i.write(R),n.parser.lazy[C.start.line]){let y=i.events.length;for(;y--;)if(i.events[y][1].start.offset<o&&(!i.events[y][1].end||i.events[y][1].end.offset>o))return;const F=n.events.length;let q=F,B,j;for(;q--;)if(n.events[q][0]==="exit"&&n.events[q][1].type==="chunkFlow"){if(B){j=n.events[q][1].end;break}B=!0}for(x(r),y=F;y<n.events.length;)n.events[y][1].end={...j},y++;pe(n.events,q+1,0,n.events.slice(F)),n.events.length=y}}function x(C){let N=t.length;for(;N-- >C;){const R=t[N];n.containerState=R[1],R[0].exit.call(n,e)}t.length=C}function E(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Si(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 Zn(e){if(e===null||G(e)||yi(e))return 1;if(gi(e))return 2}function Tn(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const yn={name:"attention",resolveAll:Ei,tokenize:Ci};function Ei(e,n){let t=-1,r,i,l,o,a,s,u,c;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 f={...e[r][1].end},d={...e[t][1].start};et(f,-s),et(d,s),o={type:s>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},l={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:s>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=re(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=re(u,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),u=re(u,Tn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=re(u,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(c=2,u=re(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):c=0,pe(e,r-1,t-r+3,u),t=r+u.length-c-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Ci(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Zn(r);let l;return o;function o(s){return l=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===l)return e.consume(s),a;const u=e.exit("attentionSequence"),c=Zn(s),f=!c||c===2&&i||t.includes(s),d=!i||i===2&&c||t.includes(r);return u._open=!!(l===42?f:f&&(i||!d)),u._close=!!(l===42?d:d&&(c||!f)),n(s)}}function et(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Ii={name:"autolink",tokenize:Ai};function Ai(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(p){return ce(p)?(e.consume(p),o):p===64?t(p):u(p)}function o(p){return p===43||p===45||p===46||ne(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,s):(p===43||p===45||p===46||ne(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||dn(p)?t(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):hi(p)?(e.consume(p),u):t(p)}function c(p){return ne(p)?f(p):t(p)}function f(p){return p===46?(e.consume(p),r=0,c):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):d(p)}function d(p){if((p===45||ne(p))&&r++<63){const b=p===45?d:f;return e.consume(p),b}return t(p)}}const Xe={partial:!0,tokenize:Pi};function Pi(e,n,t){return r;function r(l){return _(l)?V(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||L(l)?n(l):t(l)}}const jt={continuation:{tokenize:zi},exit:Li,name:"blockQuote",tokenize:Ti};function Ti(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return _(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function zi(e,n,t){const r=this;return i;function i(o){return _(o)?V(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(jt,n,t)(o)}}function Li(e){e.exit("blockQuote")}const Ht={name:"characterEscape",tokenize:vi};function vi(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return di(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const Ut={name:"characterReference",tokenize:Oi};function Oi(e,n,t){const r=this;let i=0,l,o;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),s}function s(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,o=ne,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=mi,c):(e.enter("characterReferenceValue"),l=7,o=gn,c(f))}function c(f){if(f===59&&i){const d=e.exit("characterReferenceValue");return o===ne&&!Pn(r.sliceSerialize(d))?t(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(f)&&i++<l?(e.consume(f),c):t(f)}}const nt={partial:!0,tokenize:Ri},tt={concrete:!0,name:"codeFenced",tokenize:Di};function Di(e,n,t){const r=this,i={partial:!0,tokenize:R};let l=0,o=0,a;return s;function s(y){return u(y)}function u(y){const F=r.events[r.events.length-1];return l=F&&F[1].type==="linePrefix"?F[2].sliceSerialize(F[1],!0).length:0,a=y,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(y)}function c(y){return y===a?(o++,e.consume(y),c):o<3?t(y):(e.exit("codeFencedFenceSequence"),_(y)?V(e,f,"whitespace")(y):f(y))}function f(y){return y===null||L(y)?(e.exit("codeFencedFence"),r.interrupt?n(y):e.check(nt,w,N)(y)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(y))}function d(y){return y===null||L(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(y)):_(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,p,"whitespace")(y)):y===96&&y===a?t(y):(e.consume(y),d)}function p(y){return y===null||L(y)?f(y):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===null||L(y)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(y)):y===96&&y===a?t(y):(e.consume(y),b)}function w(y){return e.attempt(i,N,A)(y)}function A(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),x}function x(y){return l>0&&_(y)?V(e,E,"linePrefix",l+1)(y):E(y)}function E(y){return y===null||L(y)?e.check(nt,w,N)(y):(e.enter("codeFlowValue"),C(y))}function C(y){return y===null||L(y)?(e.exit("codeFlowValue"),E(y)):(e.consume(y),C)}function N(y){return e.exit("codeFenced"),n(y)}function R(y,F,q){let B=0;return j;function j(v){return y.enter("lineEnding"),y.consume(v),y.exit("lineEnding"),z}function z(v){return y.enter("codeFencedFence"),_(v)?V(y,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):P(v)}function P(v){return v===a?(y.enter("codeFencedFenceSequence"),T(v)):q(v)}function T(v){return v===a?(B++,y.consume(v),T):B>=o?(y.exit("codeFencedFenceSequence"),_(v)?V(y,I,"whitespace")(v):I(v)):q(v)}function I(v){return v===null||L(v)?(y.exit("codeFencedFence"),F(v)):q(v)}}}function Ri(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const nn={name:"codeIndented",tokenize:Ni},Fi={partial:!0,tokenize:Mi};function Ni(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,l,"linePrefix",5)(u)}function l(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(u):t(u)}function o(u){return u===null?s(u):L(u)?e.attempt(Fi,o,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||L(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function Mi(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):L(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):V(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):L(o)?i(o):t(o)}}const _i={name:"codeText",previous:ji,resolve:Bi,tokenize:Hi};function Bi(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 ji(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Hi(e,n,t){let r=0,i,l;return o;function o(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),s(f))}function s(f){return f===null?t(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),s):f===96?(l=e.enter("codeTextSequence"),i=0,c(f)):L(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||L(f)?(e.exit("codeTextData"),s(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(f)):(l.type="codeTextData",u(f))}}class Ui{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Re(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Re(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Re(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);Re(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Re(this.left,t.reverse())}}}function Re(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 Vt(e){const n={};let t=-1,r,i,l,o,a,s,u;const c=new Ui(e);for(;++t<c.length;){for(;t in n;)t=n[t];if(r=c.get(t),t&&r[1].type==="chunkFlow"&&c.get(t-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,l=0,l<s.length&&s[l][1].type==="lineEndingBlank"&&(l+=2),l<s.length&&s[l][1].type==="content"))for(;++l<s.length&&s[l][1].type!=="content";)s[l][1].type==="chunkText"&&(s[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Vi(c,t)),t=n[t],u=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=c.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(o[1].type!=="linePrefix")break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,t),a.unshift(r),c.splice(i,t-i+1,a))}}return pe(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Vi(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[],o=t._tokenizer||r.parser[t.contentType](t.start),a=o.events,s=[],u={};let c,f,d=-1,p=t,b=0,w=0;const A=[w];for(;p;){for(;e.get(++i)[1]!==p;);l.push(i),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),f&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(c),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=t;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(w=d+1,A.push(w),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):A.pop(),d=A.length;d--;){const x=a.slice(A[d],A[d+1]),E=l.pop();s.push([E,E+x.length-1]),e.splice(E,2,x)}for(s.reverse(),d=-1;++d<s.length;)u[b+s[d][0]]=b+s[d][1],b+=s[d][1]-s[d][0]-1;return u}const qi={resolve:Wi,tokenize:Yi},$i={partial:!0,tokenize:Qi};function Wi(e){return Vt(e),e}function Yi(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):L(a)?e.check($i,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function Qi(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),V(e,l,"linePrefix")}function l(o){if(o===null||L(o))return t(o);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(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function qt(e,n,t,r,i,l,o,a,s){const u=s||Number.POSITIVE_INFINITY;let c=0;return f;function f(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),d):x===null||x===32||x===41||dn(x)?t(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(x))}function d(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),d(x)):x===null||x===60||L(x)?t(x):(e.c