ns-chatbot-widget 1.0.0-beta.8 → 1.0.0
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/dist/index.cjs.js +13 -28
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +3185 -5040
- package/package.json +2 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),ye=require("react");class sn extends Error{constructor(t,n){super(n),this.status=t}}function $n(e,t){return{Authorization:`Bearer ${e}`,"Content-Type":"application/json",...t?{"X-Merchant-Id":String(t)}:{}}}async function Ti(e,t,n){const r=await fetch(`${e}/chat/init`,{headers:$n(t,n)});if(!r.ok)throw new sn(r.status,await r.text());return r.json()}async function vi(e,t,n,r){const i=await fetch(`${e}/chat`,{method:"POST",headers:$n(t,r),body:JSON.stringify({message:n})});if(!i.ok)throw new sn(i.status,await i.text());return i.json()}async function Pi(e,t,n){const r=await fetch(`${e}/chat`,{method:"DELETE",headers:$n(t,n)});if(!r.ok)throw new sn(r.status,await r.text());return r.json()}const dn=()=>Math.random().toString(36).slice(2);function cr(e,t,n){const[r,i]=ye.useState([]),[o,l]=ye.useState([]),[a,u]=ye.useState(!1),[s,f]=ye.useState(null);return{messages:r,suggestedReplies:o,loading:a,error:s,init:async()=>{if(!(a||r.length>0)){u(!0);try{const g=await Ti(t,e,n),k=g.existingSession?g.messages??[]:g.reply?[{role:"assistant",content:g.reply}]:[];i(k.map(S=>({...S,id:dn(),timestamp:new Date}))),l(g.suggestedReplies)}catch(g){f(g instanceof sn&&g.status===401?"The login session is invalid.":"Unable to connect to the chatbot.")}finally{u(!1)}}},send:async g=>{if(!g.trim()||a)return;const k={id:dn(),role:"user",content:g.trim(),timestamp:new Date};i(S=>[...S,k]),l([]),f(null),u(!0);try{const S=await vi(t,e,g.trim(),n);i(y=>[...y,{id:dn(),role:"assistant",content:S.reply,timestamp:new Date,usage:S.usage}]),l(S.suggestedReplies)}catch{f("Unable to send the message. Please try again.")}finally{u(!1)}},clear:async()=>{if(!a){u(!0);try{await Pi(t,e,n),i([]),l([]),f(null)}catch{f("Unable to clear the session. Please try again.")}finally{u(!1)}}}}}function Li(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const zi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Di=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Fi={};function gt(e,t){return(Fi.jsx?Di:zi).test(e)}const Ri=/[ \t\n\f\r]/g;function _i(e){return typeof e=="object"?e.type==="text"?dt(e.value):!1:dt(e)}function dt(e){return e.replace(Ri,"")===""}class Xe{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Xe.prototype.normal={};Xe.prototype.property={};Xe.prototype.space=void 0;function fr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Xe(n,r,t)}function Dn(e){return e.toLowerCase()}class ne{constructor(t,n){this.attribute=n,this.property=t}}ne.prototype.attribute="";ne.prototype.booleanish=!1;ne.prototype.boolean=!1;ne.prototype.commaOrSpaceSeparated=!1;ne.prototype.commaSeparated=!1;ne.prototype.defined=!1;ne.prototype.mustUseProperty=!1;ne.prototype.number=!1;ne.prototype.overloadedBoolean=!1;ne.prototype.property="";ne.prototype.spaceSeparated=!1;ne.prototype.space=void 0;let Oi=0;const z=ve(),X=ve(),Fn=ve(),C=ve(),V=ve(),Ae=ve(),re=ve();function ve(){return 2**++Oi}const Rn=Object.freeze(Object.defineProperty({__proto__:null,boolean:z,booleanish:X,commaOrSpaceSeparated:re,commaSeparated:Ae,number:C,overloadedBoolean:Fn,spaceSeparated:V},Symbol.toStringTag,{value:"Module"})),yn=Object.keys(Rn);class qn extends ne{constructor(t,n,r,i){let o=-1;if(super(t,n),yt(this,"space",i),typeof r=="number")for(;++o<yn.length;){const l=yn[o];yt(this,yn[o],(r&Rn[l])===Rn[l])}}}qn.prototype.defined=!0;function yt(e,t,n){n&&(e[t]=n)}function _e(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new qn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Dn(r)]=r,n[Dn(o.attribute)]=r}return new Xe(t,n,e.space)}const hr=_e({properties:{ariaActiveDescendant:null,ariaAtomic:X,ariaAutoComplete:null,ariaBusy:X,ariaChecked:X,ariaColCount:C,ariaColIndex:C,ariaColSpan:C,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:X,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:X,ariaFlowTo:V,ariaGrabbed:X,ariaHasPopup:null,ariaHidden:X,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:C,ariaLive:null,ariaModal:X,ariaMultiLine:X,ariaMultiSelectable:X,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:C,ariaPressed:X,ariaReadOnly:X,ariaRelevant:null,ariaRequired:X,ariaRoleDescription:V,ariaRowCount:C,ariaRowIndex:C,ariaRowSpan:C,ariaSelected:X,ariaSetSize:C,ariaSort:null,ariaValueMax:C,ariaValueMin:C,ariaValueNow:C,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function pr(e,t){return t in e?e[t]:t}function mr(e,t){return pr(e,t.toLowerCase())}const Mi=_e({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ae,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alpha:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:V,autoFocus:z,autoPlay:z,blocking:V,capture:null,charSet:null,checked:z,cite:null,className:V,closedBy:null,colorSpace:null,cols:C,colSpan:C,command:null,commandFor:null,content:null,contentEditable:X,controls:z,controlsList:V,coords:C|Ae,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:Fn,draggable:X,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:V,height:C,hidden:Fn,high:C,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:V,itemRef:V,itemScope:z,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:C,manifest:null,max:null,maxLength:C,media:null,method:null,min:null,minLength:C,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,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:z,optimum:C,pattern:null,ping:V,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:V,required:z,reversed:z,rows:C,rowSpan:C,sandbox:V,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootCustomElementRegistry:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shadowRootSerializable:z,shape:null,size:C,sizes:null,slot:null,span:C,spellCheck:X,src:null,srcDoc:null,srcLang:null,srcSet:null,start:C,step:null,style:null,tabIndex:C,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:X,width:C,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:C,borderColor:null,bottomMargin:C,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:C,leftMargin:C,link:null,longDesc:null,lowSrc:null,marginHeight:C,marginWidth:C,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:C,rules:null,scheme:null,scrolling:X,standby:null,summary:null,text:null,topMargin:C,valueType:null,version:null,vAlign:null,vLink:null,vSpace:C,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:z,disablePictureInPicture:z,disableRemotePlayback:z,exportParts:Ae,part:V,prefix:null,property:null,results:C,security:null,unselectable:null},space:"html",transform:mr}),Ni=_e({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",maskType:"mask-type",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:re,accentHeight:C,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:C,amplitude:C,arabicForm:null,ascent:C,attributeName:null,attributeType:null,azimuth:C,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:C,by:null,calcMode:null,capHeight:C,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:C,diffuseConstant:C,direction:null,display:null,dur:null,divisor:C,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:C,enableBackground:null,end:null,event:null,exponent:C,externalResourcesRequired:null,fill:null,fillOpacity:C,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ae,g2:Ae,glyphName:Ae,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:C,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:C,horizOriginX:C,horizOriginY:C,id:null,ideographic:C,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:C,k:C,k1:C,k2:C,k3:C,k4:C,kernelMatrix:re,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:C,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:C,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:C,overlineThickness:C,paintOrder:null,panose1:null,path:null,pathLength:C,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:C,pointsAtY:C,pointsAtZ:C,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:re,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:re,rev:re,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:re,requiredFeatures:re,requiredFonts:re,requiredFormats:re,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:C,specularExponent:C,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:C,strikethroughThickness:C,string:null,stroke:null,strokeDashArray:re,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:C,strokeOpacity:C,strokeWidth:null,style:null,surfaceScale:C,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:re,tabIndex:C,tableValues:null,target:null,targetX:C,targetY:C,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:re,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:C,underlineThickness:C,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:C,values:null,vAlphabetic:C,vMathematical:C,vectorEffect:null,vHanging:C,vIdeographic:C,version:null,vertAdvY:C,vertOriginX:C,vertOriginY:C,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:C,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pr}),gr=_e({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dr=_e({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mr}),yr=_e({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bi={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"},ji=/[A-Z]/g,kt=/-[a-z]/g,Hi=/^data[-\w.:]+$/i;function Ui(e,t){const n=Dn(t);let r=t,i=ne;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Hi.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(kt,$i);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!kt.test(o)){let l=o.replace(ji,Vi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=qn}return new i(r,t)}function Vi(e){return"-"+e.toLowerCase()}function $i(e){return e.charAt(1).toUpperCase()}const qi=fr([hr,Mi,gr,dr,yr],"html"),Wn=fr([hr,Ni,gr,dr,yr],"svg");function Wi(e){return e.join(" ").trim()}var rn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xn={},xt=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Xi=/\n/g,Yi=/^\s*/,Qi=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Gi=/^:\s*/,Ki=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ji=/^[;\s]*/,Zi=/^\s+|\s+$/g,el=`
|
|
2
|
-
`,bt="/",wt="*",Ie="",nl="comment",tl="declaration";function rl(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var k=g.match(Xi);k&&(n+=k.length);var S=g.lastIndexOf(el);r=~S?g.length-S:r+g.length}function o(){var g={line:n,column:r};return function(k){return k.position=new l(g),s(),k}}function l(g){this.start=g,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function a(g){var k=new Error(t.source+":"+n+":"+r+": "+g);if(k.reason=g,k.filename=t.source,k.line=n,k.column=r,k.source=e,!t.silent)throw k}function u(g){var k=g.exec(e);if(k){var S=k[0];return i(S),e=e.slice(S.length),k}}function s(){u(Yi)}function f(g){var k;for(g=g||[];k=c();)k!==!1&&g.push(k);return g}function c(){var g=o();if(!(bt!=e.charAt(0)||wt!=e.charAt(1))){for(var k=2;Ie!=e.charAt(k)&&(wt!=e.charAt(k)||bt!=e.charAt(k+1));)++k;if(k+=2,Ie===e.charAt(k-1))return a("End of comment missing");var S=e.slice(2,k-2);return r+=2,i(S),e=e.slice(k),r+=2,g({type:nl,comment:S})}}function p(){var g=o(),k=u(Qi);if(k){if(c(),!u(Gi))return a("property missing ':'");var S=u(Ki),y=g({type:tl,property:St(k[0].replace(xt,Ie)),value:S?St(S[0].replace(xt,Ie)):Ie});return u(Ji),y}}function h(){var g=[];f(g);for(var k;k=p();)k!==!1&&(g.push(k),f(g));return g}return s(),h()}function St(e){return e?e.replace(Zi,Ie):Ie}var il=rl,ll=rn&&rn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.default=al;const ol=ll(il);function al(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,ol.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:a}=o;i?t(l,a,o):a&&(n=n||{},n[l]=a)}),n}var cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.camelCase=void 0;var ul=/^--[a-zA-Z0-9_-]+$/,sl=/-([a-z])/g,cl=/^[^-]+$/,fl=/^-(webkit|moz|ms|o|khtml)-/,hl=/^-(ms)-/,pl=function(e){return!e||cl.test(e)||ul.test(e)},ml=function(e,t){return t.toUpperCase()},Ct=function(e,t){return"".concat(t,"-")},gl=function(e,t){return t===void 0&&(t={}),pl(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(hl,Ct):e=e.replace(fl,Ct),e.replace(sl,ml))};cn.camelCase=gl;var dl=rn&&rn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yl=dl(Xn),kl=cn;function _n(e,t){var n={};return!e||typeof e!="string"||(0,yl.default)(e,function(r,i){r&&i&&(n[(0,kl.camelCase)(r,t)]=i)}),n}_n.default=_n;var xl=_n;const bl=kr(xl),xr=br("end"),Yn=br("start");function br(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function wl(e){const t=Yn(e),n=xr(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Et(e.position):"start"in e||"end"in e?Et(e):"line"in e||"column"in e?On(e):""}function On(e){return It(e&&e.line)+":"+It(e&&e.column)}function Et(e){return On(e&&e.start)+"-"+On(e&&e.end)}function It(e){return e&&typeof e=="number"?e:1}class J extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.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=Ue(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}}J.prototype.file="";J.prototype.name="";J.prototype.reason="";J.prototype.message="";J.prototype.stack="";J.prototype.column=void 0;J.prototype.line=void 0;J.prototype.ancestors=void 0;J.prototype.cause=void 0;J.prototype.fatal=void 0;J.prototype.place=void 0;J.prototype.ruleId=void 0;J.prototype.source=void 0;const Qn={}.hasOwnProperty,Sl=new Map,Cl=/[A-Z]/g,El=new Set(["table","tbody","thead","tfoot","tr"]),Il=new Set(["td","th"]),wr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Al(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Rl(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Fl(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Wn:qi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Sr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Sr(e,t,n){if(t.type==="element")return Tl(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return vl(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Ll(e,t,n);if(t.type==="mdxjsEsm")return Pl(e,t);if(t.type==="root")return zl(e,t,n);if(t.type==="text")return Dl(e,t)}function Tl(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Wn,e.schema=i),e.ancestors.push(t);const o=Er(e,t.tagName,!1),l=_l(e,t);let a=Kn(e,t);return El.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!_i(u):!0})),Cr(e,l,o,t),Gn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function vl(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}qe(e,t.position)}function Pl(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qe(e,t.position)}function Ll(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Wn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Er(e,t.name,!0),l=Ol(e,t),a=Kn(e,t);return Cr(e,l,o,t),Gn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function zl(e,t,n){const r={};return Gn(r,Kn(e,t)),e.create(t,e.Fragment,r,n)}function Dl(e,t){return t.value}function Cr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fl(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Rl(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=Yn(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function _l(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Qn.call(t.properties,i)){const o=Ml(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Il.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ol(e,t){const n={};for(const r of t.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(n,e.evaluater.evaluateExpression(a.argument))}else qe(e,t.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 qe(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Kn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Sl;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=Sr(e,o,l);a!==void 0&&n.push(a)}return n}function Ml(e,t,n){const r=Ui(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Li(n):Wi(n)),r.property==="style"){let i=typeof n=="object"?n:Nl(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Bl(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Bi[r.property]||r.property:r.attribute,n]}}function Nl(e,t){try{return bl(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new J("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=wr+"#cannot-parse-style-attribute",i}}function Er(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=gt(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=gt(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Qn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);qe(e)}function qe(e,t){const n=new J("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=wr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Bl(e){const t={};let n;for(n in e)Qn.call(e,n)&&(t[jl(n)]=e[n]);return t}function jl(e){let t=e.replace(Cl,Hl);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Hl(e){return"-"+e.toLowerCase()}const kn={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"]},Ul={};function Jn(e,t){const n=Ul,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ir(e,r,i)}function Ir(e,t,n){if(Vl(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return At(e.children,t,n)}return Array.isArray(e)?At(e,t,n):""}function At(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ir(e[i],t,n);return r.join("")}function Vl(e){return!!(e&&typeof e=="object")}const Tt=document.createElement("i");function Zn(e){const t="&"+e+";";Tt.innerHTML=t;const n=Tt.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ie(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function le(e,t){return e.length>0?(ie(e,e.length,0,t),e):t}const vt={}.hasOwnProperty;function Ar(e){const t={};let n=-1;for(;++n<e.length;)$l(t,e[n]);return t}function $l(e,t){let n;for(n in t){const i=(vt.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){vt.call(i,l)||(i[l]=[]);const a=o[l];ql(i[l],Array.isArray(a)?a:a?[a]:[])}}}function ql(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ie(e,0,0,r)}function Tr(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Z=we(/[A-Za-z]/),K=we(/[\dA-Za-z]/),Wl=we(/[#-'*+\--9=?A-Z^-~]/);function ln(e){return e!==null&&(e<32||e===127)}const Mn=we(/\d/),Xl=we(/[\dA-Fa-f]/),Yl=we(/[!-/:-@[-`{-~]/);function P(e){return e!==null&&e<-2}function $(e){return e!==null&&(e<0||e===32)}function _(e){return e===-2||e===-1||e===32}const fn=we(new RegExp("\\p{P}|\\p{S}","u")),Te=we(/\s/);function we(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Oe(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&K(e.charCodeAt(n+1))&&K(e.charCodeAt(n+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(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function M(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return _(u)?(e.enter(n),a(u)):t(u)}function a(u){return _(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const Ql={tokenize:Gl};function Gl(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),M(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return P(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Kl={tokenize:Jl},Pt={tokenize:Zl};function Jl(e){const t=this,n=[];let r=0,i,o,l;return a;function a(E){if(r<n.length){const F=n[r];return t.containerState=F[1],e.attempt(F[0].continuation,u,s)(E)}return s(E)}function u(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&A();const F=t.events.length;let R=F,w;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){w=t.events[R][1].end;break}y(r);let N=F;for(;N<t.events.length;)t.events[N][1].end={...w},N++;return ie(t.events,R+1,0,t.events.slice(F)),t.events.length=N,s(E)}return a(E)}function s(E){if(r===n.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Pt,f,c)(E)}function f(E){return i&&A(),y(r),p(E)}function c(E){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,g(E)}function p(E){return t.containerState={},e.attempt(Pt,h,g)(E)}function h(E){return r++,n.push([t.currentConstruct,t.containerState]),p(E)}function g(E){if(E===null){i&&A(),y(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),k(E)}function k(E){if(E===null){S(e.exit("chunkFlow"),!0),y(0),e.consume(E);return}return P(E)?(e.consume(E),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(E),k)}function S(E,F){const R=t.sliceStream(E);if(F&&R.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(R),t.parser.lazy[E.start.line]){let w=i.events.length;for(;w--;)if(i.events[w][1].start.offset<l&&(!i.events[w][1].end||i.events[w][1].end.offset>l))return;const N=t.events.length;let q=N,j,x;for(;q--;)if(t.events[q][0]==="exit"&&t.events[q][1].type==="chunkFlow"){if(j){x=t.events[q][1].end;break}j=!0}for(y(r),w=N;w<t.events.length;)t.events[w][1].end={...x},w++;ie(t.events,q+1,0,t.events.slice(N)),t.events.length=w}}function y(E){let F=n.length;for(;F-- >E;){const R=n[F];t.containerState=R[1],R[0].exit.call(t,e)}n.length=E}function A(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Zl(e,t,n){return M(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Re(e){if(e===null||$(e)||Te(e))return 1;if(fn(e))return 2}function hn(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Nn={name:"attention",resolveAll:eo,tokenize:no};function eo(e,t){let n=-1,r,i,o,l,a,u,s,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};Lt(c,-u),Lt(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=le(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=le(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=le(s,hn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=le(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=le(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,ie(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function no(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Re(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Re(u),c=!f||f===2&&i||n.includes(u),p=!i||i===2&&f||n.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),t(u)}}function Lt(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const to={name:"autolink",tokenize:ro};function ro(e,t,n){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 Z(h)?(e.consume(h),l):h===64?n(h):s(h)}function l(h){return h===43||h===45||h===46||K(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||K(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||ln(h)?n(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):Wl(h)?(e.consume(h),s):n(h)}function f(h){return K(h)?c(h):n(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"),t):p(h)}function p(h){if((h===45||K(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return n(h)}}const Ye={partial:!0,tokenize:io};function io(e,t,n){return r;function r(o){return _(o)?M(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||P(o)?t(o):n(o)}}const vr={continuation:{tokenize:oo},exit:ao,name:"blockQuote",tokenize:lo};function lo(e,t,n){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 n(l)}function o(l){return _(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function oo(e,t,n){const r=this;return i;function i(l){return _(l)?M(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(vr,t,n)(l)}}function ao(e){e.exit("blockQuote")}const Pr={name:"characterEscape",tokenize:uo};function uo(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Yl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Lr={name:"characterReference",tokenize:so};function so(e,t,n){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"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=K,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Xl,f):(e.enter("characterReferenceValue"),o=7,l=Mn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===K&&!Zn(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const zt={partial:!0,tokenize:fo},Dt={concrete:!0,name:"codeFenced",tokenize:co};function co(e,t,n){const r=this,i={partial:!0,tokenize:R};let o=0,l=0,a;return u;function u(w){return s(w)}function s(w){const N=r.events[r.events.length-1];return o=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===a?(l++,e.consume(w),f):l<3?n(w):(e.exit("codeFencedFenceSequence"),_(w)?M(e,c,"whitespace")(w):c(w))}function c(w){return w===null||P(w)?(e.exit("codeFencedFence"),r.interrupt?t(w):e.check(zt,k,F)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||P(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(w)):_(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),M(e,h,"whitespace")(w)):w===96&&w===a?n(w):(e.consume(w),p)}function h(w){return w===null||P(w)?c(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||P(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(w)):w===96&&w===a?n(w):(e.consume(w),g)}function k(w){return e.attempt(i,F,S)(w)}function S(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return o>0&&_(w)?M(e,A,"linePrefix",o+1)(w):A(w)}function A(w){return w===null||P(w)?e.check(zt,k,F)(w):(e.enter("codeFlowValue"),E(w))}function E(w){return w===null||P(w)?(e.exit("codeFlowValue"),A(w)):(e.consume(w),E)}function F(w){return e.exit("codeFenced"),t(w)}function R(w,N,q){let j=0;return x;function x(B){return w.enter("lineEnding"),w.consume(B),w.exit("lineEnding"),T}function T(B){return w.enter("codeFencedFence"),_(B)?M(w,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):v(B)}function v(B){return B===a?(w.enter("codeFencedFenceSequence"),H(B)):q(B)}function H(B){return B===a?(j++,w.consume(B),H):j>=l?(w.exit("codeFencedFenceSequence"),_(B)?M(w,W,"whitespace")(B):W(B)):q(B)}function W(B){return B===null||P(B)?(w.exit("codeFencedFence"),N(B)):q(B)}}}function fo(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const xn={name:"codeIndented",tokenize:po},ho={partial:!0,tokenize:mo};function po(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),M(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):P(s)?e.attempt(ho,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||P(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function mo(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):P(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):M(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?t(l):P(l)?i(l):n(l)}}const go={name:"codeText",previous:ko,resolve:yo,tokenize:xo};function yo(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||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),t-=r-i-2,r=i+2),i=void 0);return e}function ko(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function xo(e,t,n){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"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):P(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||P(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",s(c))}}class bo{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&je(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),je(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),je(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);je(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);je(this.left,n.reverse())}}}function je(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function zr(e){const t={};let n=-1,r,i,o,l,a,u,s;const f=new bo(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,wo(f,n)),n=t[n],s=!0);else if(r[1]._container){for(o=n,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,n),a.unshift(r),f.splice(i,n-i+1,a))}}return ie(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function wo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=n,g=0,k=0;const S=[k];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=n;++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&&(k=p+1,S.push(k),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):S.pop(),p=S.length;p--;){const y=a.slice(S[p],S[p+1]),A=o.pop();u.push([A,A+y.length-1]),e.splice(A,2,y)}for(u.reverse(),p=-1;++p<u.length;)s[g+u[p][0]]=g+u[p][1],g+=u[p][1]-u[p][0]-1;return s}const So={resolve:Eo,tokenize:Io},Co={partial:!0,tokenize:Ao};function Eo(e){return zr(e),e}function Io(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):P(a)?e.check(Co,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ao(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),M(e,o,"linePrefix")}function o(l){if(l===null||P(l))return n(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?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Dr(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||ln(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),k(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||P(y)?n(y):(e.consume(y),y===92?g:h)}function g(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function k(y){return!f&&(y===null||y===41||$(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f<s&&y===40?(e.consume(y),f++,k):y===41?(e.consume(y),f--,k):y===null||y===32||y===40||ln(y)?n(y):(e.consume(y),y===92?S:k)}function S(y){return y===40||y===41||y===92?(e.consume(y),k):k(y)}}function Fr(e,t,n,r,i,o){const l=this;let a=0,u;return s;function s(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&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):P(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||P(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!_(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Rr(e,t,n,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,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):P(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),M(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||P(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Ve(e,t){let n;return r;function r(i){return P(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):_(i)?M(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const To={name:"definition",tokenize:Po},vo={partial:!0,tokenize:Lo};function Po(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Fr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return $(h)?Ve(e,s)(h):s(h)}function s(h){return Dr(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(vo,c,c)(h)}function c(h){return _(h)?M(e,p,"whitespace")(h):p(h)}function p(h){return h===null||P(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Lo(e,t,n){return r;function r(a){return $(a)?Ve(e,i)(a):n(a)}function i(a){return Rr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return _(a)?M(e,l,"whitespace")(a):l(a)}function l(a){return a===null||P(a)?t(a):n(a)}}const zo={name:"hardBreakEscape",tokenize:Do};function Do(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return P(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Fo={name:"headingAtx",resolve:Ro,tokenize:_o};function Ro(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function _o(e,t,n){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||$(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||P(f)?(e.exit("atxHeading"),t(f)):_(f)?M(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||$(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Oo=["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"],Ft=["pre","script","style","textarea"],Mo={concrete:!0,name:"htmlFlow",resolveTo:jo,tokenize:Ho},No={partial:!0,tokenize:Vo},Bo={partial:!0,tokenize:Uo};function jo(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ho(e,t,n){const r=this;let i,o,l,a,u;return s;function s(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,k):d===63?(e.consume(d),i=3,r.interrupt?t:m):Z(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):Z(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function h(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const ue="CDATA[";return d===ue.charCodeAt(a++)?(e.consume(d),a===ue.length?r.interrupt?t:v:g):n(d)}function k(d){return Z(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||$(d)){const ue=d===47,Se=l.toLowerCase();return!ue&&!o&&Ft.includes(Se)?(i=1,r.interrupt?t(d):v(d)):Oo.includes(l.toLowerCase())?(i=6,ue?(e.consume(d),y):r.interrupt?t(d):v(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?A(d):E(d))}return d===45||K(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:v):n(d)}function A(d){return _(d)?(e.consume(d),A):x(d)}function E(d){return d===47?(e.consume(d),x):d===58||d===95||Z(d)?(e.consume(d),F):_(d)?(e.consume(d),E):x(d)}function F(d){return d===45||d===46||d===58||d===95||K(d)?(e.consume(d),F):R(d)}function R(d){return d===61?(e.consume(d),w):_(d)?(e.consume(d),R):E(d)}function w(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),u=d,N):_(d)?(e.consume(d),w):q(d)}function N(d){return d===u?(e.consume(d),u=null,j):d===null||P(d)?n(d):(e.consume(d),N)}function q(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||$(d)?R(d):(e.consume(d),q)}function j(d){return d===47||d===62||_(d)?E(d):n(d)}function x(d){return d===62?(e.consume(d),T):n(d)}function T(d){return d===null||P(d)?v(d):_(d)?(e.consume(d),T):n(d)}function v(d){return d===45&&i===2?(e.consume(d),G):d===60&&i===1?(e.consume(d),Y):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):P(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(No,me,H)(d)):d===null||P(d)?(e.exit("htmlFlowData"),H(d)):(e.consume(d),v)}function H(d){return e.check(Bo,W,me)(d)}function W(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),B}function B(d){return d===null||P(d)?H(d):(e.enter("htmlFlowData"),v(d))}function G(d){return d===45?(e.consume(d),m):v(d)}function Y(d){return d===47?(e.consume(d),l="",oe):v(d)}function oe(d){if(d===62){const ue=l.toLowerCase();return Ft.includes(ue)?(e.consume(d),ae):v(d)}return Z(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):v(d)}function pe(d){return d===93?(e.consume(d),m):v(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):v(d)}function ae(d){return d===null||P(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function Uo(e,t,n){const r=this;return i;function i(l){return P(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Vo(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ye,t,n)}}const $o={name:"htmlText",tokenize:qo};function qo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),R):m===63?(e.consume(m),E):Z(m)?(e.consume(m),q):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):Z(m)?(e.consume(m),A):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):P(m)?(l=c,Y(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?G(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?k:g):n(m)}function k(m){return m===null?n(m):m===93?(e.consume(m),S):P(m)?(l=k,Y(m)):(e.consume(m),k)}function S(m){return m===93?(e.consume(m),y):k(m)}function y(m){return m===62?G(m):m===93?(e.consume(m),y):k(m)}function A(m){return m===null||m===62?G(m):P(m)?(l=A,Y(m)):(e.consume(m),A)}function E(m){return m===null?n(m):m===63?(e.consume(m),F):P(m)?(l=E,Y(m)):(e.consume(m),E)}function F(m){return m===62?G(m):E(m)}function R(m){return Z(m)?(e.consume(m),w):n(m)}function w(m){return m===45||K(m)?(e.consume(m),w):N(m)}function N(m){return P(m)?(l=N,Y(m)):_(m)?(e.consume(m),N):G(m)}function q(m){return m===45||K(m)?(e.consume(m),q):m===47||m===62||$(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),G):m===58||m===95||Z(m)?(e.consume(m),x):P(m)?(l=j,Y(m)):_(m)?(e.consume(m),j):G(m)}function x(m){return m===45||m===46||m===58||m===95||K(m)?(e.consume(m),x):T(m)}function T(m){return m===61?(e.consume(m),v):P(m)?(l=T,Y(m)):_(m)?(e.consume(m),T):j(m)}function v(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,H):P(m)?(l=v,Y(m)):_(m)?(e.consume(m),v):(e.consume(m),W)}function H(m){return m===i?(e.consume(m),i=void 0,B):m===null?n(m):P(m)?(l=H,Y(m)):(e.consume(m),H)}function W(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||$(m)?j(m):(e.consume(m),W)}function B(m){return m===47||m===62||$(m)?j(m):n(m)}function G(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function Y(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return _(m)?M(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const et={name:"labelEnd",resolveAll:Qo,resolveTo:Go,tokenize:Ko},Wo={tokenize:Jo},Xo={tokenize:Zo},Yo={tokenize:ea};function Qo(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ie(e,0,e.length,n),e}function Go(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={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",u,t],["enter",s,t]],a=le(a,e.slice(o+1,o+r+3)),a=le(a,[["enter",f,t]]),a=le(a,hn(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=le(a,[["exit",f,t],e[l-2],e[l-1],["exit",s,t]]),a=le(a,e.slice(l+1)),a=le(a,[["exit",u,t]]),ie(e,o,e.length,a),e}function Ko(e,t,n){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(ce(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(Wo,f,l?f:c)(p):p===91?e.attempt(Xo,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(Yo,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function Jo(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return $(c)?Ve(e,o)(c):o(c)}function o(c){return c===41?f(c):Dr(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return $(c)?Ve(e,u)(c):f(c)}function a(c){return n(c)}function u(c){return c===34||c===39||c===40?Rr(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return $(c)?Ve(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Zo(e,t,n){const r=this;return i;function i(a){return Fr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function ea(e,t,n){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"),t):n(o)}}const na={name:"labelStartImage",resolveAll:et.resolveAll,tokenize:ta};function ta(e,t,n){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):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ra={name:"labelStartLink",resolveAll:et.resolveAll,tokenize:ia};function ia(e,t,n){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?n(l):t(l)}}const bn={name:"lineEnding",tokenize:la};function la(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),M(e,t,"linePrefix")}}const nn={name:"thematicBreak",tokenize:oa};function oa(e,t,n){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||P(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),_(s)?M(e,a,"whitespace")(s):a(s))}}const ee={continuation:{tokenize:ca},exit:ha,name:"list",tokenize:sa},aa={partial:!0,tokenize:pa},ua={partial:!0,tokenize:fa};function sa(e,t,n){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:Mn(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(nn,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Mn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ye,r.interrupt?n:f,e.attempt(aa,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return _(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function ca(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ye,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,M(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!_(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(ua,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,M(e,e.attempt(ee,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function fa(e,t,n){const r=this;return M(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?t(o):n(o)}}function ha(e){e.exit(this.containerState.type)}function pa(e,t,n){const r=this;return M(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!_(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Rt={name:"setextUnderline",resolveTo:ma,tokenize:ga};function ma(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);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,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function ga(e,t,n){const r=this;let i;return o;function o(s){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=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),_(s)?M(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||P(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const da={tokenize:ya};function ya(e){const t=this,n=e.attempt(Ye,r,e.attempt(this.parser.constructs.flowInitial,i,M(e,e.attempt(this.parser.constructs.flow,i,e.attempt(So,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ka={resolveAll:Or()},xa=_r("string"),ba=_r("text");function _r(e){return{resolveAll:Or(e==="text"?wa:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(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 Or(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function wa(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const s={type:n===e.length||u||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={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(n,0,["enter",s,t],["exit",s,t]),n+=2)}n++}return e}const Sa={42:ee,43:ee,45:ee,48:ee,49:ee,50:ee,51:ee,52:ee,53:ee,54:ee,55:ee,56:ee,57:ee,62:vr},Ca={91:To},Ea={[-2]:xn,[-1]:xn,32:xn},Ia={35:Fo,42:nn,45:[Rt,nn],60:Mo,61:Rt,95:nn,96:Dt,126:Dt},Aa={38:Lr,92:Pr},Ta={[-5]:bn,[-4]:bn,[-3]:bn,33:na,38:Lr,42:Nn,60:[to,$o],91:ra,92:[zo,Pr],93:et,95:Nn,96:go},va={null:[Nn,ka]},Pa={null:[42,95]},La={null:[]},za=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Pa,contentInitial:Ca,disable:La,document:Sa,flow:Ia,flowInitial:Ea,insideSpan:va,string:Aa,text:Ta},Symbol.toStringTag,{value:"Module"}));function Da(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:N(R),check:N(w),consume:A,enter:E,exit:F,interrupt:N(w,{interrupt:!0})},s={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=t.tokenize.call(s,u);return t.resolveAll&&o.push(t),s;function c(T){return l=le(l,T),S(),l[l.length-1]!==null?[]:(q(t,0),s.events=hn(o,s.events,s),s.events)}function p(T,v){return Ra(h(T),v)}function h(T){return Fa(l,T)}function g(){const{_bufferIndex:T,_index:v,line:H,column:W,offset:B}=r;return{_bufferIndex:T,_index:v,line:H,column:W,offset:B}}function k(T){i[T.line]=T.column,x()}function S(){let T;for(;r._index<l.length;){const v=l[r._index];if(typeof v=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<v.length;)y(v.charCodeAt(r._bufferIndex));else y(v)}}function y(T){f=f(T)}function A(T){P(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,x()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function E(T,v){const H=v||{};return H.type=T,H.start=g(),s.events.push(["enter",H,s]),a.push(H),H}function F(T){const v=a.pop();return v.end=g(),s.events.push(["exit",v,s]),v}function R(T,v){q(T,v.from)}function w(T,v){v.restore()}function N(T,v){return H;function H(W,B,G){let Y,oe,pe,m;return Array.isArray(W)?me(W):"tokenize"in W?me([W]):ae(W);function ae(Q){return Me;function Me(xe){const Pe=xe!==null&&Q[xe],Le=xe!==null&&Q.null,Ge=[...Array.isArray(Pe)?Pe:Pe?[Pe]:[],...Array.isArray(Le)?Le:Le?[Le]:[]];return me(Ge)(xe)}}function me(Q){return Y=Q,oe=0,Q.length===0?G:d(Q[oe])}function d(Q){return Me;function Me(xe){return m=j(),pe=Q,Q.partial||(s.currentConstruct=Q),Q.name&&s.parser.constructs.disable.null.includes(Q.name)?Se():Q.tokenize.call(v?Object.assign(Object.create(s),v):s,u,ue,Se)(xe)}}function ue(Q){return T(pe,m),B}function Se(Q){return m.restore(),++oe<Y.length?d(Y[oe]):G}}}function q(T,v){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&ie(s.events,v,s.events.length-v,T.resolve(s.events.slice(v),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function j(){const T=g(),v=s.previous,H=s.currentConstruct,W=s.events.length,B=Array.from(a);return{from:W,restore:G};function G(){r=T,s.previous=v,s.currentConstruct=H,s.events.length=W,a=B,x()}}function x(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Fa(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,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 Ra(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
3
|
-
`;break}case-3:{
|
|
4
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function _a(e){const r={constructs:Ar([za,...(e||{}).extensions||[]]),content:i(Ql),defined:[],document:i(Kl),flow:i(da),lazy:{},string:i(xa),text:i(ba)};return r;function i(o){return l;function l(a){return Da(r,o,a)}}}function Oa(e){for(;!zr(e););return e}const _t=/[\0\t\n\r]/g;function Ma(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(_t.lastIndex=c,s=_t.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){t=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Na=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ba(e){return e.replace(Na,ja)}function ja(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Tr(n.slice(o?2:1),o?16:10)}return Zn(n)||e}const Mr={}.hasOwnProperty;function Ha(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ua(n)(Oa(_a(n).document().write(Ma()(e,t,!0))))}function Ua(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(pt),autolinkProtocol:j,autolinkEmail:j,atxHeading:o(ct),blockQuote:o(Le),characterEscape:j,characterReference:j,codeFenced:o(Ge),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Ge,l),codeText:o(ki,l),codeTextData:j,data:j,codeFlowValue:j,definition:o(xi),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(bi),hardBreakEscape:o(ft),hardBreakTrailing:o(ft),htmlFlow:o(ht,l),htmlFlowData:j,htmlText:o(ht,l),htmlTextData:j,image:o(wi),label:l,link:o(pt),listItem:o(Si),listItemValue:p,listOrdered:o(mt,c),listUnordered:o(mt),paragraph:o(Ci),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(ct),strong:o(Ei),thematicBreak:o(Ai)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:Pe,autolinkProtocol:xe,blockQuote:u(),characterEscapeValue:x,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:Q,characterReference:Me,codeFenced:u(S),codeFencedFence:k,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:x,codeIndented:u(y),codeText:u(B),codeTextData:x,data:x,definition:u(),definitionDestinationString:F,definitionLabelString:A,definitionTitleString:E,emphasis:u(),hardBreakEscape:u(v),hardBreakTrailing:u(v),htmlFlow:u(H),htmlFlowData:x,htmlText:u(W),htmlTextData:x,image:u(Y),label:pe,labelText:oe,lineEnding:T,link:u(G),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ue,resourceDestinationString:m,resourceTitleString:ae,resource:me,setextHeading:u(q),setextHeadingLineSequence:N,setextHeadingText:w,strong:u(),thematicBreak:u()}};Nr(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(b){let I={type:"root",children:[]};const D={stack:[I],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:f,data:n},O=[];let U=-1;for(;++U<b.length;)if(b[U][1].type==="listOrdered"||b[U][1].type==="listUnordered")if(b[U][0]==="enter")O.push(U);else{const se=O.pop();U=i(b,se,U)}for(U=-1;++U<b.length;){const se=t[b[U][0]];Mr.call(se,b[U][1].type)&&se[b[U][1].type].call(Object.assign({sliceSerialize:b[U][2].sliceSerialize},D),b[U][1])}if(D.tokenStack.length>0){const se=D.tokenStack[D.tokenStack.length-1];(se[1]||Ot).call(D,void 0,se[0])}for(I.position={start:be(b.length>0?b[0][1].start:{line:1,column:1,offset:0}),end:be(b.length>0?b[b.length-2][1].end:{line:1,column:1,offset:0})},U=-1;++U<t.transforms.length;)I=t.transforms[U](I)||I;return I}function i(b,I,D){let O=I-1,U=-1,se=!1,Ce,ge,Ne,Be;for(;++O<=D;){const te=b[O];switch(te[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{te[0]==="enter"?U++:U--,Be=void 0;break}case"lineEndingBlank":{te[0]==="enter"&&(Ce&&!Be&&!U&&!Ne&&(Ne=O),Be=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Be=void 0}if(!U&&te[0]==="enter"&&te[1].type==="listItemPrefix"||U===-1&&te[0]==="exit"&&(te[1].type==="listUnordered"||te[1].type==="listOrdered")){if(Ce){let ze=O;for(ge=void 0;ze--;){const de=b[ze];if(de[1].type==="lineEnding"||de[1].type==="lineEndingBlank"){if(de[0]==="exit")continue;ge&&(b[ge][1].type="lineEndingBlank",se=!0),de[1].type="lineEnding",ge=ze}else if(!(de[1].type==="linePrefix"||de[1].type==="blockQuotePrefix"||de[1].type==="blockQuotePrefixWhitespace"||de[1].type==="blockQuoteMarker"||de[1].type==="listItemIndent"))break}Ne&&(!ge||Ne<ge)&&(Ce._spread=!0),Ce.end=Object.assign({},ge?b[ge][1].start:te[1].end),b.splice(ge||O,0,["exit",Ce,te[2]]),O++,D++}if(te[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},te[1].start),end:void 0};Ce=ze,b.splice(O,0,["enter",ze,te[2]]),O++,D++,Ne=void 0,Be=!0}}}return b[I][1]._spread=se,D}function o(b,I){return D;function D(O){a.call(this,b(O),O),I&&I.call(this,O)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(b,I,D){this.stack[this.stack.length-1].children.push(b),this.stack.push(b),this.tokenStack.push([I,D||void 0]),b.position={start:be(I.start),end:void 0}}function u(b){return I;function I(D){b&&b.call(this,D),s.call(this,D)}}function s(b,I){const D=this.stack.pop(),O=this.tokenStack.pop();if(O)O[0].type!==b.type&&(I?I.call(this,b,O[0]):(O[1]||Ot).call(this,b,O[0]));else throw new Error("Cannot close `"+b.type+"` ("+Ue({start:b.start,end:b.end})+"): it’s not open");D.position.end=be(b.end)}function f(){return Jn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(b){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(b),10),this.data.expectingFirstListItemValue=void 0}}function h(){const b=this.resume(),I=this.stack[this.stack.length-1];I.lang=b}function g(){const b=this.resume(),I=this.stack[this.stack.length-1];I.meta=b}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const b=this.resume(),I=this.stack[this.stack.length-1];I.value=b.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const b=this.resume(),I=this.stack[this.stack.length-1];I.value=b.replace(/(\r?\n|\r)$/g,"")}function A(b){const I=this.resume(),D=this.stack[this.stack.length-1];D.label=I,D.identifier=ce(this.sliceSerialize(b)).toLowerCase()}function E(){const b=this.resume(),I=this.stack[this.stack.length-1];I.title=b}function F(){const b=this.resume(),I=this.stack[this.stack.length-1];I.url=b}function R(b){const I=this.stack[this.stack.length-1];if(!I.depth){const D=this.sliceSerialize(b).length;I.depth=D}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function N(b){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(b).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function j(b){const D=this.stack[this.stack.length-1].children;let O=D[D.length-1];(!O||O.type!=="text")&&(O=Ii(),O.position={start:be(b.start),end:void 0},D.push(O)),this.stack.push(O)}function x(b){const I=this.stack.pop();I.value+=this.sliceSerialize(b),I.position.end=be(b.end)}function T(b){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=I.children[I.children.length-1];D.position.end=be(b.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&(j.call(this,b),x.call(this,b))}function v(){this.data.atHardBreak=!0}function H(){const b=this.resume(),I=this.stack[this.stack.length-1];I.value=b}function W(){const b=this.resume(),I=this.stack[this.stack.length-1];I.value=b}function B(){const b=this.resume(),I=this.stack[this.stack.length-1];I.value=b}function G(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=I,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function Y(){const b=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";b.type+="Reference",b.referenceType=I,delete b.url,delete b.title}else delete b.identifier,delete b.label;this.data.referenceType=void 0}function oe(b){const I=this.sliceSerialize(b),D=this.stack[this.stack.length-2];D.label=Ba(I),D.identifier=ce(I).toLowerCase()}function pe(){const b=this.stack[this.stack.length-1],I=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const O=b.children;D.children=O}else D.alt=I}function m(){const b=this.resume(),I=this.stack[this.stack.length-1];I.url=b}function ae(){const b=this.resume(),I=this.stack[this.stack.length-1];I.title=b}function me(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ue(b){const I=this.resume(),D=this.stack[this.stack.length-1];D.label=I,D.identifier=ce(this.sliceSerialize(b)).toLowerCase(),this.data.referenceType="full"}function Se(b){this.data.characterReferenceType=b.type}function Q(b){const I=this.sliceSerialize(b),D=this.data.characterReferenceType;let O;D?(O=Tr(I,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):O=Zn(I);const U=this.stack[this.stack.length-1];U.value+=O}function Me(b){const I=this.stack.pop();I.position.end=be(b.end)}function xe(b){x.call(this,b);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(b)}function Pe(b){x.call(this,b);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(b)}function Le(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function ki(){return{type:"inlineCode",value:""}}function xi(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bi(){return{type:"emphasis",children:[]}}function ct(){return{type:"heading",depth:0,children:[]}}function ft(){return{type:"break"}}function ht(){return{type:"html",value:""}}function wi(){return{type:"image",title:null,url:"",alt:null}}function pt(){return{type:"link",title:null,url:"",children:[]}}function mt(b){return{type:"list",ordered:b.type==="listOrdered",start:null,spread:b._spread,children:[]}}function Si(b){return{type:"listItem",spread:b._spread,checked:null,children:[]}}function Ci(){return{type:"paragraph",children:[]}}function Ei(){return{type:"strong",children:[]}}function Ii(){return{type:"text",value:""}}function Ai(){return{type:"thematicBreak"}}}function be(e){return{line:e.line,column:e.column,offset:e.offset}}function Nr(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Nr(e,r):Va(e,r)}}function Va(e,t){let n;for(n in t)if(Mr.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ot(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ue({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ue({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ue({start:t.start,end:t.end})+") is still open")}function $a(e){const t=this;t.parser=n;function n(r){return Ha(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function qa(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Wa(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
5
|
-
`}]}function
|
|
6
|
-
`:"",r={},i=
|
|
7
|
-
`}),
|
|
8
|
-
`});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),me=require("react");class Ge extends Error{constructor(n,t){super(t),this.status=n}}function Tn(e,n){return{Authorization:`Bearer ${e}`,"Content-Type":"application/json",...n?{"X-Merchant-Id":n}:{}}}async function Lr(e,n,t){const r=await fetch(`${e}/chat/init`,{headers:Tn(n,t)});if(!r.ok)throw new Ge(r.status,await r.text());return r.json()}async function Dr(e,n,t,r){const i=await fetch(`${e}/chat`,{method:"POST",headers:Tn(n,r),body:JSON.stringify({message:t})});if(!i.ok)throw new Ge(i.status,await i.text());return i.json()}async function Nr(e,n,t){const r=await fetch(`${e}/chat`,{method:"DELETE",headers:Tn(n,t)});if(!r.ok)throw new Ge(r.status,await r.text());return r.json()}const tn=()=>Math.random().toString(36).slice(2);function Mt(e,n,t){const[r,i]=me.useState([]),[l,o]=me.useState([]),[a,s]=me.useState(!1),[u,c]=me.useState(null);return{messages:r,suggestedReplies:l,loading:a,error:u,init:async()=>{if(!(a||r.length>0)){s(!0);try{const g=await Lr(n,e,t),k=g.existingSession?g.messages??[]:g.reply?[{role:"assistant",content:g.reply}]:[];i(k.map(E=>({...E,id:tn(),timestamp:new Date}))),o(g.suggestedReplies)}catch(g){c(g instanceof Ge&&g.status===401?"The login session is invalid.":"Unable to connect to the chatbot.")}finally{s(!1)}}},send:async g=>{if(!g.trim()||a)return;const k={id:tn(),role:"user",content:g.trim(),timestamp:new Date};i(E=>[...E,k]),o([]),c(null),s(!0);try{const E=await Dr(n,e,g.trim(),t);i(w=>[...w,{id:tn(),role:"assistant",content:E.reply,timestamp:new Date,usage:E.usage}]),o(E.suggestedReplies)}catch{c("Unable to send the message. Please try again.")}finally{s(!1)}},clear:async()=>{if(!a){s(!0);try{await Nr(n,e,t),i([]),o([]),c(null)}catch{c("Unable to clear the session. Please try again.")}finally{s(!1)}}}}}function Or(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Fr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_r=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rr={};function Yn(e,n){return(Rr.jsx?_r:Fr).test(e)}const Mr=/[ \t\n\f\r]/g;function Br(e){return typeof e=="object"?e.type==="text"?Qn(e.value):!1:Qn(e)}function Qn(e){return e.replace(Mr,"")===""}class je{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}je.prototype.normal={};je.prototype.property={};je.prototype.space=void 0;function Bt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new je(t,r,n)}function mn(e){return e.toLowerCase()}class Z{constructor(n,t){this.attribute=t,this.property=n}}Z.prototype.attribute="";Z.prototype.booleanish=!1;Z.prototype.boolean=!1;Z.prototype.commaOrSpaceSeparated=!1;Z.prototype.commaSeparated=!1;Z.prototype.defined=!1;Z.prototype.mustUseProperty=!1;Z.prototype.number=!1;Z.prototype.overloadedBoolean=!1;Z.prototype.property="";Z.prototype.spaceSeparated=!1;Z.prototype.space=void 0;let jr=0;const P=Ce(),W=Ce(),gn=Ce(),b=Ce(),B=Ce(),Se=Ce(),ne=Ce();function Ce(){return 2**++jr}const yn=Object.freeze(Object.defineProperty({__proto__:null,boolean:P,booleanish:W,commaOrSpaceSeparated:ne,commaSeparated:Se,number:b,overloadedBoolean:gn,spaceSeparated:B},Symbol.toStringTag,{value:"Module"})),rn=Object.keys(yn);class An extends Z{constructor(n,t,r,i){let l=-1;if(super(n,t),Kn(this,"space",i),typeof r=="number")for(;++l<rn.length;){const o=rn[l];Kn(this,rn[l],(r&yn[o])===yn[o])}}}An.prototype.defined=!0;function Kn(e,n,t){t&&(e[n]=t)}function ve(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new An(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[mn(r)]=r,t[mn(l.attribute)]=r}return new je(n,t,e.space)}const jt=ve({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:b,ariaColIndex:b,ariaColSpan:b,ariaControls:B,ariaCurrent:null,ariaDescribedBy:B,ariaDetails:null,ariaDisabled:W,ariaDropEffect:B,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:B,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B,ariaLevel:b,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:B,ariaPlaceholder:null,ariaPosInSet:b,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:B,ariaRowCount:b,ariaRowIndex:b,ariaRowSpan:b,ariaSelected:W,ariaSetSize:b,ariaSort:null,ariaValueMax:b,ariaValueMin:b,ariaValueNow:b,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ut(e,n){return n in e?e[n]:n}function Ht(e,n){return Ut(e,n.toLowerCase())}const Ur=ve({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Se,acceptCharset:B,accessKey:B,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alpha:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:B,autoFocus:P,autoPlay:P,blocking:B,capture:null,charSet:null,checked:P,cite:null,className:B,closedBy:null,colorSpace:null,cols:b,colSpan:b,command:null,commandFor:null,content:null,contentEditable:W,controls:P,controlsList:B,coords:b|Se,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:gn,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:B,height:b,hidden:gn,high:b,href:null,hrefLang:null,htmlFor:B,httpEquiv:B,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:B,itemRef:B,itemScope:P,itemType:B,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:b,manifest:null,max:null,maxLength:b,media:null,method:null,min:null,minLength:b,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,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:P,optimum:b,pattern:null,ping:B,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:B,required:P,reversed:P,rows:b,rowSpan:b,sandbox:B,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootCustomElementRegistry:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shadowRootSerializable:P,shape:null,size:b,sizes:null,slot:null,span:b,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:b,step:null,style:null,tabIndex:b,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:W,width:b,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B,axis:null,background:null,bgColor:null,border:b,borderColor:null,bottomMargin:b,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:b,leftMargin:b,link:null,longDesc:null,lowSrc:null,marginHeight:b,marginWidth:b,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:b,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:b,valueType:null,version:null,vAlign:null,vLink:null,vSpace:b,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:P,disablePictureInPicture:P,disableRemotePlayback:P,exportParts:Se,part:B,prefix:null,property:null,results:b,security:null,unselectable:null},space:"html",transform:Ht}),Hr=ve({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",maskType:"mask-type",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:ne,accentHeight:b,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:b,amplitude:b,arabicForm:null,ascent:b,attributeName:null,attributeType:null,azimuth:b,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:b,by:null,calcMode:null,capHeight:b,className:B,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:b,diffuseConstant:b,direction:null,display:null,dur:null,divisor:b,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:b,enableBackground:null,end:null,event:null,exponent:b,externalResourcesRequired:null,fill:null,fillOpacity:b,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:Se,g2:Se,glyphName:Se,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:b,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:b,horizOriginX:b,horizOriginY:b,id:null,ideographic:b,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:b,k:b,k1:b,k2:b,k3:b,k4:b,kernelMatrix:ne,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:b,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:b,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:b,overlineThickness:b,paintOrder:null,panose1:null,path:null,pathLength:b,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:b,pointsAtY:b,pointsAtZ:b,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ne,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ne,rev:ne,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ne,requiredFeatures:ne,requiredFonts:ne,requiredFormats:ne,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:b,specularExponent:b,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:b,strikethroughThickness:b,string:null,stroke:null,strokeDashArray:ne,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:b,strokeOpacity:b,strokeWidth:null,style:null,surfaceScale:b,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ne,tabIndex:b,tableValues:null,target:null,targetX:b,targetY:b,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ne,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:b,underlineThickness:b,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:b,values:null,vAlphabetic:b,vMathematical:b,vectorEffect:null,vHanging:b,vIdeographic:b,version:null,vertAdvY:b,vertOriginX:b,vertOriginY:b,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:b,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ut}),Vt=ve({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()}}),qt=ve({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ht}),$t=ve({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),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"},qr=/[A-Z]/g,Gn=/-[a-z]/g,$r=/^data[-\w.:]+$/i;function Wr(e,n){const t=mn(n);let r=n,i=Z;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&$r.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Gn,Yr);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Gn.test(l)){let o=l.replace(qr,Xr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=An}return new i(r,n)}function Xr(e){return"-"+e.toLowerCase()}function Yr(e){return e.charAt(1).toUpperCase()}const Qr=Bt([jt,Ur,Vt,qt,$t],"html"),Pn=Bt([jt,Hr,Vt,qt,$t],"svg");function Kr(e){return e.join(" ").trim()}var Ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vn={},Jn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Gr=/\n/g,Jr=/^\s*/,Zr=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ei=/^:\s*/,ni=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ti=/^[;\s]*/,ri=/^\s+|\s+$/g,ii=`
|
|
2
|
+
`,Zn="/",et="*",we="",li="comment",oi="declaration";function ai(e,n){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];n=n||{};var t=1,r=1;function i(g){var k=g.match(Gr);k&&(t+=k.length);var E=g.lastIndexOf(ii);r=~E?g.length-E:r+g.length}function l(){var g={line:t,column:r};return function(k){return k.position=new o(g),u(),k}}function o(g){this.start=g,this.end={line:t,column:r},this.source=n.source}o.prototype.content=e;function a(g){var k=new Error(n.source+":"+t+":"+r+": "+g);if(k.reason=g,k.filename=n.source,k.line=t,k.column=r,k.source=e,!n.silent)throw k}function s(g){var k=g.exec(e);if(k){var E=k[0];return i(E),e=e.slice(E.length),k}}function u(){s(Jr)}function c(g){var k;for(g=g||[];k=f();)k!==!1&&g.push(k);return g}function f(){var g=l();if(!(Zn!=e.charAt(0)||et!=e.charAt(1))){for(var k=2;we!=e.charAt(k)&&(et!=e.charAt(k)||Zn!=e.charAt(k+1));)++k;if(k+=2,we===e.charAt(k-1))return a("End of comment missing");var E=e.slice(2,k-2);return r+=2,i(E),e=e.slice(k),r+=2,g({type:li,comment:E})}}function m(){var g=l(),k=s(Zr);if(k){if(f(),!s(ei))return a("property missing ':'");var E=s(ni),w=g({type:oi,property:nt(k[0].replace(Jn,we)),value:E?nt(E[0].replace(Jn,we)):we});return s(ti),w}}function p(){var g=[];c(g);for(var k;k=m();)k!==!1&&(g.push(k),c(g));return g}return u(),p()}function nt(e){return e?e.replace(ri,we):we}var ui=ai,si=Ye&&Ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vn,"__esModule",{value:!0});vn.default=pi;const ci=si(ui);function pi(e,n){let t=null;if(!e||typeof e!="string")return t;const r=(0,ci.default)(e),i=typeof n=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:a}=l;i?n(o,a,l):a&&(t=t||{},t[o]=a)}),t}var Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.camelCase=void 0;var fi=/^--[a-zA-Z0-9_-]+$/,hi=/-([a-z])/g,di=/^[^-]+$/,mi=/^-(webkit|moz|ms|o|khtml)-/,gi=/^-(ms)-/,yi=function(e){return!e||di.test(e)||fi.test(e)},xi=function(e,n){return n.toUpperCase()},tt=function(e,n){return"".concat(n,"-")},ki=function(e,n){return n===void 0&&(n={}),yi(e)?e:(e=e.toLowerCase(),n.reactCompat?e=e.replace(gi,tt):e=e.replace(mi,tt),e.replace(hi,xi))};Je.camelCase=ki;var bi=Ye&&Ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},wi=bi(vn),Si=Je;function xn(e,n){var t={};return!e||typeof e!="string"||(0,wi.default)(e,function(r,i){r&&i&&(t[(0,Si.camelCase)(r,n)]=i)}),t}xn.default=xn;var Ci=xn;const Ei=Wt(Ci),Xt=Yt("end"),zn=Yt("start");function Yt(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 Ii(e){const n=zn(e),t=Xt(e);if(n&&t)return{start:n,end:t}}function _e(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?rt(e.position):"start"in e||"end"in e?rt(e):"line"in e||"column"in e?kn(e):""}function kn(e){return it(e&&e.line)+":"+it(e&&e.column)}function rt(e){return kn(e&&e.start)+"-"+kn(e&&e.end)}function it(e){return e&&typeof e=="number"?e:1}class K 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=_e(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=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const Ln={}.hasOwnProperty,Ti=new Map,Ai=/[A-Z]/g,Pi=new Set(["table","tbody","thead","tfoot","tr"]),vi=new Set(["td","th"]),Qt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function zi(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=Mi(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=Ri(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:Qr,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Kt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Kt(e,n,t){if(n.type==="element")return Li(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Di(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return Oi(e,n,t);if(n.type==="mdxjsEsm")return Ni(e,n);if(n.type==="root")return Fi(e,n,t);if(n.type==="text")return _i(e,n)}function Li(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Pn,e.schema=i),e.ancestors.push(n);const l=Jt(e,n.tagName,!1),o=Bi(e,n);let a=Nn(e,n);return Pi.has(n.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Br(s):!0})),Gt(e,o,l,n),Dn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Di(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 Ni(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Be(e,n.position)}function Oi(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=Pn,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:Jt(e,n.name,!0),o=ji(e,n),a=Nn(e,n);return Gt(e,o,l,n),Dn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Fi(e,n,t){const r={};return Dn(r,Nn(e,n)),e.create(n,e.Fragment,r,t)}function _i(e,n){return n.value}function Gt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function Dn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function Ri(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 Mi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),s=zn(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 Bi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Ln.call(n.properties,i)){const l=Ui(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&vi.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 ji(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 Nn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Ti;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=Kt(e,l,o);a!==void 0&&t.push(a)}return t}function Ui(e,n,t){const r=Wr(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Or(t):Kr(t)),r.property==="style"){let i=typeof t=="object"?t:Hi(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Vi(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Vr[r.property]||r.property:r.attribute,t]}}function Hi(e,n){try{return Ei(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new K("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=Qt+"#cannot-parse-style-attribute",i}}function Jt(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=Yn(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=Yn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Ln.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 K("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=Qt+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Vi(e){const n={};let t;for(t in e)Ln.call(e,t)&&(n[qi(t)]=e[t]);return n}function qi(e){let n=e.replace(Ai,$i);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function $i(e){return"-"+e.toLowerCase()}const ln={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"]},Wi={};function Xi(e,n){const t=Wi,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Zt(e,r,i)}function Zt(e,n,t){if(Yi(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 lt(e.children,n,t)}return Array.isArray(e)?lt(e,n,t):""}function lt(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Zt(e[i],n,t);return r.join("")}function Yi(e){return!!(e&&typeof e=="object")}const ot=document.createElement("i");function On(e){const n="&"+e+";";ot.innerHTML=n;const t=ot.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ce(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?(ce(e,e.length,0,n),e):n}const at={}.hasOwnProperty;function Qi(e){const n={};let t=-1;for(;++t<e.length;)Ki(n,e[t]);return n}function Ki(e,n){let t;for(t in n){const i=(at.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){at.call(i,o)||(i[o]=[]);const a=l[o];Gi(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Gi(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ce(e,0,0,r)}function er(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 Pe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const se=xe(/[A-Za-z]/),te=xe(/[\dA-Za-z]/),Ji=xe(/[#-'*+\--9=?A-Z^-~]/);function bn(e){return e!==null&&(e<32||e===127)}const wn=xe(/\d/),Zi=xe(/[\dA-Fa-f]/),el=xe(/[!-/:-@[-`{-~]/);function A(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const nl=xe(new RegExp("\\p{P}|\\p{S}","u")),tl=xe(/\s/);function xe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ze(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&te(e.charCodeAt(t+1))&&te(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 j(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(s){return O(s)?(e.enter(t),a(s)):n(s)}function a(s){return O(s)&&l++<i?(e.consume(s),a):(e.exit(t),n(s))}}const rl={tokenize:il};function il(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"),j(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 A(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const ll={tokenize:ol},ut={tokenize:al};function ol(e){const n=this,t=[];let r=0,i,l,o;return a;function a(C){if(r<t.length){const F=t[r];return n.containerState=F[1],e.attempt(F[0].continuation,s,u)(C)}return u(C)}function s(C){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const F=n.events.length;let U=F,x;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){x=n.events[U][1].end;break}w(r);let _=F;for(;_<n.events.length;)n.events[_][1].end={...x},_++;return ce(n.events,U+1,0,n.events.slice(F)),n.events.length=_,u(C)}return a(C)}function u(C){if(r===t.length){if(!i)return m(C);if(i.currentConstruct&&i.currentConstruct.concrete)return g(C);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(ut,c,f)(C)}function c(C){return i&&v(),w(r),m(C)}function f(C){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,g(C)}function m(C){return n.containerState={},e.attempt(ut,p,g)(C)}function p(C){return r++,t.push([n.currentConstruct,n.containerState]),m(C)}function g(C){if(C===null){i&&v(),w(0),e.consume(C);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),k(C)}function k(C){if(C===null){E(e.exit("chunkFlow"),!0),w(0),e.consume(C);return}return A(C)?(e.consume(C),E(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(C),k)}function E(C,F){const U=n.sliceStream(C);if(F&&U.push(null),C.previous=l,l&&(l.next=C),l=C,i.defineSkip(C.start),i.write(U),n.parser.lazy[C.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<o&&(!i.events[x][1].end||i.events[x][1].end.offset>o))return;const _=n.events.length;let q=_,R,H;for(;q--;)if(n.events[q][0]==="exit"&&n.events[q][1].type==="chunkFlow"){if(R){H=n.events[q][1].end;break}R=!0}for(w(r),x=_;x<n.events.length;)n.events[x][1].end={...H},x++;ce(n.events,q+1,0,n.events.slice(_)),n.events.length=x}}function w(C){let F=t.length;for(;F-- >C;){const U=t[F];n.containerState=U[1],U[0].exit.call(n,e)}t.length=C}function v(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function al(e,n,t){return j(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function st(e){if(e===null||J(e)||tl(e))return 1;if(nl(e))return 2}function Fn(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 Sn={name:"attention",resolveAll:ul,tokenize:sl};function ul(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},m={...e[t][1].start};ct(f,-s),ct(m,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:m},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,Fn(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,ce(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 sl(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=st(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=st(s),f=!c||c===2&&i||t.includes(s),m=!i||i===2&&c||t.includes(r);return u._open=!!(l===42?f:f&&(i||!m)),u._close=!!(l===42?m:m&&(c||!f)),n(s)}}function ct(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const cl={name:"autolink",tokenize:pl};function pl(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 se(p)?(e.consume(p),o):p===64?t(p):u(p)}function o(p){return p===43||p===45||p===46||te(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||te(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||bn(p)?t(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),c):Ji(p)?(e.consume(p),u):t(p)}function c(p){return te(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):m(p)}function m(p){if((p===45||te(p))&&r++<63){const g=p===45?m:f;return e.consume(p),g}return t(p)}}const Ze={partial:!0,tokenize:fl};function fl(e,n,t){return r;function r(l){return O(l)?j(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||A(l)?n(l):t(l)}}const nr={continuation:{tokenize:dl},exit:ml,name:"blockQuote",tokenize:hl};function hl(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(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function dl(e,n,t){const r=this;return i;function i(o){return O(o)?j(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(nr,n,t)(o)}}function ml(e){e.exit("blockQuote")}const tr={name:"characterEscape",tokenize:gl};function gl(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 el(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const rr={name:"characterReference",tokenize:yl};function yl(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=te,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=Zi,c):(e.enter("characterReferenceValue"),l=7,o=wn,c(f))}function c(f){if(f===59&&i){const m=e.exit("characterReferenceValue");return o===te&&!On(r.sliceSerialize(m))?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 pt={partial:!0,tokenize:kl},ft={concrete:!0,name:"codeFenced",tokenize:xl};function xl(e,n,t){const r=this,i={partial:!0,tokenize:U};let l=0,o=0,a;return s;function s(x){return u(x)}function u(x){const _=r.events[r.events.length-1];return l=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(x)}function c(x){return x===a?(o++,e.consume(x),c):o<3?t(x):(e.exit("codeFencedFenceSequence"),O(x)?j(e,f,"whitespace")(x):f(x))}function f(x){return x===null||A(x)?(e.exit("codeFencedFence"),r.interrupt?n(x):e.check(pt,k,F)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||A(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(x)):O(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),j(e,p,"whitespace")(x)):x===96&&x===a?t(x):(e.consume(x),m)}function p(x){return x===null||A(x)?f(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||A(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(x)):x===96&&x===a?t(x):(e.consume(x),g)}function k(x){return e.attempt(i,F,E)(x)}function E(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),w}function w(x){return l>0&&O(x)?j(e,v,"linePrefix",l+1)(x):v(x)}function v(x){return x===null||A(x)?e.check(pt,k,F)(x):(e.enter("codeFlowValue"),C(x))}function C(x){return x===null||A(x)?(e.exit("codeFlowValue"),v(x)):(e.consume(x),C)}function F(x){return e.exit("codeFenced"),n(x)}function U(x,_,q){let R=0;return H;function H(N){return x.enter("lineEnding"),x.consume(N),x.exit("lineEnding"),T}function T(N){return x.enter("codeFencedFence"),O(N)?j(x,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):I(N)}function I(N){return N===a?(x.enter("codeFencedFenceSequence"),V(N)):q(N)}function V(N){return N===a?(R++,x.consume(N),V):R>=o?(x.exit("codeFencedFenceSequence"),O(N)?j(x,$,"whitespace")(N):$(N)):q(N)}function $(N){return N===null||A(N)?(x.exit("codeFencedFence"),_(N)):q(N)}}}function kl(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 on={name:"codeIndented",tokenize:wl},bl={partial:!0,tokenize:Sl};function wl(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),j(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):A(u)?e.attempt(bl,o,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||A(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),n(u)}}function Sl(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):j(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):A(o)?i(o):t(o)}}const Cl={name:"codeText",previous:Il,resolve:El,tokenize:Tl};function El(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 Il(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Tl(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)):A(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||A(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 Al{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&&Oe(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),Oe(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Oe(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);Oe(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Oe(this.left,t.reverse())}}}function Oe(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 ir(e){const n={};let t=-1,r,i,l,o,a,s,u;const c=new Al(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,Pl(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"||o[1].type==="listItemIndent"))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 ce(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function Pl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,s=[],u={};let c,f,m=-1,p=t,g=0,k=0;const E=[k];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;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(k=m+1,E.push(k),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):E.pop(),m=E.length;m--;){const w=a.slice(E[m],E[m+1]),v=l.pop();s.push([v,v+w.length-1]),e.splice(v,2,w)}for(s.reverse(),m=-1;++m<s.length;)u[g+s[m][0]]=g+s[m][1],g+=s[m][1]-s[m][0]-1;return u}const vl={resolve:Ll,tokenize:Dl},zl={partial:!0,tokenize:Nl};function Ll(e){return ir(e),e}function Dl(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):A(a)?e.check(zl,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 Nl(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),j(e,l,"linePrefix")}function l(o){if(o===null||A(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 lr(e,n,t,r,i,l,o,a,s){const u=s||Number.POSITIVE_INFINITY;let c=0;return f;function f(w){return w===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(w),e.exit(l),m):w===null||w===32||w===41||bn(w)?t(w):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),k(w))}function m(w){return w===62?(e.enter(l),e.consume(w),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),m(w)):w===null||w===60||A(w)?t(w):(e.consume(w),w===92?g:p)}function g(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function k(w){return!c&&(w===null||w===41||J(w))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(w)):c<u&&w===40?(e.consume(w),c++,k):w===41?(e.consume(w),c--,k):w===null||w===32||w===40||bn(w)?t(w):(e.consume(w),w===92?E:k)}function E(w){return w===40||w===41||w===92?(e.consume(w),k):k(w)}}function or(e,n,t,r,i,l){const o=this;let a=0,s;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(l),c}function c(p){return a>999||p===null||p===91||p===93&&!s||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(e.exit(l),e.enter(i),e.consume(p),e.exit(i),e.exit(r),n):A(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||A(p)||a++>999?(e.exit("chunkString"),c(p)):(e.consume(p),s||(s=!O(p)),p===92?m:f)}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function ar(e,n,t,r,i,l){let o;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,s):t(m)}function s(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),n):(e.enter(l),u(m))}function u(m){return m===o?(e.exit(l),s(o)):m===null?t(m):A(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),j(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(m))}function c(m){return m===o||m===null||A(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?f:c)}function f(m){return m===o||m===92?(e.consume(m),c):c(m)}}function Re(e,n){let t;return r;function r(i){return A(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):O(i)?j(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const Ol={name:"definition",tokenize:_l},Fl={partial:!0,tokenize:Rl};function _l(e,n,t){const r=this;let i;return l;function l(p){return e.enter("definition"),o(p)}function o(p){return or.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):t(p)}function s(p){return J(p)?Re(e,u)(p):u(p)}function u(p){return lr(e,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return e.attempt(Fl,f,f)(p)}function f(p){return O(p)?j(e,m,"whitespace")(p):m(p)}function m(p){return p===null||A(p)?(e.exit("definition"),r.parser.defined.push(i),n(p)):t(p)}}function Rl(e,n,t){return r;function r(a){return J(a)?Re(e,i)(a):t(a)}function i(a){return ar(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return O(a)?j(e,o,"whitespace")(a):o(a)}function o(a){return a===null||A(a)?n(a):t(a)}}const Ml={name:"hardBreakEscape",tokenize:Bl};function Bl(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return A(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const jl={name:"headingAtx",resolve:Ul,tokenize:Hl};function Ul(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ce(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function Hl(e,n,t){let r=0;return i;function i(c){return e.enter("atxHeading"),l(c)}function l(c){return e.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(e.consume(c),o):c===null||J(c)?(e.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),s(c)):c===null||A(c)?(e.exit("atxHeading"),n(c)):O(c)?j(e,a,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function s(c){return c===35?(e.consume(c),s):(e.exit("atxHeadingSequence"),a(c))}function u(c){return c===null||c===35||J(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),u)}}const Vl=["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"],ht=["pre","script","style","textarea"],ql={concrete:!0,name:"htmlFlow",resolveTo:Xl,tokenize:Yl},$l={partial:!0,tokenize:Kl},Wl={partial:!0,tokenize:Ql};function Xl(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 Yl(e,n,t){const r=this;let i,l,o,a,s;return u;function u(d){return c(d)}function c(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),f}function f(d){return d===33?(e.consume(d),m):d===47?(e.consume(d),l=!0,k):d===63?(e.consume(d),i=3,r.interrupt?n:h):se(d)?(e.consume(d),o=String.fromCharCode(d),E):t(d)}function m(d){return d===45?(e.consume(d),i=2,p):d===91?(e.consume(d),i=5,a=0,g):se(d)?(e.consume(d),i=4,r.interrupt?n:h):t(d)}function p(d){return d===45?(e.consume(d),r.interrupt?n:h):t(d)}function g(d){const oe="CDATA[";return d===oe.charCodeAt(a++)?(e.consume(d),a===oe.length?r.interrupt?n:I:g):t(d)}function k(d){return se(d)?(e.consume(d),o=String.fromCharCode(d),E):t(d)}function E(d){if(d===null||d===47||d===62||J(d)){const oe=d===47,ke=o.toLowerCase();return!oe&&!l&&ht.includes(ke)?(i=1,r.interrupt?n(d):I(d)):Vl.includes(o.toLowerCase())?(i=6,oe?(e.consume(d),w):r.interrupt?n(d):I(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):l?v(d):C(d))}return d===45||te(d)?(e.consume(d),o+=String.fromCharCode(d),E):t(d)}function w(d){return d===62?(e.consume(d),r.interrupt?n:I):t(d)}function v(d){return O(d)?(e.consume(d),v):H(d)}function C(d){return d===47?(e.consume(d),H):d===58||d===95||se(d)?(e.consume(d),F):O(d)?(e.consume(d),C):H(d)}function F(d){return d===45||d===46||d===58||d===95||te(d)?(e.consume(d),F):U(d)}function U(d){return d===61?(e.consume(d),x):O(d)?(e.consume(d),U):C(d)}function x(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),s=d,_):O(d)?(e.consume(d),x):q(d)}function _(d){return d===s?(e.consume(d),s=null,R):d===null||A(d)?t(d):(e.consume(d),_)}function q(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||J(d)?U(d):(e.consume(d),q)}function R(d){return d===47||d===62||O(d)?C(d):t(d)}function H(d){return d===62?(e.consume(d),T):t(d)}function T(d){return d===null||A(d)?I(d):O(d)?(e.consume(d),T):t(d)}function I(d){return d===45&&i===2?(e.consume(d),Q):d===60&&i===1?(e.consume(d),X):d===62&&i===4?(e.consume(d),le):d===63&&i===3?(e.consume(d),h):d===93&&i===5?(e.consume(d),pe):A(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check($l,fe,V)(d)):d===null||A(d)?(e.exit("htmlFlowData"),V(d)):(e.consume(d),I)}function V(d){return e.check(Wl,$,fe)(d)}function $(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),N}function N(d){return d===null||A(d)?V(d):(e.enter("htmlFlowData"),I(d))}function Q(d){return d===45?(e.consume(d),h):I(d)}function X(d){return d===47?(e.consume(d),o="",ie):I(d)}function ie(d){if(d===62){const oe=o.toLowerCase();return ht.includes(oe)?(e.consume(d),le):I(d)}return se(d)&&o.length<8?(e.consume(d),o+=String.fromCharCode(d),ie):I(d)}function pe(d){return d===93?(e.consume(d),h):I(d)}function h(d){return d===62?(e.consume(d),le):d===45&&i===2?(e.consume(d),h):I(d)}function le(d){return d===null||A(d)?(e.exit("htmlFlowData"),fe(d)):(e.consume(d),le)}function fe(d){return e.exit("htmlFlow"),n(d)}}function Ql(e,n,t){const r=this;return i;function i(o){return A(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Kl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Gl={name:"htmlText",tokenize:Jl};function Jl(e,n,t){const r=this;let i,l,o;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),s}function s(h){return h===33?(e.consume(h),u):h===47?(e.consume(h),U):h===63?(e.consume(h),C):se(h)?(e.consume(h),q):t(h)}function u(h){return h===45?(e.consume(h),c):h===91?(e.consume(h),l=0,g):se(h)?(e.consume(h),v):t(h)}function c(h){return h===45?(e.consume(h),p):t(h)}function f(h){return h===null?t(h):h===45?(e.consume(h),m):A(h)?(o=f,X(h)):(e.consume(h),f)}function m(h){return h===45?(e.consume(h),p):f(h)}function p(h){return h===62?Q(h):h===45?m(h):f(h)}function g(h){const le="CDATA[";return h===le.charCodeAt(l++)?(e.consume(h),l===le.length?k:g):t(h)}function k(h){return h===null?t(h):h===93?(e.consume(h),E):A(h)?(o=k,X(h)):(e.consume(h),k)}function E(h){return h===93?(e.consume(h),w):k(h)}function w(h){return h===62?Q(h):h===93?(e.consume(h),w):k(h)}function v(h){return h===null||h===62?Q(h):A(h)?(o=v,X(h)):(e.consume(h),v)}function C(h){return h===null?t(h):h===63?(e.consume(h),F):A(h)?(o=C,X(h)):(e.consume(h),C)}function F(h){return h===62?Q(h):C(h)}function U(h){return se(h)?(e.consume(h),x):t(h)}function x(h){return h===45||te(h)?(e.consume(h),x):_(h)}function _(h){return A(h)?(o=_,X(h)):O(h)?(e.consume(h),_):Q(h)}function q(h){return h===45||te(h)?(e.consume(h),q):h===47||h===62||J(h)?R(h):t(h)}function R(h){return h===47?(e.consume(h),Q):h===58||h===95||se(h)?(e.consume(h),H):A(h)?(o=R,X(h)):O(h)?(e.consume(h),R):Q(h)}function H(h){return h===45||h===46||h===58||h===95||te(h)?(e.consume(h),H):T(h)}function T(h){return h===61?(e.consume(h),I):A(h)?(o=T,X(h)):O(h)?(e.consume(h),T):R(h)}function I(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,V):A(h)?(o=I,X(h)):O(h)?(e.consume(h),I):(e.consume(h),$)}function V(h){return h===i?(e.consume(h),i=void 0,N):h===null?t(h):A(h)?(o=V,X(h)):(e.consume(h),V)}function $(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||J(h)?R(h):(e.consume(h),$)}function N(h){return h===47||h===62||J(h)?R(h):t(h)}function Q(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function X(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ie}function ie(h){return O(h)?j(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):pe(h)}function pe(h){return e.enter("htmlTextData"),o(h)}}const _n={name:"labelEnd",resolveAll:to,resolveTo:ro,tokenize:io},Zl={tokenize:lo},eo={tokenize:oo},no={tokenize:ao};function to(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&ce(e,0,e.length,t),e}function ro(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const s={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",s,n],["enter",u,n]],a=re(a,e.slice(l+1,l+r+3)),a=re(a,[["enter",c,n]]),a=re(a,Fn(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=re(a,[["exit",c,n],e[o-2],e[o-1],["exit",u,n]]),a=re(a,e.slice(o+1)),a=re(a,[["exit",s,n]]),ce(e,l,e.length,a),e}function io(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(m){return l?l._inactive?f(m):(o=r.parser.defined.includes(Pe(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),s):t(m)}function s(m){return m===40?e.attempt(Zl,c,o?c:f)(m):m===91?e.attempt(eo,c,o?u:f)(m):o?c(m):f(m)}function u(m){return e.attempt(no,c,f)(m)}function c(m){return n(m)}function f(m){return l._balanced=!0,t(m)}}function lo(e,n,t){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return J(f)?Re(e,l)(f):l(f)}function l(f){return f===41?c(f):lr(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function o(f){return J(f)?Re(e,s)(f):c(f)}function a(f){return t(f)}function s(f){return f===34||f===39||f===40?ar(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return J(f)?Re(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),n):t(f)}}function oo(e,n,t){const r=this;return i;function i(a){return or.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function ao(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const uo={name:"labelStartImage",resolveAll:_n.resolveAll,tokenize:so};function so(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const co={name:"labelStartLink",resolveAll:_n.resolveAll,tokenize:po};function po(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const an={name:"lineEnding",tokenize:fo};function fo(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),j(e,n,"linePrefix")}}const We={name:"thematicBreak",tokenize:ho};function ho(e,n,t){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||A(u))?(e.exit("thematicBreak"),n(u)):t(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?j(e,a,"whitespace")(u):a(u))}}const G={continuation:{tokenize:xo},exit:bo,name:"list",tokenize:yo},mo={partial:!0,tokenize:wo},go={partial:!0,tokenize:ko};function yo(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:wn(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(We,t,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return t(p)}function s(p){return wn(p)&&++o<10?(e.consume(p),s):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):t(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ze,r.interrupt?t:c,e.attempt(mo,m,f))}function c(p){return r.containerState.initialBlankLine=!0,l++,m(p)}function f(p){return O(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):t(p)}function m(p){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(p)}}function xo(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,j(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(go,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,j(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ko(e,n,t){const r=this;return j(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function bo(e){e.exit(this.containerState.type)}function wo(e,n,t){const r=this;return j(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!O(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const dt={name:"setextUnderline",resolveTo:So,tokenize:Co};function So(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function Co(e,n,t){const r=this;let i;return l;function l(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,o(u)):t(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?j(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||A(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const Eo={tokenize:Io};function Io(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,j(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const To={resolveAll:sr()},Ao=ur("string"),Po=ur("text");function ur(e){return{resolveAll:sr(e==="text"?vo:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(c){return u(c)?l(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),s}function s(c){return u(c)?(t.exit("data"),l(c)):(t.consume(c),s)}function u(c){if(c===null)return!0;const f=i[c];let m=-1;if(f)for(;++m<f.length;){const p=f[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function sr(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function vo(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,s;for(;l--;){const u=i[l];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)s=!0,a++;else if(u!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,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 zo={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:nr},Lo={91:Ol},Do={[-2]:on,[-1]:on,32:on},No={35:jl,42:We,45:[dt,We],60:ql,61:dt,95:We,96:ft,126:ft},Oo={38:rr,92:tr},Fo={[-5]:an,[-4]:an,[-3]:an,33:uo,38:rr,42:Sn,60:[cl,Gl],91:co,92:[Ml,tr],93:_n,95:Sn,96:Cl},_o={null:[Sn,To]},Ro={null:[42,95]},Mo={null:[]},Bo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ro,contentInitial:Lo,disable:Mo,document:zo,flow:No,flowInitial:Do,insideSpan:_o,string:Oo,text:Fo},Symbol.toStringTag,{value:"Module"}));function jo(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const s={attempt:_(U),check:_(x),consume:v,enter:C,exit:F,interrupt:_(x,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:f};let c=n.tokenize.call(u,s);return n.resolveAll&&l.push(n),u;function f(T){return o=re(o,T),E(),o[o.length-1]!==null?[]:(q(n,0),u.events=Fn(l,u.events,u),u.events)}function m(T,I){return Ho(p(T),I)}function p(T){return Uo(o,T)}function g(){const{_bufferIndex:T,_index:I,line:V,column:$,offset:N}=r;return{_bufferIndex:T,_index:I,line:V,column:$,offset:N}}function k(T){i[T.line]=T.column,H()}function E(){let T;for(;r._index<o.length;){const I=o[r._index];if(typeof I=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<I.length;)w(I.charCodeAt(r._bufferIndex));else w(I)}}function w(T){c=c(T)}function v(T){A(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,H()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=T}function C(T,I){const V=I||{};return V.type=T,V.start=g(),u.events.push(["enter",V,u]),a.push(V),V}function F(T){const I=a.pop();return I.end=g(),u.events.push(["exit",I,u]),I}function U(T,I){q(T,I.from)}function x(T,I){I.restore()}function _(T,I){return V;function V($,N,Q){let X,ie,pe,h;return Array.isArray($)?fe($):"tokenize"in $?fe([$]):le($);function le(Y){return Le;function Le(ge){const Ee=ge!==null&&Y[ge],Ie=ge!==null&&Y.null,He=[...Array.isArray(Ee)?Ee:Ee?[Ee]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return fe(He)(ge)}}function fe(Y){return X=Y,ie=0,Y.length===0?Q:d(Y[ie])}function d(Y){return Le;function Le(ge){return h=R(),pe=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?ke():Y.tokenize.call(I?Object.assign(Object.create(u),I):u,s,oe,ke)(ge)}}function oe(Y){return T(pe,h),N}function ke(Y){return h.restore(),++ie<X.length?d(X[ie]):Q}}}function q(T,I){T.resolveAll&&!l.includes(T)&&l.push(T),T.resolve&&ce(u.events,I,u.events.length-I,T.resolve(u.events.slice(I),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function R(){const T=g(),I=u.previous,V=u.currentConstruct,$=u.events.length,N=Array.from(a);return{from:$,restore:Q};function Q(){r=T,u.previous=I,u.currentConstruct=V,u.events.length=$,a=N,H()}}function H(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Uo(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Ho(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
|
|
3
|
+
`;break}case-3:{o=`\r
|
|
4
|
+
`;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Vo(e){const r={constructs:Qi([Bo,...(e||{}).extensions||[]]),content:i(rl),defined:[],document:i(ll),flow:i(Eo),lazy:{},string:i(Ao),text:i(Po)};return r;function i(l){return o;function o(a){return jo(r,l,a)}}}function qo(e){for(;!ir(e););return e}const mt=/[\0\t\n\r]/g;function $o(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const s=[];let u,c,f,m,p;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),f=0,n="",t&&(l.charCodeAt(0)===65279&&f++,t=void 0);f<l.length;){if(mt.lastIndex=f,u=mt.exec(l),m=u&&u.index!==void 0?u.index:l.length,p=l.charCodeAt(m),!u){n=l.slice(f);break}if(p===10&&f===m&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),f<m&&(s.push(l.slice(f,m)),e+=m-f),p){case 0:{s.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,s.push(-2);e++<c;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}f=m+1}return a&&(r&&s.push(-5),n&&s.push(n),s.push(null)),s}}const Wo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Xo(e){return e.replace(Wo,Yo)}function Yo(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return er(t.slice(l?2:1),l?16:10)}return On(t)||e}const cr={}.hasOwnProperty;function Qo(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),Ko(t)(qo(Vo(t).document().write($o()(e,n,!0))))}function Ko(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Wn),autolinkProtocol:R,autolinkEmail:R,atxHeading:l(Vn),blockQuote:l(Ie),characterEscape:R,characterReference:R,codeFenced:l(He),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(He,o),codeText:l(Sr,o),codeTextData:R,data:R,codeFlowValue:R,definition:l(Cr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(Er),hardBreakEscape:l(qn),hardBreakTrailing:l(qn),htmlFlow:l($n,o),htmlFlowData:R,htmlText:l($n,o),htmlTextData:R,image:l(Ir),label:o,link:l(Wn),listItem:l(Tr),listItemValue:m,listOrdered:l(Xn,f),listUnordered:l(Xn),paragraph:l(Ar),reference:d,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Vn),strong:l(Pr),thematicBreak:l(zr)},exit:{atxHeading:s(),atxHeadingSequence:U,autolink:s(),autolinkEmail:Ee,autolinkProtocol:ge,blockQuote:s(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:Y,characterReference:Le,codeFenced:s(E),codeFencedFence:k,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:H,codeIndented:s(w),codeText:s(N),codeTextData:H,data:H,definition:s(),definitionDestinationString:F,definitionLabelString:v,definitionTitleString:C,emphasis:s(),hardBreakEscape:s(I),hardBreakTrailing:s(I),htmlFlow:s(V),htmlFlowData:H,htmlText:s($),htmlTextData:H,image:s(X),label:pe,labelText:ie,lineEnding:T,link:s(Q),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:oe,resourceDestinationString:h,resourceTitleString:le,resource:fe,setextHeading:s(q),setextHeadingLineSequence:_,setextHeadingText:x,strong:s(),thematicBreak:s()}};pr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(y){let S={type:"root",children:[]};const z={stack:[S],tokenStack:[],config:n,enter:a,exit:u,buffer:o,resume:c,data:t},D=[];let M=-1;for(;++M<y.length;)if(y[M][1].type==="listOrdered"||y[M][1].type==="listUnordered")if(y[M][0]==="enter")D.push(M);else{const ae=D.pop();M=i(y,ae,M)}for(M=-1;++M<y.length;){const ae=n[y[M][0]];cr.call(ae,y[M][1].type)&&ae[y[M][1].type].call(Object.assign({sliceSerialize:y[M][2].sliceSerialize},z),y[M][1])}if(z.tokenStack.length>0){const ae=z.tokenStack[z.tokenStack.length-1];(ae[1]||gt).call(z,void 0,ae[0])}for(S.position={start:ye(y.length>0?y[0][1].start:{line:1,column:1,offset:0}),end:ye(y.length>0?y[y.length-2][1].end:{line:1,column:1,offset:0})},M=-1;++M<n.transforms.length;)S=n.transforms[M](S)||S;return S}function i(y,S,z){let D=S-1,M=-1,ae=!1,be,he,De,Ne;for(;++D<=z;){const ee=y[D];switch(ee[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ee[0]==="enter"?M++:M--,Ne=void 0;break}case"lineEndingBlank":{ee[0]==="enter"&&(be&&!Ne&&!M&&!De&&(De=D),Ne=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ne=void 0}if(!M&&ee[0]==="enter"&&ee[1].type==="listItemPrefix"||M===-1&&ee[0]==="exit"&&(ee[1].type==="listUnordered"||ee[1].type==="listOrdered")){if(be){let Te=D;for(he=void 0;Te--;){const de=y[Te];if(de[1].type==="lineEnding"||de[1].type==="lineEndingBlank"){if(de[0]==="exit")continue;he&&(y[he][1].type="lineEndingBlank",ae=!0),de[1].type="lineEnding",he=Te}else if(!(de[1].type==="linePrefix"||de[1].type==="blockQuotePrefix"||de[1].type==="blockQuotePrefixWhitespace"||de[1].type==="blockQuoteMarker"||de[1].type==="listItemIndent"))break}De&&(!he||De<he)&&(be._spread=!0),be.end=Object.assign({},he?y[he][1].start:ee[1].end),y.splice(he||D,0,["exit",be,ee[2]]),D++,z++}if(ee[1].type==="listItemPrefix"){const Te={type:"listItem",_spread:!1,start:Object.assign({},ee[1].start),end:void 0};be=Te,y.splice(D,0,["enter",Te,ee[2]]),D++,z++,De=void 0,Ne=!0}}}return y[S][1]._spread=ae,z}function l(y,S){return z;function z(D){a.call(this,y(D),D),S&&S.call(this,D)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(y,S,z){this.stack[this.stack.length-1].children.push(y),this.stack.push(y),this.tokenStack.push([S,z||void 0]),y.position={start:ye(S.start),end:void 0}}function s(y){return S;function S(z){y&&y.call(this,z),u.call(this,z)}}function u(y,S){const z=this.stack.pop(),D=this.tokenStack.pop();if(D)D[0].type!==y.type&&(S?S.call(this,y,D[0]):(D[1]||gt).call(this,y,D[0]));else throw new Error("Cannot close `"+y.type+"` ("+_e({start:y.start,end:y.end})+"): it’s not open");z.position.end=ye(y.end)}function c(){return Xi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(y){if(this.data.expectingFirstListItemValue){const S=this.stack[this.stack.length-2];S.start=Number.parseInt(this.sliceSerialize(y),10),this.data.expectingFirstListItemValue=void 0}}function p(){const y=this.resume(),S=this.stack[this.stack.length-1];S.lang=y}function g(){const y=this.resume(),S=this.stack[this.stack.length-1];S.meta=y}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const y=this.resume(),S=this.stack[this.stack.length-1];S.value=y.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const y=this.resume(),S=this.stack[this.stack.length-1];S.value=y.replace(/(\r?\n|\r)$/g,"")}function v(y){const S=this.resume(),z=this.stack[this.stack.length-1];z.label=S,z.identifier=Pe(this.sliceSerialize(y)).toLowerCase()}function C(){const y=this.resume(),S=this.stack[this.stack.length-1];S.title=y}function F(){const y=this.resume(),S=this.stack[this.stack.length-1];S.url=y}function U(y){const S=this.stack[this.stack.length-1];if(!S.depth){const z=this.sliceSerialize(y).length;S.depth=z}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function _(y){const S=this.stack[this.stack.length-1];S.depth=this.sliceSerialize(y).codePointAt(0)===61?1:2}function q(){this.data.setextHeadingSlurpLineEnding=void 0}function R(y){const z=this.stack[this.stack.length-1].children;let D=z[z.length-1];(!D||D.type!=="text")&&(D=vr(),D.position={start:ye(y.start),end:void 0},z.push(D)),this.stack.push(D)}function H(y){const S=this.stack.pop();S.value+=this.sliceSerialize(y),S.position.end=ye(y.end)}function T(y){const S=this.stack[this.stack.length-1];if(this.data.atHardBreak){const z=S.children[S.children.length-1];z.position.end=ye(y.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(S.type)&&(R.call(this,y),H.call(this,y))}function I(){this.data.atHardBreak=!0}function V(){const y=this.resume(),S=this.stack[this.stack.length-1];S.value=y}function $(){const y=this.resume(),S=this.stack[this.stack.length-1];S.value=y}function N(){const y=this.resume(),S=this.stack[this.stack.length-1];S.value=y}function Q(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const S=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=S,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function X(){const y=this.stack[this.stack.length-1];if(this.data.inReference){const S=this.data.referenceType||"shortcut";y.type+="Reference",y.referenceType=S,delete y.url,delete y.title}else delete y.identifier,delete y.label;this.data.referenceType=void 0}function ie(y){const S=this.sliceSerialize(y),z=this.stack[this.stack.length-2];z.label=Xo(S),z.identifier=Pe(S).toLowerCase()}function pe(){const y=this.stack[this.stack.length-1],S=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){const D=y.children;z.children=D}else z.alt=S}function h(){const y=this.resume(),S=this.stack[this.stack.length-1];S.url=y}function le(){const y=this.resume(),S=this.stack[this.stack.length-1];S.title=y}function fe(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function oe(y){const S=this.resume(),z=this.stack[this.stack.length-1];z.label=S,z.identifier=Pe(this.sliceSerialize(y)).toLowerCase(),this.data.referenceType="full"}function ke(y){this.data.characterReferenceType=y.type}function Y(y){const S=this.sliceSerialize(y),z=this.data.characterReferenceType;let D;z?(D=er(S,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):D=On(S);const M=this.stack[this.stack.length-1];M.value+=D}function Le(y){const S=this.stack.pop();S.position.end=ye(y.end)}function ge(y){H.call(this,y);const S=this.stack[this.stack.length-1];S.url=this.sliceSerialize(y)}function Ee(y){H.call(this,y);const S=this.stack[this.stack.length-1];S.url="mailto:"+this.sliceSerialize(y)}function Ie(){return{type:"blockquote",children:[]}}function He(){return{type:"code",lang:null,meta:null,value:""}}function Sr(){return{type:"inlineCode",value:""}}function Cr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Er(){return{type:"emphasis",children:[]}}function Vn(){return{type:"heading",depth:0,children:[]}}function qn(){return{type:"break"}}function $n(){return{type:"html",value:""}}function Ir(){return{type:"image",title:null,url:"",alt:null}}function Wn(){return{type:"link",title:null,url:"",children:[]}}function Xn(y){return{type:"list",ordered:y.type==="listOrdered",start:null,spread:y._spread,children:[]}}function Tr(y){return{type:"listItem",spread:y._spread,checked:null,children:[]}}function Ar(){return{type:"paragraph",children:[]}}function Pr(){return{type:"strong",children:[]}}function vr(){return{type:"text",value:""}}function zr(){return{type:"thematicBreak"}}}function ye(e){return{line:e.line,column:e.column,offset:e.offset}}function pr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?pr(e,r):Go(e,r)}}function Go(e,n){let t;for(t in n)if(cr.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 gt(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+_e({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+_e({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+_e({start:n.start,end:n.end})+") is still open")}function Jo(e){const n=this;n.parser=t;function t(r){return Qo(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Zo(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 ea(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
|
5
|
+
`}]}function na(e,n){const t=n.value?n.value+`
|
|
6
|
+
`:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function ta(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ra(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ia(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=ze(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+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(o)}]};e.patch(n,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(n,u),e.applyData(n,u)}function la(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 oa(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function fr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function aa(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return fr(e,n);const i={src:ze(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function ua(e,n){const t={src:ze(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function sa(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 ca(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return fr(e,n);const i={href:ze(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function pa(e,n){const t={href:ze(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function fa(e,n,t){const r=e.all(n),i=t?ha(t):hr(n),l={},o=[];if(typeof n.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const c=r[a];(i||a!==0||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
|
|
7
|
+
`}),c.type==="element"&&c.tagName==="p"&&!i?o.push(...c.children):o.push(c)}const s=r[r.length-1];s&&(i||s.type!=="element"||s.tagName!=="p")&&o.push({type:"text",value:`
|
|
8
|
+
`});const u={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,u),e.applyData(n,u)}function ha(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=hr(t[r])}return n}function hr(e){const n=e.spread;return n??e.children.length>1}function da(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 o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,l),e.applyData(n,l)}function ma(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ga(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function ya(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function xa(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],o),i.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=zn(n.children[1]),s=Xt(n.children[n.children.length-1]);a&&s&&(o.position={start:a,end:s}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function ka(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let s=-1;const u=[];for(;++s<a;){const f=n.children[s],m={},p=o?o[s]:void 0;p&&(m.align=p);let g={type:"element",tagName:l,properties:m,children:[]};f&&(g.children=e.all(f),e.patch(f,g),g=e.applyData(f,g)),u.push(g)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,c),e.applyData(n,c)}function ba(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const yt=9,xt=32;function wa(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(kt(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(kt(n.slice(i),i>0,!1)),l.join("")}function kt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===yt||l===xt;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===yt||l===xt;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Sa(e,n){const t={type:"text",value:wa(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function Ca(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const Ea={blockquote:Zo,break:ea,code:na,delete:ta,emphasis:ra,footnoteReference:ia,heading:la,html:oa,imageReference:aa,image:ua,inlineCode:sa,linkReference:ca,link:pa,listItem:fa,list:da,paragraph:ma,root:ga,strong:ya,table:xa,tableCell:ba,tableRow:ka,text:Sa,thematicBreak:Ca,toml:Ve,yaml:Ve,definition:Ve,footnoteDefinition:Ve};function Ve(){}const dr=-1,en=0,Me=1,Qe=2,Rn=3,Mn=4,Bn=5,jn=6,mr=7,gr=8,Ia=typeof self=="object"?self:globalThis,bt=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new Ia[e](n)},Ta=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case en:case dr:return t(o,i);case Me:{const a=t([],i);for(const s of o)a.push(r(s));return a}case Qe:{const a=t({},i);for(const[s,u]of o)a[r(s)]=r(u);return a}case Rn:return t(new Date(o),i);case Mn:{const{source:a,flags:s}=o;return t(new RegExp(a,s),i)}case Bn:{const a=t(new Map,i);for(const[s,u]of o)a.set(r(s),r(u));return a}case jn:{const a=t(new Set,i);for(const s of o)a.add(r(s));return a}case mr:{const{name:a,message:s}=o;return t(bt(a,s),i)}case gr:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(bt(l,o),i)};return r},wt=e=>Ta(new Map,e)(0),Ae="",{toString:Aa}={},{keys:Pa}=Object,Fe=e=>{const n=typeof e;if(n!=="object"||!e)return[en,n];const t=Aa.call(e).slice(8,-1);switch(t){case"Array":return[Me,Ae];case"Object":return[Qe,Ae];case"Date":return[Rn,Ae];case"RegExp":return[Mn,Ae];case"Map":return[Bn,Ae];case"Set":return[jn,Ae];case"DataView":return[Me,t]}return t.includes("Array")?[Me,t]:t.includes("Error")?[mr,t]:[Qe,t]},qe=([e,n])=>e===en&&(n==="function"||n==="symbol"),va=(e,n,t,r)=>{const i=(o,a)=>{const s=r.push(o)-1;return t.set(a,s),s},l=o=>{if(t.has(o))return t.get(o);let[a,s]=Fe(o);switch(a){case en:{let c=o;switch(s){case"bigint":a=gr,c=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);c=null;break;case"undefined":return i([dr],o)}return i([a,c],o)}case Me:{if(s){let m=o;return s==="DataView"?m=new Uint8Array(o.buffer):s==="ArrayBuffer"&&(m=new Uint8Array(o)),i([s,[...m]],o)}const c=[],f=i([a,c],o);for(const m of o)c.push(l(m));return f}case Qe:{if(s)switch(s){case"BigInt":return i([s,o.toString()],o);case"Boolean":case"Number":case"String":return i([s,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const c=[],f=i([a,c],o);for(const m of Pa(o))(e||!qe(Fe(o[m])))&&c.push([l(m),l(o[m])]);return f}case Rn:return i([a,o.toISOString()],o);case Mn:{const{source:c,flags:f}=o;return i([a,{source:c,flags:f}],o)}case Bn:{const c=[],f=i([a,c],o);for(const[m,p]of o)(e||!(qe(Fe(m))||qe(Fe(p))))&&c.push([l(m),l(p)]);return f}case jn:{const c=[],f=i([a,c],o);for(const m of o)(e||!qe(Fe(m)))&&c.push(l(m));return f}}const{message:u}=o;return i([a,{name:s,message:u}],o)};return l},St=(e,{json:n,lossy:t}={})=>{const r=[];return va(!(n||t),!!n,new Map,r)(e),r},Ke=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?wt(St(e,n)):structuredClone(e):(e,n)=>wt(St(e,n));function za(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 La(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Da(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||za,r=e.options.footnoteBackLabel||La,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=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 c=e.all(u),f=String(u.identifier).toUpperCase(),m=ze(f.toLowerCase());let p=0;const g=[],k=e.footnoteCounts.get(f);for(;k!==void 0&&++p<=k;){g.length>0&&g.push({type:"text",value:" "});let v=typeof t=="string"?t:t(s,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+m+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(s,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const E=c[c.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const v=E.children[E.children.length-1];v&&v.type==="text"?v.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...g)}else c.push(...g);const w={type:"element",tagName:"li",properties:{id:n+"fn-"+m},children:e.wrap(c,!0)};e.patch(u,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Ke(o),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
|
|
11
|
-
`});++r<e.length;)r&&
|
|
12
|
-
`}),
|
|
13
|
-
`}),
|
|
14
|
-
`},i),o}function Bu(e,t){return e&&"run"in e?async function(n,r){const i=$t(n,{file:r,...t});await e.run(i,r)}:function(n,r){return $t(n,{file:r,...e||t})}}function qt(e){if(e)throw e}var tn=Object.prototype.hasOwnProperty,Wr=Object.prototype.toString,Wt=Object.defineProperty,Xt=Object.getOwnPropertyDescriptor,Yt=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Wr.call(t)==="[object Array]"},Qt=function(t){if(!t||Wr.call(t)!=="[object Object]")return!1;var n=tn.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&tn.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||tn.call(t,i)},Gt=function(t,n){Wt&&n.name==="__proto__"?Wt(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Kt=function(t,n){if(n==="__proto__")if(tn.call(t,n)){if(Xt)return Xt(t,n).value}else return;return t[n]},ju=function e(){var t,n,r,i,o,l,a=arguments[0],u=1,s=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<s;++u)if(t=arguments[u],t!=null)for(n in t)r=Kt(a,n),i=Kt(t,n),a!==i&&(f&&i&&(Qt(i)||(o=Yt(i)))?(o?(o=!1,l=r&&Yt(r)?r:[]):l=r&&Qt(r)?r:{},Gt(a,{name:n,newValue:e(f,l,i)})):typeof i<"u"&&Gt(a,{name:n,newValue:i}));return a};const wn=kr(ju);function Hn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Hu(){const e=[],t={run:n,use:r};return t;function n(...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(u,...s){const f=e[++o];let c=-1;if(u){l(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?Uu(f,a)(...s):l(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Uu(e,t){let n;return r;function r(...l){const a=e.length>l.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(s){const f=s;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){n||(n=!0,t(l,...a))}function o(l){i(null,l)}}const fe={basename:Vu,dirname:$u,extname:qu,join:Wu,sep:"/"};function Vu(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Qe(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function $u(e){if(Qe(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function qu(e){Qe(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const a=e.codePointAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Wu(...e){let t=-1,n;for(;++t<e.length;)Qe(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Xu(n)}function Xu(e){Qe(e);const t=e.codePointAt(0)===47;let n=Yu(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Yu(e,t){let n="",r=0,i=-1,o=0,l=-1,a,u;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(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return n}function Qe(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Qu={cwd:Gu};function Gu(){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 Ku(e){if(typeof e=="string")e=new URL(e);else if(!Un(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Ju(e)}function Ju(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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+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(t)}const Sn=["history","path","basename","stem","extname","dirname"];class Xr{constructor(t){let n;t?Un(t)?n={path:t}:typeof t=="string"||Zu(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Qu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Sn.length;){const o=Sn[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Sn.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?fe.basename(this.path):void 0}set basename(t){En(t,"basename"),Cn(t,"basename"),this.path=fe.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fe.dirname(this.path):void 0}set dirname(t){Jt(this.basename,"dirname"),this.path=fe.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fe.extname(this.path):void 0}set extname(t){if(Cn(t,"extname"),Jt(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fe.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Un(t)&&(t=Ku(t)),En(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fe.basename(this.path,this.extname):void 0}set stem(t){En(t,"stem"),Cn(t,"stem"),this.path=fe.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new J(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Cn(e,t){if(e&&e.includes(fe.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fe.sep+"`")}function En(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Jt(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Zu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const es=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},ns={}.hasOwnProperty;class ot extends es{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=Hu()}copy(){const t=new ot;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(wn(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Tn("data",this.frozen),this.namespace[t]=n,this):ns.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Tn("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ze(t),r=this.parser||this.Parser;return In("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),In("process",this.parser||this.Parser),An("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const a=Ze(t),u=r.parse(a);r.run(u,a,function(f,c,p){if(f||!c||!p)return s(f);const h=c,g=r.stringify(h,p);is(g)?p.value=g:p.result=g,s(f,p)});function s(f,c){f||!c?l(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),In("processSync",this.parser||this.Parser),An("processSync",this.compiler||this.Compiler),this.process(t,i),er("processSync","process",n),r;function i(o,l){n=!0,qt(o),r=l}}run(t,n,r){Zt(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const u=Ze(n);i.run(t,u,s);function s(f,c,p){const h=c||t;f?a(f):l?l(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),er("runSync","run",r),i;function o(l,a){qt(l),i=a,r=!0}}stringify(t,n){this.freeze();const r=Ze(n),i=this.compiler||this.Compiler;return An("stringify",i),Zt(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Tn("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))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(s.plugins),s.settings&&(i.settings=wn(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const c=s[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,p=-1;for(;++c<r.length;)if(r[c][0]===s){p=c;break}if(p===-1)r.push([s,...f]);else if(f.length>0){let[h,...g]=f;const k=r[p][1];Hn(k)&&Hn(h)&&(h=wn(!0,k,h)),r[p]=[s,h,...g]}}}}const ts=new ot().freeze();function In(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function An(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tn(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zt(e){if(!Hn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function er(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ze(e){return rs(e)?e:new Xr(e)}function rs(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function is(e){return typeof e=="string"||ls(e)}function ls(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const os="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",nr=[],tr={allowDangerousHtml:!0},as=/^(https?|ircs?|mailto|xmpp)$/i,us=[{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 ss(e){const t=cs(e),n=fs(e);return hs(t.runSync(t.parse(n),n),e)}function cs(e){const t=e.rehypePlugins||nr,n=e.remarkPlugins||nr,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...tr}:tr;return ts().use($a).use(n).use(Bu,r).use(t)}function fs(e){const t=e.children||"",n=new Xr;return typeof t=="string"&&(n.value=t),n}function hs(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||ps;for(const f of us)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+os+f.id,void 0);return lt(e,s),Al(e,{Fragment:L.Fragment,components:i,ignoreInvalidStyle:!0,jsx:L.jsx,jsxs:L.jsxs,passKeys:!0,passNode:!0});function s(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 kn)if(Object.hasOwn(kn,h)&&Object.hasOwn(f.properties,h)){const g=f.properties[h],k=kn[h];(k===null||k.includes(f.tagName))&&(f.properties[h]=u(String(g||""),h,f))}}if(f.type==="element"){let h=n?!n.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 ps(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||as.test(e.slice(0,t))?e:""}function ms(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yr(e,t,n){const i=mn((n||{}).ignore||[]),o=gs(t);let l=-1;for(;++l<o.length;)qr(e,"text",a);function a(s,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 u(s,f)}function u(s,f){const c=f[f.length-1],p=o[l][0],h=o[l][1];let g=0;const S=c.children.indexOf(s);let y=!1,A=[];p.lastIndex=0;let E=p.exec(s.value);for(;E;){const F=E.index,R={index:E.index,input:E.input,stack:[...f,s]};let w=h(...E,R);if(typeof w=="string"&&(w=w.length>0?{type:"text",value:w}:void 0),w===!1?p.lastIndex=F+1:(g!==F&&A.push({type:"text",value:s.value.slice(g,F)}),Array.isArray(w)?A.push(...w):w&&A.push(w),g=F+E[0].length,y=!0),!p.global)break;E=p.exec(s.value)}return y?(g<s.value.length&&A.push({type:"text",value:s.value.slice(g)}),c.children.splice(S,1,...A)):A=[s],S+A.length}}function gs(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([ds(i[0]),ys(i[1])])}return t}function ds(e){return typeof e=="string"?new RegExp(ms(e),"g"):e}function ys(e){return typeof e=="function"?e:function(){return e}}function ks(e){Yr(e,[/\r?\n|\r/g,xs])}function xs(){return{type:"break"}}function bs(){return function(e){ks(e)}}function rr(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const vn="phrasing",Pn=["autolink","link","image","label"];function ws(){return{transforms:[vs],enter:{literalAutolink:Cs,literalAutolinkEmail:Ln,literalAutolinkHttp:Ln,literalAutolinkWww:Ln},exit:{literalAutolink:Ts,literalAutolinkEmail:As,literalAutolinkHttp:Es,literalAutolinkWww:Is}}}function Ss(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vn,notInConstruct:Pn},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vn,notInConstruct:Pn},{character:":",before:"[ps]",after:"\\/",inConstruct:vn,notInConstruct:Pn}]}}function Cs(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ln(e){this.config.enter.autolinkProtocol.call(this,e)}function Es(e){this.config.exit.autolinkProtocol.call(this,e)}function Is(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function As(e){this.config.exit.autolinkEmail.call(this,e)}function Ts(e){this.exit(e)}function vs(e){Yr(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ps],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Ls]],{ignore:["link","linkReference"]})}function Ps(e,t,n,r,i){let o="";if(!Qr(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!zs(n)))return!1;const l=Ds(n+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function Ls(e,t,n,r){return!Qr(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zs(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Ds(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=rr(e,"(");let o=rr(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Qr(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Te(n)||fn(n))&&(!t||n!==47)}Gr.peek=Hs;function Fs(){this.buffer()}function Rs(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function _s(){this.buffer()}function Os(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ms(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ns(e){this.exit(e)}function Bs(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function js(e){this.exit(e)}function Hs(){return"["}function Gr(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function Us(){return{enter:{gfmFootnoteCallString:Fs,gfmFootnoteCall:Rs,gfmFootnoteDefinitionLabelString:_s,gfmFootnoteDefinition:Os},exit:{gfmFootnoteCallString:Ms,gfmFootnoteCall:Ns,gfmFootnoteDefinitionLabelString:Bs,gfmFootnoteDefinition:js}}}function Vs(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Gr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const a=o.createTracker(l);let u=a.move("[^");const s=o.enter("footnoteDefinition"),f=o.enter("label");return u+=a.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((t?`
|
|
15
|
-
`:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Kr:$s))),s(),u}}function $s(e,t,n){return t===0?e:Kr(e,t,n)}function Kr(e,t,n){return(n?"":" ")+e}const qs=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Jr.peek=Gs;function Ws(){return{canContainEols:["delete"],enter:{strikethrough:Ys},exit:{strikethrough:Qs}}}function Xs(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:qs}],handlers:{delete:Jr}}}function Ys(e){this.enter({type:"delete",children:[]},e)}function Qs(e){this.exit(e)}function Jr(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Gs(){return"~"}function Ks(e){return e.length}function Js(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ks,o=[],l=[],a=[],u=[];let s=0,f=-1;for(;++f<e.length;){const k=[],S=[];let y=-1;for(e[f].length>s&&(s=e[f].length);++y<e[f].length;){const A=Zs(e[f][y]);if(n.alignDelimiters!==!1){const E=i(A);S[y]=E,(u[y]===void 0||E>u[y])&&(u[y]=E)}k.push(A)}l[f]=k,a[f]=S}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<s;)o[c]=ir(r[c]);else{const k=ir(r);for(;++c<s;)o[c]=k}c=-1;const p=[],h=[];for(;++c<s;){const k=o[c];let S="",y="";k===99?(S=":",y=":"):k===108?S=":":k===114&&(y=":");let A=n.alignDelimiters===!1?1:Math.max(1,u[c]-S.length-y.length);const E=S+"-".repeat(A)+y;n.alignDelimiters!==!1&&(A=S.length+A+y.length,A>u[c]&&(u[c]=A),h[c]=A),p[c]=E}l.splice(1,0,p),a.splice(1,0,h),f=-1;const g=[];for(;++f<l.length;){const k=l[f],S=a[f];c=-1;const y=[];for(;++c<s;){const A=k[c]||"";let E="",F="";if(n.alignDelimiters!==!1){const R=u[c]-(S[c]||0),w=o[c];w===114?E=" ".repeat(R):w===99?R%2?(E=" ".repeat(R/2+.5),F=" ".repeat(R/2-.5)):(E=" ".repeat(R/2),F=E):F=" ".repeat(R)}n.delimiterStart!==!1&&!c&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||c)&&y.push(" "),n.alignDelimiters!==!1&&y.push(E),y.push(A),n.alignDelimiters!==!1&&y.push(F),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||c!==s-1)&&y.push("|")}g.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return g.join(`
|
|
16
|
-
`)}function Zs(e){return e==null?"":String(e)}function ir(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ec(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),nc);return i(),l}function nc(e,t,n){return">"+(n?"":" ")+e}function tc(e,t){return lr(e,t.inConstruct,!0)&&!lr(e,t.notInConstruct,!1)}function lr(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function or(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
17
|
-
`&&tc(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
18
|
-
`}function rc(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function ic(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function lc(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function oc(e,t,n,r){const i=lc(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(ic(e,n)){const c=n.enter("codeIndented"),p=n.indentLines(o,ac);return c(),p}const a=n.createTracker(r),u=i.repeat(Math.max(rc(o,i)+1,3)),s=n.enter("codeFenced");let f=a.move(u);if(e.lang){const c=n.enter(`codeFencedLang${l}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
|
|
19
|
-
`,encode:["`"],...a.current()})),c()}return f+=a.move(`
|
|
20
|
-
`),o&&(f+=a.move(o+`
|
|
21
|
-
`)),f+=a.move(u),s(),f}function ac(e,t,n){return(n?"":" ")+e}function at(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function uc(e,t,n,r){const i=at(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let a=n.enter("label");const u=n.createTracker(r);let s=u.move("[");return s+=u.move(n.safe(n.associationId(e),{before:s,after:"]",...u.current()})),s+=u.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(n.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=n.enter("destinationRaw"),s+=u.move(n.safe(e.url,{before:s,after:e.title?" ":`
|
|
22
|
-
`,...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),s+=u.move(" "+i),s+=u.move(n.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),l(),s}function sc(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function We(e){return"&#x"+e.toString(16).toUpperCase()+";"}function un(e,t,n){const r=Re(e),i=Re(t);return r===void 0?i===void 0?n==="_"?{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}}Zr.peek=cc;function Zr(e,t,n,r){const i=sc(n),o=n.enter("emphasis"),l=n.createTracker(r),a=l.move(i);let u=l.move(n.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=u.charCodeAt(0),f=un(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=We(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=un(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+We(c));const h=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function cc(e,t,n){return n.options.emphasis||"*"}function fc(e,t){let n=!1;return lt(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Bn}),!!((!e.depth||e.depth<3)&&Jn(e)&&(t.options.setext||n))}function hc(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(fc(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),p=n.containerPhrasing(e,{...o.current(),before:`
|
|
23
|
-
`,after:`
|
|
24
|
-
`});return c(),f(),p+`
|
|
25
|
-
`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
26
|
-
`))+1))}const l="#".repeat(i),a=n.enter("headingAtx"),u=n.enter("phrasing");o.move(l+" ");let s=n.containerPhrasing(e,{before:"# ",after:`
|
|
27
|
-
`,...o.current()});return/^[\t ]/.test(s)&&(s=We(s.charCodeAt(0))+s.slice(1)),s=s?l+" "+s:l,n.options.closeAtx&&(s+=" "+l),u(),a(),s}ei.peek=pc;function ei(e){return e.value||""}function pc(){return"<"}ni.peek=mc;function ni(e,t,n,r){const i=at(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let a=n.enter("label");const u=n.createTracker(r);let s=u.move("![");return s+=u.move(n.safe(e.alt,{before:s,after:"]",...u.current()})),s+=u.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),s+=u.move("<"),s+=u.move(n.safe(e.url,{before:s,after:">",...u.current()})),s+=u.move(">")):(a=n.enter("destinationRaw"),s+=u.move(n.safe(e.url,{before:s,after:e.title?" ":")",...u.current()}))),a(),e.title&&(a=n.enter(`title${o}`),s+=u.move(" "+i),s+=u.move(n.safe(e.title,{before:s,after:i,...u.current()})),s+=u.move(i),a()),s+=u.move(")"),l(),s}function mc(){return"!"}ti.peek=gc;function ti(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const a=n.createTracker(r);let u=a.move("![");const s=n.safe(e.alt,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function gc(){return"!"}ri.peek=dc;function ri(e,t,n){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<n.unsafe.length;){const l=n.unsafe[o],a=n.compilePattern(l);let u;if(l.atBreak)for(;u=a.exec(r);){let s=u.index;r.charCodeAt(s)===10&&r.charCodeAt(s-1)===13&&s--,r=r.slice(0,s)+" "+r.slice(u.index+1)}}return i+r+i}function dc(){return"`"}function ii(e,t){const n=Jn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}li.peek=yc;function li(e,t,n,r){const i=at(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let a,u;if(ii(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=l.move("<");return c+=l.move(n.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),n.stack=f,c}a=n.enter("link"),u=n.enter("label");let s=l.move("[");return s+=l.move(n.containerPhrasing(e,{before:s,after:"](",...l.current()})),s+=l.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),s+=l.move("<"),s+=l.move(n.safe(e.url,{before:s,after:">",...l.current()})),s+=l.move(">")):(u=n.enter("destinationRaw"),s+=l.move(n.safe(e.url,{before:s,after:e.title?" ":")",...l.current()}))),u(),e.title&&(u=n.enter(`title${o}`),s+=l.move(" "+i),s+=l.move(n.safe(e.title,{before:s,after:i,...l.current()})),s+=l.move(i),u()),s+=l.move(")"),a(),s}function yc(e,t,n){return ii(e,n)?"<":"["}oi.peek=kc;function oi(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const a=n.createTracker(r);let u=a.move("[");const s=n.containerPhrasing(e,{before:u,after:"]",...a.current()});u+=a.move(s+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:u,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!s||s!==c?u+=a.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function kc(){return"["}function ut(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function xc(e){const t=ut(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bc(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ai(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wc(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?bc(n):ut(n);const a=e.ordered?l==="."?")":".":xc(n);let u=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),ai(n)===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"){u=!0;break}}}}u&&(l=a),n.bulletCurrent=l;const s=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),s}function Sc(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Cc(e,t,n,r){const i=Sc(n);let o=n.bulletCurrent||ut(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const u=n.enter("listItem"),s=n.indentLines(n.containerFlow(e,a.current()),f);return u(),s;function f(c,p,h){return p?(h?"":" ".repeat(l))+c:(h?o:o+" ".repeat(l-o.length))+c}}function Ec(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const Ic=mn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Ac(e,t,n,r){return(e.children.some(function(l){return Ic(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Tc(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ui.peek=vc;function ui(e,t,n,r){const i=Tc(n),o=n.enter("strong"),l=n.createTracker(r),a=l.move(i+i);let u=l.move(n.containerPhrasing(e,{after:i,before:a,...l.current()}));const s=u.charCodeAt(0),f=un(r.before.charCodeAt(r.before.length-1),s,i);f.inside&&(u=We(s)+u.slice(1));const c=u.charCodeAt(u.length-1),p=un(r.after.charCodeAt(0),c,i);p.inside&&(u=u.slice(0,-1)+We(c));const h=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+u+h}function vc(e,t,n){return n.options.strong||"*"}function Pc(e,t,n,r){return n.safe(e.value,r)}function Lc(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function zc(e,t,n){const r=(ai(n)+(n.options.ruleSpaces?" ":"")).repeat(Lc(n));return n.options.ruleSpaces?r.slice(0,-1):r}const si={blockquote:ec,break:or,code:oc,definition:uc,emphasis:Zr,hardBreak:or,heading:hc,html:ei,image:ni,imageReference:ti,inlineCode:ri,link:li,linkReference:oi,list:wc,listItem:Cc,paragraph:Ec,root:Ac,strong:ui,text:Pc,thematicBreak:zc};function Dc(){return{enter:{table:Fc,tableData:ar,tableHeader:ar,tableRow:_c},exit:{codeText:Oc,table:Rc,tableData:zn,tableHeader:zn,tableRow:zn}}}function Fc(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Rc(e){this.exit(e),this.data.inTable=void 0}function _c(e){this.enter({type:"tableRow",children:[]},e)}function zn(e){this.exit(e)}function ar(e){this.enter({type:"tableCell",children:[]},e)}function Oc(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Mc));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Mc(e,t){return t==="|"?t:e}function Nc(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
28
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:l,tableCell:u,tableRow:a}};function l(h,g,k,S){return s(f(h,k,S),h.align)}function a(h,g,k,S){const y=c(h,k,S),A=s([y]);return A.slice(0,A.indexOf(`
|
|
29
|
-
`))}function u(h,g,k,S){const y=k.enter("tableCell"),A=k.enter("phrasing"),E=k.containerPhrasing(h,{...S,before:o,after:o});return A(),y(),E}function s(h,g){return Js(h,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function f(h,g,k){const S=h.children;let y=-1;const A=[],E=g.enter("table");for(;++y<S.length;)A[y]=c(S[y],g,k);return E(),A}function c(h,g,k){const S=h.children;let y=-1;const A=[],E=g.enter("tableRow");for(;++y<S.length;)A[y]=u(S[y],h,g,k);return E(),A}function p(h,g,k){let S=si.inlineCode(h,g,k);return k.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function Bc(){return{exit:{taskListCheckValueChecked:ur,taskListCheckValueUnchecked:ur,paragraph:Hc}}}function jc(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Uc}}}function ur(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Hc(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Uc(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(l);let u=si.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(f){return f+l}}function Vc(){return[ws(),Us(),Ws(),Dc(),Bc()]}function $c(e){return{extensions:[Ss(),Vs(e),Xs(),Nc(e),jc()]}}const qc={tokenize:Kc,partial:!0},ci={tokenize:Jc,partial:!0},fi={tokenize:Zc,partial:!0},hi={tokenize:ef,partial:!0},Wc={tokenize:nf,partial:!0},pi={name:"wwwAutolink",tokenize:Qc,previous:gi},mi={name:"protocolAutolink",tokenize:Gc,previous:di},ke={name:"emailAutolink",tokenize:Yc,previous:yi},he={};function Xc(){return{text:he}}let Ee=48;for(;Ee<123;)he[Ee]=ke,Ee++,Ee===58?Ee=65:Ee===91&&(Ee=97);he[43]=ke;he[45]=ke;he[46]=ke;he[95]=ke;he[72]=[ke,mi];he[104]=[ke,mi];he[87]=[ke,pi];he[119]=[ke,pi];function Yc(e,t,n){const r=this;let i,o;return l;function l(c){return!Vn(c)||!yi.call(r,r.previous)||st(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Vn(c)?(e.consume(c),a):c===64?(e.consume(c),u):n(c)}function u(c){return c===46?e.check(Wc,f,s)(c):c===45||c===95||K(c)?(o=!0,e.consume(c),u):f(c)}function s(c){return e.consume(c),i=!0,u}function f(c){return o&&i&&Z(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Qc(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!gi.call(r,r.previous)||st(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(qc,e.attempt(ci,e.attempt(fi,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Gc(e,t,n){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&di.call(r,r.previous)&&!st(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(Z(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),u}return n(c)}function u(c){return c===47?(e.consume(c),o?s:(o=!0,u)):n(c)}function s(c){return c===null||ln(c)||$(c)||Te(c)||fn(c)?n(c):e.attempt(ci,e.attempt(fi,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Kc(e,t,n){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):n(l)}function o(l){return l===null?n(l):t(l)}}function Jc(e,t,n){let r,i,o;return l;function l(s){return s===46||s===95?e.check(hi,u,a)(s):s===null||$(s)||Te(s)||s!==45&&fn(s)?u(s):(o=!0,e.consume(s),l)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),l}function u(s){return i||r||!o?n(s):t(s)}}function Zc(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?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,t,o)(l):l===null||$(l)||Te(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function ef(e,t,n){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||$(a)||Te(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||$(a)||Te(a)?t(a):r(a)}function o(a){return Z(a)?l(a):n(a)}function l(a){return a===59?(e.consume(a),r):Z(a)?(e.consume(a),l):n(a)}}function nf(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return K(o)?n(o):t(o)}}function gi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||$(e)}function di(e){return!Z(e)}function yi(e){return!(e===47||Vn(e))}function Vn(e){return e===43||e===45||e===46||e===95||K(e)}function st(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const tf={tokenize:ff,partial:!0};function rf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:uf,continuation:{tokenize:sf},exit:cf}},text:{91:{name:"gfmFootnoteCall",tokenize:af},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:lf,resolveTo:of}}}}function lf(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!l||!l._balanced)return n(u);const s=ce(r.sliceSerialize({start:l.end,end:r.now()}));return s.codePointAt(0)!==94||!o.includes(s.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function of(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+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[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function af(e,t,n){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"),u}function u(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(o>999||c===93&&!l||c===null||c===91||$(c))return n(c);if(c===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(ce(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return $(c)||(l=!0),o++,e.consume(c),c===92?f:s}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,s):s(c)}}function uf(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return u;function u(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(g)}function f(g){if(l>999||g===93&&!a||g===null||g===91||$(g))return n(g);if(g===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return o=ce(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return $(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),M(e,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return t(g)}}function sf(e,t,n){return e.check(Ye,t,e.attempt(tf,t,n))}function cf(e){e.exit("gfmFootnoteDefinition")}function ff(e,t,n){const r=this;return M(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?t(o):n(o)}}function hf(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let s=u;for(;s--;)if(l[s][0]==="exit"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[s][1].end.offset-l[s][1].start.offset){l[u][1].type="strikethroughSequence",l[s][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[s][1].start),end:Object.assign({},l[u][1].end)},c={type:"strikethroughText",start:Object.assign({},l[s][1].end),end:Object.assign({},l[u][1].start)},p=[["enter",f,a],["enter",l[s][1],a],["exit",l[s][1],a],["enter",c,a]],h=a.parser.constructs.insideSpan.null;h&&ie(p,p.length,0,hn(h,l.slice(s+1,u),a)),ie(p,p.length,0,[["exit",c,a],["enter",l[u][1],a],["exit",l[u][1],a],["exit",f,a]]),ie(l,s-1,u-s+3,p),u=s+p.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function o(l,a,u){const s=this.previous,f=this.events;let c=0;return p;function p(g){return s===126&&f[f.length-1][1].type!=="characterEscape"?u(g):(l.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const k=Re(s);if(g===126)return c>1?u(g):(l.consume(g),c++,h);if(c<2&&!n)return u(g);const S=l.exit("strikethroughSequenceTemporary"),y=Re(g);return S._open=!y||y===2&&!!k,S._close=!k||k===2&&!!y,a(g)}}}class pf{constructor(){this.map=[]}add(t,n,r){mf(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function mf(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function gf(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-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"&&(n=!0);t+=1}return r}function df(){return{flow:{null:{name:"table",tokenize:yf,resolveAll:kf}}}}function yf(e,t,n){const r=this;let i=0,o=0,l;return a;function a(x){let T=r.events.length-1;for(;T>-1;){const W=r.events[T][1].type;if(W==="lineEnding"||W==="linePrefix")T--;else break}const v=T>-1?r.events[T][1].type:null,H=v==="tableHead"||v==="tableRow"?w:u;return H===w&&r.parser.lazy[r.now().line]?n(x):H(x)}function u(x){return e.enter("tableHead"),e.enter("tableRow"),s(x)}function s(x){return x===124||(l=!0,o+=1),f(x)}function f(x){return x===null?n(x):P(x)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),h):n(x):_(x)?M(e,f,"whitespace")(x):(o+=1,l&&(l=!1,i+=1),x===124?(e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(x)))}function c(x){return x===null||x===124||$(x)?(e.exit("data"),f(x)):(e.consume(x),x===92?p:c)}function p(x){return x===92||x===124?(e.consume(x),c):c(x)}function h(x){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(x):(e.enter("tableDelimiterRow"),l=!1,_(x)?M(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):g(x))}function g(x){return x===45||x===58?S(x):x===124?(l=!0,e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),k):R(x)}function k(x){return _(x)?M(e,S,"whitespace")(x):S(x)}function S(x){return x===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(x),e.exit("tableDelimiterMarker"),y):x===45?(o+=1,y(x)):x===null||P(x)?F(x):R(x)}function y(x){return x===45?(e.enter("tableDelimiterFiller"),A(x)):R(x)}function A(x){return x===45?(e.consume(x),A):x===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(x),e.exit("tableDelimiterMarker"),E):(e.exit("tableDelimiterFiller"),E(x))}function E(x){return _(x)?M(e,F,"whitespace")(x):F(x)}function F(x){return x===124?g(x):x===null||P(x)?!l||i!==o?R(x):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(x)):R(x)}function R(x){return n(x)}function w(x){return e.enter("tableRow"),N(x)}function N(x){return x===124?(e.enter("tableCellDivider"),e.consume(x),e.exit("tableCellDivider"),N):x===null||P(x)?(e.exit("tableRow"),t(x)):_(x)?M(e,N,"whitespace")(x):(e.enter("data"),q(x))}function q(x){return x===null||x===124||$(x)?(e.exit("data"),N(x)):(e.consume(x),x===92?j:q)}function j(x){return x===92||x===124?(e.consume(x),q):q(x)}}function kf(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,u=0,s,f,c;const p=new pf;for(;++n<e.length;){const h=e[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(a=!1,u!==0&&(sr(p,t,u,s,f),f=void 0,u=0),s={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",s,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",f,t]])),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=en(p,t,o,i,void 0,c),o=[0,0,0,0]),l[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=en(p,t,o,i,void 0,c)),o=l,l=[o[1],n,0,0])):g.type==="tableHead"?(a=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,o[1]!==0?(l[0]=l[1],c=en(p,t,o,i,n,c)):l[1]!==0&&(c=en(p,t,l,i,n,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(l[3]=n)}for(u!==0&&sr(p,t,u,s,f),p.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=gf(t.events,n))}return e}function en(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Fe(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=Fe(t.events,n[1]);if(o={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const s=Fe(t.events,n[2]),f=Fe(t.events,n[3]),c={type:a,start:Object.assign({},s),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const p=t.events[n[2]],h=t.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,k=n[3]-n[2]-1;e.add(g,k,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Fe(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function sr(e,t,n,r,i){const o=[],l=Fe(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Fe(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const xf={name:"tasklistCheck",tokenize:wf};function bf(){return{text:{91:xf}}}function wf(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return $(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):n(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return P(u)?t(u):_(u)?e.check({tokenize:Sf},t,n)(u):n(u)}}function Sf(e,t,n){return M(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Cf(e){return Ar([Xc(),rf(),hf(e),df(),bf()])}const Ef={};function If(e){const t=this,n=e||Ef,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Cf(n)),o.push(Vc()),l.push($c(n))}function Af(e){return e.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:6})}function Tf({message:e}){return L.jsxs("div",{className:`bubble ${e.role}`,children:[e.role==="assistant"?L.jsx(ss,{remarkPlugins:[bs,If],children:e.content}):e.content,L.jsxs("div",{className:"bubble-footer",children:[L.jsx("small",{children:e.timestamp.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}),e.role==="assistant"&&e.usage&&L.jsxs("small",{className:"usage",children:[e.usage.inputTokens.toLocaleString("en-US")," in"," · ",e.usage.outputTokens.toLocaleString("en-US")," out"," · ",Af(e.usage.estimatedCostUsd)]})]})]})}function vf({messages:e,suggestedReplies:t,loading:n,error:r,send:i}){const[o,l]=ye.useState(""),a=ye.useRef(null);ye.useEffect(()=>{var s;return(s=a.current)==null?void 0:s.scrollIntoView({behavior:"smooth"})},[e,n]);const u=()=>{o.trim()&&(i(o),l(""))};return L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"messages",children:[e.map(s=>L.jsx(Tf,{message:s},s.id)),n&&L.jsxs("div",{className:"typing-indicator",children:[L.jsx("span",{}),L.jsx("span",{}),L.jsx("span",{})]}),L.jsx("div",{ref:a})]}),t.length>0&&L.jsx("div",{className:"suggestions",children:t.map(s=>L.jsx("button",{onClick:()=>void i(s),children:s},s))}),r&&L.jsx("div",{className:"error-banner",children:r}),L.jsxs("div",{className:"composer",children:[L.jsx("input",{value:o,onChange:s=>l(s.target.value),onKeyDown:s=>s.key==="Enter"&&u(),placeholder:"Type a message...",disabled:n}),L.jsx("button",{onClick:u,disabled:n||!o.trim(),"aria-label":"Send message",children:L.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),L.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]})]})}function Pf({token:e,chatbotUrl:t,merchantId:n,autoOpen:r=!1}){const[i,o]=ye.useState(r),l=cr(e,t,n);ye.useEffect(()=>{r&&l.init()},[]);const a=()=>{o(!0),l.init()};return L.jsxs(L.Fragment,{children:[!i&&L.jsx("button",{className:"fab",onClick:a,"aria-label":"Open chatbot",children:"Chat"}),i&&L.jsxs("section",{className:"chat-panel",children:[L.jsxs("header",{children:[L.jsxs("div",{className:"chat-header-info",children:[L.jsx("div",{className:"chat-avatar",children:"AI"}),L.jsxs("div",{children:[L.jsx("strong",{children:"Operational Assistant"}),L.jsx("span",{children:"Online"})]})]}),L.jsxs("div",{className:"chat-header-actions",children:[L.jsx("button",{onClick:()=>void l.clear(),className:"header-icon-btn","aria-label":"New chat",title:"Start a new conversation",children:L.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("path",{d:"M12 20h9"}),L.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),L.jsx("button",{onClick:()=>o(!1),className:"header-icon-btn","aria-label":"Close chatbot",children:L.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),L.jsx(vf,{...l})]})]})}exports.ChatWidget=Pf;exports.useChatbot=cr;
|
|
10
|
+
`}]}}const Un=function(e){if(e==null)return _a;if(typeof e=="function")return nn(e);if(typeof e=="object")return Array.isArray(e)?Na(e):Oa(e);if(typeof e=="string")return Fa(e);throw new Error("Expected function, string, or object as test")};function Na(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=Un(e[t]);return nn(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function Oa(e){const n=e;return nn(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function Fa(e){return nn(n);function n(t){return t&&t.type===e}}function nn(e){return n;function n(t,r,i){return!!(Ra(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function _a(){return!0}function Ra(e){return e!==null&&typeof e=="object"&&"type"in e}const yr=[],Ma=!0,Ct=!1,Ba="skip";function xr(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=Un(i),o=r?-1:1;a(e,void 0,[])();function a(s,u,c){const f=s&&typeof s=="object"?s:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(s.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=yr,g,k,E;if((!n||l(s,u,c[c.length-1]||void 0))&&(p=ja(t(s,c)),p[0]===Ct))return p;if("children"in s&&s.children){const w=s;if(w.children&&p[0]!==Ba)for(k=(r?w.children.length:-1)+o,E=c.concat(w);k>-1&&k<w.children.length;){const v=w.children[k];if(g=a(v,k,E)(),g[0]===Ct)return g;k=typeof g[1]=="number"?g[1]:k+o}}return p}}}function ja(e){return Array.isArray(e)?e:typeof e=="number"?[Ma,e]:e==null?yr:[e]}function kr(e,n,t,r){let i,l,o;typeof n=="function"&&typeof t!="function"?(l=void 0,o=n,i=t):(l=n,o=t,i=r),xr(e,l,a,i);function a(s,u){const c=u[u.length-1],f=c?c.children.indexOf(s):void 0;return o(s,f,c)}}const Cn={}.hasOwnProperty,Ua={};function Ha(e,n){const t=n||Ua,r=new Map,i=new Map,l=new Map,o={...Ea,...t.handlers},a={all:u,applyData:qa,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:s,options:t,patch:Va,wrap:Wa};return kr(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,m=String(c.identifier).toUpperCase();f.has(m)||f.set(m,c)}}),a;function s(c,f){const m=c.type,p=a.handlers[m];if(Cn.call(a.handlers,m)&&p)return p(a,c,f);if(a.options.passThrough&&a.options.passThrough.includes(m)){if("children"in c){const{children:k,...E}=c,w=Ke(E);return w.children=a.all(c),w}return Ke(c)}return(a.options.unknownHandler||$a)(a,c,f)}function u(c){const f=[];if("children"in c){const m=c.children;let p=-1;for(;++p<m.length;){const g=a.one(m[p],c);if(g){if(p&&m[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Et(g.value)),!Array.isArray(g)&&g.type==="element")){const k=g.children[0];k&&k.type==="text"&&(k.value=Et(k.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function Va(e,n){e.position&&(n.position=Ii(e))}function qa(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const o="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:o}}t.type==="element"&&l&&Object.assign(t.properties,Ke(l)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function $a(e,n){const t=n.data||{},r="value"in n&&!(Cn.call(t,"hProperties")||Cn.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 Wa(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
|
|
11
|
+
`});++r<e.length;)r&&t.push({type:"text",value:`
|
|
12
|
+
`}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
|
|
13
|
+
`}),t}function Et(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function It(e,n){const t=Ha(e,n),r=t.one(e,void 0),i=Da(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
|
|
14
|
+
`},i),l}function Xa(e,n){return e&&"run"in e?async function(t,r){const i=It(t,{file:r,...n});await e.run(i,r)}:function(t,r){return It(t,{file:r,...e||n})}}function Tt(e){if(e)throw e}var Xe=Object.prototype.hasOwnProperty,br=Object.prototype.toString,At=Object.defineProperty,Pt=Object.getOwnPropertyDescriptor,vt=function(n){return typeof Array.isArray=="function"?Array.isArray(n):br.call(n)==="[object Array]"},zt=function(n){if(!n||br.call(n)!=="[object Object]")return!1;var t=Xe.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&Xe.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!t&&!r)return!1;var i;for(i in n);return typeof i>"u"||Xe.call(n,i)},Lt=function(n,t){At&&t.name==="__proto__"?At(n,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):n[t.name]=t.newValue},Dt=function(n,t){if(t==="__proto__")if(Xe.call(n,t)){if(Pt)return Pt(n,t).value}else return;return n[t]},Ya=function e(){var n,t,r,i,l,o,a=arguments[0],s=1,u=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},s=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});s<u;++s)if(n=arguments[s],n!=null)for(t in n)r=Dt(a,t),i=Dt(n,t),a!==i&&(c&&i&&(zt(i)||(l=vt(i)))?(l?(l=!1,o=r&&vt(r)?r:[]):o=r&&zt(r)?r:{},Lt(a,{name:t,newValue:e(c,o,i)})):typeof i<"u"&&Lt(a,{name:t,newValue:i}));return a};const un=Wt(Ya);function En(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 Qa(){const e=[],n={run:t,use:r};return n;function t(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(s,...u){const c=e[++l];let f=-1;if(s){o(s);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?Ka(c,a)(...u):o(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 Ka(e,n){let t;return r;function r(...o){const a=e.length>o.length;let s;a&&o.push(i);try{s=e.apply(this,o)}catch(u){const c=u;if(a&&t)throw c;return i(c)}a||(s&&s.then&&typeof s.then=="function"?s.then(l,i):s instanceof Error?i(s):l(s))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const ue={basename:Ga,dirname:Ja,extname:Za,join:eu,sep:"/"};function Ga(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ue(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function Ja(e){if(Ue(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 Za(e){Ue(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function eu(...e){let n=-1,t;for(;++n<e.length;)Ue(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":nu(t)}function nu(e){Ue(e);const n=e.codePointAt(0)===47;let t=tu(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function tu(e,n){let t="",r=0,i=-1,l=0,o=-1,a,s;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(s=t.lastIndexOf("/"),s!==t.length-1){s<0?(t="",r=0):(t=t.slice(0,s),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function Ue(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ru={cwd:iu};function iu(){return"/"}function In(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lu(e){if(typeof e=="string")e=new URL(e);else if(!In(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 ou(e)}function ou(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 sn=["history","path","basename","stem","extname","dirname"];class wr{constructor(n){let t;n?In(n)?t={path:n}:typeof n=="string"||au(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":ru.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sn.length;){const l=sn[r];l in t&&t[l]!==void 0&&t[l]!==null&&(this[l]=l==="history"?[...t[l]]:t[l])}let i;for(i in t)sn.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?ue.basename(this.path):void 0}set basename(n){pn(n,"basename"),cn(n,"basename"),this.path=ue.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ue.dirname(this.path):void 0}set dirname(n){Nt(this.basename,"dirname"),this.path=ue.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ue.extname(this.path):void 0}set extname(n){if(cn(n,"extname"),Nt(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=ue.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){In(n)&&(n=lu(n)),pn(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ue.basename(this.path,this.extname):void 0}set stem(n){pn(n,"stem"),cn(n,"stem"),this.path=ue.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 K(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 cn(e,n){if(e&&e.includes(ue.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ue.sep+"`")}function pn(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Nt(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function au(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uu=function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l},su={}.hasOwnProperty;class Hn extends uu{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=Qa()}copy(){const n=new Hn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(un(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(dn("data",this.frozen),this.namespace[n]=t,this):su.call(this.namespace,n)&&this.namespace[n]||void 0:n?(dn("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=$e(n),r=this.parser||this.Parser;return fn("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),fn("process",this.parser||this.Parser),hn("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(l,o){const a=$e(n),s=r.parse(a);r.run(s,a,function(c,f,m){if(c||!f||!m)return u(c);const p=f,g=r.stringify(p,m);fu(g)?m.value=g:m.result=g,u(c,m)});function u(c,f){c||!f?o(c):l?l(f):t(void 0,f)}}}processSync(n){let t=!1,r;return this.freeze(),fn("processSync",this.parser||this.Parser),hn("processSync",this.compiler||this.Compiler),this.process(n,i),Ft("processSync","process",t),r;function i(l,o){t=!0,Tt(l),r=o}}run(n,t,r){Ot(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?l(void 0,r):new Promise(l);function l(o,a){const s=$e(t);i.run(n,s,u);function u(c,f,m){const p=f||n;c?a(c):o?o(p):r(void 0,p,m)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),Ft("runSync","run",r),i;function l(o,a){Tt(o),i=a,r=!0}}stringify(n,t){this.freeze();const r=$e(t),i=this.compiler||this.Compiler;return hn("stringify",i),Ot(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(dn("use",this.frozen),n!=null)if(typeof n=="function")s(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):o(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;s(c,f)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(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=un(!0,i.settings,u.settings))}function a(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];l(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,c){let f=-1,m=-1;for(;++f<r.length;)if(r[f][0]===u){m=f;break}if(m===-1)r.push([u,...c]);else if(c.length>0){let[p,...g]=c;const k=r[m][1];En(k)&&En(p)&&(p=un(!0,k,p)),r[m]=[u,p,...g]}}}}const cu=new Hn().freeze();function fn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dn(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 Ot(e){if(!En(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ft(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function $e(e){return pu(e)?e:new wr(e)}function pu(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function fu(e){return typeof e=="string"||hu(e)}function hu(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const du="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",_t=[],Rt={allowDangerousHtml:!0},mu=/^(https?|ircs?|mailto|xmpp)$/i,gu=[{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 yu(e){const n=xu(e),t=ku(e);return bu(n.runSync(n.parse(t),t),e)}function xu(e){const n=e.rehypePlugins||_t,t=e.remarkPlugins||_t,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Rt}:Rt;return cu().use(Jo).use(t).use(Xa,r).use(n)}function ku(e){const n=e.children||"",t=new wr;return typeof n=="string"&&(t.value=n),t}function bu(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,s=n.urlTransform||wu;for(const c of gu)Object.hasOwn(n,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+du+c.id,void 0);return kr(e,u),zi(e,{Fragment:L.Fragment,components:i,ignoreInvalidStyle:!0,jsx:L.jsx,jsxs:L.jsxs,passKeys:!0,passNode:!0});function u(c,f,m){if(c.type==="raw"&&m&&typeof f=="number")return o?m.children.splice(f,1):m.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let p;for(p in ln)if(Object.hasOwn(ln,p)&&Object.hasOwn(c.properties,p)){const g=c.properties[p],k=ln[p];(k===null||k.includes(c.tagName))&&(c.properties[p]=s(String(g||""),p,c))}}if(c.type==="element"){let p=t?!t.includes(c.tagName):l?l.includes(c.tagName):!1;if(!p&&r&&typeof f=="number"&&(p=!r(c,f,m)),p&&m&&typeof f=="number")return a&&c.children?m.children.splice(f,1,...c.children):m.children.splice(f,1),f}}}function wu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||mu.test(e.slice(0,n))?e:""}function Su(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Cu(e,n,t){const i=Un({}.ignore||[]),l=Eu(n);let o=-1;for(;++o<l.length;)xr(e,"text",a);function a(u,c){let f=-1,m;for(;++f<c.length;){const p=c[f],g=m?m.children:void 0;if(i(p,g?g.indexOf(p):void 0,m))return;m=p}if(m)return s(u,c)}function s(u,c){const f=c[c.length-1],m=l[o][0],p=l[o][1];let g=0;const E=f.children.indexOf(u);let w=!1,v=[];m.lastIndex=0;let C=m.exec(u.value);for(;C;){const F=C.index,U={index:C.index,input:C.input,stack:[...c,u]};let x=p(...C,U);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?m.lastIndex=F+1:(g!==F&&v.push({type:"text",value:u.value.slice(g,F)}),Array.isArray(x)?v.push(...x):x&&v.push(x),g=F+C[0].length,w=!0),!m.global)break;C=m.exec(u.value)}return w?(g<u.value.length&&v.push({type:"text",value:u.value.slice(g)}),f.children.splice(E,1,...v)):v=[u],E+v.length}}function Eu(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([Iu(i[0]),Tu(i[1])])}return n}function Iu(e){return typeof e=="string"?new RegExp(Su(e),"g"):e}function Tu(e){return typeof e=="function"?e:function(){return e}}function Au(e){Cu(e,[/\r?\n|\r/g,Pu])}function Pu(){return{type:"break"}}function vu(){return function(e){Au(e)}}function zu(e){return e.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:6})}function Lu({message:e}){return L.jsxs("div",{className:`bubble ${e.role}`,children:[e.role==="assistant"?L.jsx(yu,{remarkPlugins:[vu],children:e.content}):e.content,L.jsx("small",{children:e.timestamp.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})}),e.role==="assistant"&&e.usage&&L.jsxs("small",{className:"usage",children:["Input: ",e.usage.inputTokens.toLocaleString("en-US")," | ","Output: ",e.usage.outputTokens.toLocaleString("en-US")," | ","Estimated cost: ",zu(e.usage.estimatedCostUsd)]})]})}function Du({messages:e,suggestedReplies:n,loading:t,error:r,send:i}){const[l,o]=me.useState(""),a=me.useRef(null);me.useEffect(()=>{var u;return(u=a.current)==null?void 0:u.scrollIntoView({behavior:"smooth"})},[e,t]);const s=()=>{l.trim()&&(i(l),o(""))};return L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"messages",children:[e.map(u=>L.jsx(Lu,{message:u},u.id)),t&&L.jsx("div",{className:"typing",children:"Responding..."}),L.jsx("div",{ref:a})]}),n.length>0&&L.jsx("div",{className:"suggestions",children:n.map(u=>L.jsx("button",{onClick:()=>void i(u),children:u},u))}),r&&L.jsx("div",{className:"error-banner",children:r}),L.jsxs("div",{className:"composer",children:[L.jsx("input",{value:l,onChange:u=>o(u.target.value),onKeyDown:u=>u.key==="Enter"&&s(),placeholder:"Type a message...",disabled:t}),L.jsx("button",{onClick:s,disabled:t||!l.trim(),children:"Send"})]})]})}function Nu({token:e,chatbotUrl:n,merchantId:t,autoOpen:r=!1}){const[i,l]=me.useState(r),o=Mt(e,n,t);me.useEffect(()=>{r&&o.init()},[]);const a=()=>{l(!0),o.init()};return L.jsxs(L.Fragment,{children:[!i&&L.jsx("button",{className:"fab",onClick:a,"aria-label":"Open chatbot",children:"Chat"}),i&&L.jsxs("section",{className:"chat-panel",children:[L.jsxs("header",{children:[L.jsxs("div",{className:"chat-header-info",children:[L.jsx("div",{className:"chat-avatar",children:"AI"}),L.jsxs("div",{children:[L.jsx("strong",{children:"Operational Assistant"}),L.jsx("span",{children:"Online"})]})]}),L.jsxs("div",{className:"chat-header-actions",children:[L.jsx("button",{onClick:()=>void o.clear(),className:"header-icon-btn","aria-label":"New chat",title:"Start a new conversation",children:L.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("path",{d:"M12 20h9"}),L.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})}),L.jsx("button",{onClick:()=>l(!1),className:"header-icon-btn","aria-label":"Close chatbot",children:L.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),L.jsx(Du,{...o})]})]})}exports.ChatWidget=Nu;exports.useChatbot=Mt;
|