@nameless26/widget 0.1.2 → 0.1.3

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 CHANGED
@@ -1,6 +1,20 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react");function W({color:t}){return e.jsx("div",{style:{background:"var(--nx-surface)"},className:`flex items-end gap-1 px-3 py-2.5 rounded-2xl rounded-bl-sm w-fit\r
2
- bg-[rgba(255,255,255,0.06)]`,children:[0,1,2].map(o=>e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:t,opacity:.6,animation:`nexusBounce 1.2s ease-in-out ${o*.2}s infinite`}},o))})}function z({msg:t,primaryColor:o}){const n=t.role==="user";return t.content?e.jsx("div",{className:`flex ${n?"justify-end":"justify-start"}`,children:e.jsx("div",{style:n?{background:o}:{background:"var(--nx-surface)",color:"var(--nx-text)"},className:`max-w-[82%] px-3 py-2.5 rounded-2xl text-sm leading-relaxed
3
- ${n?"text-white rounded-br-sm":"bg-[rgba(255,255,255,0.06)] text-[rgba(255,255,255,0.8)] rounded-bl-sm"}`,children:t.content})}):e.jsx(e.Fragment,{})}function L({agentName:t,messages:o,isLoading:n,error:f,primaryColor:u,welcomeMessage:l,onSend:b,onClose:c,isFullView:r,onToggleFullView:g}){const[x,d]=s.useState(""),N=s.useRef(null),p=s.useRef(null);s.useEffect(()=>{N.current?.scrollIntoView({behavior:"smooth"})},[o,n]),s.useEffect(()=>{p.current?.focus()},[]);const j=()=>{!x.trim()||n||(b(x),d(""))},C=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),j())};return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),V=require("react");function Cr(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const Er=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ir={};function qn(e,n){return(Ir.jsx?vr:Er).test(e)}const Tr=/[ \t\n\f\r]/g;function Pr(e){return typeof e=="object"?e.type==="text"?$n(e.value):!1:$n(e)}function $n(e){return e.replace(Tr,"")===""}class Ue{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Ue.prototype.normal={};Ue.prototype.property={};Ue.prototype.space=void 0;function Lt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Ue(t,r,n)}function mn(e){return e.toLowerCase()}class ee{constructor(n,t){this.attribute=t,this.property=n}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ar=0;const R=Se(),X=Se(),gn=Se(),k=Se(),W=Se(),we=Se(),te=Se();function Se(){return 2**++Ar}const xn=Object.freeze(Object.defineProperty({__proto__:null,boolean:R,booleanish:X,commaOrSpaceSeparated:te,commaSeparated:we,number:k,overloadedBoolean:gn,spaceSeparated:W},Symbol.toStringTag,{value:"Module"})),en=Object.keys(xn);class vn extends ee{constructor(n,t,r,i){let l=-1;if(super(n,t),Wn(this,"space",i),typeof r=="number")for(;++l<en.length;){const o=en[l];Wn(this,en[l],(r&xn[o])===xn[o])}}}vn.prototype.defined=!0;function Wn(e,n,t){t&&(e[n]=t)}function Ae(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new vn(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 Ue(n,t,e.space)}const jt=Ae({properties:{ariaActiveDescendant:null,ariaAtomic:X,ariaAutoComplete:null,ariaBusy:X,ariaChecked:X,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:W,ariaCurrent:null,ariaDescribedBy:W,ariaDetails:null,ariaDisabled:X,ariaDropEffect:W,ariaErrorMessage:null,ariaExpanded:X,ariaFlowTo:W,ariaGrabbed:X,ariaHasPopup:null,ariaHidden:X,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:W,ariaLevel:k,ariaLive:null,ariaModal:X,ariaMultiLine:X,ariaMultiSelectable:X,ariaOrientation:null,ariaOwns:W,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:X,ariaReadOnly:X,ariaRelevant:null,ariaRequired:X,ariaRoleDescription:W,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:X,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Nt(e,n){return n in e?e[n]:n}function Rt(e,n){return Nt(e,n.toLowerCase())}const zr=Ae({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:we,acceptCharset:W,accessKey:W,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:W,autoFocus:R,autoPlay:R,blocking:W,capture:null,charSet:null,checked:R,cite:null,className:W,closedBy:null,colorSpace:null,cols:k,colSpan:k,command:null,commandFor:null,content:null,contentEditable:X,controls:R,controlsList:W,coords:k|we,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:gn,draggable:X,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:W,height:k,hidden:gn,high:k,href:null,hrefLang:null,htmlFor:W,httpEquiv:W,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:W,itemRef:W,itemScope:R,itemType:W,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,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:R,optimum:k,pattern:null,ping:W,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:W,required:R,reversed:R,rows:k,rowSpan:k,sandbox:W,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:X,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:X,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:W,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:X,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:we,part:W,prefix:null,property:null,results:k,security:null,unselectable:null},space:"html",transform:Rt}),Lr=Ae({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:te,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:W,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:we,g2:we,glyphName:we,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:k,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:W,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Nt}),Dt=Ae({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()}}),Ot=Ae({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Rt}),Mt=Ae({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),jr={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"},Nr=/[A-Z]/g,Yn=/-[a-z]/g,Rr=/^data[-\w.:]+$/i;function Dr(e,n){const t=mn(n);let r=n,i=ee;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Rr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Yn,Mr);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Yn.test(l)){let o=l.replace(Nr,Or);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=vn}return new i(r,n)}function Or(e){return"-"+e.toLowerCase()}function Mr(e){return e.charAt(1).toUpperCase()}const _r=Lt([jt,zr,Dt,Ot,Mt],"html"),In=Lt([jt,Lr,Dt,Ot,Mt],"svg");function Fr(e){return e.join(" ").trim()}function _t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ie={},nn,Xn;function Br(){if(Xn)return nn;Xn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
2
+ `,s="/",u="*",p="",m="comment",f="declaration";function w(E,y){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];y=y||{};var A=1,I=1;function j(z){var v=z.match(n);v&&(A+=v.length);var q=z.lastIndexOf(c);I=~q?z.length-q:I+z.length}function _(){var z={line:A,column:I};return function(v){return v.position=new x(z),O(),v}}function x(z){this.start=z,this.end={line:A,column:I},this.source=y.source}x.prototype.content=E;function L(z){var v=new Error(y.source+":"+A+":"+I+": "+z);if(v.reason=z,v.filename=y.source,v.line=A,v.column=I,v.source=E,!y.silent)throw v}function F(z){var v=z.exec(E);if(v){var q=v[0];return j(q),E=E.slice(q.length),v}}function O(){F(t)}function M(z){var v;for(z=z||[];v=P();)v!==!1&&z.push(v);return z}function P(){var z=_();if(!(s!=E.charAt(0)||u!=E.charAt(1))){for(var v=2;p!=E.charAt(v)&&(u!=E.charAt(v)||s!=E.charAt(v+1));)++v;if(v+=2,p===E.charAt(v-1))return L("End of comment missing");var q=E.slice(2,v-2);return I+=2,j(q),E=E.slice(v),I+=2,z({type:m,comment:q})}}function T(){var z=_(),v=F(r);if(v){if(P(),!F(i))return L("property missing ':'");var q=F(l),Q=z({type:f,property:C(v[0].replace(e,p)),value:q?C(q[0].replace(e,p)):p});return F(o),Q}}function U(){var z=[];M(z);for(var v;v=T();)v!==!1&&(z.push(v),M(z));return z}return O(),U()}function C(E){return E?E.replace(a,p):p}return nn=w,nn}var Qn;function Hr(){if(Qn)return Ie;Qn=1;var e=Ie&&Ie.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.default=t;const n=e(Br());function t(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,n.default)(r),a=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:s,value:u}=c;a?i(s,u,c):u&&(l=l||{},l[s]=u)}),l}return Ie}var Re={},Kn;function Ur(){if(Kn)return Re;Kn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(s){return!s||t.test(s)||e.test(s)},o=function(s,u){return u.toUpperCase()},a=function(s,u){return"".concat(u,"-")},c=function(s,u){return u===void 0&&(u={}),l(s)?s:(s=s.toLowerCase(),u.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(n,o))};return Re.camelCase=c,Re}var De,Jn;function Vr(){if(Jn)return De;Jn=1;var e=De&&De.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(Hr()),t=Ur();function r(i,l){var o={};return!i||typeof i!="string"||(0,n.default)(i,function(a,c){a&&c&&(o[(0,t.camelCase)(a,l)]=c)}),o}return r.default=r,De=r,De}var qr=Vr();const $r=_t(qr),Ft=Bt("end"),Tn=Bt("start");function Bt(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Wr(e){const n=Tn(e),t=Ft(e);if(n&&t)return{start:n,end:t}}function _e(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Gn(e.position):"start"in e||"end"in e?Gn(e):"line"in e||"column"in e?yn(e):""}function yn(e){return Zn(e&&e.line)+":"+Zn(e&&e.column)}function Gn(e){return yn(e&&e.start)+"-"+yn(e&&e.end)}function Zn(e){return e&&typeof e=="number"?e:1}class J 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 c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.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}}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 Pn={}.hasOwnProperty,Yr=new Map,Xr=/[A-Z]/g,Qr=new Set(["table","tbody","thead","tfoot","tr"]),Kr=new Set(["td","th"]),Ht="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Jr(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=li(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=ii(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"?In:_r,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Ut(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Ut(e,n,t){if(n.type==="element")return Gr(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return Zr(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return ni(e,n,t);if(n.type==="mdxjsEsm")return ei(e,n);if(n.type==="root")return ti(e,n,t);if(n.type==="text")return ri(e,n)}function Gr(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=In,e.schema=i),e.ancestors.push(n);const l=qt(e,n.tagName,!1),o=oi(e,n);let a=zn(e,n);return Qr.has(n.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!Pr(c):!0})),Vt(e,o,l,n),An(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function Zr(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)}He(e,n.position)}function ei(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);He(e,n.position)}function ni(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=In,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:qt(e,n.name,!0),o=ai(e,n),a=zn(e,n);return Vt(e,o,l,n),An(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function ti(e,n,t){const r={};return An(r,zn(e,n)),e.create(n,e.Fragment,r,t)}function ri(e,n){return n.value}function Vt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function An(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function ii(e,n,t){return r;function r(i,l,o,a){const s=Array.isArray(o.children)?t:n;return a?s(l,o,a):s(l,o)}}function li(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),c=Tn(r);return n(i,l,o,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function oi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&Pn.call(n.properties,i)){const l=si(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Kr.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 ai(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 He(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 He(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function zn(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:Yr;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const s=i.get(c)||0;o=c+"-"+s,i.set(c,s+1)}}const a=Ut(e,l,o);a!==void 0&&t.push(a)}return t}function si(e,n,t){const r=Dr(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Cr(t):Fr(t)),r.property==="style"){let i=typeof t=="object"?t:ui(e,String(t));return e.stylePropertyNameCase==="css"&&(i=ci(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?jr[r.property]||r.property:r.attribute,t]}}function ui(e,n){try{return $r(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,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=Ht+"#cannot-parse-style-attribute",i}}function qt(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=qn(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=qn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return Pn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);He(e)}function He(e,n){const t=new J("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=Ht+"#cannot-handle-mdx-estrees-without-createevaluater",t}function ci(e){const n={};let t;for(t in e)Pn.call(e,t)&&(n[pi(t)]=e[t]);return n}function pi(e){let n=e.replace(Xr,fi);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function fi(e){return"-"+e.toLowerCase()}const tn={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"]},hi={};function di(e,n){const t=hi,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return $t(e,r,i)}function $t(e,n,t){if(mi(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 et(e.children,n,t)}return Array.isArray(e)?et(e,n,t):""}function et(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=$t(e[i],n,t);return r.join("")}function mi(e){return!!(e&&typeof e=="object")}const nt=document.createElement("i");function Ln(e){const n="&"+e+";";nt.innerHTML=n;const t=nt.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function pe(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function ie(e,n){return e.length>0?(pe(e,e.length,0,n),e):n}const tt={}.hasOwnProperty;function gi(e){const n={};let t=-1;for(;++t<e.length;)xi(n,e[t]);return n}function xi(e,n){let t;for(t in n){const i=(tt.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){tt.call(i,o)||(i[o]=[]);const a=l[o];yi(i[o],Array.isArray(a)?a:a?[a]:[])}}}function yi(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);pe(e,0,0,r)}function Wt(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 ce=ye(/[A-Za-z]/),re=ye(/[\dA-Za-z]/),bi=ye(/[#-'*+\--9=?A-Z^-~]/);function bn(e){return e!==null&&(e<32||e===127)}const kn=ye(/\d/),ki=ye(/[\dA-Fa-f]/),wi=ye(/[!-/:-@[-`{-~]/);function N(e){return e!==null&&e<-2}function Z(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}const Si=ye(new RegExp("\\p{P}|\\p{S}","u")),Ci=ye(/\s/);function ye(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&&re(e.charCodeAt(t+1))&&re(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 Y(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(c){return H(c)?(e.enter(t),a(c)):n(c)}function a(c){return H(c)&&l++<i?(e.consume(c),a):(e.exit(t),n(c))}}const Ei={tokenize:vi};function vi(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"),Y(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const c=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=c),t=c,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return N(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const Ii={tokenize:Ti},rt={tokenize:Pi};function Ti(e){const n=this,t=[];let r=0,i,l,o;return a;function a(I){if(r<t.length){const j=t[r];return n.containerState=j[1],e.attempt(j[0].continuation,c,s)(I)}return s(I)}function c(I){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&A();const j=n.events.length;let _=j,x;for(;_--;)if(n.events[_][0]==="exit"&&n.events[_][1].type==="chunkFlow"){x=n.events[_][1].end;break}y(r);let L=j;for(;L<n.events.length;)n.events[L][1].end={...x},L++;return pe(n.events,_+1,0,n.events.slice(j)),n.events.length=L,s(I)}return a(I)}function s(I){if(r===t.length){if(!i)return m(I);if(i.currentConstruct&&i.currentConstruct.concrete)return w(I);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(rt,u,p)(I)}function u(I){return i&&A(),y(r),m(I)}function p(I){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,w(I)}function m(I){return n.containerState={},e.attempt(rt,f,w)(I)}function f(I){return r++,t.push([n.currentConstruct,n.containerState]),m(I)}function w(I){if(I===null){i&&A(),y(0),e.consume(I);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),C(I)}function C(I){if(I===null){E(e.exit("chunkFlow"),!0),y(0),e.consume(I);return}return N(I)?(e.consume(I),E(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(I),C)}function E(I,j){const _=n.sliceStream(I);if(j&&_.push(null),I.previous=l,l&&(l.next=I),l=I,i.defineSkip(I.start),i.write(_),n.parser.lazy[I.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 L=n.events.length;let F=L,O,M;for(;F--;)if(n.events[F][0]==="exit"&&n.events[F][1].type==="chunkFlow"){if(O){M=n.events[F][1].end;break}O=!0}for(y(r),x=L;x<n.events.length;)n.events[x][1].end={...M},x++;pe(n.events,F+1,0,n.events.slice(L)),n.events.length=x}}function y(I){let j=t.length;for(;j-- >I;){const _=t[j];n.containerState=_[1],_[0].exit.call(n,e)}t.length=I}function A(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Pi(e,n,t){return Y(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function it(e){if(e===null||Z(e)||Ci(e))return 1;if(Si(e))return 2}function jn(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 wn={name:"attention",resolveAll:Ai,tokenize:zi};function Ai(e,n){let t=-1,r,i,l,o,a,c,s,u;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;c=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 p={...e[r][1].end},m={...e[t][1].start};lt(p,-c),lt(m,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:m},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ie(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=ie(s,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),s=ie(s,jn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=ie(s,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(u=2,s=ie(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):u=0,pe(e,r-1,t-r+3,s),t=r+s.length-u-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function zi(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=it(r);let l;return o;function o(c){return l=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===l)return e.consume(c),a;const s=e.exit("attentionSequence"),u=it(c),p=!u||u===2&&i||t.includes(c),m=!i||i===2&&u||t.includes(r);return s._open=!!(l===42?p:p&&(i||!m)),s._close=!!(l===42?m:m&&(u||!p)),n(c)}}function lt(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Li={name:"autolink",tokenize:ji};function ji(e,n,t){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(f){return ce(f)?(e.consume(f),o):f===64?t(f):s(f)}function o(f){return f===43||f===45||f===46||re(f)?(r=1,a(f)):s(f)}function a(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||re(f))&&r++<32?(e.consume(f),a):(r=0,s(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):f===null||f===32||f===60||bn(f)?t(f):(e.consume(f),c)}function s(f){return f===64?(e.consume(f),u):bi(f)?(e.consume(f),s):t(f)}function u(f){return re(f)?p(f):t(f)}function p(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):m(f)}function m(f){if((f===45||re(f))&&r++<63){const w=f===45?m:p;return e.consume(f),w}return t(f)}}const Je={partial:!0,tokenize:Ni};function Ni(e,n,t){return r;function r(l){return H(l)?Y(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||N(l)?n(l):t(l)}}const Yt={continuation:{tokenize:Di},exit:Oi,name:"blockQuote",tokenize:Ri};function Ri(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 H(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function Di(e,n,t){const r=this;return i;function i(o){return H(o)?Y(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(Yt,n,t)(o)}}function Oi(e){e.exit("blockQuote")}const Xt={name:"characterEscape",tokenize:Mi};function Mi(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 wi(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const Qt={name:"characterReference",tokenize:_i};function _i(e,n,t){const r=this;let i=0,l,o;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),c}function c(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),l=31,o=re,u(p))}function s(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=ki,u):(e.enter("characterReferenceValue"),l=7,o=kn,u(p))}function u(p){if(p===59&&i){const m=e.exit("characterReferenceValue");return o===re&&!Ln(r.sliceSerialize(m))?t(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(p)&&i++<l?(e.consume(p),u):t(p)}}const ot={partial:!0,tokenize:Bi},at={concrete:!0,name:"codeFenced",tokenize:Fi};function Fi(e,n,t){const r=this,i={partial:!0,tokenize:_};let l=0,o=0,a;return c;function c(x){return s(x)}function s(x){const L=r.events[r.events.length-1];return l=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(x)}function u(x){return x===a?(o++,e.consume(x),u):o<3?t(x):(e.exit("codeFencedFenceSequence"),H(x)?Y(e,p,"whitespace")(x):p(x))}function p(x){return x===null||N(x)?(e.exit("codeFencedFence"),r.interrupt?n(x):e.check(ot,C,j)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||N(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(x)):H(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Y(e,f,"whitespace")(x)):x===96&&x===a?t(x):(e.consume(x),m)}function f(x){return x===null||N(x)?p(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(x))}function w(x){return x===null||N(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(x)):x===96&&x===a?t(x):(e.consume(x),w)}function C(x){return e.attempt(i,j,E)(x)}function E(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),y}function y(x){return l>0&&H(x)?Y(e,A,"linePrefix",l+1)(x):A(x)}function A(x){return x===null||N(x)?e.check(ot,C,j)(x):(e.enter("codeFlowValue"),I(x))}function I(x){return x===null||N(x)?(e.exit("codeFlowValue"),A(x)):(e.consume(x),I)}function j(x){return e.exit("codeFenced"),n(x)}function _(x,L,F){let O=0;return M;function M(v){return x.enter("lineEnding"),x.consume(v),x.exit("lineEnding"),P}function P(v){return x.enter("codeFencedFence"),H(v)?Y(x,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):T(v)}function T(v){return v===a?(x.enter("codeFencedFenceSequence"),U(v)):F(v)}function U(v){return v===a?(O++,x.consume(v),U):O>=o?(x.exit("codeFencedFenceSequence"),H(v)?Y(x,z,"whitespace")(v):z(v)):F(v)}function z(v){return v===null||N(v)?(x.exit("codeFencedFence"),L(v)):F(v)}}}function Bi(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 rn={name:"codeIndented",tokenize:Ui},Hi={partial:!0,tokenize:Vi};function Ui(e,n,t){const r=this;return i;function i(s){return e.enter("codeIndented"),Y(e,l,"linePrefix",5)(s)}function l(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(s):t(s)}function o(s){return s===null?c(s):N(s)?e.attempt(Hi,o,c)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||N(s)?(e.exit("codeFlowValue"),o(s)):(e.consume(s),a)}function c(s){return e.exit("codeIndented"),n(s)}}function Vi(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):N(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Y(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):N(o)?i(o):t(o)}}const qi={name:"codeText",previous:Wi,resolve:$i,tokenize:Yi};function $i(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 Wi(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Yi(e,n,t){let r=0,i,l;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),a(p)}function a(p){return p===96?(e.consume(p),r++,a):(e.exit("codeTextSequence"),c(p))}function c(p){return p===null?t(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),c):p===96?(l=e.enter("codeTextSequence"),i=0,u(p)):N(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("codeTextData"),s(p))}function s(p){return p===null||p===32||p===96||N(p)?(e.exit("codeTextData"),c(p)):(e.consume(p),s)}function u(p){return p===96?(e.consume(p),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(p)):(l.type="codeTextData",s(p))}}class Xi{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 Kt(e){const n={};let t=-1,r,i,l,o,a,c,s;const u=new Xi(e);for(;++t<u.length;){for(;t in n;)t=n[t];if(r=u.get(t),t&&r[1].type==="chunkFlow"&&u.get(t-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Qi(u,t)),t=n[t],s=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=u.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.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={...u.get(i)[1].start},a=u.slice(i,t),a.unshift(r),u.splice(i,t-i+1,a))}}return pe(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!s}function Qi(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,c=[],s={};let u,p,m=-1,f=t,w=0,C=0;const E=[C];for(;f;){for(;e.get(++i)[1]!==f;);l.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),p&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=f,f=f.next}for(f=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&&(C=m+1,E.push(C),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):E.pop(),m=E.length;m--;){const y=a.slice(E[m],E[m+1]),A=l.pop();c.push([A,A+y.length-1]),e.splice(A,2,y)}for(c.reverse(),m=-1;++m<c.length;)s[w+c[m][0]]=w+c[m][1],w+=c[m][1]-c[m][0]-1;return s}const Ki={resolve:Gi,tokenize:Zi},Ji={partial:!0,tokenize:el};function Gi(e){return Kt(e),e}function Zi(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):N(a)?e.check(Ji,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 el(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Y(e,l,"linePrefix")}function l(o){if(o===null||N(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 Jt(e,n,t,r,i,l,o,a,c){const s=c||Number.POSITIVE_INFINITY;let u=0;return p;function p(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),m):y===null||y===32||y===41||bn(y)?t(y):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),C(y))}function m(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),m(y)):y===null||y===60||N(y)?t(y):(e.consume(y),y===92?w:f)}function w(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function C(y){return!u&&(y===null||y===41||Z(y))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(y)):u<s&&y===40?(e.consume(y),u++,C):y===41?(e.consume(y),u--,C):y===null||y===32||y===40||bn(y)?t(y):(e.consume(y),y===92?E:C)}function E(y){return y===40||y===41||y===92?(e.consume(y),C):C(y)}}function Gt(e,n,t,r,i,l){const o=this;let a=0,c;return s;function s(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(l),u}function u(f){return a>999||f===null||f===91||f===93&&!c||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(f):f===93?(e.exit(l),e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):N(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||N(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),c||(c=!H(f)),f===92?m:p)}function m(f){return f===91||f===92||f===93?(e.consume(f),a++,p):p(f)}}function Zt(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,c):t(m)}function c(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),n):(e.enter(l),s(m))}function s(m){return m===o?(e.exit(l),c(o)):m===null?t(m):N(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Y(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(m))}function u(m){return m===o||m===null||N(m)?(e.exit("chunkString"),s(m)):(e.consume(m),m===92?p:u)}function p(m){return m===o||m===92?(e.consume(m),u):u(m)}}function Fe(e,n){let t;return r;function r(i){return N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):H(i)?Y(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const nl={name:"definition",tokenize:rl},tl={partial:!0,tokenize:il};function rl(e,n,t){const r=this;let i;return l;function l(f){return e.enter("definition"),o(f)}function o(f){return Gt.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):t(f)}function c(f){return Z(f)?Fe(e,s)(f):s(f)}function s(f){return Jt(e,u,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(tl,p,p)(f)}function p(f){return H(f)?Y(e,m,"whitespace")(f):m(f)}function m(f){return f===null||N(f)?(e.exit("definition"),r.parser.defined.push(i),n(f)):t(f)}}function il(e,n,t){return r;function r(a){return Z(a)?Fe(e,i)(a):t(a)}function i(a){return Zt(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return H(a)?Y(e,o,"whitespace")(a):o(a)}function o(a){return a===null||N(a)?n(a):t(a)}}const ll={name:"hardBreakEscape",tokenize:ol};function ol(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return N(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const al={name:"headingAtx",resolve:sl,tokenize:ul};function sl(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"},pe(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function ul(e,n,t){let r=0;return i;function i(u){return e.enter("atxHeading"),l(u)}function l(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Z(u)?(e.exit("atxHeadingSequence"),a(u)):t(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),c(u)):u===null||N(u)?(e.exit("atxHeading"),n(u)):H(u)?Y(e,a,"whitespace")(u):(e.enter("atxHeadingText"),s(u))}function c(u){return u===35?(e.consume(u),c):(e.exit("atxHeadingSequence"),a(u))}function s(u){return u===null||u===35||Z(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),s)}}const cl=["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"],st=["pre","script","style","textarea"],pl={concrete:!0,name:"htmlFlow",resolveTo:dl,tokenize:ml},fl={partial:!0,tokenize:xl},hl={partial:!0,tokenize:gl};function dl(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 ml(e,n,t){const r=this;let i,l,o,a,c;return s;function s(d){return u(d)}function u(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),p}function p(d){return d===33?(e.consume(d),m):d===47?(e.consume(d),l=!0,C):d===63?(e.consume(d),i=3,r.interrupt?n:h):ce(d)?(e.consume(d),o=String.fromCharCode(d),E):t(d)}function m(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,w):ce(d)?(e.consume(d),i=4,r.interrupt?n:h):t(d)}function f(d){return d===45?(e.consume(d),r.interrupt?n:h):t(d)}function w(d){const ae="CDATA[";return d===ae.charCodeAt(a++)?(e.consume(d),a===ae.length?r.interrupt?n:T:w):t(d)}function C(d){return ce(d)?(e.consume(d),o=String.fromCharCode(d),E):t(d)}function E(d){if(d===null||d===47||d===62||Z(d)){const ae=d===47,be=o.toLowerCase();return!ae&&!l&&st.includes(be)?(i=1,r.interrupt?n(d):T(d)):cl.includes(o.toLowerCase())?(i=6,ae?(e.consume(d),y):r.interrupt?n(d):T(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(d):l?A(d):I(d))}return d===45||re(d)?(e.consume(d),o+=String.fromCharCode(d),E):t(d)}function y(d){return d===62?(e.consume(d),r.interrupt?n:T):t(d)}function A(d){return H(d)?(e.consume(d),A):M(d)}function I(d){return d===47?(e.consume(d),M):d===58||d===95||ce(d)?(e.consume(d),j):H(d)?(e.consume(d),I):M(d)}function j(d){return d===45||d===46||d===58||d===95||re(d)?(e.consume(d),j):_(d)}function _(d){return d===61?(e.consume(d),x):H(d)?(e.consume(d),_):I(d)}function x(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),c=d,L):H(d)?(e.consume(d),x):F(d)}function L(d){return d===c?(e.consume(d),c=null,O):d===null||N(d)?t(d):(e.consume(d),L)}function F(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||Z(d)?_(d):(e.consume(d),F)}function O(d){return d===47||d===62||H(d)?I(d):t(d)}function M(d){return d===62?(e.consume(d),P):t(d)}function P(d){return d===null||N(d)?T(d):H(d)?(e.consume(d),P):t(d)}function T(d){return d===45&&i===2?(e.consume(d),q):d===60&&i===1?(e.consume(d),Q):d===62&&i===4?(e.consume(d),oe):d===63&&i===3?(e.consume(d),h):d===93&&i===5?(e.consume(d),fe):N(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(fl,he,U)(d)):d===null||N(d)?(e.exit("htmlFlowData"),U(d)):(e.consume(d),T)}function U(d){return e.check(hl,z,he)(d)}function z(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),v}function v(d){return d===null||N(d)?U(d):(e.enter("htmlFlowData"),T(d))}function q(d){return d===45?(e.consume(d),h):T(d)}function Q(d){return d===47?(e.consume(d),o="",le):T(d)}function le(d){if(d===62){const ae=o.toLowerCase();return st.includes(ae)?(e.consume(d),oe):T(d)}return ce(d)&&o.length<8?(e.consume(d),o+=String.fromCharCode(d),le):T(d)}function fe(d){return d===93?(e.consume(d),h):T(d)}function h(d){return d===62?(e.consume(d),oe):d===45&&i===2?(e.consume(d),h):T(d)}function oe(d){return d===null||N(d)?(e.exit("htmlFlowData"),he(d)):(e.consume(d),oe)}function he(d){return e.exit("htmlFlow"),n(d)}}function gl(e,n,t){const r=this;return i;function i(o){return N(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 xl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Je,n,t)}}const yl={name:"htmlText",tokenize:bl};function bl(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),c}function c(h){return h===33?(e.consume(h),s):h===47?(e.consume(h),_):h===63?(e.consume(h),I):ce(h)?(e.consume(h),F):t(h)}function s(h){return h===45?(e.consume(h),u):h===91?(e.consume(h),l=0,w):ce(h)?(e.consume(h),A):t(h)}function u(h){return h===45?(e.consume(h),f):t(h)}function p(h){return h===null?t(h):h===45?(e.consume(h),m):N(h)?(o=p,Q(h)):(e.consume(h),p)}function m(h){return h===45?(e.consume(h),f):p(h)}function f(h){return h===62?q(h):h===45?m(h):p(h)}function w(h){const oe="CDATA[";return h===oe.charCodeAt(l++)?(e.consume(h),l===oe.length?C:w):t(h)}function C(h){return h===null?t(h):h===93?(e.consume(h),E):N(h)?(o=C,Q(h)):(e.consume(h),C)}function E(h){return h===93?(e.consume(h),y):C(h)}function y(h){return h===62?q(h):h===93?(e.consume(h),y):C(h)}function A(h){return h===null||h===62?q(h):N(h)?(o=A,Q(h)):(e.consume(h),A)}function I(h){return h===null?t(h):h===63?(e.consume(h),j):N(h)?(o=I,Q(h)):(e.consume(h),I)}function j(h){return h===62?q(h):I(h)}function _(h){return ce(h)?(e.consume(h),x):t(h)}function x(h){return h===45||re(h)?(e.consume(h),x):L(h)}function L(h){return N(h)?(o=L,Q(h)):H(h)?(e.consume(h),L):q(h)}function F(h){return h===45||re(h)?(e.consume(h),F):h===47||h===62||Z(h)?O(h):t(h)}function O(h){return h===47?(e.consume(h),q):h===58||h===95||ce(h)?(e.consume(h),M):N(h)?(o=O,Q(h)):H(h)?(e.consume(h),O):q(h)}function M(h){return h===45||h===46||h===58||h===95||re(h)?(e.consume(h),M):P(h)}function P(h){return h===61?(e.consume(h),T):N(h)?(o=P,Q(h)):H(h)?(e.consume(h),P):O(h)}function T(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(e.consume(h),i=h,U):N(h)?(o=T,Q(h)):H(h)?(e.consume(h),T):(e.consume(h),z)}function U(h){return h===i?(e.consume(h),i=void 0,v):h===null?t(h):N(h)?(o=U,Q(h)):(e.consume(h),U)}function z(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||Z(h)?O(h):(e.consume(h),z)}function v(h){return h===47||h===62||Z(h)?O(h):t(h)}function q(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),n):t(h)}function Q(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),le}function le(h){return H(h)?Y(e,fe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):fe(h)}function fe(h){return e.enter("htmlTextData"),o(h)}}const Nn={name:"labelEnd",resolveAll:Cl,resolveTo:El,tokenize:vl},kl={tokenize:Il},wl={tokenize:Tl},Sl={tokenize:Pl};function Cl(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&&pe(e,0,e.length,t),e}function El(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 c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",c,n],["enter",s,n]],a=ie(a,e.slice(l+1,l+r+3)),a=ie(a,[["enter",u,n]]),a=ie(a,jn(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=ie(a,[["exit",u,n],e[o-2],e[o-1],["exit",s,n]]),a=ie(a,e.slice(o+1)),a=ie(a,[["exit",c,n]]),pe(e,l,e.length,a),e}function vl(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?p(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"),c):t(m)}function c(m){return m===40?e.attempt(kl,u,o?u:p)(m):m===91?e.attempt(wl,u,o?s:p)(m):o?u(m):p(m)}function s(m){return e.attempt(Sl,u,p)(m)}function u(m){return n(m)}function p(m){return l._balanced=!0,t(m)}}function Il(e,n,t){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return Z(p)?Fe(e,l)(p):l(p)}function l(p){return p===41?u(p):Jt(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Z(p)?Fe(e,c)(p):u(p)}function a(p){return t(p)}function c(p){return p===34||p===39||p===40?Zt(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):u(p)}function s(p){return Z(p)?Fe(e,u)(p):u(p)}function u(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),n):t(p)}}function Tl(e,n,t){const r=this;return i;function i(a){return Gt.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 Pl(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 Al={name:"labelStartImage",resolveAll:Nn.resolveAll,tokenize:zl};function zl(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 Ll={name:"labelStartLink",resolveAll:Nn.resolveAll,tokenize:jl};function jl(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 ln={name:"lineEnding",tokenize:Nl};function Nl(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Y(e,n,"linePrefix")}}const Xe={name:"thematicBreak",tokenize:Rl};function Rl(e,n,t){let r=0,i;return l;function l(s){return e.enter("thematicBreak"),o(s)}function o(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),c(s)):r>=3&&(s===null||N(s))?(e.exit("thematicBreak"),n(s)):t(s)}function c(s){return s===i?(e.consume(s),r++,c):(e.exit("thematicBreakSequence"),H(s)?Y(e,a,"whitespace")(s):a(s))}}const G={continuation:{tokenize:_l},exit:Bl,name:"list",tokenize:Ml},Dl={partial:!0,tokenize:Hl},Ol={partial:!0,tokenize:Fl};function Ml(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(f){const w=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:kn(f)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Xe,t,s)(f):s(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return t(f)}function c(f){return kn(f)&&++o<10?(e.consume(f),c):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),s(f)):t(f)}function s(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Je,r.interrupt?t:u,e.attempt(Dl,m,p))}function u(f){return r.containerState.initialBlankLine=!0,l++,m(f)}function p(f){return H(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):t(f)}function m(f){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(f)}}function _l(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Je,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Y(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!H(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(Ol,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Y(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Fl(e,n,t){const r=this;return Y(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 Bl(e){e.exit(this.containerState.type)}function Hl(e,n,t){const r=this;return Y(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!H(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const ut={name:"setextUnderline",resolveTo:Ul,tokenize:Vl};function Ul(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 Vl(e,n,t){const r=this;let i;return l;function l(s){let u=r.events.length,p;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){p=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=s,o(s)):t(s)}function o(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),H(s)?Y(e,c,"lineSuffix")(s):c(s))}function c(s){return s===null||N(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const ql={tokenize:$l};function $l(e){const n=this,t=e.attempt(Je,r,e.attempt(this.parser.constructs.flowInitial,i,Y(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ki,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 Wl={resolveAll:nr()},Yl=er("string"),Xl=er("text");function er(e){return{resolveAll:nr(e==="text"?Ql: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(u){return s(u)?l(u):a(u)}function a(u){if(u===null){t.consume(u);return}return t.enter("data"),t.consume(u),c}function c(u){return s(u)?(t.exit("data"),l(u)):(t.consume(u),c)}function s(u){if(u===null)return!0;const p=i[u];let m=-1;if(p)for(;++m<p.length;){const f=p[m];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function nr(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 Ql(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,c;for(;l--;){const s=i[l];if(typeof s=="string"){for(o=s.length;s.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(s===-2)c=!0,a++;else if(s!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||c||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={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Kl={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:Yt},Jl={91:nl},Gl={[-2]:rn,[-1]:rn,32:rn},Zl={35:al,42:Xe,45:[ut,Xe],60:pl,61:ut,95:Xe,96:at,126:at},eo={38:Qt,92:Xt},no={[-5]:ln,[-4]:ln,[-3]:ln,33:Al,38:Qt,42:wn,60:[Li,yl],91:Ll,92:[ll,Xt],93:Nn,95:wn,96:qi},to={null:[wn,Wl]},ro={null:[42,95]},io={null:[]},lo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ro,contentInitial:Jl,disable:io,document:Kl,flow:Zl,flowInitial:Gl,insideSpan:to,string:eo,text:no},Symbol.toStringTag,{value:"Module"}));function oo(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 c={attempt:L(_),check:L(x),consume:A,enter:I,exit:j,interrupt:L(x,{interrupt:!0})},s={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:m,sliceStream:f,write:p};let u=n.tokenize.call(s,c);return n.resolveAll&&l.push(n),s;function p(P){return o=ie(o,P),E(),o[o.length-1]!==null?[]:(F(n,0),s.events=jn(l,s.events,s),s.events)}function m(P,T){return so(f(P),T)}function f(P){return ao(o,P)}function w(){const{_bufferIndex:P,_index:T,line:U,column:z,offset:v}=r;return{_bufferIndex:P,_index:T,line:U,column:z,offset:v}}function C(P){i[P.line]=P.column,M()}function E(){let P;for(;r._index<o.length;){const T=o[r._index];if(typeof T=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<T.length;)y(T.charCodeAt(r._bufferIndex));else y(T)}}function y(P){u=u(P)}function A(P){N(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,M()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=P}function I(P,T){const U=T||{};return U.type=P,U.start=w(),s.events.push(["enter",U,s]),a.push(U),U}function j(P){const T=a.pop();return T.end=w(),s.events.push(["exit",T,s]),T}function _(P,T){F(P,T.from)}function x(P,T){T.restore()}function L(P,T){return U;function U(z,v,q){let Q,le,fe,h;return Array.isArray(z)?he(z):"tokenize"in z?he([z]):oe(z);function oe(K){return Le;function Le(ge){const Ce=ge!==null&&K[ge],Ee=ge!==null&&K.null,qe=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return he(qe)(ge)}}function he(K){return Q=K,le=0,K.length===0?q:d(K[le])}function d(K){return Le;function Le(ge){return h=O(),fe=K,K.partial||(s.currentConstruct=K),K.name&&s.parser.constructs.disable.null.includes(K.name)?be():K.tokenize.call(T?Object.assign(Object.create(s),T):s,c,ae,be)(ge)}}function ae(K){return P(fe,h),v}function be(K){return h.restore(),++le<Q.length?d(Q[le]):q}}}function F(P,T){P.resolveAll&&!l.includes(P)&&l.push(P),P.resolve&&pe(s.events,T,s.events.length-T,P.resolve(s.events.slice(T),s)),P.resolveTo&&(s.events=P.resolveTo(s.events,s))}function O(){const P=w(),T=s.previous,U=s.currentConstruct,z=s.events.length,v=Array.from(a);return{from:z,restore:q};function q(){r=P,s.previous=T,s.currentConstruct=U,s.events.length=z,a=v,M()}}function M(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function ao(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 so(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 uo(e){const r={constructs:gi([lo,...(e||{}).extensions||[]]),content:i(Ei),defined:[],document:i(Ii),flow:i(ql),lazy:{},string:i(Yl),text:i(Xl)};return r;function i(l){return o;function o(a){return oo(r,l,a)}}}function co(e){for(;!Kt(e););return e}const ct=/[\0\t\n\r]/g;function po(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const c=[];let s,u,p,m,f;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),p=0,n="",t&&(l.charCodeAt(0)===65279&&p++,t=void 0);p<l.length;){if(ct.lastIndex=p,s=ct.exec(l),m=s&&s.index!==void 0?s.index:l.length,f=l.charCodeAt(m),!s){n=l.slice(p);break}if(f===10&&p===m&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),p<m&&(c.push(l.slice(p,m)),e+=m-p),f){case 0:{c.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,c.push(-2);e++<u;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}p=m+1}return a&&(r&&c.push(-5),n&&c.push(n),c.push(null)),c}}const fo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ho(e){return e.replace(fo,mo)}function mo(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return Wt(t.slice(l?2:1),l?16:10)}return Ln(t)||e}const tr={}.hasOwnProperty;function go(e,n,t){return n&&typeof n=="object"&&(t=n,n=void 0),xo(t)(co(uo(t).document().write(po()(e,n,!0))))}function xo(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Un),autolinkProtocol:O,autolinkEmail:O,atxHeading:l(Fn),blockQuote:l(Ee),characterEscape:O,characterReference:O,codeFenced:l(qe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(qe,o),codeText:l(dr,o),codeTextData:O,data:O,codeFlowValue:O,definition:l(mr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(gr),hardBreakEscape:l(Bn),hardBreakTrailing:l(Bn),htmlFlow:l(Hn,o),htmlFlowData:O,htmlText:l(Hn,o),htmlTextData:O,image:l(xr),label:o,link:l(Un),listItem:l(yr),listItemValue:m,listOrdered:l(Vn,p),listUnordered:l(Vn),paragraph:l(br),reference:d,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Fn),strong:l(kr),thematicBreak:l(Sr)},exit:{atxHeading:c(),atxHeadingSequence:_,autolink:c(),autolinkEmail:Ce,autolinkProtocol:ge,blockQuote:c(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:K,characterReference:Le,codeFenced:c(E),codeFencedFence:C,codeFencedFenceInfo:f,codeFencedFenceMeta:w,codeFlowValue:M,codeIndented:c(y),codeText:c(v),codeTextData:M,data:M,definition:c(),definitionDestinationString:j,definitionLabelString:A,definitionTitleString:I,emphasis:c(),hardBreakEscape:c(T),hardBreakTrailing:c(T),htmlFlow:c(U),htmlFlowData:M,htmlText:c(z),htmlTextData:M,image:c(Q),label:fe,labelText:le,lineEnding:P,link:c(q),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ae,resourceDestinationString:h,resourceTitleString:oe,resource:he,setextHeading:c(F),setextHeadingLineSequence:L,setextHeadingText:x,strong:c(),thematicBreak:c()}};rr(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(g){let S={type:"root",children:[]};const D={stack:[S],tokenStack:[],config:n,enter:a,exit:s,buffer:o,resume:u,data:t},B=[];let $=-1;for(;++$<g.length;)if(g[$][1].type==="listOrdered"||g[$][1].type==="listUnordered")if(g[$][0]==="enter")B.push($);else{const se=B.pop();$=i(g,se,$)}for($=-1;++$<g.length;){const se=n[g[$][0]];tr.call(se,g[$][1].type)&&se[g[$][1].type].call(Object.assign({sliceSerialize:g[$][2].sliceSerialize},D),g[$][1])}if(D.tokenStack.length>0){const se=D.tokenStack[D.tokenStack.length-1];(se[1]||pt).call(D,void 0,se[0])}for(S.position={start:xe(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:xe(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},$=-1;++$<n.transforms.length;)S=n.transforms[$](S)||S;return S}function i(g,S,D){let B=S-1,$=-1,se=!1,ke,de,je,Ne;for(;++B<=D;){const ne=g[B];switch(ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ne[0]==="enter"?$++:$--,Ne=void 0;break}case"lineEndingBlank":{ne[0]==="enter"&&(ke&&!Ne&&!$&&!je&&(je=B),Ne=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ne=void 0}if(!$&&ne[0]==="enter"&&ne[1].type==="listItemPrefix"||$===-1&&ne[0]==="exit"&&(ne[1].type==="listUnordered"||ne[1].type==="listOrdered")){if(ke){let ve=B;for(de=void 0;ve--;){const me=g[ve];if(me[1].type==="lineEnding"||me[1].type==="lineEndingBlank"){if(me[0]==="exit")continue;de&&(g[de][1].type="lineEndingBlank",se=!0),me[1].type="lineEnding",de=ve}else if(!(me[1].type==="linePrefix"||me[1].type==="blockQuotePrefix"||me[1].type==="blockQuotePrefixWhitespace"||me[1].type==="blockQuoteMarker"||me[1].type==="listItemIndent"))break}je&&(!de||je<de)&&(ke._spread=!0),ke.end=Object.assign({},de?g[de][1].start:ne[1].end),g.splice(de||B,0,["exit",ke,ne[2]]),B++,D++}if(ne[1].type==="listItemPrefix"){const ve={type:"listItem",_spread:!1,start:Object.assign({},ne[1].start),end:void 0};ke=ve,g.splice(B,0,["enter",ve,ne[2]]),B++,D++,je=void 0,Ne=!0}}}return g[S][1]._spread=se,D}function l(g,S){return D;function D(B){a.call(this,g(B),B),S&&S.call(this,B)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(g,S,D){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([S,D||void 0]),g.position={start:xe(S.start),end:void 0}}function c(g){return S;function S(D){g&&g.call(this,D),s.call(this,D)}}function s(g,S){const D=this.stack.pop(),B=this.tokenStack.pop();if(B)B[0].type!==g.type&&(S?S.call(this,g,B[0]):(B[1]||pt).call(this,g,B[0]));else throw new Error("Cannot close `"+g.type+"` ("+_e({start:g.start,end:g.end})+"): it’s not open");D.position.end=xe(g.end)}function u(){return di(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function m(g){if(this.data.expectingFirstListItemValue){const S=this.stack[this.stack.length-2];S.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function f(){const g=this.resume(),S=this.stack[this.stack.length-1];S.lang=g}function w(){const g=this.resume(),S=this.stack[this.stack.length-1];S.meta=g}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const g=this.resume(),S=this.stack[this.stack.length-1];S.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const g=this.resume(),S=this.stack[this.stack.length-1];S.value=g.replace(/(\r?\n|\r)$/g,"")}function A(g){const S=this.resume(),D=this.stack[this.stack.length-1];D.label=S,D.identifier=Pe(this.sliceSerialize(g)).toLowerCase()}function I(){const g=this.resume(),S=this.stack[this.stack.length-1];S.title=g}function j(){const g=this.resume(),S=this.stack[this.stack.length-1];S.url=g}function _(g){const S=this.stack[this.stack.length-1];if(!S.depth){const D=this.sliceSerialize(g).length;S.depth=D}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function L(g){const S=this.stack[this.stack.length-1];S.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function O(g){const D=this.stack[this.stack.length-1].children;let B=D[D.length-1];(!B||B.type!=="text")&&(B=wr(),B.position={start:xe(g.start),end:void 0},D.push(B)),this.stack.push(B)}function M(g){const S=this.stack.pop();S.value+=this.sliceSerialize(g),S.position.end=xe(g.end)}function P(g){const S=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=S.children[S.children.length-1];D.position.end=xe(g.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(S.type)&&(O.call(this,g),M.call(this,g))}function T(){this.data.atHardBreak=!0}function U(){const g=this.resume(),S=this.stack[this.stack.length-1];S.value=g}function z(){const g=this.resume(),S=this.stack[this.stack.length-1];S.value=g}function v(){const g=this.resume(),S=this.stack[this.stack.length-1];S.value=g}function q(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const S=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=S,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function Q(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const S=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=S,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function le(g){const S=this.sliceSerialize(g),D=this.stack[this.stack.length-2];D.label=ho(S),D.identifier=Pe(S).toLowerCase()}function fe(){const g=this.stack[this.stack.length-1],S=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const B=g.children;D.children=B}else D.alt=S}function h(){const g=this.resume(),S=this.stack[this.stack.length-1];S.url=g}function oe(){const g=this.resume(),S=this.stack[this.stack.length-1];S.title=g}function he(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function ae(g){const S=this.resume(),D=this.stack[this.stack.length-1];D.label=S,D.identifier=Pe(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function be(g){this.data.characterReferenceType=g.type}function K(g){const S=this.sliceSerialize(g),D=this.data.characterReferenceType;let B;D?(B=Wt(S,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):B=Ln(S);const $=this.stack[this.stack.length-1];$.value+=B}function Le(g){const S=this.stack.pop();S.position.end=xe(g.end)}function ge(g){M.call(this,g);const S=this.stack[this.stack.length-1];S.url=this.sliceSerialize(g)}function Ce(g){M.call(this,g);const S=this.stack[this.stack.length-1];S.url="mailto:"+this.sliceSerialize(g)}function Ee(){return{type:"blockquote",children:[]}}function qe(){return{type:"code",lang:null,meta:null,value:""}}function dr(){return{type:"inlineCode",value:""}}function mr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function gr(){return{type:"emphasis",children:[]}}function Fn(){return{type:"heading",depth:0,children:[]}}function Bn(){return{type:"break"}}function Hn(){return{type:"html",value:""}}function xr(){return{type:"image",title:null,url:"",alt:null}}function Un(){return{type:"link",title:null,url:"",children:[]}}function Vn(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function yr(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function br(){return{type:"paragraph",children:[]}}function kr(){return{type:"strong",children:[]}}function wr(){return{type:"text",value:""}}function Sr(){return{type:"thematicBreak"}}}function xe(e){return{line:e.line,column:e.column,offset:e.offset}}function rr(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?rr(e,r):yo(e,r)}}function yo(e,n){let t;for(t in n)if(tr.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 pt(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 bo(e){const n=this;n.parser=t;function t(r){return go(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function ko(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 wo(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
5
+ `}]}function So(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 Co(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Eo(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function vo(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 c={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,c);const s={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,s),e.applyData(n,s)}function Io(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 To(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function ir(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 Po(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return ir(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 Ao(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 zo(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 Lo(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return ir(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 jo(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 No(e,n,t){const r=e.all(n),i=t?Ro(t):lr(n),l={},o=[];if(typeof n.checked=="boolean"){const u=r[0];let p;u&&u.type==="element"&&u.tagName==="p"?p=u:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.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 u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
7
+ `}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
8
+ `});const s={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,s),e.applyData(n,s)}function Ro(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=lr(t[r])}return n}function lr(e){const n=e.spread;return n??e.children.length>1}function Do(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 Oo(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Mo(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function _o(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Fo(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=Tn(n.children[1]),c=Ft(n.children[n.children.length-1]);a&&c&&(o.position={start:a,end:c}),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 Bo(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 c=-1;const s=[];for(;++c<a;){const p=n.children[c],m={},f=o?o[c]:void 0;f&&(m.align=f);let w={type:"element",tagName:l,properties:m,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),s.push(w)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(n,u),e.applyData(n,u)}function Ho(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const ft=9,ht=32;function Uo(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(dt(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(dt(n.slice(i),i>0,!1)),l.join("")}function dt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===ft||l===ht;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===ft||l===ht;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Vo(e,n){const t={type:"text",value:Uo(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function qo(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const $o={blockquote:ko,break:wo,code:So,delete:Co,emphasis:Eo,footnoteReference:vo,heading:Io,html:To,imageReference:Po,image:Ao,inlineCode:zo,linkReference:Lo,link:jo,listItem:No,list:Do,paragraph:Oo,root:Mo,strong:_o,table:Fo,tableCell:Ho,tableRow:Bo,text:Vo,thematicBreak:qo,toml:$e,yaml:$e,definition:$e,footnoteDefinition:$e};function $e(){}const or=-1,Ge=0,Be=1,Qe=2,Rn=3,Dn=4,On=5,Mn=6,ar=7,sr=8,Wo=typeof self=="object"?self:globalThis,mt=(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 Wo[e](n)},Yo=(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 Ge:case or:return t(o,i);case Be:{const a=t([],i);for(const c of o)a.push(r(c));return a}case Qe:{const a=t({},i);for(const[c,s]of o)a[r(c)]=r(s);return a}case Rn:return t(new Date(o),i);case Dn:{const{source:a,flags:c}=o;return t(new RegExp(a,c),i)}case On:{const a=t(new Map,i);for(const[c,s]of o)a.set(r(c),r(s));return a}case Mn:{const a=t(new Set,i);for(const c of o)a.add(r(c));return a}case ar:{const{name:a,message:c}=o;return t(mt(a,c),i)}case sr: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(mt(l,o),i)};return r},gt=e=>Yo(new Map,e)(0),Te="",{toString:Xo}={},{keys:Qo}=Object,Me=e=>{const n=typeof e;if(n!=="object"||!e)return[Ge,n];const t=Xo.call(e).slice(8,-1);switch(t){case"Array":return[Be,Te];case"Object":return[Qe,Te];case"Date":return[Rn,Te];case"RegExp":return[Dn,Te];case"Map":return[On,Te];case"Set":return[Mn,Te];case"DataView":return[Be,t]}return t.includes("Array")?[Be,t]:t.includes("Error")?[ar,t]:[Qe,t]},We=([e,n])=>e===Ge&&(n==="function"||n==="symbol"),Ko=(e,n,t,r)=>{const i=(o,a)=>{const c=r.push(o)-1;return t.set(a,c),c},l=o=>{if(t.has(o))return t.get(o);let[a,c]=Me(o);switch(a){case Ge:{let u=o;switch(c){case"bigint":a=sr,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);u=null;break;case"undefined":return i([or],o)}return i([a,u],o)}case Be:{if(c){let m=o;return c==="DataView"?m=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(o)),i([c,[...m]],o)}const u=[],p=i([a,u],o);for(const m of o)u.push(l(m));return p}case Qe:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const u=[],p=i([a,u],o);for(const m of Qo(o))(e||!We(Me(o[m])))&&u.push([l(m),l(o[m])]);return p}case Rn:return i([a,o.toISOString()],o);case Dn:{const{source:u,flags:p}=o;return i([a,{source:u,flags:p}],o)}case On:{const u=[],p=i([a,u],o);for(const[m,f]of o)(e||!(We(Me(m))||We(Me(f))))&&u.push([l(m),l(f)]);return p}case Mn:{const u=[],p=i([a,u],o);for(const m of o)(e||!We(Me(m)))&&u.push(l(m));return p}}const{message:s}=o;return i([a,{name:c,message:s}],o)};return l},xt=(e,{json:n,lossy:t}={})=>{const r=[];return Ko(!(n||t),!!n,new Map,r)(e),r},Ke=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?gt(xt(e,n)):structuredClone(e):(e,n)=>gt(xt(e,n));function Jo(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 Go(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function Zo(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||Jo,r=e.options.footnoteBackLabel||Go,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const s=e.footnoteById.get(e.footnoteOrder[c]);if(!s)continue;const u=e.all(s),p=String(s.identifier).toUpperCase(),m=ze(p.toLowerCase());let f=0;const w=[],C=e.footnoteCounts.get(p);for(;C!==void 0&&++f<=C;){w.length>0&&w.push({type:"text",value:" "});let A=typeof t=="string"?t:t(c,f);typeof A=="string"&&(A={type:"text",value:A}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+m+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const E=u[u.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const A=E.children[E.children.length-1];A&&A.type==="text"?A.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...w)}else u.push(...w);const y={type:"element",tagName:"li",properties:{id:n+"fn-"+m},children:e.wrap(u,!0)};e.patch(s,y),a.push(y)}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
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
10
+ `}]}}const ur=(function(e){if(e==null)return ra;if(typeof e=="function")return Ze(e);if(typeof e=="object")return Array.isArray(e)?ea(e):na(e);if(typeof e=="string")return ta(e);throw new Error("Expected function, string, or object as test")});function ea(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=ur(e[t]);return Ze(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function na(e){const n=e;return Ze(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function ta(e){return Ze(n);function n(t){return t&&t.type===e}}function Ze(e){return n;function n(t,r,i){return!!(ia(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function ra(){return!0}function ia(e){return e!==null&&typeof e=="object"&&"type"in e}const cr=[],la=!0,yt=!1,oa="skip";function aa(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=ur(i),o=r?-1:1;a(e,void 0,[])();function a(c,s,u){const p=c&&typeof c=="object"?c:{};if(typeof p.type=="string"){const f=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(m,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return m;function m(){let f=cr,w,C,E;if((!n||l(c,s,u[u.length-1]||void 0))&&(f=sa(t(c,u)),f[0]===yt))return f;if("children"in c&&c.children){const y=c;if(y.children&&f[0]!==oa)for(C=(r?y.children.length:-1)+o,E=u.concat(y);C>-1&&C<y.children.length;){const A=y.children[C];if(w=a(A,C,E)(),w[0]===yt)return w;C=typeof w[1]=="number"?w[1]:C+o}}return f}}}function sa(e){return Array.isArray(e)?e:typeof e=="number"?[la,e]:e==null?cr:[e]}function pr(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),aa(e,l,a,i);function a(c,s){const u=s[s.length-1],p=u?u.children.indexOf(c):void 0;return o(c,p,u)}}const Sn={}.hasOwnProperty,ua={};function ca(e,n){const t=n||ua,r=new Map,i=new Map,l=new Map,o={...$o,...t.handlers},a={all:s,applyData:fa,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:c,options:t,patch:pa,wrap:da};return pr(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const p=u.type==="definition"?r:i,m=String(u.identifier).toUpperCase();p.has(m)||p.set(m,u)}}),a;function c(u,p){const m=u.type,f=a.handlers[m];if(Sn.call(a.handlers,m)&&f)return f(a,u,p);if(a.options.passThrough&&a.options.passThrough.includes(m)){if("children"in u){const{children:C,...E}=u,y=Ke(E);return y.children=a.all(u),y}return Ke(u)}return(a.options.unknownHandler||ha)(a,u,p)}function s(u){const p=[];if("children"in u){const m=u.children;let f=-1;for(;++f<m.length;){const w=a.one(m[f],u);if(w){if(f&&m[f-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=bt(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=bt(C.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function pa(e,n){e.position&&(n.position=Wr(e))}function fa(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 ha(e,n){const t=n.data||{},r="value"in n&&!(Sn.call(t,"hProperties")||Sn.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 da(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 bt(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function kt(e,n){const t=ca(e,n),r=t.one(e,void 0),i=Zo(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 ma(e,n){return e&&"run"in e?async function(t,r){const i=kt(t,{file:r,...n});await e.run(i,r)}:function(t,r){return kt(t,{file:r,...e||n})}}function wt(e){if(e)throw e}var on,St;function ga(){if(St)return on;St=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):n.call(s)==="[object Array]"},l=function(s){if(!s||n.call(s)!=="[object Object]")return!1;var u=e.call(s,"constructor"),p=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!u&&!p)return!1;var m;for(m in s);return typeof m>"u"||e.call(s,m)},o=function(s,u){t&&u.name==="__proto__"?t(s,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):s[u.name]=u.newValue},a=function(s,u){if(u==="__proto__")if(e.call(s,u)){if(r)return r(s,u).value}else return;return s[u]};return on=function c(){var s,u,p,m,f,w,C=arguments[0],E=1,y=arguments.length,A=!1;for(typeof C=="boolean"&&(A=C,C=arguments[1]||{},E=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});E<y;++E)if(s=arguments[E],s!=null)for(u in s)p=a(C,u),m=a(s,u),C!==m&&(A&&m&&(l(m)||(f=i(m)))?(f?(f=!1,w=p&&i(p)?p:[]):w=p&&l(p)?p:{},o(C,{name:u,newValue:c(A,w,m)})):typeof m<"u"&&o(C,{name:u,newValue:m}));return C},on}var xa=ga();const an=_t(xa);function Cn(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 ya(){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(c,...s){const u=e[++l];let p=-1;if(c){o(c);return}for(;++p<i.length;)(s[p]===null||s[p]===void 0)&&(s[p]=i[p]);i=s,u?ba(u,a)(...s):o(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function ba(e,n){let t;return r;function r(...o){const a=e.length>o.length;let c;a&&o.push(i);try{c=e.apply(this,o)}catch(s){const u=s;if(a&&t)throw u;return i(u)}a||(c&&c.then&&typeof c.then=="function"?c.then(l,i):c instanceof Error?i(c):l(c))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const ue={basename:ka,dirname:wa,extname:Sa,join:Ca,sep:"/"};function ka(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ve(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 wa(e){if(Ve(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 Sa(e){Ve(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 Ca(...e){let n=-1,t;for(;++n<e.length;)Ve(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Ea(t)}function Ea(e){Ve(e);const n=e.codePointAt(0)===47;let t=va(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function va(e,n){let t="",r=0,i=-1,l=0,o=-1,a,c;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(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),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 Ve(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ia={cwd:Ta};function Ta(){return"/"}function En(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Pa(e){if(typeof e=="string")e=new URL(e);else if(!En(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 Aa(e)}function Aa(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 fr{constructor(n){let t;n?En(n)?t={path:n}:typeof n=="string"||za(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Ia.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){cn(n,"basename"),un(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){Ct(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(un(n,"extname"),Ct(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){En(n)&&(n=Pa(n)),cn(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){cn(n,"stem"),un(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 J(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 un(e,n){if(e&&e.includes(ue.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ue.sep+"`")}function cn(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Ct(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function za(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const La=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),ja={}.hasOwnProperty;class _n extends La{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=ya()}copy(){const n=new _n;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(an(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(hn("data",this.frozen),this.namespace[n]=t,this):ja.call(this.namespace,n)&&this.namespace[n]||void 0:n?(hn("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=Ye(n),r=this.parser||this.Parser;return pn("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),pn("process",this.parser||this.Parser),fn("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(l,o){const a=Ye(n),c=r.parse(a);r.run(c,a,function(u,p,m){if(u||!p||!m)return s(u);const f=p,w=r.stringify(f,m);Da(w)?m.value=w:m.result=w,s(u,m)});function s(u,p){u||!p?o(u):l?l(p):t(void 0,p)}}}processSync(n){let t=!1,r;return this.freeze(),pn("processSync",this.parser||this.Parser),fn("processSync",this.compiler||this.Compiler),this.process(n,i),vt("processSync","process",t),r;function i(l,o){t=!0,wt(l),r=o}}run(n,t,r){Et(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 c=Ye(t);i.run(n,c,s);function s(u,p,m){const f=p||n;u?a(u):o?o(f):r(void 0,f,m)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),vt("runSync","run",r),i;function l(o,a){wt(o),i=a,r=!0}}stringify(n,t){this.freeze();const r=Ye(t),i=this.compiler||this.Compiler;return fn("stringify",i),Et(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(hn("use",this.frozen),n!=null)if(typeof n=="function")c(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(s){if(typeof s=="function")c(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[u,...p]=s;c(u,p)}else o(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function o(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=an(!0,i.settings,s.settings))}function a(s){let u=-1;if(s!=null)if(Array.isArray(s))for(;++u<s.length;){const p=s[u];l(p)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function c(s,u){let p=-1,m=-1;for(;++p<r.length;)if(r[p][0]===s){m=p;break}if(m===-1)r.push([s,...u]);else if(u.length>0){let[f,...w]=u;const C=r[m][1];Cn(C)&&Cn(f)&&(f=an(!0,C,f)),r[m]=[s,f,...w]}}}}const Na=new _n().freeze();function pn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hn(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 Et(e){if(!Cn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vt(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ye(e){return Ra(e)?e:new fr(e)}function Ra(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Da(e){return typeof e=="string"||Oa(e)}function Oa(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ma="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",It=[],Tt={allowDangerousHtml:!0},_a=/^(https?|ircs?|mailto|xmpp)$/i,Fa=[{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 Ba(e){const n=Ha(e),t=Ua(e);return Va(n.runSync(n.parse(t),t),e)}function Ha(e){const n=e.rehypePlugins||It,t=e.remarkPlugins||It,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Tt}:Tt;return Na().use(bo).use(t).use(ma,r).use(n)}function Ua(e){const n=e.children||"",t=new fr;return typeof n=="string"&&(t.value=n),t}function Va(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,c=n.urlTransform||qa;for(const u of Fa)Object.hasOwn(n,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Ma+u.id,void 0);return pr(e,s),Jr(e,{Fragment:b.Fragment,components:i,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function s(u,p,m){if(u.type==="raw"&&m&&typeof p=="number")return o?m.children.splice(p,1):m.children[p]={type:"text",value:u.value},p;if(u.type==="element"){let f;for(f in tn)if(Object.hasOwn(tn,f)&&Object.hasOwn(u.properties,f)){const w=u.properties[f],C=tn[f];(C===null||C.includes(u.tagName))&&(u.properties[f]=c(String(w||""),f,u))}}if(u.type==="element"){let f=t?!t.includes(u.tagName):l?l.includes(u.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(u,p,m)),f&&m&&typeof p=="number")return a&&u.children?m.children.splice(p,1,...u.children):m.children.splice(p,1),p}}}function qa(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||_a.test(e.slice(0,n))?e:""}function $a({children:e}){const[n,t]=V.useState(!1),r=V.useRef(null),i=()=>{navigator.clipboard.writeText(r.current?.innerText??"").then(()=>{t(!0),setTimeout(()=>t(!1),2e3)})};return b.jsxs("div",{style:{position:"relative",margin:"0.6em 0"},children:[b.jsx("pre",{ref:r,children:e}),b.jsx("button",{className:"hover:bg-[#ffffff] rounded-full",onClick:i,style:{position:"absolute",top:1,right:1,padding:"8px",fontSize:"0.72em",color:"var(--nx-text-muted)",cursor:"pointer",transition:"color 0.15s"},children:n?b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:b.jsx("path",{d:"M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0"})}):b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:b.jsx("path",{fillRule:"evenodd",d:"M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1z"})})})]})}function Wa({content:e}){return b.jsx(Ba,{components:{p:({children:n})=>b.jsx("p",{style:{margin:"0 0 0.5em",lineHeight:1.6},children:n}),ul:({children:n})=>b.jsx("ul",{style:{margin:"0.25em 0 0.5em",paddingLeft:"1.25em"},children:n}),ol:({children:n})=>b.jsx("ol",{style:{margin:"0.25em 0 0.5em",paddingLeft:"1.25em"},children:n}),li:({children:n})=>b.jsx("li",{style:{margin:"0.2em 0",lineHeight:1.5},children:n}),strong:({children:n})=>b.jsx("strong",{style:{fontWeight:600,color:"var(--nx-text)"},children:n}),em:({children:n})=>b.jsx("em",{style:{opacity:.85},children:n}),code:({children:n})=>b.jsx($a,{children:n}),pre:({children:n})=>b.jsx("pre",{style:{background:"var(--nx-surface)",border:"1px solid var(--nx-border)",borderRadius:8,padding:"0.75em 1em",overflowX:"auto",fontSize:"0.82em",fontFamily:"monospace",margin:"0.5em 0"},children:n}),hr:()=>b.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--nx-border)",margin:"0.75em 0"}}),a:({children:n})=>b.jsx("span",{style:{textDecoration:"underline",opacity:.8},children:n})},children:e})}function Ya({color:e,agentName:n}){return b.jsxs("div",{className:"flex items-start gap-3",children:[b.jsx("div",{style:{background:e,flexShrink:0},className:`w-7 h-7 rounded-full flex items-center justify-center\r
15
+ text-white text-xs font-semibold mt-0.5`,children:n[0].toUpperCase()}),b.jsx("div",{className:"flex items-end gap-1 pt-2.5",children:[0,1,2].map(t=>b.jsx("span",{style:{display:"block",width:6,height:6,borderRadius:"50%",background:e,opacity:.55,animation:`nexusBounce 1.2s ease-in-out ${t*.2}s infinite`}},t))})]})}function Xa({msg:e,primaryColor:n,agentName:t}){const r=e.role==="user";return e.content?r?b.jsx("div",{className:"flex justify-end",children:b.jsx("div",{style:{background:n},className:`max-w-[75%] px-4 py-2.5 rounded-2xl rounded-br-sm\r
16
+ text-white text-sm leading-relaxed`,children:e.content})}):b.jsxs("div",{className:"flex items-start gap-3",children:[b.jsx("div",{style:{background:n,flexShrink:0},className:`w-7 h-7 rounded-full flex items-center justify-center\r
17
+ text-white text-xs font-semibold mt-0.5`,children:t[0].toUpperCase()}),b.jsx("div",{style:{color:"var(--nx-text)"},className:"flex-1 text-sm leading-relaxed pt-0.5 min-w-0",children:b.jsx(Wa,{content:e.content})})]}):b.jsx(V.Fragment,{})}function Qa({agentName:e,messages:n,isLoading:t,error:r,primaryColor:i,welcomeMessage:l,onSend:o,onClose:a,isFullView:c,onToggleFullView:s}){const[u,p]=V.useState(""),m=V.useRef(null),f=V.useRef(null),[w,C]=V.useState(!1),E=V.useRef(null),y=()=>{const j=E.current;j&&C(j.scrollHeight-j.scrollTop-j.clientHeight>120)};V.useEffect(()=>{m.current?.scrollIntoView({behavior:"smooth"})},[n,t]),V.useEffect(()=>{f.current?.focus()},[]);const A=()=>{!u.trim()||t||(o(u),p(""))},I=j=>{j.key==="Enter"&&!j.shiftKey&&(j.preventDefault(),A())};return b.jsxs(b.Fragment,{children:[b.jsx("style",{children:`
4
18
  @keyframes nexusBounce {
5
19
  0%, 80%, 100% { transform: translateY(0); }
6
20
  40% { transform: translateY(-5px); }
@@ -8,13 +22,14 @@
8
22
  button {
9
23
  cursor: pointer;
10
24
  }
11
- `}),e.jsxs("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif",position:"relative",background:"var(--nx-bg)",borderColor:r?"none":"var(--nx-border)"},className:`flex flex-col overflow-hidden shadow-2xl h-full ${r?"":"rounded-2xl border"}`,role:"dialog","aria-label":`${t} chat`,children:[!r&&e.jsxs("div",{style:{background:"var(--nx-bg)",borderBottom:"1px solid var(--nx-border)"},className:"flex items-center justify-between px-4 py-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[var(--nx-text)]/40"}),e.jsx("span",{style:{color:u},className:"text-sm font-medium",children:t})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:g,"aria-label":"Expand to full view",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),e.jsx("button",{onClick:c,"aria-label":"Close chat",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})]}),r&&e.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-2",style:{zIndex:10},children:[e.jsx("button",{onClick:g,"aria-label":"Exit full view",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})})}),e.jsx("button",{onClick:c,"aria-label":"Close chat",className:"nexus-ctrl-btn p-2",children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",style:{minHeight:0,background:"var(--nx-bg)"},children:e.jsxs("div",{className:"space-y-3 p-2",style:r?{maxWidth:720,margin:"0 auto"}:void 0,children:[o.length===0&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{style:{background:"var(--nx-surface)",color:"var(--nx-text)"},className:"max-w-[82%] px-3 py-2.5 rounded-2xl rounded-bl-sm text-sm leading-relaxed",children:l})}),o.map(a=>e.jsx(z,{msg:a,primaryColor:u},a.id)),n&&e.jsx("div",{className:"flex justify-start",children:e.jsx(W,{color:u})}),f&&e.jsx("div",{className:"text-center text-xs text-red-400/70 py-1",children:f}),e.jsx("div",{ref:N})]})}),e.jsx("div",{style:{background:"var(--nx-bg)",borderColor:r?"none":"var(--nx-border)"},className:`${!r&&"border-t"} shrink-0 px-2.5`,children:e.jsxs("div",{className:"relative w-full mx-auto flex items-center shadow rounded-xl",style:{maxWidth:r?720:"none",marginBottom:r?20:12,marginTop:r?0:10},children:[e.jsx("textarea",{ref:p,rows:1,value:x,onChange:a=>{d(a.target.value),a.target.style.height="auto",a.target.style.height=`${Math.min(a.target.scrollHeight,100)}px`},onKeyDown:C,placeholder:"Type a message…",disabled:n,style:{resize:"none",minHeight:44,maxHeight:100,overflowY:"auto",paddingRight:52},className:`nexus-input w-full border rounded-xl px-3 py-2.5 text-sm\r
12
- transition-colors disabled:opacity-40`}),e.jsx("button",{onClick:j,disabled:!x.trim()||n,"aria-label":"Send message",style:{position:"absolute",right:6,bottom:6,background:x.trim()&&!n?u:"var(--nx-surface)"},className:`w-8 h-8 rounded-lg flex items-center justify-center\r
25
+ `}),b.jsxs("div",{style:{fontFamily:"system-ui, -apple-system, sans-serif",position:"relative",background:"var(--nx-bg)",borderColor:c?"none":"var(--nx-border)"},className:`flex flex-col overflow-hidden shadow-2xl h-full ${c?"":"rounded-2xl border"}`,role:"dialog","aria-label":`${e} chat`,children:[!c&&b.jsxs("div",{style:{background:"var(--nx-bg)",borderBottom:"1px solid var(--nx-border)"},className:"flex items-center justify-between px-4 py-3 shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-2.5",children:[b.jsx("div",{className:"w-2 h-2 rounded-full bg-[var(--nx-text)]/40"}),b.jsx("span",{style:{color:i},className:"text-sm font-medium",children:e})]}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("button",{onClick:s,"aria-label":"Expand to full view",className:"nexus-ctrl-btn p-2",children:b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:b.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})})}),b.jsx("button",{onClick:a,"aria-label":"Close chat",className:"nexus-ctrl-btn p-2",children:b.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:b.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]})]}),c&&b.jsxs("div",{className:"absolute top-4 right-4 flex items-center gap-2",style:{zIndex:10},children:[b.jsx("button",{onClick:s,"aria-label":"Exit full view",className:"nexus-ctrl-btn p-2",children:b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:b.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})})}),b.jsx("button",{onClick:a,"aria-label":"Close chat",className:"nexus-ctrl-btn p-2",children:b.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:b.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),b.jsx("div",{ref:E,onScroll:y,className:"flex-1 overflow-y-auto",style:{minHeight:0,background:"var(--nx-bg)"},children:b.jsxs("div",{className:"space-y-3 p-2",style:c?{maxWidth:720,margin:"0 auto"}:void 0,children:[n.length===0&&b.jsxs("div",{className:"flex items-start gap-3",children:[b.jsx("div",{style:{background:i,flexShrink:0},className:`w-7 h-7 rounded-full flex items-center justify-center\r
26
+ text-white text-xs font-semibold mt-0.5`,children:e[0].toUpperCase()}),b.jsx("p",{style:{color:"var(--nx-text)"},className:"flex-1 text-sm leading-relaxed pt-0.5",children:l})]}),n.map((j,_)=>{const x=n[_-1],L=_>0&&x.role==="assistant"&&j.role==="user";return b.jsxs(V.Fragment,{children:[L&&b.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--nx-border)",margin:"1rem 0"}}),b.jsx(Xa,{msg:j,primaryColor:i,agentName:e})]},j.id)}),t&&b.jsx(Ya,{color:i,agentName:e}),r&&b.jsx("p",{className:"text-center text-xs py-1",style:{color:"var(--nx-error)"},children:r}),b.jsx("div",{ref:m})]})}),w&&b.jsx("button",{onClick:()=>m.current?.scrollIntoView({behavior:"smooth"}),"aria-label":"Scroll to bottom",style:{position:"absolute",bottom:90,left:"50%",transform:"translateX(-50%)",width:30,height:30,borderRadius:"50%",background:"var(--nx-bg)",opacity:.8,border:"1px solid var(--nx-border)",boxShadow:"0 2px 8px rgba(0,0,0,0.10)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"var(--nx-text)",zIndex:5},children:b.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:b.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})})}),b.jsx("div",{style:{background:"var(--nx-bg)",borderColor:c?"none":"var(--nx-border)"},className:`${!c&&"border-t"} shrink-0 px-2.5`,children:b.jsxs("div",{className:"relative w-full mx-auto flex items-center shadow rounded-xl",style:{maxWidth:c?720:"none",marginBottom:c?20:12,marginTop:c?0:10},children:[b.jsx("textarea",{ref:f,rows:1,value:u,onChange:j=>{p(j.target.value),j.target.style.height="auto",j.target.style.height=`${Math.min(j.target.scrollHeight,100)}px`},onKeyDown:I,placeholder:"Type a message…",disabled:t,style:{resize:"none",minHeight:44,maxHeight:100,overflowY:"auto",paddingRight:52},className:`nexus-input w-full border rounded-xl px-3 py-2.5 text-sm\r
27
+ transition-colors disabled:opacity-40`}),b.jsx("button",{onClick:A,disabled:!u.trim()||t,"aria-label":"Send message",style:{position:"absolute",right:6,bottom:6,background:u.trim()&&!t?i:"var(--nx-surface)"},className:`w-8 h-8 rounded-lg flex items-center justify-center\r
13
28
  transition-colors disabled:opacity-40\r
14
- disabled:cursor-not-allowed`,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:x.trim()&&!n?"white":"var(--nx-text-muted)",viewBox:"0 0 16 16",children:e.jsx("path",{fillRule:"evenodd",d:"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5"})})})]})})]})]})}function H(t){return`nexus_widget_session_${t}`}function A(t){const o=sessionStorage.getItem(H(t));if(o)return o;const n=crypto.randomUUID();return sessionStorage.setItem(H(t),n),n}async function*_(t,o){const n=new TextDecoder;let f="";try{for(;;){if(o.aborted)return;const{done:u,value:l}=await t.read();if(u)return;f+=n.decode(l,{stream:!0});const b=f.split(`
29
+ disabled:cursor-not-allowed`,children:b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:u.trim()&&!t?"white":"var(--nx-text-muted)",viewBox:"0 0 16 16",children:b.jsx("path",{fillRule:"evenodd",d:"M8 12a.5.5 0 0 0 .5-.5V5.707l2.146 2.147a.5.5 0 0 0 .708-.708l-3-3a.5.5 0 0 0-.708 0l-3 3a.5.5 0 1 0 .708.708L7.5 5.707V11.5a.5.5 0 0 0 .5.5"})})})]})})]})]})}function Pt(e){return`nexus_widget_session_${e}`}function Ka(e){const n=sessionStorage.getItem(Pt(e));if(n)return n;const t=crypto.randomUUID();return sessionStorage.setItem(Pt(e),t),t}async function*Ja(e,n){const t=new TextDecoder;let r="";try{for(;;){if(n.aborted)return;const{done:i,value:l}=await e.read();if(i)return;r+=t.decode(l,{stream:!0});const o=r.split(`
15
30
 
16
- `);f=b.pop()??"";for(const c of b)for(const r of c.split(`
17
- `)){if(!r.startsWith("data: "))continue;const g=r.slice(6).trim();try{yield JSON.parse(g)}catch{}}}}finally{t.releaseLock()}}function P({agentId:t,baseUrl:o,agentCoreUrl:n,endUserId:f}){const[u,l]=s.useState([]),[b,c]=s.useState(!1),[r,g]=s.useState(!0),[x,d]=s.useState(null),[N,p]=s.useState(null),[j,C]=s.useState(null),a=s.useRef(A(t)),m=s.useRef(null),S=s.useCallback(async()=>{m.current?.abort(),g(!0),d(null);const y=new AbortController;m.current=y;try{const i=await fetch(`${o}/widget/session`,{method:"POST",signal:y.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:t,sessionId:a.current})});if(!i.ok)throw new Error(`HTTP ${i.status}`);const k=await i.json();C(k.token);const v=await fetch(`${o}/chat/history`,{method:"POST",signal:y.signal,headers:{"Content-Type":"application/json",Authorization:`Bearer ${k.token}`},body:JSON.stringify({agentId:t,sessionId:a.current})});if(v.status==404){l([]),p(null);return}if(!v.ok)throw new Error(`HTTP ${v.status}`);const h=await v.json();l(h.messages??[]),p(h.conversationId??null)}catch(i){console.log(i),i.status!=404&&i?.name!=="AbortError"&&d("Error Loading History")}finally{g(!1)}},[t]);s.useEffect(()=>(S(),()=>{m.current?.abort()}),[S]);const M=s.useCallback(()=>{m.current?.abort(),c(!1)},[]),E=s.useCallback(()=>{m.current?.abort(),l([]),p(null),d(null),c(!1),a.current=crypto.randomUUID(),C(null),S()},[S]),T=s.useCallback(async y=>{if(!y.trim()||b||!j)return;m.current?.abort();const i=new AbortController;m.current=i,d(null);const k=`u_${Date.now()}`,v=`a_${Date.now()}`;l(h=>[...h,{id:k,role:"user",content:y.trim()}]),c(!0);try{const h=await fetch(`${n}/chat`,{method:"POST",signal:i.signal,headers:{"Content-Type":"application/json",Authorization:`Bearer ${j}`},body:JSON.stringify({agent_id:t,message:y.trim(),session_id:a.current})});if(!h.ok||!h.body)throw new Error(`HTTP ${h.status}`);l(w=>[...w,{id:v,role:"assistant",content:""}]);const $=h.body.getReader();for await(const w of _($,i.signal))switch(w.type){case"start":p(w.conversationId);break;case"token":l(I=>I.map(B=>B.id===v?{...B,content:B.content+w.content}:B));break;case"done":break;case"error":d(w.message),l(I=>I.filter(B=>B.id!==v));break}}catch(h){if(h?.name==="AbortError")return;d("Something went wrong. Please try again."),l($=>$.filter(w=>w.id!==k&&w.id!==v))}finally{c(!1)}},[t,f,b,j]);return{messages:u,isLoading:b,historyLoading:r,error:x,conversationId:N,send:T,reset:E,cancel:M}}const O={bg:"#0d0d1a",surface:"rgba(255,255,255,0.06)",border:"rgba(255,255,255,0.08)",text:"rgba(255,255,255,0.82)",textMuted:"rgba(255,255,255,0.25)",inputBg:"rgba(255,255,255,0.05)",inputBorder:"rgba(255,255,255,0.08)",inputBorderFocus:"rgba(255,255,255,0.20)",error:"rgba(248,113,113,0.75)"},D={bg:"#f8f9fb",surface:"rgba(0,0,0,0.055)",border:"rgba(0,0,0,0.09)",text:"rgba(0,0,0,0.82)",textMuted:"rgba(0,0,0,0.38)",inputBg:"rgba(0,0,0,0.04)",inputBorder:"rgba(0,0,0,0.10)",inputBorderFocus:"rgba(0,0,0,0.22)",error:"rgba(220,38,38,0.80)"};function R(t){return t==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?O:D:t==="dark"?O:D}function U(t){return{"--nx-bg":t.bg,"--nx-surface":t.surface,"--nx-border":t.border,"--nx-text":t.text,"--nx-text-muted":t.textMuted,"--nx-input-bg":t.inputBg,"--nx-input-border":t.inputBorder,"--nx-input-border-focus":t.inputBorderFocus,"--nx-error":t.error}}function J({agentId:t,agentName:o,baseUrl:n,agentCoreUrl:f,primaryColor:u="#6366f1",welcomeMessage:l="Hi! How can I help you?",position:b="bottom-right",theme:c="dark"}){const[r,g]=s.useState(!1),[x,d]=s.useState(!1),[N,p]=s.useState(()=>R(c)),j=s.useRef(null),{messages:C,isLoading:a,error:m,send:S,reset:M,cancel:E}=P({agentId:t,baseUrl:n,agentCoreUrl:f}),T=b!=="bottom-left",y=()=>{E(),g(!1),d(!1)};return s.useEffect(()=>{if(p(R(c)),c!=="system")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),k=()=>p(R("system"));return i.addEventListener("change",k),()=>i.removeEventListener("change",k)},[c]),e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
31
+ `);r=o.pop()??"";for(const a of o)for(const c of a.split(`
32
+ `)){if(!c.startsWith("data: "))continue;const s=c.slice(6).trim();try{yield JSON.parse(s)}catch{}}}}finally{e.releaseLock()}}function hr({agentId:e,baseUrl:n,agentCoreUrl:t,endUserId:r}){const[i,l]=V.useState([]),[o,a]=V.useState(!1),[c,s]=V.useState(!0),[u,p]=V.useState(null),[m,f]=V.useState(null),[w,C]=V.useState(null),E=V.useRef(Ka(e)),y=V.useRef(null),A=V.useCallback(async()=>{y.current?.abort(),s(!0),p(null);const x=new AbortController;y.current=x;try{const L=await fetch(`${n}/widget/session`,{method:"POST",signal:x.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify({agentId:e,sessionId:E.current})});if(!L.ok)throw new Error(`HTTP ${L.status}`);const F=await L.json();C(F.token);const O=await fetch(`${n}/chat/history`,{method:"POST",signal:x.signal,headers:{"Content-Type":"application/json",Authorization:`Bearer ${F.token}`},body:JSON.stringify({agentId:e,sessionId:E.current})});if(O.status==404){l([]),f(null);return}if(!O.ok)throw new Error(`HTTP ${O.status}`);const M=await O.json();l(M.messages??[]),f(M.conversationId??null)}catch(L){console.log(L),L.status!=404&&L?.name!=="AbortError"&&p("Error Loading History")}finally{s(!1)}},[e]);V.useEffect(()=>(A(),()=>{y.current?.abort()}),[A]);const I=V.useCallback(()=>{y.current?.abort(),a(!1)},[]),j=V.useCallback(()=>{y.current?.abort(),l([]),f(null),p(null),a(!1),E.current=crypto.randomUUID(),C(null),A()},[A]),_=V.useCallback(async x=>{if(!x.trim()||o||!w)return;y.current?.abort();const L=new AbortController;y.current=L,p(null);const F=`u_${Date.now()}`,O=`a_${Date.now()}`;l(M=>[...M,{id:F,role:"user",content:x.trim()}]),a(!0);try{const M=await fetch(`${t}/chat`,{method:"POST",signal:L.signal,headers:{"Content-Type":"application/json",Authorization:`Bearer ${w}`},body:JSON.stringify({agent_id:e,message:x.trim(),session_id:E.current})});if(!M.ok||!M.body)throw new Error(`HTTP ${M.status}`);l(T=>[...T,{id:O,role:"assistant",content:""}]);const P=M.body.getReader();for await(const T of Ja(P,L.signal))switch(T.type){case"start":f(T.conversationId);break;case"token":l(U=>U.map(z=>z.id===O?{...z,content:z.content+T.content}:z));break;case"done":break;case"error":p(T.message),l(U=>U.filter(z=>z.id!==O));break}}catch(M){if(M?.name==="AbortError")return;p("Something went wrong. Please try again."),l(P=>P.filter(T=>T.id!==F&&T.id!==O))}finally{a(!1)}},[e,r,o,w]);return{messages:i,isLoading:o,historyLoading:c,error:u,conversationId:m,send:_,reset:j,cancel:I}}const At={bg:"#0d0d1a",surface:"rgba(255,255,255,0.06)",border:"rgba(255,255,255,0.08)",text:"rgba(255,255,255,0.82)",textMuted:"rgba(255,255,255,0.25)",inputBg:"rgba(255,255,255,0.05)",inputBorder:"rgba(255,255,255,0.08)",inputBorderFocus:"rgba(255,255,255,0.20)",error:"rgba(248,113,113,0.75)"},zt={bg:"#f8f9fb",surface:"rgba(0,0,0,0.055)",border:"rgba(0,0,0,0.09)",text:"rgba(0,0,0,0.82)",textMuted:"rgba(0,0,0,0.38)",inputBg:"rgba(0,0,0,0.04)",inputBorder:"rgba(0,0,0,0.10)",inputBorderFocus:"rgba(0,0,0,0.22)",error:"rgba(220,38,38,0.80)"};function dn(e){return e==="system"?typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches?At:zt:e==="dark"?At:zt}function Ga(e){return{"--nx-bg":e.bg,"--nx-surface":e.surface,"--nx-border":e.border,"--nx-text":e.text,"--nx-text-muted":e.textMuted,"--nx-input-bg":e.inputBg,"--nx-input-border":e.inputBorder,"--nx-input-border-focus":e.inputBorderFocus,"--nx-error":e.error}}function Za({agentId:e,agentName:n,baseUrl:t,agentCoreUrl:r,primaryColor:i="#6366f1",welcomeMessage:l="Hi! How can I help you?",position:o="bottom-right",theme:a="dark"}){const[c,s]=V.useState(!1),[u,p]=V.useState(!1),[m,f]=V.useState(()=>dn(a)),w=V.useRef(null),{messages:C,isLoading:E,error:y,send:A,reset:I,cancel:j}=hr({agentId:e,baseUrl:t,agentCoreUrl:r}),_=o!=="bottom-left",x=()=>{j(),s(!1),p(!1)};return V.useEffect(()=>{if(f(dn(a)),a!=="system")return;const L=window.matchMedia("(prefers-color-scheme: dark)"),F=()=>f(dn("system"));return L.addEventListener("change",F),()=>L.removeEventListener("change",F)},[a]),b.jsxs(b.Fragment,{children:[b.jsx("style",{children:`
18
33
  .nexus-bubble-btn {
19
34
  transition: transform 0.2s ease, box-shadow 0.15s ease, opacity 0.18s ease;
20
35
  }
@@ -46,7 +61,7 @@
46
61
  color: var(--nx-text);
47
62
  background: var(--nx-surface);
48
63
  }
49
- `}),e.jsxs("div",{ref:j,style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:"none",fontFamily:"system-ui, -apple-system, sans-serif",...U(N)},children:[e.jsx("div",{style:x?{position:"absolute",inset:0,opacity:1,pointerEvents:"auto",transition:"all 0.25s ease"}:r?{position:"absolute",[T?"right":"left"]:0,top:0,bottom:0,width:380,opacity:1,pointerEvents:"auto",transition:"all 0.28s cubic-bezier(0.34, 1.45, 0.64, 1)"}:{position:"absolute",[T?"right":"left"]:20,bottom:88,width:420,height:"calc(100vh - 108px)",border:"1px solid var(--nx-border)",opacity:0,transform:"scale(0.82) translateY(12px)",transformOrigin:`bottom ${T?"right":"left"}`,pointerEvents:"none",transition:"all 0.2s ease-in"},children:r&&e.jsx(L,{agentName:o??"Assistant",messages:C,isLoading:a,error:m??null,primaryColor:u,welcomeMessage:l,onSend:S,onReset:M,onClose:y,onToggleFullView:()=>d(i=>!i),isFullView:x})}),e.jsx("button",{className:"nexus-bubble-btn",onClick:()=>g(i=>!i),"aria-label":r?"Close chat":"Open chat","aria-expanded":r,style:{position:"absolute",[T?"right":"left"]:20,bottom:20,width:56,height:56,borderRadius:"50%",background:u,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.28)",pointerEvents:"auto",opacity:r?0:1,transform:r?"scale(0.5)":"scale(1)"},children:e.jsx("span",{style:{position:"relative",width:40,height:40},children:e.jsx("span",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease, transform 0.2s ease",opacity:r?0:1,transform:r?"scale(0.65) rotate(-15deg)":"scale(1) rotate(0deg)"},children:e.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("circle",{cx:"256",cy:"256",r:"220",fill:"#6366f1"}),e.jsx("rect",{x:"156",y:"150",width:"200",height:"170",rx:"36",fill:"white"}),e.jsx("line",{x1:"256",y1:"120",x2:"256",y2:"150",stroke:"white","stroke-width":"10","stroke-linecap":"round"}),e.jsx("circle",{cx:"256",cy:"105",r:"14",fill:"white"}),e.jsx("circle",{cx:"210",cy:"220",r:"18",fill:"#6366f1"}),e.jsx("circle",{cx:"302",cy:"220",r:"18",fill:"#6366f1"}),e.jsx("rect",{x:"206",y:"265",width:"100",height:"16",rx:"8",fill:"#6366f1"}),e.jsx("rect",{x:"132",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),e.jsx("rect",{x:"356",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),e.jsx("path",{d:`M180 340
64
+ `}),b.jsxs("div",{ref:w,style:{position:"fixed",inset:0,zIndex:9999,pointerEvents:"none",fontFamily:"system-ui, -apple-system, sans-serif",...Ga(m)},children:[b.jsx("div",{style:u?{position:"absolute",inset:0,opacity:1,pointerEvents:"auto",transition:"all 0.25s ease"}:c?{position:"absolute",top:10,bottom:10,width:380,opacity:1,[_?"right":"left"]:10,pointerEvents:"auto",transition:"all 0.28s cubic-bezier(0.34, 1.45, 0.64, 1)"}:{position:"absolute",[_?"right":"left"]:20,bottom:88,width:420,height:"calc(100vh - 108px)",border:"1px solid var(--nx-border)",opacity:0,transform:"scale(0.82) translateY(12px)",transformOrigin:`bottom ${_?"right":"left"}`,pointerEvents:"none",transition:"all 0.2s ease-in"},children:c&&b.jsx(Qa,{agentName:n??"Assistant",messages:C,isLoading:E,error:y??null,primaryColor:i,welcomeMessage:l,onSend:A,onReset:I,onClose:x,onToggleFullView:()=>p(L=>!L),isFullView:u})}),b.jsx("button",{className:"nexus-bubble-btn",onClick:()=>s(L=>!L),"aria-label":c?"Close chat":"Open chat","aria-expanded":c,style:{position:"absolute",[_?"right":"left"]:20,bottom:20,width:56,height:56,borderRadius:"50%",background:i,border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.28)",pointerEvents:"auto",opacity:c?0:1,transform:c?"scale(0.5)":"scale(1)"},children:b.jsx("span",{style:{position:"relative",width:40,height:40},children:b.jsx("span",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 0.2s ease, transform 0.2s ease",opacity:c?0:1,transform:c?"scale(0.65) rotate(-15deg)":"scale(1) rotate(0deg)"},children:b.jsxs("svg",{width:"512",height:"512",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:[b.jsx("circle",{cx:"256",cy:"256",r:"220",fill:"#6366f1"}),b.jsx("rect",{x:"156",y:"150",width:"200",height:"170",rx:"36",fill:"white"}),b.jsx("line",{x1:"256",y1:"120",x2:"256",y2:"150",stroke:"white",strokeWidth:"10",strokeLinecap:"round"}),b.jsx("circle",{cx:"256",cy:"105",r:"14",fill:"white"}),b.jsx("circle",{cx:"210",cy:"220",r:"18",fill:"#6366f1"}),b.jsx("circle",{cx:"302",cy:"220",r:"18",fill:"#6366f1"}),b.jsx("rect",{x:"206",y:"265",width:"100",height:"16",rx:"8",fill:"#6366f1"}),b.jsx("rect",{x:"132",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),b.jsx("rect",{x:"356",y:"205",width:"24",height:"60",rx:"12",fill:"white"}),b.jsx("path",{d:`M180 340
50
65
  h152
51
66
  a24 24 0 0 1 24 24
52
67
  v20
@@ -57,4 +72,4 @@
57
72
  h-52
58
73
  a24 24 0 0 1 -24 -24
59
74
  v-20
60
- a24 24 0 0 1 24 -24z`,fill:"white"}),e.jsx("circle",{cx:"220",cy:"374",r:"8",fill:"#6366f1"}),e.jsx("circle",{cx:"256",cy:"374",r:"8",fill:"#6366f1"}),e.jsx("circle",{cx:"292",cy:"374",r:"8",fill:"#6366f1"})]})})})})]})]})}exports.NexusWidget=J;exports.useChat=P;
75
+ a24 24 0 0 1 24 -24z`,fill:"white"}),b.jsx("circle",{cx:"220",cy:"374",r:"8",fill:"#6366f1"}),b.jsx("circle",{cx:"256",cy:"374",r:"8",fill:"#6366f1"}),b.jsx("circle",{cx:"292",cy:"374",r:"8",fill:"#6366f1"})]})})})})]})]})}exports.NexusWidget=Za;exports.useChat=hr;