@snf/qa-bot-core 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@
5
5
  * Copyright(c) 2015 Andreas Lubbe
6
6
  * Copyright(c) 2015 Tiancheng "Timothy" Gu
7
7
  * MIT Licensed
8
- */var rn,on;const ln=nn(function(){if(on)return rn;on=1;var e=/["'&<>]/;return rn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,i="",l=0,s=0;for(l=r.index;l<n.length;l++){switch(n.charCodeAt(l)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#39;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}s!==l&&(i+=n.substring(s,l)),s=l+1,i+=o}return s!==l?i+n.substring(s,l):i}}());function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const an=/(url|image|image-set)\(/i;class An extends tn{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(an)&&delete t[e]}),t}}const cn=/^<(!doctype|(html|head|body)(\s|>))/i,un=/^(aria-|data-|\w+:)/iu,dn=/{{{(\w+)\/?}}}/;function fn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let pn=class{constructor(e,t={},n=[],r=[]){var o;if(sn(this,"allowed",void 0),sn(this,"banned",void 0),sn(this,"blocked",void 0),sn(this,"container",void 0),sn(this,"content",[]),sn(this,"props",void 0),sn(this,"matchers",void 0),sn(this,"filters",void 0),sn(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new An],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:Xt),this.banned=new Set(Kt),this.blocked=new Set(t.blockList)}applyAttributeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.attribute?n.attribute(e,t):t,t)}applyNodeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.node?n.node(e,t):t,t)}applyMatchers(e,t){const n={},{props:r}=this;let o=e,i=0,l=null;return this.matchers.forEach(e=>{const s=e.asTag().toLowerCase(),a=this.getTagConfig(s);if(r[e.inverseName]||!this.isTagAllowed(s)||!this.canRenderChild(t,a))return;let A="";for(;o&&(l=e.match(o));){const{index:t,length:s,match:a,valid:c,void:u,...d}=l,f=e.propName+String(i);t>0&&(A+=o.slice(0,t)),c?(A+=u?`{{{${f}/}}}`:`{{{${f}}}}${a}{{{/${f}}}}`,this.keyIndex+=1,i+=1,n[f]={children:a,matcher:e,props:{...r,...d,key:this.keyIndex}}):A+=a,e.greedy?(o=A+o.slice(t+s),A=""):o=o.slice(t+(s||a.length))}e.greedy||(o=A+o)}),0===i?e:this.replaceTokens(o,n)}canRenderChild(e,t){return!(!e.tagName||!t.tagName||e.void)&&(e.children.length>0?e.children.includes(t.tagName):!(e.invalid.length>0&&e.invalid.includes(t.tagName))&&(t.parent.length>0?t.parent.includes(e.tagName):!(!e.self&&e.tagName===t.tagName)&&!!(e&&e.content&t.type)))}convertLineBreaks(e){const{noHtml:t,disableLineBreaks:n}=this.props;if(t||n||e.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return e;let r=e.replace(/\r\n/g,"\n");return r=r.replace(/\n{3,}/g,"\n\n\n"),r=r.replace(/\n/g,"<br/>"),r}createContainer(e){var t;const n=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||fn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(cn)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?ln(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:i,value:l}=o,s=i.toLowerCase(),a=Jt[s]||Jt[i];if(!this.isSafe(e)||!s.match(un)&&(!t&&(!a||2===a)||s.startsWith("on")||l.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let A="style"===s?this.extractStyleAttribute(e):l;4===a?A=!0:3===a?A=Number.parseFloat(String(A)):5!==a&&(A=String(A)),n[Zt[s]||s]=this.applyAttributeFilters(s,A),r+=1}),0!==r)?n:null}extractStyleAttribute(e){const t={};return Array.from(e.style).forEach(n=>{const r=e.style[n];("string"==typeof r||"number"==typeof r)&&(t[n.replace(/-([a-z])/g,(e,t)=>String(t).toUpperCase())]=r)}),t}getTagConfig(e){const t={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return Yt[e]?{...t,...Yt[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:i,transform:l,transformOnlyAllowList:s}=this.props;let a=[],A="";return[...t.childNodes].forEach(t=>{if(1===t.nodeType){const u=t.nodeName.toLowerCase(),d=this.getTagConfig(u);A&&(a.push(A),A="");const f=this.applyNodeFilters(u,t);if(!f)return;let p;if(l&&(!s||this.isTagAllowed(u))){this.keyIndex+=1;const t=this.keyIndex;p=this.parseNode(f,d);const n=l(f,p,d);if(null===n)return;if(typeof n<"u")return void a.push(e.cloneElement(n,{key:t}));this.keyIndex=t-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!i&&!this.canRenderChild(n,d))a=[...a,...this.parseNode(f,d.tagName?d:n)];else{var c;this.keyIndex+=1;const t=this.extractAttributes(f),n={tagName:u};t&&(n.attributes=t),d.void&&(n.selfClose=d.void),a.push(e.createElement(en,{...n,key:this.keyIndex},null!==(c=p)&&void 0!==c?c:this.parseNode(f,d)))}}else if(3===t.nodeType){const e=r&&!o?t.textContent:this.applyMatchers(t.textContent||"",n);Array.isArray(e)?a=[...a,...e]:A+=e}}),A&&a.push(A),a}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(dn);){const[e,i]=o,l=o.index,s=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[i])throw new Error(`Token "${i}" found but no matching element to replace with.`);l>0&&(n.push(r.slice(0,l)),r=r.slice(l));const{children:a,matcher:A,props:c}=t[i];let u;if(s)u=e.length,n.push(A.createElement(a,c));else{const o=r.match(new RegExp(`{{{/${i}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${i}".`);u=o.index+o[0].length,n.push(A.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function hn(t){var n;const{attributes:r,className:o,containerTagName:i,content:l,emptyContent:s,parsedContent:a,tagName:A,noWrap:c}=t,u=null!==(n=i??A)&&void 0!==n?n:"span",d="fragment"===u||c;let f;if(a)f=a;else{const e=new pn(l??"",t).parse();e.length>0&&(f=e)}return f||(f=s),d?e.createElement(e.Fragment,null,f):e.createElement(en,{attributes:r,className:o,tagName:u},f)}function gn(t){const{attributes:n,className:r,content:o="",disableFilters:i=!1,disableMatchers:l=!1,emptyContent:s=null,filters:a=[],matchers:A=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:f=!1,...p}=t,h=l?[]:A,g=i?[]:a,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const y=m.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new pn(y,p,h,g),b=v.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return e.createElement(hn,{attributes:n,className:r,containerTagName:t.containerTagName,emptyContent:s,noWrap:f,parsedContent:0===b.length?void 0:b,tagName:d})}const mn=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(gn,{content:"string"==typeof e?e:""})}),vn={autoConfig:!0},yn=(e,t,n)=>{var r;if(!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderHtml)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)},wn=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const i=e[o];"<"===i?r?(t.push(n),n=i):(r=!0,n=i):">"===i?(n+=i,t.push(n),n="",r=!1):r?n+=i:t.push(i)}return""!==n&&t.push(n),t},bn=t=>{const{getFlow:n}=Ht(),{messages:r,replaceMessages:o}=zt(),{settings:i}=_t(),{hasChatHistoryLoaded:l}=Vt(),s={...t,...vn},a=s.htmlComponent?s.htmlComponent:mn;e.useEffect(()=>{var e,t;if(l){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=i.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=a)}o(n)}},[l]);const A=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();"string"==typeof e.data.message.content&&yn(e,n(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=wn),e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};Ut(N.PRE_INJECT_MESSAGE,A),Ut(N.CHUNK_STREAM_MESSAGE,A),Ut(N.START_STREAM_MESSAGE,A),Ut(N.START_SIMULATE_STREAM_MESSAGE,A),Ut(N.START_SPEAK_AUDIO,async e=>{yn(e,n(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=s&&s.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const xn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,En={};function Cn(e,t){return(En.jsx?kn:xn).test(e)}const Pn=/[ \t\n\f\r]/g;function Sn(e){return""===e.replace(Pn,"")}class Dn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Bn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Dn(n,r,t)}function In(e){return e.toLowerCase()}Dn.prototype.property={},Dn.prototype.normal={},Dn.prototype.space=null;class Tn{constructor(e,t){this.property=e,this.attribute=t}}Tn.prototype.space=null,Tn.prototype.boolean=!1,Tn.prototype.booleanish=!1,Tn.prototype.overloadedBoolean=!1,Tn.prototype.number=!1,Tn.prototype.commaSeparated=!1,Tn.prototype.spaceSeparated=!1,Tn.prototype.commaOrSpaceSeparated=!1,Tn.prototype.mustUseProperty=!1,Tn.prototype.defined=!1;let Qn=0;const Mn=Hn(),On=Hn(),Ln=Hn(),Rn=Hn(),jn=Hn(),Nn=Hn(),Fn=Hn();function Hn(){return 2**++Qn}const zn=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mn,booleanish:On,commaOrSpaceSeparated:Fn,commaSeparated:Nn,number:Rn,overloadedBoolean:Ln,spaceSeparated:jn},Symbol.toStringTag,{value:"Module"})),Un=Object.keys(zn);class _n extends Tn{constructor(e,t,n,r){let o=-1;if(super(e,t),qn(this,"space",r),"number"==typeof n)for(;++o<Un.length;){const e=Un[o];qn(this,Un[o],(n&zn[e])===zn[e])}}}function qn(e,t,n){n&&(e[t]=n)}_n.prototype.defined=!0;const Vn={}.hasOwnProperty;function Gn(e){const t={},n={};let r;for(r in e.properties)if(Vn.call(e.properties,r)){const o=e.properties[r],i=new _n(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[In(r)]=r,n[In(i.attribute)]=r}return new Dn(t,n,e.space)}const Wn=Gn({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Yn=Gn({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Kn(e,t){return t in e?e[t]:t}function Xn(e,t){return Kn(e,t.toLowerCase())}const Jn=Gn({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Xn,properties:{xmlns:null,xmlnsXLink:null}}),Zn=Gn({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:On,ariaAutoComplete:null,ariaBusy:On,ariaChecked:On,ariaColCount:Rn,ariaColIndex:Rn,ariaColSpan:Rn,ariaControls:jn,ariaCurrent:null,ariaDescribedBy:jn,ariaDetails:null,ariaDisabled:On,ariaDropEffect:jn,ariaErrorMessage:null,ariaExpanded:On,ariaFlowTo:jn,ariaGrabbed:On,ariaHasPopup:null,ariaHidden:On,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jn,ariaLevel:Rn,ariaLive:null,ariaModal:On,ariaMultiLine:On,ariaMultiSelectable:On,ariaOrientation:null,ariaOwns:jn,ariaPlaceholder:null,ariaPosInSet:Rn,ariaPressed:On,ariaReadOnly:On,ariaRelevant:null,ariaRequired:On,ariaRoleDescription:jn,ariaRowCount:Rn,ariaRowIndex:Rn,ariaRowSpan:Rn,ariaSelected:On,ariaSetSize:Rn,ariaSort:null,ariaValueMax:Rn,ariaValueMin:Rn,ariaValueNow:Rn,ariaValueText:null,role:null}}),$n=Gn({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Xn,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nn,acceptCharset:jn,accessKey:jn,action:null,allow:null,allowFullScreen:Mn,allowPaymentRequest:Mn,allowUserMedia:Mn,alt:null,as:null,async:Mn,autoCapitalize:null,autoComplete:jn,autoFocus:Mn,autoPlay:Mn,blocking:jn,capture:null,charSet:null,checked:Mn,cite:null,className:jn,cols:Rn,colSpan:null,content:null,contentEditable:On,controls:Mn,controlsList:jn,coords:Rn|Nn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mn,defer:Mn,dir:null,dirName:null,disabled:Mn,download:Ln,draggable:On,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mn,formTarget:null,headers:jn,height:Rn,hidden:Mn,high:Rn,href:null,hrefLang:null,htmlFor:jn,httpEquiv:jn,id:null,imageSizes:null,imageSrcSet:null,inert:Mn,inputMode:null,integrity:null,is:null,isMap:Mn,itemId:null,itemProp:jn,itemRef:jn,itemScope:Mn,itemType:jn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mn,low:Rn,manifest:null,max:null,maxLength:Rn,media:null,method:null,min:null,minLength:Rn,multiple:Mn,muted:Mn,name:null,nonce:null,noModule:Mn,noValidate:Mn,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:Mn,optimum:Rn,pattern:null,ping:jn,placeholder:null,playsInline:Mn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mn,referrerPolicy:null,rel:jn,required:Mn,reversed:Mn,rows:Rn,rowSpan:Rn,sandbox:jn,scope:null,scoped:Mn,seamless:Mn,selected:Mn,shadowRootClonable:Mn,shadowRootDelegatesFocus:Mn,shadowRootMode:null,shape:null,size:Rn,sizes:null,slot:null,span:Rn,spellCheck:On,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Rn,step:null,style:null,tabIndex:Rn,target:null,title:null,translate:null,type:null,typeMustMatch:Mn,useMap:null,value:On,width:Rn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jn,axis:null,background:null,bgColor:null,border:Rn,borderColor:null,bottomMargin:Rn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mn,declare:Mn,event:null,face:null,frame:null,frameBorder:null,hSpace:Rn,leftMargin:Rn,link:null,longDesc:null,lowSrc:null,marginHeight:Rn,marginWidth:Rn,noResize:Mn,noHref:Mn,noShade:Mn,noWrap:Mn,object:null,profile:null,prompt:null,rev:null,rightMargin:Rn,rules:null,scheme:null,scrolling:On,standby:null,summary:null,text:null,topMargin:Rn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Rn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mn,disableRemotePlayback:Mn,prefix:null,property:null,results:Rn,security:null,unselectable:null}}),er=Gn({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:Kn,properties:{about:Fn,accentHeight:Rn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Rn,amplitude:Rn,arabicForm:null,ascent:Rn,attributeName:null,attributeType:null,azimuth:Rn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Rn,by:null,calcMode:null,capHeight:Rn,className:jn,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:Rn,diffuseConstant:Rn,direction:null,display:null,dur:null,divisor:Rn,dominantBaseline:null,download:Mn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Rn,enableBackground:null,end:null,event:null,exponent:Rn,externalResourcesRequired:null,fill:null,fillOpacity:Rn,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:Nn,g2:Nn,glyphName:Nn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Rn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Rn,horizOriginX:Rn,horizOriginY:Rn,id:null,ideographic:Rn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Rn,k:Rn,k1:Rn,k2:Rn,k3:Rn,k4:Rn,kernelMatrix:Fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Rn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Rn,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:Rn,overlineThickness:Rn,paintOrder:null,panose1:null,path:null,pathLength:Rn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Rn,pointsAtY:Rn,pointsAtZ:Rn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fn,rev:Fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fn,requiredFeatures:Fn,requiredFonts:Fn,requiredFormats:Fn,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:Rn,specularExponent:Rn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Rn,strikethroughThickness:Rn,string:null,stroke:null,strokeDashArray:Fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Rn,strokeOpacity:Rn,strokeWidth:null,style:null,surfaceScale:Rn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fn,tabIndex:Rn,tableValues:null,target:null,targetX:Rn,targetY:Rn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Rn,underlineThickness:Rn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Rn,values:null,vAlphabetic:Rn,vMathematical:Rn,vectorEffect:null,vHanging:Rn,vIdeographic:Rn,version:null,vertAdvY:Rn,vertOriginX:Rn,vertOriginY:Rn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Rn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),tr=/^data[-\w.:]+$/i,nr=/-[a-z]/g,rr=/[A-Z]/g;function or(e){return"-"+e.toLowerCase()}function ir(e){return e.charAt(1).toUpperCase()}const lr={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"},sr=Bn([Yn,Wn,Jn,Zn,$n],"html"),ar=Bn([Yn,Wn,Jn,Zn,er],"svg");function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cr,ur,dr,fr={};var pr=function(){if(dr)return fr;dr=1;var e=fr&&fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fr,"__esModule",{value:!0}),fr.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),i="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;i?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(ur)return cr;ur=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,a="";function A(e){return e?e.replace(s,a):a}return cr=function(s,c){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];c=c||{};var u=1,d=1;function f(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=s,!c.silent)throw t}function m(e){var t=e.exec(s);if(t){var n=t[0];return f(n),s=s.slice(n.length),t}}function v(){m(n)}function y(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=p();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;a!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,a===s.charAt(t-1))return g("End of comment missing");var n=s.slice(2,t-2);return d+=2,f(n),s=s.slice(t),d+=2,e({type:"comment",comment:n})}}function b(){var t=p(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var s=m(i),c=t({type:"declaration",property:A(n[0].replace(e,a)),value:s?A(s[0].replace(e,a)):a});return m(l),c}}return h.prototype.content=s,v(),function(){var e,t=[];for(y(t);e=b();)!1!==e&&(t.push(e),y(t));return t}()},cr}());return fr}();const hr=Ar(pr),gr=hr.default||hr,mr=yr("end"),vr=yr("start");function yr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function wr(e){return e&&"object"==typeof e?"position"in e||"type"in e?xr(e.position):"start"in e||"end"in e?xr(e):"line"in e||"column"in e?br(e):"":""}function br(e){return kr(e&&e.line)+":"+kr(e&&e.column)}function xr(e){return br(e&&e.start)+"-"+br(e&&e.end)}function kr(e){return e&&"number"==typeof e?e:1}class Er extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=l?l.line:void 0,this.name=wr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Er.prototype.file="",Er.prototype.name="",Er.prototype.reason="",Er.prototype.message="",Er.prototype.stack="",Er.prototype.column=void 0,Er.prototype.line=void 0,Er.prototype.ancestors=void 0,Er.prototype.cause=void 0,Er.prototype.fatal=void 0,Er.prototype.place=void 0,Er.prototype.ruleId=void 0,Er.prototype.source=void 0;const Cr={}.hasOwnProperty,Pr=new Map,Sr=/[A-Z]/g,Dr=/-([a-z])/g,Br=new Set(["table","tbody","thead","tfoot","tr"]),Ir=new Set(["td","th"]),Tr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Qr(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const l=Array.isArray(o.children),s=vr(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const l=Array.isArray(o.children)?n:t;return i?l(r,o,i):l(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?ar:sr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Mr(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Mr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const i=Nr(e,t.tagName,!1),l=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Cr.call(t.properties,o)){const i=jr(e,o,t.properties[o]);if(i){const[o,l]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof l&&Ir.has(t.tagName)?r=l:n[o]=l}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Rr(e,t);return Br.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&Sn(e.value):Sn(e)}(e)})),Or(e,l,i,t),Lr(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Fr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const i=null===t.name?e.Fragment:Nr(e,t.name,!0),l=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const i=o.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Fr(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,i=e.evaluater.evaluateExpression(t.expression)}else Fr(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=Rr(e,t);return Or(e,l,i,t),Lr(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Lr(r,Rr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Or(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Lr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Rr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Pr;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;l=e+"-"+t,o.set(e,t+1)}}const s=Mr(e,i,l);void 0!==s&&n.push(s)}return n}function jr(e,t,n){const r=function(e,t){const n=In(t);let r=t,o=Tn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&tr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(nr,ir);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!nr.test(e)){let n=e.replace(rr,or);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=_n}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{gr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Tr+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(Dr,zr)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Cr.call(e,n)&&(t[Hr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?lr[r.property]||r.property:r.attribute,n]}}function Nr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Cn(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:!(!o||"Literal"!==t.type),optional:!1}:t}r=n}else r=Cn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Cr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Fr(e)}function Fr(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Tr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Hr(e){let t=e.replace(Sr,Ur);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function zr(e,t){return t.toUpperCase()}function Ur(e){return"-"+e.toLowerCase()}const _r={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"]},qr={};function Vr(e,t,n){if(function(e){return!(!e||"object"!=typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Gr(e.children,t,n)}return Array.isArray(e)?Gr(e,t,n):""}function Gr(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Vr(e[o],t,n);return r.join("")}const Wr=document.createElement("i");function Yr(e){const t="&"+e+";";Wr.innerHTML=t;const n=Wr.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function Kr(e,t,n,r){const o=e.length;let i,l=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)i=r.slice(l,l+1e4),i.unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function Xr(e,t){return e.length>0?(Kr(e,e.length,0,t),e):t}const Jr={}.hasOwnProperty;function Zr(e){const t={};let n=-1;for(;++n<e.length;)$r(t,e[n]);return t}function $r(e,t){let n;for(n in t){const r=(Jr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){Jr.call(r,i)||(r[i]=[]);const e=o[i];eo(r[i],Array.isArray(e)?e:e?[e]:[])}}}function eo(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Kr(e,0,0,r)}function to(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function no(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ro=go(/[A-Za-z]/),oo=go(/[\dA-Za-z]/),io=go(/[#-'*+\--9=?A-Z^-~]/);function lo(e){return null!==e&&(e<32||127===e)}const so=go(/\d/),ao=go(/[\dA-Fa-f]/),Ao=go(/[!-/:-@[-`{-~]/);function co(e){return null!==e&&e<-2}function uo(e){return null!==e&&(e<0||32===e)}function fo(e){return-2===e||-1===e||32===e}const po=go(new RegExp("\\p{P}|\\p{S}","u")),ho=go(/\s/);function go(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function mo(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(37===i&&oo(e.charCodeAt(n+1))&&oo(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(l=String.fromCharCode(i,t),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function vo(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){return fo(r)?(e.enter(n),l(r)):t(r)};function l(r){return fo(r)&&i++<o?(e.consume(r),l):(e.exit(n),t(r))}}const yo={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),vo(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):co(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const wo={tokenize:function(e){const t=this,n=[];let r,o,i,l=0;return s;function s(r){if(l<n.length){const o=n[l];return t.containerState=o[1],e.attempt(o[0].continuation,a,A)(r)}return A(r)}function a(e){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}m(l);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Kr(t.events,i+1,0,t.events.slice(n)),t.events.length=s,A(e)}return s(e)}function A(o){if(l===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return p(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bo,c,u)(o)}function c(e){return r&&v(),m(l),d(e)}function u(e){return t.parser.lazy[t.now().line]=l!==n.length,i=t.now().offset,p(e)}function d(n){return t.containerState={},e.attempt(bo,f,p)(n)}function f(e){return l++,n.push([t.currentConstruct,t.containerState]),d(e)}function p(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):co(n)?(e.consume(n),g(e.exit("chunkFlow")),l=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){if(o){s=t.events[a][1].end;break}o=!0}for(m(l),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;Kr(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},bo={tokenize:function(e,t,n){return vo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function xo(e){return null===e||uo(e)||ho(e)?1:po(e)?2:void 0}function ko(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Eo={name:"attention",resolveAll:function(e,t){let n,r,o,i,l,s,a,A,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};Co(u,-s),Co(d,s),i={type:s>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[c][1].start={...l.end},a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=Xr(a,[["enter",e[n][1],t],["exit",e[n][1],t]])),a=Xr(a,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),a=Xr(a,ko(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),a=Xr(a,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(A=2,a=Xr(a,[["enter",e[c][1],t],["exit",e[c][1],t]])):A=0,Kr(e,n-1,c-n+3,a),c=n+a.length-A-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=xo(r);let i;return function(t){return i=t,e.enter("attentionSequence"),l(t)};function l(s){if(s===i)return e.consume(s),l;const a=e.exit("attentionSequence"),A=xo(s),c=!A||2===A&&o||n.includes(s),u=!o||2===o&&A||n.includes(r);return a._open=!!(42===i?c:c&&(o||!u)),a._close=!!(42===i?u:u&&(A||!c)),t(s)}}};function Co(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Po={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return ro(t)?(e.consume(t),i):64===t?n(t):a(t)}function i(e){return 43===e||45===e||46===e||oo(e)?(r=1,l(e)):a(e)}function l(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||oo(t))&&r++<32?(e.consume(t),l):(r=0,a(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||lo(r)?n(r):(e.consume(r),s)}function a(t){return 64===t?(e.consume(t),A):io(t)?(e.consume(t),a):n(t)}function A(e){return oo(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,A):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||oo(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const So={partial:!0,tokenize:function(e,t,n){return function(t){return fo(t)?vo(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||co(e)?t(e):n(e)}}};const Do={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return fo(t)?vo(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(Do,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return fo(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Bo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return Ao(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const Io={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),o=31,i=oo,A(t))}function a(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=ao,A):(e.enter("characterReferenceValue"),o=7,i=so,A(t))}function A(s){if(59===s&&l){const o=e.exit("characterReferenceValue");return i!==oo||Yr(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&l++<o?(e.consume(s),A):n(s)}}};const To={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},Qo={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return l;function l(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a}function a(t){return e.enter("codeFencedFence"),fo(t)?vo(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),fo(t)?vo(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||co(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,l=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return l=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}(t)};function a(t){return t===i?(s++,e.consume(t),a):s<3?n(t):(e.exit("codeFencedFenceSequence"),fo(t)?vo(e,A,"whitespace")(t):A(t))}function A(n){return null===n||co(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(To,f,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||co(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),A(t)):fo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),vo(e,u,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),c)}function u(t){return null===t||co(t)?A(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||co(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),A(t)):96===t&&t===i?n(t):(e.consume(t),d)}function f(t){return e.attempt(o,v,p)(t)}function p(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return l>0&&fo(t)?vo(e,g,"linePrefix",l+1)(t):g(t)}function g(t){return null===t||co(t)?e.check(To,f,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||co(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Mo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),vo(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):co(t)?e.attempt(Oo,i,s)(t):(e.enter("codeFlowValue"),l(t))}function l(t){return null===t||co(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),l)}function s(n){return e.exit("codeIndented"),t(n)}}},Oo={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):vo(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):co(e)?o(e):n(e)}}};const Lo={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),l(t)};function l(t){return 96===t?(e.consume(t),i++,l):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,A(t)):co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),a(t))}function a(t){return null===t||32===t||96===t||co(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),a)}function A(n){return 96===n?(e.consume(n),r++,A):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",a(n))}}};class Ro{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&jo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),jo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);jo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);jo(this.left,t.reverse())}}}function jo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function No(e){const t={};let n,r,o,i,l,s,a,A=-1;const c=new Ro(e);for(;++A<c.length;){for(;A in t;)A=t[A];if(n=c.get(A),A&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(A-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Fo(c,A)),A=t[A],a=!0);else if(n[1]._container){for(o=A,r=void 0;o--;)if(i=c.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type)break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,A),l.unshift(n),c.splice(r,A-r+1,l))}}return Kr(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!a}function Fo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[],l=n._tokenizer||r.parser[n.contentType](n.start),s=l.events,a=[],A={};let c,u,d=-1,f=n,p=0,h=0;const g=[h];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),u&&l.defineSkip(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++d<s.length;)"exit"===s[d][0]&&"enter"===s[d-1][0]&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(h=d+1,g.push(h),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const t=s.slice(g[d],g[d+1]),n=i.pop();a.push([n,n+t.length-1]),e.splice(n,2,t)}for(a.reverse(),d=-1;++d<a.length;)A[p+a[d][0]]=p+a[d][1],p+=a[d][1]-a[d][0]-1;return A}const Ho={resolve:function(e){return No(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):co(t)?e.check(zo,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},zo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),vo(e,o,"linePrefix")};function o(o){if(null===o||co(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Uo(e,t,n,r,o,i,l,s,a){const A=a||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),u):null===t||32===t||41===t||lo(t)?n(t):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t))};function u(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),u(t)):null===t||60===t||co(t)?n(t):(e.consume(t),92===t?f:d)}function f(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function p(o){return c||null!==o&&41!==o&&!uo(o)?c<A&&40===o?(e.consume(o),c++,p):41===o?(e.consume(o),c--,p):null===o||32===o||40===o||lo(o)?n(o):(e.consume(o),92===o?h:p):(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function _o(e,t,n,r,o,i){const l=this;let s,a=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),A};function A(u){return a>999||null===u||91===u||93===u&&!s||94===u&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(u):93===u?(e.exit(i),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):co(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),A):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||co(t)||a++>999?(e.exit("chunkString"),A(t)):(e.consume(t),s||(s=!fo(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}}function qo(e,t,n,r,o,i){let l;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),l=40===t?41:t,s):n(t)};function s(n){return n===l?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),a(n))}function a(t){return t===l?(e.exit(i),s(l)):null===t?n(t):co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),vo(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),A(t))}function A(t){return t===l||null===t||co(t)?(e.exit("chunkString"),a(t)):(e.consume(t),92===t?c:A)}function c(t){return t===l||92===t?(e.consume(t),A):A(t)}}function Vo(e,t){let n;return function r(o){return co(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):fo(o)?vo(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Go={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return _o.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=no(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return uo(t)?Vo(e,s)(t):s(t)}function s(t){return Uo(e,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function a(t){return e.attempt(Wo,A,A)(t)}function A(t){return fo(t)?vo(e,c,"whitespace")(t):c(t)}function c(i){return null===i||co(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},Wo={partial:!0,tokenize:function(e,t,n){return function(t){return uo(t)?Vo(e,r)(t):n(t)};function r(t){return qo(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return fo(t)?vo(e,i,"whitespace")(t):i(t)}function i(e){return null===e||co(e)?t(e):n(e)}}};const Yo={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return co(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Ko={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},Kr(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||uo(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),l(n)):null===n||co(n)?(e.exit("atxHeading"),t(n)):fo(n)?vo(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function l(t){return 35===t?(e.consume(t),l):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||uo(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const Xo=["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"],Jo=["pre","script","style","textarea"],Zo={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let o,i,l,s,a;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),A}(t)};function A(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,f):63===s?(e.consume(s),o=3,r.interrupt?t:O):ro(s)?(e.consume(s),l=String.fromCharCode(s),p):n(s)}function c(i){return 45===i?(e.consume(i),o=2,u):91===i?(e.consume(i),o=5,s=0,d):ro(i)?(e.consume(i),o=4,r.interrupt?t:O):n(i)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:P:d):n(o)}function f(t){return ro(t)?(e.consume(t),l=String.fromCharCode(t),p):n(t)}function p(s){if(null===s||47===s||62===s||uo(s)){const a=47===s,A=l.toLowerCase();return a||i||!Jo.includes(A)?Xo.includes(l.toLowerCase())?(o=6,a?(e.consume(s),h):r.interrupt?t(s):P(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):m(s)):(o=1,r.interrupt?t(s):P(s))}return 45===s||oo(s)?(e.consume(s),l+=String.fromCharCode(s),p):n(s)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:P):n(o)}function g(t){return fo(t)?(e.consume(t),g):E(t)}function m(t){return 47===t?(e.consume(t),E):58===t||95===t||ro(t)?(e.consume(t),v):fo(t)?(e.consume(t),m):E(t)}function v(t){return 45===t||46===t||58===t||95===t||oo(t)?(e.consume(t),v):y(t)}function y(t){return 61===t?(e.consume(t),w):fo(t)?(e.consume(t),y):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,b):fo(t)?(e.consume(t),w):x(t)}function b(t){return t===a?(e.consume(t),a=null,k):null===t||co(t)?n(t):(e.consume(t),b)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||uo(t)?y(t):(e.consume(t),x)}function k(e){return 47===e||62===e||fo(e)?m(e):n(e)}function E(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||co(t)?P(t):fo(t)?(e.consume(t),C):n(t)}function P(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!co(t)||6!==o&&7!==o?null===t||co(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),P):(e.exit("htmlFlowData"),e.check($o,R,S)(t))}function S(t){return e.check(ei,D,R)(t)}function D(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),B}function B(t){return null===t||co(t)?S(t):(e.enter("htmlFlowData"),P(t))}function I(t){return 45===t?(e.consume(t),O):P(t)}function T(t){return 47===t?(e.consume(t),l="",Q):P(t)}function Q(t){if(62===t){const n=l.toLowerCase();return Jo.includes(n)?(e.consume(t),L):P(t)}return ro(t)&&l.length<8?(e.consume(t),l+=String.fromCharCode(t),Q):P(t)}function M(t){return 93===t?(e.consume(t),O):P(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):P(t)}function L(t){return null===t||co(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),L)}function R(n){return e.exit("htmlFlow"),t(n)}}},$o={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(So,t,n)}}},ei={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const ti={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,l;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),a):47===t?(e.consume(t),w):63===t?(e.consume(t),v):ro(t)?(e.consume(t),k):n(t)}function a(t){return 45===t?(e.consume(t),A):91===t?(e.consume(t),i=0,f):ro(t)?(e.consume(t),m):n(t)}function A(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):co(t)?(l=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?p:f):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),h):co(t)?(l=p,Q(t)):(e.consume(t),p)}function h(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):p(t)}function m(t){return null===t||62===t?T(t):co(t)?(l=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):co(t)?(l=v,Q(t)):(e.consume(t),v)}function y(e){return 62===e?T(e):v(e)}function w(t){return ro(t)?(e.consume(t),b):n(t)}function b(t){return 45===t||oo(t)?(e.consume(t),b):x(t)}function x(t){return co(t)?(l=x,Q(t)):fo(t)?(e.consume(t),x):T(t)}function k(t){return 45===t||oo(t)?(e.consume(t),k):47===t||62===t||uo(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),T):58===t||95===t||ro(t)?(e.consume(t),C):co(t)?(l=E,Q(t)):fo(t)?(e.consume(t),E):T(t)}function C(t){return 45===t||46===t||58===t||95===t||oo(t)?(e.consume(t),C):P(t)}function P(t){return 61===t?(e.consume(t),S):co(t)?(l=P,Q(t)):fo(t)?(e.consume(t),P):E(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,D):co(t)?(l=S,Q(t)):fo(t)?(e.consume(t),S):(e.consume(t),B)}function D(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):co(t)?(l=D,Q(t)):(e.consume(t),D)}function B(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||uo(t)?E(t):(e.consume(t),B)}function I(e){return 47===e||62===e||uo(e)?E(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return fo(t)?vo(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),l(t)}}};const ni={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&Kr(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,i,l=e.length,s=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=l);const a={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},A={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",a,t],["enter",A,t]],i=Xr(i,e.slice(r+1,r+s+3)),i=Xr(i,[["enter",c,t]]),i=Xr(i,ko(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=Xr(i,[["exit",c,t],e[o-2],e[o-1],["exit",A,t]]),i=Xr(i,e.slice(o+1)),i=Xr(i,[["exit",a,t]]),Kr(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,l=r.events.length;for(;l--;)if(("labelImage"===r.events[l][1].type||"labelLink"===r.events[l][1].type)&&!r.events[l][1]._balanced){o=r.events[l][1];break}return function(t){return o?o._inactive?c(t):(i=r.parser.defined.includes(no(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):n(t)};function s(t){return 40===t?e.attempt(ri,A,i?A:c)(t):91===t?e.attempt(oi,A,i?a:c)(t):i?A(t):c(t)}function a(t){return e.attempt(ii,A,c)(t)}function A(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},ri={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return uo(t)?Vo(e,o)(t):o(t)}function o(t){return 41===t?A(t):Uo(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return uo(t)?Vo(e,s)(t):A(t)}function l(e){return n(e)}function s(t){return 34===t||39===t||40===t?qo(e,a,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):A(t)}function a(t){return uo(t)?Vo(e,A)(t):A(t)}function A(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},oi={tokenize:function(e,t,n){const r=this;return function(t){return _o.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(no(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},ii={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const li={name:"labelStartImage",resolveAll:ni.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const si={name:"labelStartLink",resolveAll:ni.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const ai={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),vo(e,t,"linePrefix")}}};const Ai={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),l(i)):o>=3&&(null===i||co(i))?(e.exit("thematicBreak"),t(i)):n(i)}function l(t){return t===r?(e.consume(t),o++,l):(e.exit("thematicBreakSequence"),fo(t)?vo(e,i,"whitespace")(t):i(t))}}};const ci={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(So,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,vo(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!fo(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(di,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,vo(e,e.attempt(ci,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,l=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:so(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(Ai,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return so(t)&&++l<10?(e.consume(t),s):(!r.interrupt||l<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),a(t)):n(t)}function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(So,r.interrupt?n:A,e.attempt(ui,u,c))}function A(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return fo(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},ui={partial:!0,tokenize:function(e,t,n){const r=this;return vo(e,function(e){const o=r.events[r.events.length-1];return!fo(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},di={partial:!0,tokenize:function(e,t,n){const r=this;return vo(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const fi={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),!o&&"definition"===e[i][1].type&&(o=i);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",l,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=l,e.push(["exit",l,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let l,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){l="paragraph"===r.events[s][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!l?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t))};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),fo(t)?vo(e,l,"lineSuffix")(t):l(t))}function l(r){return null===r||co(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const pi={tokenize:function(e){const t=this,n=e.attempt(So,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,vo(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ho,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const hi={resolveAll:yi()},gi=vi("string"),mi=vi("text");function vi(e){return{resolveAll:yi("text"===e?wi:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,l);return i;function i(e){return a(e)?o(e):l(e)}function l(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return a(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function a(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function yi(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):(!t[o]||"data"!==t[o][1].type)&&(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function wi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,l=o.length,s=-1,a=0;for(;l--;){const e=o[l];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)a++,s--;if(s)break;s=-1}else if(-2===e)i=!0,a++;else if(-1!==e){l++;break}}if(a){const o={type:n===e.length||i||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const bi={42:ci,43:ci,45:ci,48:ci,49:ci,50:ci,51:ci,52:ci,53:ci,54:ci,55:ci,56:ci,57:ci,62:Do},xi={91:Go},ki={[-2]:Mo,[-1]:Mo,32:Mo},Ei={35:Ko,42:Ai,45:[fi,Ai],60:Zo,61:fi,95:Ai,96:Qo,126:Qo},Ci={38:Io,92:Bo},Pi={[-5]:ai,[-4]:ai,[-3]:ai,33:li,38:Io,42:Eo,60:[Po,ti],91:si,92:[Yo,Bo],93:ni,95:Eo,96:Lo},Si={null:[Eo,hi]},Di=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:xi,disable:{null:[]},document:bi,flow:Ei,flowInitial:ki,insideSpan:Si,string:Ci,text:Pi},Symbol.toStringTag,{value:"Module"}));function Bi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let l=[],s=[];const a={attempt:h(function(e,t){g(e,t.from)}),check:h(p),consume:function(e){co(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),A.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),A.events.push(["enter",n,A]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=d(),A.events.push(["exit",t,A]),t},interrupt:h(p,{interrupt:!0})},A={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,m()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let l;if("string"==typeof i)l=i;else switch(i){case-5:l="\r";break;case-4:l="\n";break;case-3:l="\r\n";break;case-2:l=t?" ":"\t";break;case-1:if(!t&&o)continue;l=" ";break;default:l=String.fromCharCode(i)}o=-2===i,r.push(l)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){return l=Xr(l,e),function(){let e;for(;r._index<l.length;){const t=l[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)f(t.charCodeAt(r._bufferIndex));else f(t)}}(),null!==l[l.length-1]?[]:(g(t,0),A.events=ko(i,A.events,A),A.events)}};let c=t.tokenize.call(A,a);return t.resolveAll&&i.push(t),A;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,i)];else{if(l=e.slice(n,o),r>-1){const e=l[0];"string"==typeof e?l[0]=e.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}(l,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function f(e){c=c(e)}function p(e,t){t.restore()}function h(e,t){return function(n,o,i){let l,c,u,f;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return p([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function p(e){return l=e,c=0,0===e.length?i:h(e[c])}function h(e){return function(n){return f=function(){const e=d(),t=A.previous,n=A.currentConstruct,o=A.events.length,i=Array.from(s);return{from:o,restore:l};function l(){r=e,A.previous=t,A.currentConstruct=n,A.events.length=o,s=i,m()}}(),u=e,e.partial||(A.currentConstruct=e),e.name&&A.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(A),t):A,a,g,v)(n)}}function g(t){return e(u,f),o}function v(e){return f.restore(),++c<l.length?h(l[c]):i}}}function g(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&Kr(A.events,t,A.events.length-t,e.resolve(A.events.slice(t),A)),e.resolveTo&&(A.events=e.resolveTo(A.events,A))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const Ii=/[\0\t\n\r]/g;const Ti=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qi(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return to(n.slice(t?2:1),t?16:10)}return Yr(n)||e}const Mi={}.hasOwnProperty;function Oi(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(J),blockQuote:i(G),characterEscape:C,characterReference:C,codeFenced:i(W),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(W,l),codeText:i(Y,l),codeTextData:C,data:C,codeFlowValue:C,definition:i(K),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(X),hardBreakEscape:i(Z),hardBreakTrailing:i(Z),htmlFlow:i($,l),htmlFlowData:C,htmlText:i($,l),htmlTextData:C,image:i(ee),label:l,link:i(te),listItem:i(re),listItemValue:d,listOrdered:i(ne,u),listUnordered:i(ne),paragraph:i(oe),reference:F,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(J),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:a(),atxHeadingSequence:b,autolink:a(),autolinkEmail:V,autolinkProtocol:q,blockQuote:a(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:U,characterReference:_,codeFenced:a(g),codeFencedFence:h,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:P,codeIndented:a(m),codeText:a(T),codeTextData:P,data:P,definition:a(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:y,emphasis:a(),hardBreakEscape:a(D),hardBreakTrailing:a(D),htmlFlow:a(B),htmlFlowData:P,htmlText:a(I),htmlTextData:P,image:a(M),label:L,labelText:O,lineEnding:S,link:a(Q),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:H,resourceDestinationString:R,resourceTitleString:j,resource:N,setextHeading:a(E),setextHeadingLineSequence:k,setextHeadingText:x,strong:a(),thematicBreak:a()}};Ri(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:A,buffer:l,resume:c,data:n},a=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])a.push(u);else{u=o(e,a.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];Mi.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},i),e[u][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Ni).call(i,void 0,e[0])}for(r.position={start:Li(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Li(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,i,l,s=t-1,a=-1,A=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?a++:a--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!l&&!a&&!i&&(i=s),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!a&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===a&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=s;for(o=void 0;l--;){const t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",A=!0),t[1].type="lineEnding",o=l}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,l=!0}}}return e[t][1]._spread=A,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Li(t.start),end:void 0}}function a(e){return t;function t(t){e&&e.call(this,t),A.call(this,t)}}function A(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+wr({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ni).call(this,e,r[0])),n.position.end=Li(e.end)}function c(){return function(e){return Vr(e,"boolean"!=typeof qr.includeImageAlt||qr.includeImageAlt,"boolean"!=typeof qr.includeHtml||qr.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function p(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=no(this.sliceSerialize(e)).toLowerCase()}function y(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function b(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function k(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=le(),n.position={start:Li(e.start),end:void 0},t.push(n)),this.stack.push(n)}function P(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Li(e.end)}function S(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=Li(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),P.call(this,e))}function D(){this.data.atHardBreak=!0}function B(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Ti,Qi)}(t),n.identifier=no(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function R(){const e=this.resume();this.stack[this.stack.length-1].url=e}function j(){const e=this.resume();this.stack[this.stack.length-1].title=e}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function H(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=no(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function z(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=to(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Yr(t);this.stack[this.stack.length-1].value+=r}function _(e){this.stack.pop().position.end=Li(e.end)}function q(e){P.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function V(e){P.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function K(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function X(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function le(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!No(e););return e}(function(e){const t={constructs:Zr([Di,...(e||{}).extensions||[]]),content:n(yo),defined:[],document:n(wo),flow:n(pi),lazy:{},string:n(gi),text:n(mi)};return t;function n(e){return function(n){return Bi(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,l){const s=[];let a,A,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(Ii.lastIndex=c,a=Ii.exec(o),u=a&&void 0!==a.index?a.index:o.length,d=o.charCodeAt(u),!a){n=o.slice(c);break}if(10===d&&c===u&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),c<u&&(s.push(o.slice(c,u)),t+=u-c),d){case 0:s.push(65533),t++;break;case 9:for(A=4*Math.ceil(t/4),s.push(-2);t++<A;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return l&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function Li(e){return{line:e.line,column:e.column,offset:e.offset}}function Ri(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ri(e,r):ji(e,r)}}function ji(e,t){let n;for(n in t)if(Mi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ni(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wr({start:t.start,end:t.end})+") is still open")}function Fi(e){const t=this;t.parser=function(n){return Oi(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hi(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&"text"===l.type?l.value+=r:o.push({type:"text",value:r}),o}function zi(e){return e.spread??e.children.length>1}function Ui(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(_i(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(_i(t.slice(o),o>0,!1)),i.join("")}function _i(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const qi={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=mo(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,s+=1,e.footnoteCounts.set(r,s);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const A={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,A),e.applyData(t,A)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hi(e,t);const o={src:mo(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:mo(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hi(e,t);const o={href:mo(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:mo(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=zi(n[r])}return t}(n):zi(t),i={},l=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?l.push(e):l.push(...e.children)}const a=r[r.length-1];a&&(o||"element"!==a.type||"p"!==a.tagName)&&l.push({type:"text",value:"\n"});const A={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,A),e.applyData(t,A)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=vr(t.children[1]),l=mr(t.children[t.children.length-1]);i&&l&&(r.position={start:i,end:l}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,l=i?i.length:t.children.length;let s=-1;const a=[];for(;++s<l;){const n=t.children[s],r={},l=i?i[s]:void 0;l&&(r.align=l);let A={type:"element",tagName:o,properties:r,children:[]};n&&(A.children=e.all(n),e.patch(n,A),A=e.applyData(n,A)),a.push(A)}const A={type:"element",tagName:"tr",properties:{},children:e.wrap(a,!0)};return e.patch(t,A),e.applyData(t,A)},text:function(e,t){const n={type:"text",value:Ui(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Vi,yaml:Vi,definition:Vi,footnoteDefinition:Vi};function Vi(){}const Gi="object"==typeof self?self:globalThis,Wi=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case 0:case-1:return n(l,o);case 1:{const e=n([],o);for(const t of l)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of l)e[r(t)]=r(n);return e}case 3:return n(new Date(l),o);case 4:{const{source:e,flags:t}=l;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of l)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of l)e.add(r(t));return e}case 7:{const{name:e,message:t}=l;return n(new Gi[e](t),o)}case 8:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:e}=new Uint8Array(l);return n(new DataView(e),l)}}return n(new Gi[i](l),o)};return r})(new Map,e)(0),Yi="",{toString:Ki}={},{keys:Xi}=Object,Ji=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Ki.call(e).slice(8,-1);switch(n){case"Array":return[1,Yi];case"Object":return[2,Yi];case"Date":return[3,Yi];case"RegExp":return[4,Yi];case"Map":return[5,Yi];case"Set":return[6,Yi];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Zi=([e,t])=>0===e&&("function"===t||"symbol"===t),$i=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[l,s]=Ji(r);switch(l){case 0:{let t=r;switch(s){case"bigint":l=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([l,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([l,e],r);for(const t of r)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],a=o([l,n],r);for(const t of Xi(r))(e||!Zi(Ji(r[t])))&&n.push([i(t),i(r[t])]);return a}case 3:return o([l,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([l,{source:e,flags:t}],r)}case 5:{const t=[],n=o([l,t],r);for(const[n,o]of r)(e||!Zi(Ji(n))&&!Zi(Ji(o)))&&t.push([i(n),i(o)]);return n}case 6:{const t=[],n=o([l,t],r);for(const n of r)(e||!Zi(Ji(n)))&&t.push(i(n));return n}}const{message:a}=r;return o([l,{name:s,message:a}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},el="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Wi($i(e,t)):structuredClone(e):(e,t)=>Wi($i(e,t));function tl(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nl(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const rl=function(e){if(null==e)return il;if("function"==typeof e)return ol(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rl(e[n]);return ol(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return ol(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return ol(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function ol(e){return function(t,n,r){return!(!function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)||!e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function il(){return!0}const ll=[],sl=!0,al=!1;function Al(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=rl(o),l=r?-1:1;!function e(o,s,a){const A=o&&"object"==typeof o?o:{};if("string"==typeof A.type){const e="string"==typeof A.tagName?A.tagName:"string"==typeof A.name?A.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let A,c,u,d=ll;if((!t||i(o,s,a[a.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[sl,e]:null==e?ll:[e]}(n(o,a)),d[0]===al))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+l,u=a.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(A=e(n,c,u)(),A[0]===al)return A;c="number"==typeof A[1]?A[1]:c+l}}return d}}(e,void 0,[])()}function cl(e,t,n,r){let o,i,l;"function"==typeof t?(i=void 0,l=t,o=n):(i=t,l=n,o=r),Al(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},o)}const ul={}.hasOwnProperty,dl={};function fl(e,t){const n=t||dl,r=new Map,o=new Map,i=new Map,l={...qi,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=vl(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=vl(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:hl,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:l,one:function(e,t){const n=e.type,r=s.handlers[n];if(ul.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=el(n);return r.children=s.all(e),r}return el(e)}return(s.options.unknownHandler||gl)(s,e,t)},options:n,patch:pl,wrap:ml};return cl(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}function pl(e,t){e.position&&(t.position=function(e){const t=vr(e),n=mr(e);if(t&&n)return{start:t,end:n}}(e))}function hl(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,el(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function gl(e,t){const n=t.data||{},r=!("value"in t)||ul.call(n,"hProperties")||ul.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function ml(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function vl(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function yl(e,t){const n=fl(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tl,r=e.options.footnoteBackLabel||nl,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[a]);if(!o)continue;const i=e.all(o),l=String(o.identifier).toUpperCase(),A=mo(l.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(l);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(a,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+A+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(a,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){const e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...u)}else i.push(...u);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+A},children:e.wrap(i,!0)};e.patch(o,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...el(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function wl(e,t){return e&&"run"in e?async function(n,r){const o=yl(n,{file:r,...t});await e.run(o,r)}:function(n,r){return yl(n,{file:r,...e||t})}}function bl(e){if(e)throw e}var xl,kl;var El=function(){if(kl)return xl;kl=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},l=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return xl=function e(){var t,n,r,a,A,c,u=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof u&&(p=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(u,n),u!==(a=s(t,n))&&(p&&a&&(i(a)||(A=o(a)))?(A?(A=!1,c=r&&o(r)?r:[]):c=r&&i(r)?r:{},l(u,{name:n,newValue:e(p,c,a)})):typeof a<"u"&&l(u,{name:n,newValue:a}));return u},xl}();const Cl=Ar(El);function Pl(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Sl(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...l){const s=e[++n];let a=-1;if(i)r(i);else{for(;++a<t.length;)(null===l[a]||void 0===l[a])&&(l[a]=t[a]);t=l,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let l;r&&t.push(o);try{l=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(l&&l.then&&"function"==typeof l.then?l.then(i,o):l instanceof Error?o(l):i(l))}function o(e,...r){n||(n=!0,t(e,...r))}function i(e){o(null,e)}}(s,o)(...l):r(null,...l)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const Dl={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Bl(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=l));return r===o?o=l:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Bl(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Bl(e);let t,n=e.length,r=-1,o=0,i=-1,l=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==l&&(l=1):i>-1&&(l=-1);else if(t){o=n+1;break}}return i<0||r<0||0===l||1===l&&i===r-1&&i===o+1?"":e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Bl(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Bl(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,l=-1,s=0,a=-1;for(;++a<=e.length;){if(a<e.length)n=e.codePointAt(a);else{if(47===n)break;n=47}if(47===n){if(l!==a-1&&1!==s)if(l!==a-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),l=a,s=0;continue}}else if(o.length>0){o="",i=0,l=a,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(l+1,a):o=e.slice(l+1,a),i=a-l-1;l=a,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);return 0===n.length&&!t&&(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function Bl(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Il={cwd:function(){return"/"}};function Tl(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Ql(e){if("string"==typeof e)e=new URL(e);else if(!Tl(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Ml=["history","path","basename","stem","extname","dirname"];class Ol{constructor(e){let t;var n;t=e?Tl(e)?{path:e}:"string"==typeof e||(n=e)&&"object"==typeof n&&"byteLength"in n&&"byteOffset"in n?{value:e}:e:{},this.cwd="cwd"in t?"":Il.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Ml.length;){const e=Ml[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Ml.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?Dl.basename(this.path):void 0}set basename(e){Rl(e,"basename"),Ll(e,"basename"),this.path=Dl.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Dl.dirname(this.path):void 0}set dirname(e){jl(this.basename,"dirname"),this.path=Dl.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Dl.extname(this.path):void 0}set extname(e){if(Ll(e,"extname"),jl(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Dl.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Tl(e)&&(e=Ql(e)),Rl(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Dl.basename(this.path,this.extname):void 0}set stem(e){Rl(e,"stem"),Ll(e,"stem"),this.path=Dl.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Er(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Ll(e,t){if(e&&e.includes(Dl.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Dl.sep+"`")}function Rl(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Nl=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Fl={}.hasOwnProperty;class Hl extends Nl{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=Sl()}copy(){const e=new Hl;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Cl(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(ql("data",this.frozen),this.namespace[e]=t,this):Fl.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ql("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Wl(e),n=this.parser||this.Parser;return Ul("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ul("process",this.parser||this.Parser),_l("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=Wl(e),l=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(l,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var l;"string"==typeof(l=i)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(l)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ul("processSync",this.parser||this.Parser),_l("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,bl(e),t=r}),Gl("processSync","process",n),t}run(e,t,n){Vl(e),this.freeze();const r=this.transformers;return!n&&"function"==typeof t&&(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const l=Wl(t);r.run(e,l,function(t,r,l){const s=r||e;t?i(t):o?o(s):n(void 0,s,l)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){bl(e),n=t,r=!0}),Gl("runSync","run",r),n}stringify(e,t){this.freeze();const n=Wl(t),r=this.compiler||this.Compiler;return _l("stringify",r),Vl(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(ql("use",this.frozen),null!=e)if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?l(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))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");l(e.plugins),e.settings&&(r.settings=Cl(!0,r.settings,e.settings))}function l(e){let t=-1;if(null!=e){if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const l=n[o][1];Pl(l)&&Pl(r)&&(r=Cl(!0,l,r)),n[o]=[e,r,...i]}}}}const zl=(new Hl).freeze();function Ul(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function _l(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function ql(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vl(e){if(!Pl(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Gl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wl(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Ol(e)}const Yl=[],Kl={allowDangerousHtml:!0},Xl=/^(https?|ircs?|mailto|xmpp)$/i,Jl=[{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:"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 Zl(e){const t=e.allowedElements,r=e.allowElement,o=e.children||"",i=e.className,l=e.components,s=e.disallowedElements,a=e.rehypePlugins||Yl,A=e.remarkPlugins||Yl,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Kl}:Kl,u=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||$l,p=zl().use(Fi).use(A).use(wl,c).use(a),h=new Ol;"string"==typeof o&&(h.value=o);for(const t of Jl)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const g=p.parse(h);let m=p.runSync(g,h);return i&&(m={type:"element",tagName:"div",properties:{className:i},children:"root"===m.type?m.children:[m]}),cl(m,function(e,n,o){if("raw"===e.type&&o&&"number"==typeof n)return u?o.children.splice(n,1):o.children[n]={type:"text",value:e.value},n;if("element"===e.type){let t;for(t in _r)if(Object.hasOwn(_r,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=_r[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=f(String(n||""),t,e))}}if("element"===e.type){let i=t?!t.includes(e.tagName):!!s&&s.includes(e.tagName);if(!i&&r&&"number"==typeof n&&(i=!r(e,n,o)),i&&o&&"number"==typeof n)return d&&e.children?o.children.splice(n,1,...e.children):o.children.splice(n,1),n}}),Qr(m,{Fragment:n.Fragment,components:l,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0})}function $l(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||Xl.test(e.slice(0,t))?e:""}const es=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(Zl,{components:{p:({...e})=>n.jsx("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>n.jsx("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>n.jsx("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>n.jsx("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?n.jsx("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):n.jsx("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:n.jsx("code",{children:t})}),blockquote:({...e})=>n.jsx("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),ts={autoConfig:!0},ns=t=>()=>(t=>{const{getFlow:n}=Ht(),{messages:r,replaceMessages:o}=zt(),{settings:i}=_t(),{hasChatHistoryLoaded:l}=Vt(),s={...t,...ts},a=s.markdownComponent?s.markdownComponent:es;e.useEffect(()=>{var e,t;if(l){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=i.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=a)}o(n)}},[l]);const A=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,n(),r)&&(e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};Ut(N.PRE_INJECT_MESSAGE,A),Ut(N.CHUNK_STREAM_MESSAGE,A),Ut(N.START_STREAM_MESSAGE,A),Ut(N.START_SIMULATE_STREAM_MESSAGE,A);const c={name:"@rcb-plugins/markdown-renderer"};return null!=s&&s.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(t),rs={autoConfig:!0,promptBaseColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"},promptHoveredColors:{info:"#0056b3",warning:"#d39e00",error:"#c82333",success:"#218838"},textAreaHighlightColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"}},os=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const i=o[n];return"function"==typeof i?i:void 0},is=t=>{const{showToast:n}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=Je();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:r}=Ht(),{styles:o,updateStyles:i,replaceStyles:l}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=It();return{styles:e,replaceStyles:t,updateStyles:n}})(),s=(e=>({...rs,...e,promptBaseColors:{...rs.promptBaseColors},promptHoveredColors:{...rs.promptHoveredColors},textAreaHighlightColors:{...rs.textAreaHighlightColors}}))(t),[a,A]=e.useState(0),c=e.useRef({});Ut(N.USER_SUBMIT_TEXT,e=>{const t=e,l=os(t,r(),"validateTextInput");if(!l)return;const u=l(t.data.inputText);if(null!=u&&u.success||e.preventDefault(),!u.promptContent)return;0===a&&(c.current=structuredClone(o));const d=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(u,s);i(d),n(u.promptContent,u.promptDuration??3e3),A(e=>e+1)}),Ut(N.USER_UPLOAD_FILE,e=>{var t,o;const i=e,l=null==(o=null==(t=i.data)?void 0:t.files)?void 0:o[0];if(!l)return console.error("No file uploaded."),void e.preventDefault();const s=os(i,r(),"validateFileInput");if(!s)return void console.error("Validator not found for file input.");const a=s(l);if(!a.success)return console.error("Validation failed:",a),a.promptContent&&n(a.promptContent,a.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",a)}),Ut(N.DISMISS_TOAST,()=>{A(e=>e-1)}),e.useEffect(()=>{0===a&&setTimeout(()=>{l(c.current)})},[a,l]);const u={name:"@rcb-plugins/input-validator"};return s.autoConfig&&(u.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),u};function ls(){}function ss(){}const as=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,As=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cs={};function us(e,t){return(cs.jsx?As:as).test(e)}const ds=/[ \t\n\f\r]/g;function fs(e){return""===e.replace(ds,"")}class ps{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function hs(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ps(n,r,t)}function gs(e){return e.toLowerCase()}ps.prototype.normal={},ps.prototype.property={},ps.prototype.space=void 0;class ms{constructor(e,t){this.attribute=t,this.property=e}}ms.prototype.attribute="",ms.prototype.booleanish=!1,ms.prototype.boolean=!1,ms.prototype.commaOrSpaceSeparated=!1,ms.prototype.commaSeparated=!1,ms.prototype.defined=!1,ms.prototype.mustUseProperty=!1,ms.prototype.number=!1,ms.prototype.overloadedBoolean=!1,ms.prototype.property="",ms.prototype.spaceSeparated=!1,ms.prototype.space=void 0;let vs=0;const ys=Ps(),ws=Ps(),bs=Ps(),xs=Ps(),ks=Ps(),Es=Ps(),Cs=Ps();function Ps(){return 2**++vs}var Ss=Object.freeze({__proto__:null,boolean:ys,booleanish:ws,commaOrSpaceSeparated:Cs,commaSeparated:Es,number:xs,overloadedBoolean:bs,spaceSeparated:ks});const Ds=Object.keys(Ss);class Bs extends ms{constructor(e,t,n,r){let o=-1;if(super(e,t),Is(this,"space",r),"number"==typeof n)for(;++o<Ds.length;){const e=Ds[o];Is(this,Ds[o],(n&Ss[e])===Ss[e])}}}function Is(e,t,n){n&&(e[t]=n)}function Ts(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Bs(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[gs(r)]=r,n[gs(i.attribute)]=r}return new ps(t,n,e.space)}Bs.prototype.defined=!0;const Qs=Ts({properties:{ariaActiveDescendant:null,ariaAtomic:ws,ariaAutoComplete:null,ariaBusy:ws,ariaChecked:ws,ariaColCount:xs,ariaColIndex:xs,ariaColSpan:xs,ariaControls:ks,ariaCurrent:null,ariaDescribedBy:ks,ariaDetails:null,ariaDisabled:ws,ariaDropEffect:ks,ariaErrorMessage:null,ariaExpanded:ws,ariaFlowTo:ks,ariaGrabbed:ws,ariaHasPopup:null,ariaHidden:ws,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ks,ariaLevel:xs,ariaLive:null,ariaModal:ws,ariaMultiLine:ws,ariaMultiSelectable:ws,ariaOrientation:null,ariaOwns:ks,ariaPlaceholder:null,ariaPosInSet:xs,ariaPressed:ws,ariaReadOnly:ws,ariaRelevant:null,ariaRequired:ws,ariaRoleDescription:ks,ariaRowCount:xs,ariaRowIndex:xs,ariaRowSpan:xs,ariaSelected:ws,ariaSetSize:xs,ariaSort:null,ariaValueMax:xs,ariaValueMin:xs,ariaValueNow:xs,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Ms(e,t){return t in e?e[t]:t}function Os(e,t){return Ms(e,t.toLowerCase())}const Ls=Ts({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Es,acceptCharset:ks,accessKey:ks,action:null,allow:null,allowFullScreen:ys,allowPaymentRequest:ys,allowUserMedia:ys,alt:null,as:null,async:ys,autoCapitalize:null,autoComplete:ks,autoFocus:ys,autoPlay:ys,blocking:ks,capture:null,charSet:null,checked:ys,cite:null,className:ks,cols:xs,colSpan:null,content:null,contentEditable:ws,controls:ys,controlsList:ks,coords:xs|Es,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ys,defer:ys,dir:null,dirName:null,disabled:ys,download:bs,draggable:ws,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ys,formTarget:null,headers:ks,height:xs,hidden:bs,high:xs,href:null,hrefLang:null,htmlFor:ks,httpEquiv:ks,id:null,imageSizes:null,imageSrcSet:null,inert:ys,inputMode:null,integrity:null,is:null,isMap:ys,itemId:null,itemProp:ks,itemRef:ks,itemScope:ys,itemType:ks,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ys,low:xs,manifest:null,max:null,maxLength:xs,media:null,method:null,min:null,minLength:xs,multiple:ys,muted:ys,name:null,nonce:null,noModule:ys,noValidate:ys,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:ys,optimum:xs,pattern:null,ping:ks,placeholder:null,playsInline:ys,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ys,referrerPolicy:null,rel:ks,required:ys,reversed:ys,rows:xs,rowSpan:xs,sandbox:ks,scope:null,scoped:ys,seamless:ys,selected:ys,shadowRootClonable:ys,shadowRootDelegatesFocus:ys,shadowRootMode:null,shape:null,size:xs,sizes:null,slot:null,span:xs,spellCheck:ws,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xs,step:null,style:null,tabIndex:xs,target:null,title:null,translate:null,type:null,typeMustMatch:ys,useMap:null,value:ws,width:xs,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ks,axis:null,background:null,bgColor:null,border:xs,borderColor:null,bottomMargin:xs,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ys,declare:ys,event:null,face:null,frame:null,frameBorder:null,hSpace:xs,leftMargin:xs,link:null,longDesc:null,lowSrc:null,marginHeight:xs,marginWidth:xs,noResize:ys,noHref:ys,noShade:ys,noWrap:ys,object:null,profile:null,prompt:null,rev:null,rightMargin:xs,rules:null,scheme:null,scrolling:ws,standby:null,summary:null,text:null,topMargin:xs,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xs,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ys,disableRemotePlayback:ys,prefix:null,property:null,results:xs,security:null,unselectable:null},space:"html",transform:Os}),Rs=Ts({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Cs,accentHeight:xs,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xs,amplitude:xs,arabicForm:null,ascent:xs,attributeName:null,attributeType:null,azimuth:xs,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xs,by:null,calcMode:null,capHeight:xs,className:ks,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:xs,diffuseConstant:xs,direction:null,display:null,dur:null,divisor:xs,dominantBaseline:null,download:ys,dx:null,dy:null,edgeMode:null,editable:null,elevation:xs,enableBackground:null,end:null,event:null,exponent:xs,externalResourcesRequired:null,fill:null,fillOpacity:xs,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:Es,g2:Es,glyphName:Es,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xs,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xs,horizOriginX:xs,horizOriginY:xs,id:null,ideographic:xs,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xs,k:xs,k1:xs,k2:xs,k3:xs,k4:xs,kernelMatrix:Cs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xs,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xs,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:xs,overlineThickness:xs,paintOrder:null,panose1:null,path:null,pathLength:xs,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ks,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xs,pointsAtY:xs,pointsAtZ:xs,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cs,rev:Cs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cs,requiredFeatures:Cs,requiredFonts:Cs,requiredFormats:Cs,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:xs,specularExponent:xs,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xs,strikethroughThickness:xs,string:null,stroke:null,strokeDashArray:Cs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xs,strokeOpacity:xs,strokeWidth:null,style:null,surfaceScale:xs,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cs,tabIndex:xs,tableValues:null,target:null,targetX:xs,targetY:xs,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xs,underlineThickness:xs,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xs,values:null,vAlphabetic:xs,vMathematical:xs,vectorEffect:null,vHanging:xs,vIdeographic:xs,version:null,vertAdvY:xs,vertOriginX:xs,vertOriginY:xs,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xs,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ms}),js=Ts({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Ns=Ts({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Os}),Fs=Ts({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Hs={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"},zs=/[A-Z]/g,Us=/-[a-z]/g,_s=/^data[-\w.:]+$/i;function qs(e){return"-"+e.toLowerCase()}function Vs(e){return e.charAt(1).toUpperCase()}const Gs=hs([Qs,Ls,js,Ns,Fs],"html"),Ws=hs([Qs,Rs,js,Ns,Fs],"svg");var Ys="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xs={},Js=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Zs=/\n/g,$s=/^\s*/,ea=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ta=/^:\s*/,na=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ra=/^[;\s]*/,oa=/^\s+|\s+$/g,ia="";function la(e){return e?e.replace(oa,ia):ia}var sa=Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,aa.default)(e),o="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,i=e.value;o?t(r,i,e):i&&((n=n||{})[r]=i)}}),n};var aa=sa(function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(e){var t=e.match(Zs);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function i(){var e={line:n,column:r};return function(t){return t.position=new l(e),A(),t}}function l(e){this.start=e,this.end={line:n,column:r},this.source=t.source}function s(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i}function a(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function A(){a($s)}function c(e){var t;for(e=e||[];t=u();)!1!==t&&e.push(t);return e}function u(){var t=i();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;ia!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,ia===e.charAt(n-1))return s("End of comment missing");var l=e.slice(2,n-2);return r+=2,o(l),e=e.slice(n),r+=2,t({type:"comment",comment:l})}}function d(){var e=i(),t=a(ea);if(t){if(u(),!a(ta))return s("property missing ':'");var n=a(na),r=e({type:"declaration",property:la(t[0].replace(Js,ia)),value:n?la(n[0].replace(Js,ia)):ia});return a(ra),r}}return l.prototype.content=e,A(),function(){var e,t=[];for(c(t);e=d();)!1!==e&&(t.push(e),c(t));return t}()});var Aa={};Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.camelCase=void 0;var ca=/^--[a-zA-Z0-9_-]+$/,ua=/-([a-z])/g,da=/^[^-]+$/,fa=/^-(webkit|moz|ms|o|khtml)-/,pa=/^-(ms)-/,ha=function(e,t){return t.toUpperCase()},ga=function(e,t){return"".concat(t,"-")};Aa.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||da.test(e)||ca.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(pa,ga):e.replace(fa,ga)).replace(ua,ha))};var ma=(Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Xs),va=Aa;function ya(e,t){var n={};return e&&"string"==typeof e?((0,ma.default)(e,function(e,r){e&&r&&(n[(0,va.camelCase)(e,t)]=r)}),n):n}ya.default=ya;var wa=Ks(ya);const ba=ka("end"),xa=ka("start");function ka(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Ea(e){return e&&"object"==typeof e?"position"in e||"type"in e?Pa(e.position):"start"in e||"end"in e?Pa(e):"line"in e||"column"in e?Ca(e):"":""}function Ca(e){return Sa(e&&e.line)+":"+Sa(e&&e.column)}function Pa(e){return Ca(e&&e.start)+"-"+Ca(e&&e.end)}function Sa(e){return e&&"number"==typeof e?e:1}class Da extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Ea(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Da.prototype.file="",Da.prototype.name="",Da.prototype.reason="",Da.prototype.message="",Da.prototype.stack="",Da.prototype.column=void 0,Da.prototype.line=void 0,Da.prototype.ancestors=void 0,Da.prototype.cause=void 0,Da.prototype.fatal=void 0,Da.prototype.place=void 0,Da.prototype.ruleId=void 0,Da.prototype.source=void 0;const Ba={}.hasOwnProperty,Ia=new Map,Ta=/[A-Z]/g,Qa=new Set(["table","tbody","thead","tfoot","tr"]),Ma=new Set(["td","th"]),Oa="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function La(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const l=Array.isArray(o.children),s=xa(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const l=Array.isArray(o.children)?n:t;return i?l(r,o,i):l(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?Ws:Gs,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Ra(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Ra(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=Ws,e.schema=o);e.ancestors.push(t);const i=za(e,t.tagName,!1),l=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Ba.call(t.properties,o)){const i=Ha(e,o,t.properties[o]);if(i){const[o,l]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof l&&Ma.has(t.tagName)?r=l:n[o]=l}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Fa(e,t);Qa.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&fs(t.value):fs(t));var t}));return ja(e,l,i,t),Na(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ua(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=Ws,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:za(e,t.name,!0),l=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];ls(t.type);const o=t.expression;ls(o.type);const i=o.properties[0];ls(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Ua(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];ls(t.type),i=e.evaluater.evaluateExpression(t.expression)}else Ua(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=Fa(e,t);return ja(e,l,i,t),Na(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ua(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Na(r,Fa(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function ja(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Na(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fa(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Ia;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;l=e+"-"+t,o.set(e,t+1)}}const s=Ra(e,i,l);void 0!==s&&n.push(s)}return n}function Ha(e,t,n){const r=function(e,t){const n=gs(t);let r=t,o=ms;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&_s.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Us,Vs);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Us.test(e)){let n=e.replace(zs,qs);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Bs}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return wa(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,r=new Da("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Oa+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Ba.call(e,n)&&(t[_a(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Hs[r.property]||r.property:r.attribute,n]}}function za(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=us(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=us(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Ba.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ua(e)}function Ua(e,t){const n=new Da("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Oa+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _a(e){let t=e.replace(Ta,qa);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function qa(e){return"-"+e.toLowerCase()}const Va={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"]},Ga={};function Wa(e,t){return Ya(e,"boolean"!=typeof Ga.includeImageAlt||Ga.includeImageAlt,"boolean"!=typeof Ga.includeHtml||Ga.includeHtml)}function Ya(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ka(e.children,t,n)}return Array.isArray(e)?Ka(e,t,n):""}function Ka(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Ya(e[o],t,n);return r.join("")}const Xa=document.createElement("i");function Ja(e){const t="&"+e+";";Xa.innerHTML=t;const n=Xa.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function Za(e,t,n,r){const o=e.length;let i,l=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)i=r.slice(l,l+1e4),i.unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function $a(e,t){return e.length>0?(Za(e,e.length,0,t),e):t}const eA={}.hasOwnProperty;function tA(e){const t={};let n=-1;for(;++n<e.length;)nA(t,e[n]);return t}function nA(e,t){let n;for(n in t){const r=(eA.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){eA.call(r,i)||(r[i]=[]);const e=o[i];rA(r[i],Array.isArray(e)?e:e?[e]:[])}}}function rA(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Za(e,0,0,r)}function oA(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function iA(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lA=vA(/[A-Za-z]/),sA=vA(/[\dA-Za-z]/),aA=vA(/[#-'*+\--9=?A-Z^-~]/);function AA(e){return null!==e&&(e<32||127===e)}const cA=vA(/\d/),uA=vA(/[\dA-Fa-f]/),dA=vA(/[!-/:-@[-`{-~]/);function fA(e){return null!==e&&e<-2}function pA(e){return null!==e&&(e<0||32===e)}function hA(e){return-2===e||-1===e||32===e}const gA=vA(/\p{P}|\p{S}/u),mA=vA(/\s/);function vA(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function yA(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(37===i&&sA(e.charCodeAt(n+1))&&sA(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(l=String.fromCharCode(i,t),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function wA(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(hA(r))return e.enter(n),l(r);return t(r)};function l(r){return hA(r)&&i++<o?(e.consume(r),l):(e.exit(n),t(r))}}const bA={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),wA(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):fA(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const xA={tokenize:function(e){const t=this,n=[];let r,o,i,l=0;return s;function s(r){if(l<n.length){const o=n[l];return t.containerState=o[1],e.attempt(o[0].continuation,a,A)(r)}return A(r)}function a(e){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}m(l);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Za(t.events,i+1,0,t.events.slice(n)),t.events.length=s,A(e)}return s(e)}function A(o){if(l===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return p(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(kA,c,u)(o)}function c(e){return r&&v(),m(l),d(e)}function u(e){return t.parser.lazy[t.now().line]=l!==n.length,i=t.now().offset,p(e)}function d(n){return t.containerState={},e.attempt(kA,f,p)(n)}function f(e){return l++,n.push([t.currentConstruct,t.containerState]),d(e)}function p(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):fA(n)?(e.consume(n),g(e.exit("chunkFlow")),l=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){if(o){s=t.events[a][1].end;break}o=!0}for(m(l),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;Za(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},kA={tokenize:function(e,t,n){return wA(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function EA(e){return null===e||pA(e)||mA(e)?1:gA(e)?2:void 0}function CA(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const PA={name:"attention",resolveAll:function(e,t){let n,r,o,i,l,s,a,A,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};SA(u,-s),SA(d,s),i={type:s>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[c][1].start={...l.end},a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=$a(a,[["enter",e[n][1],t],["exit",e[n][1],t]])),a=$a(a,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),a=$a(a,CA(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),a=$a(a,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(A=2,a=$a(a,[["enter",e[c][1],t],["exit",e[c][1],t]])):A=0,Za(e,n-1,c-n+3,a),c=n+a.length-A-2;break}c=-1;for(;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=EA(r);let i;return function(t){return i=t,e.enter("attentionSequence"),l(t)};function l(s){if(s===i)return e.consume(s),l;const a=e.exit("attentionSequence"),A=EA(s),c=!A||2===A&&o||n.includes(s),u=!o||2===o&&A||n.includes(r);return a._open=Boolean(42===i?c:c&&(o||!u)),a._close=Boolean(42===i?u:u&&(A||!c)),t(s)}}};function SA(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const DA={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return lA(t)?(e.consume(t),i):64===t?n(t):a(t)}function i(e){return 43===e||45===e||46===e||sA(e)?(r=1,l(e)):a(e)}function l(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||sA(t))&&r++<32?(e.consume(t),l):(r=0,a(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||AA(r)?n(r):(e.consume(r),s)}function a(t){return 64===t?(e.consume(t),A):aA(t)?(e.consume(t),a):n(t)}function A(e){return sA(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,A):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||sA(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const BA={partial:!0,tokenize:function(e,t,n){return function(t){return hA(t)?wA(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||fA(e)?t(e):n(e)}}};const IA={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(hA(t))return wA(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(IA,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return hA(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const TA={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return dA(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const QA={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),o=31,i=sA,A(t))}function a(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=uA,A):(e.enter("characterReferenceValue"),o=7,i=cA,A(t))}function A(s){if(59===s&&l){const o=e.exit("characterReferenceValue");return i!==sA||Ja(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&l++<o?(e.consume(s),A):n(s)}}};const MA={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},OA={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return l;function l(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a}function a(t){return e.enter("codeFencedFence"),hA(t)?wA(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),hA(t)?wA(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||fA(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,l=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return l=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}(t)};function a(t){return t===i?(s++,e.consume(t),a):s<3?n(t):(e.exit("codeFencedFenceSequence"),hA(t)?wA(e,A,"whitespace")(t):A(t))}function A(n){return null===n||fA(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(MA,f,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||fA(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),A(t)):hA(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wA(e,u,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),c)}function u(t){return null===t||fA(t)?A(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||fA(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),A(t)):96===t&&t===i?n(t):(e.consume(t),d)}function f(t){return e.attempt(o,v,p)(t)}function p(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return l>0&&hA(t)?wA(e,g,"linePrefix",l+1)(t):g(t)}function g(t){return null===t||fA(t)?e.check(MA,f,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||fA(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const LA={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),wA(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):fA(t)?e.attempt(RA,i,s)(t):(e.enter("codeFlowValue"),l(t))}function l(t){return null===t||fA(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),l)}function s(n){return e.exit("codeIndented"),t(n)}}},RA={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):fA(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):wA(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):fA(e)?o(e):n(e)}}};const jA={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),l(t)};function l(t){return 96===t?(e.consume(t),i++,l):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,A(t)):fA(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),a(t))}function a(t){return null===t||32===t||96===t||fA(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),a)}function A(n){return 96===n?(e.consume(n),r++,A):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",a(n))}}};class NA{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&FA(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),FA(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),FA(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);FA(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);FA(this.left,t.reverse())}}}function FA(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function HA(e){const t={};let n,r,o,i,l,s,a,A=-1;const c=new NA(e);for(;++A<c.length;){for(;A in t;)A=t[A];if(n=c.get(A),A&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(A-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,zA(c,A)),A=t[A],a=!0);else if(n[1]._container){for(o=A,r=void 0;o--;)if(i=c.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,A),l.unshift(n),c.splice(r,A-r+1,l))}}return Za(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!a}function zA(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const s=l.events,a=[],A={};let c,u,d=-1,f=n,p=0,h=0;const g=[h];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),u&&l.defineSkip(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++d<s.length;)"exit"===s[d][0]&&"enter"===s[d-1][0]&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(h=d+1,g.push(h),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const t=s.slice(g[d],g[d+1]),n=i.pop();a.push([n,n+t.length-1]),e.splice(n,2,t)}for(a.reverse(),d=-1;++d<a.length;)A[p+a[d][0]]=p+a[d][1],p+=a[d][1]-a[d][0]-1;return A}const UA={resolve:function(e){return HA(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):fA(t)?e.check(_A,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},_A={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),wA(e,o,"linePrefix")};function o(o){if(null===o||fA(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function qA(e,t,n,r,o,i,l,s,a){const A=a||Number.POSITIVE_INFINITY;let c=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),u;if(null===t||32===t||41===t||AA(t))return n(t);return e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t)};function u(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),u(t)):null===t||60===t||fA(t)?n(t):(e.consume(t),92===t?f:d)}function f(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function p(o){return c||null!==o&&41!==o&&!pA(o)?c<A&&40===o?(e.consume(o),c++,p):41===o?(e.consume(o),c--,p):null===o||32===o||40===o||AA(o)?n(o):(e.consume(o),92===o?h:p):(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function VA(e,t,n,r,o,i){const l=this;let s,a=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),A};function A(u){return a>999||null===u||91===u||93===u&&!s||94===u&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(u):93===u?(e.exit(i),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):fA(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),A):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||fA(t)||a++>999?(e.exit("chunkString"),A(t)):(e.consume(t),s||(s=!hA(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}}function GA(e,t,n,r,o,i){let l;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),l=40===t?41:t,s;return n(t)};function s(n){return n===l?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),a(n))}function a(t){return t===l?(e.exit(i),s(l)):null===t?n(t):fA(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),wA(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),A(t))}function A(t){return t===l||null===t||fA(t)?(e.exit("chunkString"),a(t)):(e.consume(t),92===t?c:A)}function c(t){return t===l||92===t?(e.consume(t),A):A(t)}}function WA(e,t){let n;return function r(o){if(fA(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(hA(o))return wA(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const YA={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return VA.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=iA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return pA(t)?WA(e,s)(t):s(t)}function s(t){return qA(e,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function a(t){return e.attempt(KA,A,A)(t)}function A(t){return hA(t)?wA(e,c,"whitespace")(t):c(t)}function c(i){return null===i||fA(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},KA={partial:!0,tokenize:function(e,t,n){return function(t){return pA(t)?WA(e,r)(t):n(t)};function r(t){return GA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return hA(t)?wA(e,i,"whitespace")(t):i(t)}function i(e){return null===e||fA(e)?t(e):n(e)}}};const XA={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return fA(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const JA={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},Za(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||pA(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),l(n)):null===n||fA(n)?(e.exit("atxHeading"),t(n)):hA(n)?wA(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function l(t){return 35===t?(e.consume(t),l):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||pA(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const ZA=["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"],$A=["pre","script","style","textarea"],ec={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,l,s,a;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),A}(t)};function A(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,f):63===s?(e.consume(s),o=3,r.interrupt?t:O):lA(s)?(e.consume(s),l=String.fromCharCode(s),p):n(s)}function c(i){return 45===i?(e.consume(i),o=2,u):91===i?(e.consume(i),o=5,s=0,d):lA(i)?(e.consume(i),o=4,r.interrupt?t:O):n(i)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:P:d):n(o)}function f(t){return lA(t)?(e.consume(t),l=String.fromCharCode(t),p):n(t)}function p(s){if(null===s||47===s||62===s||pA(s)){const a=47===s,A=l.toLowerCase();return a||i||!$A.includes(A)?ZA.includes(l.toLowerCase())?(o=6,a?(e.consume(s),h):r.interrupt?t(s):P(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):m(s)):(o=1,r.interrupt?t(s):P(s))}return 45===s||sA(s)?(e.consume(s),l+=String.fromCharCode(s),p):n(s)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:P):n(o)}function g(t){return hA(t)?(e.consume(t),g):E(t)}function m(t){return 47===t?(e.consume(t),E):58===t||95===t||lA(t)?(e.consume(t),v):hA(t)?(e.consume(t),m):E(t)}function v(t){return 45===t||46===t||58===t||95===t||sA(t)?(e.consume(t),v):y(t)}function y(t){return 61===t?(e.consume(t),w):hA(t)?(e.consume(t),y):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,b):hA(t)?(e.consume(t),w):x(t)}function b(t){return t===a?(e.consume(t),a=null,k):null===t||fA(t)?n(t):(e.consume(t),b)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||pA(t)?y(t):(e.consume(t),x)}function k(e){return 47===e||62===e||hA(e)?m(e):n(e)}function E(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||fA(t)?P(t):hA(t)?(e.consume(t),C):n(t)}function P(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!fA(t)||6!==o&&7!==o?null===t||fA(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),P):(e.exit("htmlFlowData"),e.check(tc,R,S)(t))}function S(t){return e.check(nc,D,R)(t)}function D(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),B}function B(t){return null===t||fA(t)?S(t):(e.enter("htmlFlowData"),P(t))}function I(t){return 45===t?(e.consume(t),O):P(t)}function T(t){return 47===t?(e.consume(t),l="",Q):P(t)}function Q(t){if(62===t){const n=l.toLowerCase();return $A.includes(n)?(e.consume(t),L):P(t)}return lA(t)&&l.length<8?(e.consume(t),l+=String.fromCharCode(t),Q):P(t)}function M(t){return 93===t?(e.consume(t),O):P(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):P(t)}function L(t){return null===t||fA(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),L)}function R(n){return e.exit("htmlFlow"),t(n)}}},tc={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(BA,t,n)}}},nc={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(fA(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const rc={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,l;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),a):47===t?(e.consume(t),w):63===t?(e.consume(t),v):lA(t)?(e.consume(t),k):n(t)}function a(t){return 45===t?(e.consume(t),A):91===t?(e.consume(t),i=0,f):lA(t)?(e.consume(t),m):n(t)}function A(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):fA(t)?(l=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?p:f):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),h):fA(t)?(l=p,Q(t)):(e.consume(t),p)}function h(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):p(t)}function m(t){return null===t||62===t?T(t):fA(t)?(l=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):fA(t)?(l=v,Q(t)):(e.consume(t),v)}function y(e){return 62===e?T(e):v(e)}function w(t){return lA(t)?(e.consume(t),b):n(t)}function b(t){return 45===t||sA(t)?(e.consume(t),b):x(t)}function x(t){return fA(t)?(l=x,Q(t)):hA(t)?(e.consume(t),x):T(t)}function k(t){return 45===t||sA(t)?(e.consume(t),k):47===t||62===t||pA(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),T):58===t||95===t||lA(t)?(e.consume(t),C):fA(t)?(l=E,Q(t)):hA(t)?(e.consume(t),E):T(t)}function C(t){return 45===t||46===t||58===t||95===t||sA(t)?(e.consume(t),C):P(t)}function P(t){return 61===t?(e.consume(t),S):fA(t)?(l=P,Q(t)):hA(t)?(e.consume(t),P):E(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,D):fA(t)?(l=S,Q(t)):hA(t)?(e.consume(t),S):(e.consume(t),B)}function D(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):fA(t)?(l=D,Q(t)):(e.consume(t),D)}function B(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||pA(t)?E(t):(e.consume(t),B)}function I(e){return 47===e||62===e||pA(e)?E(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return hA(t)?wA(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),l(t)}}};const oc={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&Za(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,l=e.length,s=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=l);const a={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},A={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",a,t],["enter",A,t]],i=$a(i,e.slice(r+1,r+s+3)),i=$a(i,[["enter",c,t]]),i=$a(i,CA(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=$a(i,[["exit",c,t],e[o-2],e[o-1],["exit",A,t]]),i=$a(i,e.slice(o+1)),i=$a(i,[["exit",a,t]]),Za(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,l=r.events.length;for(;l--;)if(("labelImage"===r.events[l][1].type||"labelLink"===r.events[l][1].type)&&!r.events[l][1]._balanced){o=r.events[l][1];break}return function(t){if(!o)return n(t);if(o._inactive)return c(t);return i=r.parser.defined.includes(iA(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(ic,A,i?A:c)(t):91===t?e.attempt(lc,A,i?a:c)(t):i?A(t):c(t)}function a(t){return e.attempt(sc,A,c)(t)}function A(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},ic={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return pA(t)?WA(e,o)(t):o(t)}function o(t){return 41===t?A(t):qA(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return pA(t)?WA(e,s)(t):A(t)}function l(e){return n(e)}function s(t){return 34===t||39===t||40===t?GA(e,a,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):A(t)}function a(t){return pA(t)?WA(e,A)(t):A(t)}function A(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},lc={tokenize:function(e,t,n){const r=this;return function(t){return VA.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(iA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},sc={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const ac={name:"labelStartImage",resolveAll:oc.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Ac={name:"labelStartLink",resolveAll:oc.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const cc={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),wA(e,t,"linePrefix")}}};const uc={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),l(i)):o>=3&&(null===i||fA(i))?(e.exit("thematicBreak"),t(i)):n(i)}function l(t){return t===r?(e.consume(t),o++,l):(e.exit("thematicBreakSequence"),hA(t)?wA(e,i,"whitespace")(t):i(t))}}};const dc={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(BA,o,i);function o(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,wA(e,t,"listItemIndent",r.containerState.size+1)(n)}function i(n){return r.containerState.furtherBlankLines||!hA(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pc,t,l)(n))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,wA(e,e.attempt(dc,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,l=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:cA(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(uc,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return cA(t)&&++l<10?(e.consume(t),s):(!r.interrupt||l<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),a(t)):n(t)}function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(BA,r.interrupt?n:A,e.attempt(fc,u,c))}function A(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return hA(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},fc={partial:!0,tokenize:function(e,t,n){const r=this;return wA(e,function(e){const o=r.events[r.events.length-1];return!hA(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},pc={partial:!0,tokenize:function(e,t,n){const r=this;return wA(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const hc={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",l,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=l;return e.push(["exit",l,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let l,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){l="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||l))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),hA(t)?wA(e,l,"lineSuffix")(t):l(t))}function l(r){return null===r||fA(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const gc={tokenize:function(e){const t=this,n=e.attempt(BA,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,wA(e,e.attempt(this.parser.constructs.flow,r,e.attempt(UA,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const mc={resolveAll:bc()},vc=wc("string"),yc=wc("text");function wc(e){return{resolveAll:bc("text"===e?xc:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,l);return i;function i(e){return a(e)?o(e):l(e)}function l(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return a(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function a(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function bc(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function xc(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,l=o.length,s=-1,a=0;for(;l--;){const e=o[l];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)a++,s--;if(s)break;s=-1}else if(-2===e)i=!0,a++;else if(-1!==e){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const o={type:n===e.length||i||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const kc={42:dc,43:dc,45:dc,48:dc,49:dc,50:dc,51:dc,52:dc,53:dc,54:dc,55:dc,56:dc,57:dc,62:IA},Ec={91:YA},Cc={[-2]:LA,[-1]:LA,32:LA},Pc={35:JA,42:uc,45:[hc,uc],60:ec,61:hc,95:uc,96:OA,126:OA},Sc={38:QA,92:TA},Dc={[-5]:cc,[-4]:cc,[-3]:cc,33:ac,38:QA,42:PA,60:[DA,rc],91:Ac,92:[XA,TA],93:oc,95:PA,96:jA},Bc={null:[PA,mc]};var Ic=Object.freeze({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:Ec,disable:{null:[]},document:kc,flow:Pc,flowInitial:Cc,insideSpan:Bc,string:Sc,text:Dc});function Tc(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let l=[],s=[];const a={attempt:g(function(e,t){m(e,t.from)}),check:g(h),consume:function(e){fA(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,v()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++));A.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),A.events.push(["enter",n,A]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=d(),A.events.push(["exit",t,A]),t},interrupt:g(h,{interrupt:!0})},A={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,v()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let l;if("string"==typeof i)l=i;else switch(i){case-5:l="\r";break;case-4:l="\n";break;case-3:l="\r\n";break;case-2:l=t?" ":"\t";break;case-1:if(!t&&o)continue;l=" ";break;default:l=String.fromCharCode(i)}o=-2===i,r.push(l)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){if(l=$a(l,e),f(),null!==l[l.length-1])return[];return m(t,0),A.events=CA(i,A.events,A),A.events}};let c=t.tokenize.call(A,a);return t.resolveAll&&i.push(t),A;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,i)];else{if(l=e.slice(n,o),r>-1){const e=l[0];"string"==typeof e?l[0]=e.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}(l,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function f(){let e;for(;r._index<l.length;){const t=l[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}function p(e){c=c(e)}function h(e,t){t.restore()}function g(e,t){return function(n,o,i){let l,c,u,f;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return p([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function p(e){return l=e,c=0,0===e.length?i:h(e[c])}function h(e){return function(n){f=function(){const e=d(),t=A.previous,n=A.currentConstruct,o=A.events.length,i=Array.from(s);return{from:o,restore:l};function l(){r=e,A.previous=t,A.currentConstruct=n,A.events.length=o,s=i,v()}}(),u=e,e.partial||(A.currentConstruct=e);if(e.name&&A.parser.constructs.disable.null.includes(e.name))return m();return e.tokenize.call(t?Object.assign(Object.create(A),t):A,a,g,m)(n)}}function g(t){return e(u,f),o}function m(e){return f.restore(),++c<l.length?h(l[c]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&Za(A.events,t,A.events.length-t,e.resolve(A.events.slice(t),A)),e.resolveTo&&(A.events=e.resolveTo(A.events,A))}function v(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const Qc=/[\0\t\n\r]/g;const Mc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Oc(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return oA(n.slice(t?2:1),t?16:10)}return Ja(n)||e}const Lc={}.hasOwnProperty;function Rc(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(J),blockQuote:i(G),characterEscape:C,characterReference:C,codeFenced:i(W),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(W,l),codeText:i(Y,l),codeTextData:C,data:C,codeFlowValue:C,definition:i(K),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(X),hardBreakEscape:i(Z),hardBreakTrailing:i(Z),htmlFlow:i($,l),htmlFlowData:C,htmlText:i($,l),htmlTextData:C,image:i(ee),label:l,link:i(te),listItem:i(re),listItemValue:d,listOrdered:i(ne,u),listUnordered:i(ne),paragraph:i(oe),reference:F,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(J),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:a(),atxHeadingSequence:b,autolink:a(),autolinkEmail:V,autolinkProtocol:q,blockQuote:a(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:U,characterReference:_,codeFenced:a(g),codeFencedFence:h,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:P,codeIndented:a(m),codeText:a(T),codeTextData:P,data:P,definition:a(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:y,emphasis:a(),hardBreakEscape:a(D),hardBreakTrailing:a(D),htmlFlow:a(B),htmlFlowData:P,htmlText:a(I),htmlTextData:P,image:a(M),label:L,labelText:O,lineEnding:S,link:a(Q),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:H,resourceDestinationString:R,resourceTitleString:j,resource:N,setextHeading:a(E),setextHeadingLineSequence:k,setextHeadingText:x,strong:a(),thematicBreak:a()}};Nc(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:A,buffer:l,resume:c,data:n},a=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])a.push(u);else{u=o(e,a.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];Lc.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},i),e[u][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Hc).call(i,void 0,e[0])}for(r.position={start:jc(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:jc(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,i,l,s=t-1,a=-1,A=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?a++:a--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||l||a||i||(i=s),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!a&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===a&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=s;for(o=void 0;l--;){const t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",A=!0),t[1].type="lineEnding",o=l}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,l=!0}}}return e[t][1]._spread=A,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:jc(t.start),end:void 0}}function a(e){return t;function t(t){e&&e.call(this,t),A.call(this,t)}}function A(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Ea({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||Hc).call(this,e,r[0])}n.position.end=jc(e.end)}function c(){return Wa(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function p(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iA(this.sliceSerialize(e)).toLowerCase()}function y(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function b(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function k(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=le(),n.position={start:jc(e.start),end:void 0},t.push(n)),this.stack.push(n)}function P(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=jc(e.end)}function S(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=jc(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),P.call(this,e))}function D(){this.data.atHardBreak=!0}function B(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Mc,Oc)}(t),n.identifier=iA(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function R(){const e=this.resume();this.stack[this.stack.length-1].url=e}function j(){const e=this.resume();this.stack[this.stack.length-1].title=e}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function H(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function z(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=oA(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=Ja(t)}this.stack[this.stack.length-1].value+=r}function _(e){this.stack.pop().position.end=jc(e.end)}function q(e){P.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function V(e){P.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function K(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function X(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function le(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!HA(e););return e}(function(e){const t={constructs:tA([Ic,...(e||{}).extensions||[]]),content:n(bA),defined:[],document:n(xA),flow:n(gc),lazy:{},string:n(vc),text:n(yc)};return t;function n(e){return function(n){return Tc(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,l){const s=[];let a,A,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(Qc.lastIndex=c,a=Qc.exec(o),u=a&&void 0!==a.index?a.index:o.length,d=o.charCodeAt(u),!a){n=o.slice(c);break}if(10===d&&c===u&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),c<u&&(s.push(o.slice(c,u)),t+=u-c),d){case 0:s.push(65533),t++;break;case 9:for(A=4*Math.ceil(t/4),s.push(-2);t++<A;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return l&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function jc(e){return{line:e.line,column:e.column,offset:e.offset}}function Nc(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Nc(e,r):Fc(e,r)}}function Fc(e,t){let n;for(n in t)if(Lc.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Hc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ea({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ea({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ea({start:t.start,end:t.end})+") is still open")}function zc(e){const t=this;t.parser=function(n){return Rc(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Uc(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&"text"===l.type?l.value+=r:o.push({type:"text",value:r}),o}function _c(e){const t=e.spread;return null==t?e.children.length>1:t}function qc(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Vc(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Vc(t.slice(o),o>0,!1)),i.join("")}function Vc(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const Gc={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=yA(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,s+=1,e.footnoteCounts.set(r,s);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const A={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,A),e.applyData(t,A)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Uc(e,t);const o={src:yA(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:yA(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Uc(e,t);const o={href:yA(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:yA(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=_c(n[r])}return t}(n):_c(t),i={},l=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?l.push(e):l.push(...e.children)}const a=r[r.length-1];a&&(o||"element"!==a.type||"p"!==a.tagName)&&l.push({type:"text",value:"\n"});const A={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,A),e.applyData(t,A)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=xa(t.children[1]),l=ba(t.children[t.children.length-1]);i&&l&&(r.position={start:i,end:l}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,l=i?i.length:t.children.length;let s=-1;const a=[];for(;++s<l;){const n=t.children[s],r={},l=i?i[s]:void 0;l&&(r.align=l);let A={type:"element",tagName:o,properties:r,children:[]};n&&(A.children=e.all(n),e.patch(n,A),A=e.applyData(n,A)),a.push(A)}const A={type:"element",tagName:"tr",properties:{},children:e.wrap(a,!0)};return e.patch(t,A),e.applyData(t,A)},text:function(e,t){const n={type:"text",value:qc(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Wc,yaml:Wc,definition:Wc,footnoteDefinition:Wc};function Wc(){}const Yc="object"==typeof self?self:globalThis,Kc=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case 0:case-1:return n(l,o);case 1:{const e=n([],o);for(const t of l)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of l)e[r(t)]=r(n);return e}case 3:return n(new Date(l),o);case 4:{const{source:e,flags:t}=l;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of l)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of l)e.add(r(t));return e}case 7:{const{name:e,message:t}=l;return n(new Yc[e](t),o)}case 8:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:e}=new Uint8Array(l);return n(new DataView(e),l)}}return n(new Yc[i](l),o)};return r})(new Map,e)(0),Xc="",{toString:Jc}={},{keys:Zc}=Object,$c=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Jc.call(e).slice(8,-1);switch(n){case"Array":return[1,Xc];case"Object":return[2,Xc];case"Date":return[3,Xc];case"RegExp":return[4,Xc];case"Map":return[5,Xc];case"Set":return[6,Xc];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},eu=([e,t])=>0===e&&("function"===t||"symbol"===t),tu=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[l,s]=$c(r);switch(l){case 0:{let t=r;switch(s){case"bigint":l=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([l,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([l,e],r);for(const t of r)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],a=o([l,n],r);for(const t of Zc(r))!e&&eu($c(r[t]))||n.push([i(t),i(r[t])]);return a}case 3:return o([l,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([l,{source:e,flags:t}],r)}case 5:{const t=[],n=o([l,t],r);for(const[n,o]of r)(e||!eu($c(n))&&!eu($c(o)))&&t.push([i(n),i(o)]);return n}case 6:{const t=[],n=o([l,t],r);for(const n of r)!e&&eu($c(n))||t.push(i(n));return n}}const{message:a}=r;return o([l,{name:s,message:a}],r)};return i})(!(t||n),!!t,new Map,r)(e),r};var nu="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Kc(tu(e,t)):structuredClone(e):(e,t)=>Kc(tu(e,t));function ru(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ou(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const iu=function(e){if(null==e)return su;if("function"==typeof e)return lu(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=iu(e[n]);return lu(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return lu(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return lu(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function lu(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function su(){return!0}const au=[],Au=!0,cu=!1;function uu(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=iu(o),l=r?-1:1;!function e(o,s,a){const A=o&&"object"==typeof o?o:{};if("string"==typeof A.type){const e="string"==typeof A.tagName?A.tagName:"string"==typeof A.name?A.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let A,c,u,d=au;if((!t||i(o,s,a[a.length-1]||void 0))&&(d=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[Au,e];return null==e?au:[e]}(n(o,a)),d[0]===cu))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+l,u=a.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(A=e(n,c,u)(),A[0]===cu)return A;c="number"==typeof A[1]?A[1]:c+l}}return d}}(e,void 0,[])()}function du(e,t,n,r){let o,i,l;"function"==typeof t&&"function"!=typeof n?(i=void 0,l=t,o=n):(i=t,l=n,o=r),uu(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},o)}const fu={}.hasOwnProperty,pu={};function hu(e,t){e.position&&(t.position=function(e){const t=xa(e),n=ba(e);if(t&&n)return{start:t,end:n}}(e))}function gu(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,nu(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function mu(e,t){const n=t.data||{},r=!("value"in t)||fu.call(n,"hProperties")||fu.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function vu(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function yu(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function wu(e,t){const n=function(e,t){const n=t||pu,r=new Map,o=new Map,i=new Map,l={...Gc,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=yu(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=yu(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:gu,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:l,one:function(e,t){const n=e.type,r=s.handlers[n];if(fu.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=nu(n);return r.children=s.all(e),r}return nu(e)}return(s.options.unknownHandler||mu)(s,e,t)},options:n,patch:hu,wrap:vu};return du(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ru,r=e.options.footnoteBackLabel||ou,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[a]);if(!o)continue;const i=e.all(o),l=String(o.identifier).toUpperCase(),A=yA(l.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(l);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(a,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+A+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(a,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){const e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...u)}else i.push(...u);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+A},children:e.wrap(i,!0)};e.patch(o,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...nu(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function bu(e,t){return e&&"run"in e?async function(n,r){const o=wu(n,{file:r,...t});await e.run(o,r)}:function(n,r){return wu(n,{file:r,...e||t})}}function xu(e){if(e)throw e}var ku=Object.prototype.hasOwnProperty,Eu=Object.prototype.toString,Cu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,Su=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Eu.call(e)},Du=function(e){if(!e||"[object Object]"!==Eu.call(e))return!1;var t,n=ku.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&ku.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||ku.call(e,t)},Bu=function(e,t){Cu&&"__proto__"===t.name?Cu(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Iu=function(e,t){if("__proto__"===t){if(!ku.call(e,t))return;if(Pu)return Pu(e,t).value}return e[t]},Tu=function e(){var t,n,r,o,i,l,s=arguments[0],a=1,A=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},a=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});a<A;++a)if(null!=(t=arguments[a]))for(n in t)r=Iu(s,n),s!==(o=Iu(t,n))&&(c&&o&&(Du(o)||(i=Su(o)))?(i?(i=!1,l=r&&Su(r)?r:[]):l=r&&Du(r)?r:{},Bu(s,{name:n,newValue:e(c,l,o)})):void 0!==o&&Bu(s,{name:n,newValue:o}));return s},Qu=Ks(Tu);function Mu(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Ou(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...l){const s=e[++n];let a=-1;if(i)r(i);else{for(;++a<t.length;)null!==l[a]&&void 0!==l[a]||(l[a]=t[a]);t=l,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let l;r&&t.push(o);try{l=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(l&&l.then&&"function"==typeof l.then?l.then(i,o):l instanceof Error?o(l):i(l))}function o(e,...r){n||(n=!0,t(e,...r))}function i(e){o(null,e)}}(s,o)(...l):r(null,...l)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const Lu={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Ru(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=l));r===o?o=l:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(Ru(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Ru(e);let t,n=e.length,r=-1,o=0,i=-1,l=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==l&&(l=1):i>-1&&(l=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===l||1===l&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Ru(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Ru(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,l=-1,s=0,a=-1;for(;++a<=e.length;){if(a<e.length)n=e.codePointAt(a);else{if(47===n)break;n=47}if(47===n){if(l===a-1||1===s);else if(l!==a-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),l=a,s=0;continue}}else if(o.length>0){o="",i=0,l=a,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(l+1,a):o=e.slice(l+1,a),i=a-l-1;l=a,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function Ru(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ju={cwd:function(){return"/"}};function Nu(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Fu(e){if("string"==typeof e)e=new URL(e);else if(!Nu(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Hu=["history","path","basename","stem","extname","dirname"];class zu{constructor(e){let t;t=e?Nu(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":ju.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<Hu.length;){const e=Hu[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)Hu.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?Lu.basename(this.path):void 0}set basename(e){_u(e,"basename"),Uu(e,"basename"),this.path=Lu.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Lu.dirname(this.path):void 0}set dirname(e){qu(this.basename,"dirname"),this.path=Lu.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Lu.extname(this.path):void 0}set extname(e){if(Uu(e,"extname"),qu(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Lu.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Nu(e)&&(e=Fu(e)),_u(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Lu.basename(this.path,this.extname):void 0}set stem(e){_u(e,"stem"),Uu(e,"stem"),this.path=Lu.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Da(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function Uu(e,t){if(e&&e.includes(Lu.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Lu.sep+"`")}function _u(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Vu=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Gu={}.hasOwnProperty;class Wu extends Vu{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=Ou()}copy(){const e=new Wu;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Qu(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(Ju("data",this.frozen),this.namespace[e]=t,this):Gu.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ju("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=ed(e),n=this.parser||this.Parser;return Ku("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ku("process",this.parser||this.Parser),Xu("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=ed(e),l=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(l,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var l;"string"==typeof(l=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(l)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ku("processSync",this.parser||this.Parser),Xu("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,xu(e),t=r}),$u("processSync","process",n),t}run(e,t,n){Zu(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const l=ed(t);r.run(e,l,function(t,r,l){const s=r||e;t?i(t):o?o(s):n(void 0,s,l)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){xu(e),n=t,r=!0}),$u("runSync","run",r),n}stringify(e,t){this.freeze();const n=ed(t),r=this.compiler||this.Compiler;return Xu("stringify",r),Zu(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(Ju("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?l(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))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");l(e.plugins),e.settings&&(r.settings=Qu(!0,r.settings,e.settings))}function l(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const l=n[o][1];Mu(l)&&Mu(r)&&(r=Qu(!0,l,r)),n[o]=[e,r,...i]}}}}const Yu=(new Wu).freeze();function Ku(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Xu(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ju(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zu(e){if(!Mu(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function $u(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ed(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new zu(e)}const td=[],nd={allowDangerousHtml:!0},rd=/^(https?|ircs?|mailto|xmpp)$/i,od=[{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:"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 id(e){const t=function(e){const t=e.rehypePlugins||td,n=e.remarkPlugins||td,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nd}:nd,o=Yu().use(zc).use(n).use(bu,r).use(t);return o}(e),r=function(e){const t=e.children||"",n=new zu;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const r=t.allowedElements,o=t.allowElement,i=t.components,l=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,A=t.urlTransform||ld;for(const e of od)Object.hasOwn(t,e.from)&&ss((e.from,e.to&&e.to,e.id));t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:"root"===e.type?e.children:[e]});return du(e,c),La(e,{Fragment:n.Fragment,components:i,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0});function c(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return s?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Va)if(Object.hasOwn(Va,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Va[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=A(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!l&&l.includes(e.tagName);if(!i&&o&&"number"==typeof t&&(i=!o(e,t,n)),i&&n&&"number"==typeof t)return a&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}(t.runSync(t.parse(r),r),e)}function ld(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||rd.test(e.slice(0,t))?e:""}function sd(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}function ad(e,t,n){const r=iu((n||{}).ignore||[]),o=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([Ad(e[0]),cd(e[1])])}return t}(t);let i=-1;for(;++i<o.length;)uu(e,"text",l);function l(e,t){let n,l=-1;for(;++l<t.length;){const e=t[l],o=n?n.children:void 0;if(r(e,o?o.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=o[i][0],l=o[i][1];let s=0;const a=n.children.indexOf(e);let A=!1,c=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){const n=u.index,o={index:u.index,input:u.input,stack:[...t,e]};let i=l(...u,o);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(s!==n&&c.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(i)?c.push(...i):i&&c.push(i),s=n+u[0].length,A=!0),!r.global)break;u=r.exec(e.value)}A?(s<e.value.length&&c.push({type:"text",value:e.value.slice(s)}),n.children.splice(a,1,...c)):c=[e];return a+c.length}(e,t)}}function Ad(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function cd(e){return"function"==typeof e?e:function(){return e}}const ud="phrasing",dd=["autolink","link","image","label"];function fd(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pd(e){this.config.enter.autolinkProtocol.call(this,e)}function hd(e){this.config.exit.autolinkProtocol.call(this,e)}function gd(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function md(e){this.config.exit.autolinkEmail.call(this,e)}function vd(e){this.exit(e)}function yd(e){ad(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wd],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,bd]],{ignore:["link","linkReference"]})}function wd(e,t,n,r,o){let i="";if(!xd(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const l=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=sd(e,"(");let i=sd(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!l[0])return!1;const s={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[s,{type:"text",value:l[1]}]:s}function bd(e,t,n,r){return!(!xd(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xd(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||mA(n)||gA(n))&&(!t||47!==n)}function kd(){this.buffer()}function Ed(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Cd(){this.buffer()}function Pd(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Sd(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=iA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Dd(e){this.exit(e)}function Bd(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=iA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Id(e){this.exit(e)}function Td(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const l=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),l(),i+=o.move("]"),i}function Qd(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,o){const i=r.createTracker(o);let l=i.move("[^");const s=r.enter("footnoteDefinition"),a=r.enter("label");l+=i.move(r.safe(r.associationId(e),{before:l,after:"]"})),a(),l+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),l+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?Od:Md)));return s(),l},footnoteReference:Td},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function Md(e,t,n){return 0===t?e:Od(e,t,n)}function Od(e,t,n){return(n?"":" ")+e}Td.peek=function(){return"["};const Ld=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function Rd(e){this.enter({type:"delete",children:[]},e)}function jd(e){this.exit(e)}function Nd(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),i(),l}function Fd(e){return e.length}function Hd(e){return null==e?"":String(e)}function zd(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function Ud(e,t,n){return">"+(n?"":" ")+e}function _d(e,t){return qd(e,t.inConstruct,!0)&&!qd(e,t.notInConstruct,!1)}function qd(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Vd(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&_d(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function Gd(e,t,n){return(n?"":" ")+e}function Wd(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Yd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Kd(e,t,n){const r=EA(e),o=EA(t);return void 0===r?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Xd(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),l=n.createTracker(r),s=l.move(o);let a=l.move(n.containerPhrasing(e,{after:o,before:s,...l.current()}));const A=a.charCodeAt(0),c=Kd(r.before.charCodeAt(r.before.length-1),A,o);c.inside&&(a=Yd(A)+a.slice(1));const u=a.charCodeAt(a.length-1),d=Kd(r.after.charCodeAt(0),u,o);d.inside&&(a=a.slice(0,-1)+Yd(u));const f=l.move(o);return i(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+a+f}function Jd(e){return e.value||""}function Zd(e,t,n,r){const o=Wd(n),i='"'===o?"Quote":"Apostrophe",l=n.enter("image");let s=n.enter("label");const a=n.createTracker(r);let A=a.move("![");return A+=a.move(n.safe(e.alt,{before:A,after:"]",...a.current()})),A+=a.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),A+=a.move("<"),A+=a.move(n.safe(e.url,{before:A,after:">",...a.current()})),A+=a.move(">")):(s=n.enter("destinationRaw"),A+=a.move(n.safe(e.url,{before:A,after:e.title?" ":")",...a.current()}))),s(),e.title&&(s=n.enter(`title${i}`),A+=a.move(" "+o),A+=a.move(n.safe(e.title,{before:A,after:o,...a.current()})),A+=a.move(o),s()),A+=a.move(")"),l(),A}function $d(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const s=n.createTracker(r);let a=s.move("![");const A=n.safe(e.alt,{before:a,after:"]",...s.current()});a+=s.move(A+"]["),l();const c=n.stack;n.stack=[],l=n.enter("reference");const u=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=c,i(),"full"!==o&&A&&A===u?"shortcut"===o?a=a.slice(0,-1):a+=s.move("]"):a+=s.move(u+"]"),a}function ef(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function tf(e,t){const n=Wa(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function nf(e,t,n,r){const o=Wd(n),i='"'===o?"Quote":"Apostrophe",l=n.createTracker(r);let s,a;if(tf(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=l.move("<");return r+=l.move(n.containerPhrasing(e,{before:r,after:">",...l.current()})),r+=l.move(">"),s(),n.stack=t,r}s=n.enter("link"),a=n.enter("label");let A=l.move("[");return A+=l.move(n.containerPhrasing(e,{before:A,after:"](",...l.current()})),A+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),A+=l.move("<"),A+=l.move(n.safe(e.url,{before:A,after:">",...l.current()})),A+=l.move(">")):(a=n.enter("destinationRaw"),A+=l.move(n.safe(e.url,{before:A,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),A+=l.move(" "+o),A+=l.move(n.safe(e.title,{before:A,after:o,...l.current()})),A+=l.move(o),a()),A+=l.move(")"),s(),A}function rf(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const s=n.createTracker(r);let a=s.move("[");const A=n.containerPhrasing(e,{before:a,after:"]",...s.current()});a+=s.move(A+"]["),l();const c=n.stack;n.stack=[],l=n.enter("reference");const u=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=c,i(),"full"!==o&&A&&A===u?"shortcut"===o?a=a.slice(0,-1):a+=s.move("]"):a+=s.move(u+"]"),a}function of(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lf(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}Nd.peek=function(){return"~"},Xd.peek=function(e,t,n){return n.options.emphasis||"*"},Jd.peek=function(){return"<"},Zd.peek=function(){return"!"},$d.peek=function(){return"!"},ef.peek=function(){return"`"},nf.peek=function(e,t,n){return tf(e,n)?"<":"["},rf.peek=function(){return"["};const sf=iu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function af(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),l=n.createTracker(r),s=l.move(o+o);let a=l.move(n.containerPhrasing(e,{after:o,before:s,...l.current()}));const A=a.charCodeAt(0),c=Kd(r.before.charCodeAt(r.before.length-1),A,o);c.inside&&(a=Yd(A)+a.slice(1));const u=a.charCodeAt(a.length-1),d=Kd(r.after.charCodeAt(0),u,o);d.inside&&(a=a.slice(0,-1)+Yd(u));const f=l.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+a+f}af.peek=function(e,t,n){return n.options.strong||"*"};const Af={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),Ud);return o(),l},break:Vd,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",l="`"===o?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,Gd);return e(),t}const s=n.createTracker(r),a=o.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,l=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===o?++i>l&&(l=i):i=1,o=r+t.length,r=n.indexOf(t,o);return l}(i,o)+1,3)),A=n.enter("codeFenced");let c=s.move(a);if(e.lang){const t=n.enter(`codeFencedLang${l}`);c+=s.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${l}`);c+=s.move(" "),c+=s.move(n.safe(e.meta,{before:c,after:"\n",encode:["`"],...s.current()})),t()}return c+=s.move("\n"),i&&(c+=s.move(i+"\n")),c+=s.move(a),A(),c},definition:function(e,t,n,r){const o=Wd(n),i='"'===o?"Quote":"Apostrophe",l=n.enter("definition");let s=n.enter("label");const a=n.createTracker(r);let A=a.move("[");return A+=a.move(n.safe(n.associationId(e),{before:A,after:"]",...a.current()})),A+=a.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),A+=a.move("<"),A+=a.move(n.safe(e.url,{before:A,after:">",...a.current()})),A+=a.move(">")):(s=n.enter("destinationRaw"),A+=a.move(n.safe(e.url,{before:A,after:e.title?" ":"\n",...a.current()}))),s(),e.title&&(s=n.enter(`title${i}`),A+=a.move(" "+o),A+=a.move(n.safe(e.title,{before:A,after:o,...a.current()})),A+=a.move(o),s()),l(),A},emphasis:Xd,hardBreak:Vd,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return du(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,cu}),Boolean((!e.depth||e.depth<3)&&Wa(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),l=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),l+"\n"+(1===o?"=":"-").repeat(l.length-(Math.max(l.lastIndexOf("\r"),l.lastIndexOf("\n"))+1))}const l="#".repeat(o),s=n.enter("headingAtx"),a=n.enter("phrasing");i.move(l+" ");let A=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(A)&&(A=Yd(A.charCodeAt(0))+A.slice(1)),A=A?l+" "+A:l,n.options.closeAtx&&(A+=" "+l),a(),s(),A},html:Jd,image:Zd,imageReference:$d,inlineCode:ef,link:nf,linkReference:rf,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):of(n);const s=e.ordered?"."===l?")":".":function(e){const t=of(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let a=!(!t||!n.bulletLastUsed)&&l===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==l&&"-"!==l||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(a=!0),lf(n)===l&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){a=!0;break}}}}a&&(l=s),n.bulletCurrent=l;const A=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=i,o(),A},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||of(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let l=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(l=4*Math.ceil(l/4));const s=n.createTracker(r);s.move(i+" ".repeat(l-i.length)),s.shift(l);const a=n.enter("listItem"),A=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(l))+e;return(n?i:i+" ".repeat(l-i.length))+e});return a(),A},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),o(),l},root:function(e,t,n,r){const o=e.children.some(function(e){return sf(e)});return(o?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:af,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(lf(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function cf(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function uf(e){this.exit(e),this.data.inTable=void 0}function df(e){this.enter({type:"tableRow",children:[]},e)}function ff(e){this.exit(e)}function pf(e){this.enter({type:"tableCell",children:[]},e)}function hf(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gf));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gf(e,t){return"|"===t?t:e}function mf(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=Af.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let o=-1;const i=[],l=t.enter("table");for(;++o<r.length;)i[o]=a(r[o],t,n);return l(),i}(e,n,r),e.align)},tableCell:l,tableRow:function(e,t,n,r){const o=a(e,n,r),i=s([o]);return i.slice(0,i.indexOf("\n"))}}};function l(e,t,n,r){const o=n.enter("tableCell"),l=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:i,after:i});return l(),o(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||Fd,i=[],l=[],s=[],a=[];let A=0,c=-1;for(;++c<e.length;){const t=[],r=[];let i=-1;for(e[c].length>A&&(A=e[c].length);++i<e[c].length;){const l=Hd(e[c][i]);if(!1!==n.alignDelimiters){const e=o(l);r[i]=e,(void 0===a[i]||e>a[i])&&(a[i]=e)}t.push(l)}l[c]=t,s[c]=r}let u=-1;if("object"==typeof r&&"length"in r)for(;++u<A;)i[u]=zd(r[u]);else{const e=zd(r);for(;++u<A;)i[u]=e}u=-1;const d=[],f=[];for(;++u<A;){const e=i[u];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let o=!1===n.alignDelimiters?1:Math.max(1,a[u]-t.length-r.length);const l=t+"-".repeat(o)+r;!1!==n.alignDelimiters&&(o=t.length+o+r.length,o>a[u]&&(a[u]=o),f[u]=o),d[u]=l}l.splice(1,0,d),s.splice(1,0,f),c=-1;const p=[];for(;++c<l.length;){const e=l[c],t=s[c];u=-1;const r=[];for(;++u<A;){const o=e[u]||"";let l="",s="";if(!1!==n.alignDelimiters){const e=a[u]-(t[u]||0),n=i[u];114===n?l=" ".repeat(e):99===n?e%2?(l=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(l=" ".repeat(e/2),s=l):s=" ".repeat(e)}!1===n.delimiterStart||u||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===o||!1===n.delimiterStart&&!u||r.push(" "),!1!==n.alignDelimiters&&r.push(l),r.push(o),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&u===A-1||r.push("|")}p.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return p.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function a(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("tableRow");for(;++o<r.length;)i[o]=l(r[o],0,t,n);return s(),i}}function vf(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function yf(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function wf(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,l="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(l);let a=Af.listItem(e,t,n,{...r,...s.current()});return i&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+l})),a}const bf={tokenize:function(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},xf={tokenize:function(e,t,n){let r,o,i;return l;function l(t){return 46===t||95===t?e.check(Ef,a,s)(t):null===t||pA(t)||mA(t)||45!==t&&gA(t)?a(t):(i=!0,e.consume(t),l)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),l}function a(e){return o||r||!i?n(e):t(e)}},partial:!0},kf={tokenize:function(e,t){let n=0,r=0;return o;function o(l){return 40===l?(n++,e.consume(l),o):41===l&&r<n?i(l):33===l||34===l||38===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||60===l||63===l||93===l||95===l||126===l?e.check(Ef,t,i)(l):null===l||pA(l)||mA(l)?t(l):(e.consume(l),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},Ef={tokenize:function(e,t,n){return r;function r(l){return 33===l||34===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||63===l||95===l||126===l?(e.consume(l),r):38===l?(e.consume(l),i):93===l?(e.consume(l),o):60===l||null===l||pA(l)||mA(l)?t(l):n(l)}function o(e){return null===e||40===e||91===e||pA(e)||mA(e)?t(e):r(e)}function i(e){return lA(e)?l(e):n(e)}function l(t){return 59===t?(e.consume(t),r):lA(t)?(e.consume(t),l):n(t)}},partial:!0},Cf={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return sA(e)?n(e):t(e)}},partial:!0},Pf={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!Tf.call(r,r.previous)||Lf(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(bf,e.attempt(xf,e.attempt(kf,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:Tf},Sf={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&Qf.call(r,r.previous)&&!Lf(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),l;return n(t)};function l(t){if(lA(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),l;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?a:(i=!0,s)):n(t)}function a(t){return null===t||AA(t)||pA(t)||mA(t)||gA(t)?n(t):e.attempt(xf,e.attempt(kf,A),n)(t)}function A(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:Qf},Df={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let o,i;return function(t){if(!Of(t)||!Mf.call(r,r.previous)||Lf(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(t)};function l(t){return Of(t)?(e.consume(t),l):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(Cf,A,a)(t):45===t||95===t||sA(t)?(i=!0,e.consume(t),s):A(t)}function a(t){return e.consume(t),o=!0,s}function A(l){return i&&o&&lA(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(l)):n(l)}},previous:Mf},Bf={};let If=48;for(;If<123;)Bf[If]=Df,If++,58===If?If=65:91===If&&(If=97);function Tf(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||pA(e)}function Qf(e){return!lA(e)}function Mf(e){return!(47===e||Of(e))}function Of(e){return 43===e||45===e||46===e||95===e||sA(e)}function Lf(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}Bf[43]=Df,Bf[45]=Df,Bf[46]=Df,Bf[95]=Df,Bf[72]=[Df,Sf],Bf[104]=[Df,Sf],Bf[87]=[Df,Pf],Bf[119]=[Df,Pf];const Rf={tokenize:function(e,t,n){const r=this;return wA(e,function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function jf(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){l=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!l||!l._balanced)return n(o);const s=iA(r.sliceSerialize({start:l.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function Nf(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function Ff(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(s){if(l>999||93===s&&!i||null===s||91===s||pA(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(iA(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return pA(s)||(i=!0),l++,e.consume(s),92===s?A:a}function A(t){return 91===t||92===t||93===t?(e.consume(t),l++,a):a(t)}}function Hf(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),a};function a(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",A):n(t)}function A(t){if(s>999||93===t&&!l||null===t||91===t||pA(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=iA(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return pA(t)||(l=!0),s++,e.consume(t),92===t?c:A}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,A):A(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),wA(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function zf(e,t,n){return e.check(BA,t,e.attempt(Rf,t,n))}function Uf(e){e.exit("gfmFootnoteDefinition")}function _f(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const o=this.previous,i=this.events;let l=0;return function(t){if(126===o&&"characterEscape"!==i[i.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(i){const a=EA(o);if(126===i)return l>1?r(i):(e.consume(i),l++,s);if(l<2&&!t)return r(i);const A=e.exit("strikethroughSequenceTemporary"),c=EA(i);return A._open=!c||2===c&&Boolean(a),A._close=!a||2===a&&Boolean(c),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},l=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],s=t.parser.constructs.insideSpan.null;s&&Za(l,l.length,0,CA(s,e.slice(r+1,n),t)),Za(l,l.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),Za(e,r-1,n-r+3,l),n=r+l.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class qf{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0===n&&0===r.length)return;for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function Vf(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function Gf(e,t,n){const r=this;let o,i=0,l=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?w:s;if(i===w&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return a(e);return o=!0,l+=1,a(e)}(t)}function a(t){return null===t?n(t):fA(t)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):hA(t)?wA(e,a,"whitespace")(t):(l+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,a):(e.enter("data"),A(t)))}function A(t){return null===t||124===t||pA(t)?(e.exit("data"),a(t)):(e.consume(t),92===t?c:A)}function c(t){return 92===t||124===t?(e.consume(t),A):A(t)}function u(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,hA(t)?wA(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):d(t))}function d(t){return 45===t||58===t?p(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):y(t)}function f(t){return hA(t)?wA(e,p,"whitespace")(t):p(t)}function p(t){return 58===t?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(l+=1,h(t)):null===t||fA(t)?v(t):y(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):y(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):(e.exit("tableDelimiterFiller"),m(t))}function m(t){return hA(t)?wA(e,v,"whitespace")(t):v(t)}function v(n){return 124===n?d(n):(null===n||fA(n))&&o&&i===l?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):y(n)}function y(e){return n(e)}function w(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||fA(n)?(e.exit("tableRow"),t(n)):hA(n)?wA(e,b,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||pA(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?k:x)}function k(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function Wf(e,t){let n,r,o,i=-1,l=!0,s=0,a=[0,0,0,0],A=[0,0,0,0],c=!1,u=0;const d=new qf;for(;++i<e.length;){const f=e[i],p=f[1];"enter"===f[0]?"tableHead"===p.type?(c=!1,0!==u&&(Kf(d,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(i,0,[["enter",n,t]])):"tableRow"===p.type||"tableDelimiterRow"===p.type?(l=!0,o=void 0,a=[0,0,0,0],A=[0,i+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===p.type?2:r?3:1):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type?"tableCellDivider"===p.type&&(l?l=!1:(0!==a[1]&&(A[0]=A[1],o=Yf(d,t,a,s,void 0,o)),a=A,A=[a[1],i,0,0])):(l=!1,0===A[2]&&(0!==a[1]&&(A[0]=A[1],o=Yf(d,t,a,s,void 0,o),a=[0,0,0,0]),A[2]=i)):"tableHead"===p.type?(c=!0,u=i):"tableRow"===p.type||"tableDelimiterRow"===p.type?(u=i,0!==a[1]?(A[0]=A[1],o=Yf(d,t,a,s,i,o)):0!==A[1]&&(o=Yf(d,t,A,s,i,o)),s=0):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type||(A[3]=i)}for(0!==u&&Kf(d,t,u,n,r),d.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=Vf(t.events,i))}return e}function Yf(e,t,n,r,o,i){const l=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},Xf(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=Xf(t.events,n[1]);if(i={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=Xf(t.events,n[2]),i=Xf(t.events,n[3]),l={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",l,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",l,t]])}return void 0!==o&&(i.end=Object.assign({},Xf(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Kf(e,t,n,r,o){const i=[],l=Xf(t.events,n);o&&(o.end=Object.assign({},l),i.push(["exit",o,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function Xf(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const Jf={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return pA(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(t)}function l(r){return fA(r)?t(r):hA(r)?e.check({tokenize:Zf},t,n)(r):n(r)}}};function Zf(e,t,n){return wA(e,function(e){return null===e?n(e):t(e)},"whitespace")}const $f={};function ep(e){const t=e||$f,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return tA([{text:Bf},{document:{91:{name:"gfmFootnoteDefinition",tokenize:Hf,continuation:{tokenize:zf},exit:Uf}},text:{91:{name:"gfmFootnoteCall",tokenize:Ff},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jf,resolveTo:Nf}}},_f(e),{flow:{null:{name:"table",tokenize:Gf,resolveAll:Wf}}},{text:{91:Jf}}])}(t)),o.push([{transforms:[yd],enter:{literalAutolink:fd,literalAutolinkEmail:pd,literalAutolinkHttp:pd,literalAutolinkWww:pd},exit:{literalAutolink:vd,literalAutolinkEmail:md,literalAutolinkHttp:hd,literalAutolinkWww:gd}},{enter:{gfmFootnoteCallString:kd,gfmFootnoteCall:Ed,gfmFootnoteDefinitionLabelString:Cd,gfmFootnoteDefinition:Pd},exit:{gfmFootnoteCallString:Sd,gfmFootnoteCall:Dd,gfmFootnoteDefinitionLabelString:Bd,gfmFootnoteDefinition:Id}},{canContainEols:["delete"],enter:{strikethrough:Rd},exit:{strikethrough:jd}},{enter:{table:cf,tableData:pf,tableHeader:pf,tableRow:df},exit:{codeText:hf,table:uf,tableData:ff,tableHeader:ff,tableRow:ff}},{exit:{taskListCheckValueChecked:vf,taskListCheckValueUnchecked:vf,paragraph:yf}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ud,notInConstruct:dd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ud,notInConstruct:dd},{character:":",before:"[ps]",after:"\\/",inConstruct:ud,notInConstruct:dd}]},Qd(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ld}],handlers:{delete:Nd}},mf(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wf}}]}}(t))}const tp="rgba(0, 0, 0, 0.3)",np={p:t=>{let{children:n}=t;return e.createElement("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"}},n)},ul:t=>{let{children:n}=t;return e.createElement("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"}},n)},ol:t=>{let{children:n}=t;return e.createElement("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"}},n)},li:t=>{let{children:n}=t;return e.createElement("li",{style:{marginBottom:"1px",lineHeight:1.4}},n)},code:t=>{let{className:n,children:r}=t;return/\blanguage-/.test(n||"")?e.createElement("pre",{style:{backgroundColor:tp,padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"}},e.createElement("code",null,r)):e.createElement("code",{style:{backgroundColor:tp,padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"}},r)},blockquote:t=>{let{children:n}=t;return e.createElement("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid rgba(255, 255, 255, 0.4)",color:"inherit",fontStyle:"italic"}},n)},a:t=>{let{children:n,href:r}=t;return e.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline",fontWeight:600}},n)},table:t=>{let{children:n}=t;return e.createElement("table",{style:{borderCollapse:"collapse",width:"100%",margin:"0.5em 0",fontSize:"0.95em",color:"#fff"}},n)},th:t=>{let{children:n}=t;return e.createElement("th",{style:{border:"1px solid rgba(255, 255, 255, 0.4)",padding:"6px 10px",textAlign:"left",verticalAlign:"top",fontWeight:600,color:"#fff",backgroundColor:"rgba(255, 255, 255, 0.15)",overflowWrap:"normal",wordBreak:"normal"}},n)},td:t=>{let{children:n}=t;return e.createElement("td",{style:{border:"1px solid rgba(255, 255, 255, 0.4)",padding:"6px 10px",textAlign:"left",verticalAlign:"top",color:"#fff",overflowWrap:"normal",wordBreak:"normal"}},n)}},rp=t=>{let{children:n}=t;return e.createElement("div",{style:{whiteSpace:"normal"}},e.createElement(id,{remarkPlugins:[ep],components:np},"string"==typeof n?n:""))},op=e.forwardRef((t,n)=>{let{embedded:r,currentOpen:o,enabled:i,onSetEnabled:l}=t;const s=zt(),a=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=V();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),A=e.useRef(!1),c=e.useRef(!1);return e.useEffect(()=>{!r&&a&&a.toggleChatWindow&&(A.current===o||c.current||(setTimeout(()=>{a&&a.toggleChatWindow&&a.toggleChatWindow(o)},0),A.current=null!=o&&o),c.current=!1)},[o,r,a]),e.useEffect(()=>{const e=()=>{c.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),e.useImperativeHandle(n,()=>({addMessage:e=>{s&&s.injectMessage&&s.injectMessage(e)},openChat:()=>{!r&&a&&a.toggleChatWindow&&a.toggleChatWindow(!0)},closeChat:()=>{!r&&a&&a.toggleChatWindow&&a.toggleChatWindow(!1)},toggleChat:()=>{!r&&a&&a.toggleChatWindow&&a.toggleChatWindow()},setBotEnabled:e=>{l&&l(e)}}),[s,a,r,l]),null});op.displayName="BotController";const ip=e.createContext(null),lp=t=>{let{trackEvent:n,children:r}=t;const o=e.useRef(n);return o.current=n,e.createElement(ip.Provider,{value:{trackEvent:e=>o.current(e)}},r)},sp=()=>{const t=e.useContext(ip);return t||{trackEvent:()=>{}}},ap=t=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:i=!1}=t;const{trackEvent:l}=sp(),s=i?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return e.createElement(e.Fragment,null,i&&e.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),e.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:`qa-bot-login-button ${i?"qa-bot-header-login-button":""} ${r}`,style:Object.assign(Object.assign({},s),o),onClick:()=>{l({type:"chatbot_login_clicked",loginUrl:n})}},"Log In"))},Ap=()=>e.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},e.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElement("circle",{cx:"12",cy:"7",r:"4"}))),cp=[];for(let e=0;e<256;++e)cp.push((e+256).toString(16).slice(1));let up;const dp=new Uint8Array(16);var fp={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function pp(e,t,n){if(fp.randomUUID&&!e)return fp.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!up){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");up=crypto.getRandomValues.bind(crypto)}return up(dp)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(cp[e[t+0]]+cp[e[t+1]]+cp[e[t+2]]+cp[e[t+3]]+"-"+cp[e[t+4]]+cp[e[t+5]]+"-"+cp[e[t+6]]+cp[e[t+7]]+"-"+cp[e[t+8]]+cp[e[t+9]]+"-"+cp[e[t+10]]+cp[e[t+11]]+cp[e[t+12]]+cp[e[t+13]]+cp[e[t+14]]+cp[e[t+15]]).toLowerCase()}(r)}function hp(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const gp="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",mp="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",vp="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",yp="background: #f97316; color: white; padding: 2px 6px; border-radius: 3px;",wp="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",bp="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",xp=()=>{hp()&&console.log("%c QA Bot Core %c v0.4.0 ",wp,bp)},kp=function(e){if(hp()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(`%c[Session]%c ${e}`,gp,"",...n)}},Ep=function(e){if(hp()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(`%c[History]%c ${e}`,mp,"",...n)}},Cp=(e,t)=>{hp()&&console.log(`%c[Message]%c ${e}`,vp,"",t)},Pp=function(e){if(hp()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(`%c[Turnstile]%c ${e}`,yp,"",...n)}},Sp=function(){console.warn(...arguments)},Dp=function(){console.error(...arguments)},Bp="qa_bot_session_messages",Ip=()=>`qa_bot_session_${pp()}`,Tp=()=>{try{const e=localStorage.getItem(Bp);return e?JSON.parse(e):{}}catch(e){return{}}},Qp=(e,t,n,r,o)=>{const i=Tp();!i[e]&&(i[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},Ep("NEW session created",{sessionId:e.slice(-12)}));if(i[e].messages.some(e=>e.id===t))return void Ep("DUPLICATE message skipped",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r});const l={id:t,content:n,sender:r,type:o,timestamp:Date.now()};i[e].messages.push(l),Ep("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:i[e].messages.length});const s=i[e].messages,a=s.find(e=>{var t;return"bot"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())&&e.content.length>=100});if(a){const t=a.content;i[e].preview=t.slice(0,50)+(t.length>50?"...":"")}else{const t=s.find(e=>{var t;return"user"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())});if(t&&!i[e].preview){const n=t.content;i[e].preview=n.slice(0,50)+(n.length>50?"...":"")}}(e=>{var t;const n=()=>Object.values(e).reduce((e,t)=>e+t.messages.length,0);for(;n()>100&&Object.keys(e).length>1;){const n=null===(t=Object.entries(e).sort((e,t)=>{let[,n]=e,[,r]=t;return new Date(n.startedAt).getTime()-new Date(r.startedAt).getTime()})[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(Bp,JSON.stringify(e))})(i),Ep("STORAGE state",{ourSessions:Object.keys(i).length,ourTotalMessages:Object.values(i).reduce((e,t)=>e+t.messages.length,0)})},Mp=e=>{var t,n;return null!==(n=null===(t=Tp()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},Op=e=>{const t=Tp()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},Lp=e.createContext(void 0),Rp=t=>{let{children:n,getSessionId:r,setSessionId:o,resetSession:i,clearResettingFlag:l}=t;return e.createElement(Lp.Provider,{value:{getSessionId:r,setSessionId:o,resetSession:i,clearResettingFlag:l}},n)},jp=()=>{const t=e.useContext(Lp);if(!t)throw new Error("useSession must be used within a SessionProvider");return t},Np=()=>{const[t,n]=e.useState(!1),[r,o]=e.useState([]),[i,l]=e.useState(null),[s,a]=e.useState(0),A=e.useRef(null),c=e.useRef(null),{replaceMessages:u}=zt(),{toggleTextAreaDisabled:d}=qt(),{setSessionId:f,getSessionId:p}=jp();e.useEffect(()=>{var e,r;const o=e=>{A.current&&!A.current.contains(e.target)&&c.current&&!c.current.contains(e.target)&&n(!1)},i=null!==(r=null===(e=A.current)||void 0===e?void 0:e.getRootNode())&&void 0!==r?r:document;return t&&i.addEventListener("mousedown",o),()=>{i.removeEventListener("mousedown",o)}},[t]);const h=e=>{var t;const r=p();if(Ep("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==r?void 0:r.slice(-12)}),e===r)return Ep("RESTORE skipped - already on this session"),void n(!1);const o=(e=>{var t;return(null===(t=Tp()[e])||void 0===t?void 0:t.messages)||[]})(e).filter(e=>{var t;return null===(t=e.content)||void 0===t?void 0:t.trim()});Ep("Stored messages from our localStorage",{count:o.length,ids:o.map(e=>e.id.slice(-8))});const i=o.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));f(e),Ep("Session ID updated",{newSession:e.slice(-12)}),u(i),Ep("replaceMessages called",{count:i.length}),(e=>{setTimeout(()=>{const t=(e||document).querySelector(".rcb-chat-body-container");t&&t.querySelectorAll(".rcb-bot-message").forEach(e=>{var t;let n=e.innerHTML,r=!1;n.includes("](")&&(n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),r=!0),n.includes("&lt;a href=")&&(n=n.replace(/&lt;a\s+href=["']([^"']+)["'][^&]*&gt;([^&]+)&lt;\/a&gt;/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),(n.includes("&lt;a ")||(null===(t=e.textContent)||void 0===t?void 0:t.includes("<a href=")))&&(e.textContent||"").includes("<a href=")&&(n=n.replace(/&lt;a\s+href="([^"]+)"[^&]*&gt;([^&]+)&lt;\/a&gt;/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),r&&(e.innerHTML=n)})},50)})(null===(t=c.current)||void 0===t?void 0:t.getRootNode()),d(!1),Ep("Chat input enabled after restore"),n(!1)};return e.createElement("div",{style:{position:"relative"}},e.createElement("button",{ref:c,className:"history-button",onClick:()=>{if(!t&&(o((()=>{const e=Tp();return Object.entries(e).map(e=>{let[t,n]=e;return Object.assign({sessionId:t},n)}).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime())})()),c.current)){const e=c.current.closest(".rcb-chat-window");if(e){const t=e.getBoundingClientRect(),n=c.current.getBoundingClientRect();l(t.width+3),a(t.right-n.right-18+4)}}n(!t)},style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"18px",display:"flex",border:"none",cursor:"pointer",padding:0},"aria-label":"View chat history",title:"View chat history","aria-expanded":t,"aria-haspopup":"menu"},e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("circle",{cx:"12",cy:"12",r:"10"}),e.createElement("polyline",{points:"12 6 12 12 16 14"}))),t&&e.createElement("div",{ref:A,role:"menu",style:{position:"absolute",right:s?`-${s}px`:"-18px",top:"100%",marginTop:"8px",width:i?`${i}px`:"550px",backgroundColor:"white",borderRadius:0,borderBottom:"3px solid var(--primaryColor, #1a5b6e)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",maxHeight:"250px",overflowY:"auto",zIndex:1e3}},0===r.length?e.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):r.map(t=>e.createElement("button",{key:t.sessionId,role:"menuitem",onClick:()=>h(t.sessionId),style:{width:"100%",padding:"10px 14px",border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left",display:"flex",flexDirection:"column",gap:"2px",borderBottom:"1px solid #eee"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},e.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.preview||"New conversation"),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},(e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/864e5);return 0===r?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):1===r?"Yesterday":r<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})})(t.startedAt))))))},Fp=t=>{var{width:n=24,height:r=24,color:o="currentColor",children:i}=t,l=a(t,["width","height","color","children"]);return e.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},l),i)},Hp=t=>e.createElement(Fp,t,e.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),zp=()=>{const{restartFlow:t}=Ht(),{setTextAreaValue:n}=qt(),{getSessionId:r,resetSession:o,clearResettingFlag:i}=jp(),{trackEvent:l}=sp();return e.createElement("button",{onClick:async()=>{const e=r(),s=e?Mp(e):0;l({type:"chatbot_new_chat",previousMessageCount:s}),o(),await n(""),await t(),setTimeout(()=>{i()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},e.createElement(Hp,{width:16,height:16}),"New Chat")};function Up(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(Up).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return Up(t.children)}return""}const _p=()=>{const{getSessionId:t}=jp(),n=e.useCallback(e=>{var n;const r=null===(n=e.data)||void 0===n?void 0:n.message;if(!(null==r?void 0:r.id))return;const o=r.sender,i=r.type||"string";let l;if(l="string"==typeof r.content?r.content:Up(r.content),Cp("TRACKED",{id:r.id,sender:o,content:l.substring(0,50)+(l.length>50?"...":"")}),l.includes("rcb-options-container"))return;if(!l.trim())return;const s=t();Qp(s,r.id,l,o,i)},[t]);return e.useEffect(()=>(window.addEventListener("rcb-pre-inject-message",n),window.addEventListener("rcb-stop-stream-message",n),()=>{window.removeEventListener("rcb-pre-inject-message",n),window.removeEventListener("rcb-stop-stream-message",n)}),[n]),null},qp=()=>(e.useEffect(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let i=[];if(o.length>0){const e=o[o.length-1],t=Array.from(e.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);if(t.length>0){const e=t[t.length-1];i=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===i.length)return;const l=i.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=l<i.length-1?l+1:0,i[t].setAttribute("tabindex","0"),i.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),i[t].classList.add("keyboard-focused"),i[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=l>0?l-1:i.length-1,i[t].setAttribute("tabindex","0"),i.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),i[t].classList.add("keyboard-focused"),i[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&i.includes(document.activeElement)){const e=document.activeElement;if(e.classList.contains("rcb-checkbox-row-container")||e.closest(".rcb-checkbox-row-container")){const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.querySelector(".rcb-checkbox-label"),o=r?r.textContent:e.textContent||"checkbox",i=e.querySelector(".rcb-checkbox-mark"),l=i&&i.style.backgroundColor?"checked":"unchecked";t(`${o} ${l}`)}else{const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.textContent||e.innerText;t(`Selected: ${r}`)}}break;case"Home":e.preventDefault(),i.length>0&&(i[0].setAttribute("tabindex","0"),i.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),i[0].classList.add("keyboard-focused"),i[0].focus());break;case"End":if(e.preventDefault(),i.length>0){const e=i.length-1;i[e].setAttribute("tabindex","0"),i.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),i[e].classList.add("keyboard-focused"),i[e].focus()}}},t=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&document.body.removeChild(t)},1e3)},n=(e=null)=>{let n=e;if(n||(n=document.querySelector(".rcb-chat-window"),n||(n=document.querySelector('[class*="rcb-chat"]')),n||(n=document.querySelector(".qa-bot"))),!n)return;const r=null!==n.closest(".embedded-qa-bot"),o=Array.from(n.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(0===o.length)return;const i=o[o.length-1],l=Array.from(i.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let s=[];if(l.length>0){const e=l[l.length-1];s=Array.from(e.querySelectorAll(".rcb-options"))}if(0===s.length){let e=i.querySelector(".rcb-checkbox-container");if(!e&&n&&(e=n.querySelector(".rcb-checkbox-container")),e&&null!==e.offsetParent){const t=Array.from(e.querySelectorAll(".rcb-checkbox-row-container")).filter(e=>null!==e.offsetParent&&"none"!==e.style.display);if(t.length>0){const n=e.querySelector(".rcb-checkbox-next-button"),o=[...t];if(n&&null!==n.offsetParent&&o.push(n),o.forEach((e,t)=>{e.setAttribute("tabindex",0===t?"0":"-1"),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),t.length>1){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select/deselect, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}return void setTimeout(()=>{o[0]&&null!==o[0].offsetParent&&!r&&o[0].focus()},150)}}}if(s.length>0){if(s.forEach((e,t)=>{const n=0===t?"0":"-1";e.setAttribute("tabindex",n),e.setAttribute("role","option"),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",s.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),s.length>1){const e=l.length>0?l[l.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}}else{const e=l.length>0?l[l.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{s[0]&&null!==s[0].offsetParent&&!r&&(s[0].focus(),s.length>1&&t(`${s.length} options available. Use arrow keys to navigate.`))},200)}},r=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type){const t=Array.from(e.addedNodes),r=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-options-container")||e.classList?.contains("rcb-options")||e.querySelector?.(".rcb-options-container")||e.querySelector?.(".rcb-options"))),o=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-checkbox-container")||e.querySelector?.(".rcb-checkbox-container")));if(r||o){let t=e.target;for(;t&&!t.classList?.contains("qa-bot")&&!t.classList?.contains("rcb-chat-window");)t=t.parentElement;(t||document).querySelectorAll(".rcb-options[tabindex], .rcb-checkbox-row-container[tabindex], .rcb-checkbox-next-button[tabindex]").forEach(e=>{e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused")}),setTimeout(()=>n(t),100)}}})});r.observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("keydown",e),n();const o=setInterval(()=>{document.querySelectorAll(".qa-bot").forEach(e=>{const t=e.querySelectorAll(".rcb-options-container .rcb-options").length>0,r=e.querySelectorAll(".rcb-checkbox-row-container").length>0;if(t){const t=e.querySelectorAll(".rcb-options[tabindex]").length;e.querySelectorAll(".rcb-options").length>t&&n(e)}if(r){const t=e.querySelectorAll(".rcb-checkbox-row-container[tabindex]").length;e.querySelectorAll(".rcb-checkbox-row-container").length>t&&n(e)}})},1e3);return()=>{document.removeEventListener("keydown",e),r.disconnect(),clearInterval(o)}},[]),null);let Vp=!1,Gp=null;function Wp(){return Vp?Promise.resolve():Gp||(Gp=new Promise((e,t)=>{const n=document.createElement("script");n.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",n.async=!0,n.onload=()=>{Vp=!0,Pp("Script loaded"),e()},n.onerror=()=>{Gp=null,t(new Error("Failed to load Turnstile script"))},document.head.appendChild(n)}),Gp)}const Yp=e=>{if(!e||"string"!=typeof e)return e;let t=e.replace(/\[(https?:\/\/[^\s]+?)\]/gi,"[$1]($1)");return t=t.replace(/(?<!\]\(|href=["']|\[)https?:\/\/[^\s[\]()]+/gi,e=>{let t=e,n="";const r=t.match(/([.,;:!?]+)$/);return r&&(n=r[1],t=t.slice(0,-n.length)),`[${t}](${t})${n}`}),t},Kp=t=>{let{siteKey:n,onVerify:r,onError:i,loginUrl:l}=t;const s=e.useRef(null),a=e.useRef(null),A=e.useRef(!1),c=e.useRef(null),u=e.useRef(null),[d,f]=e.useState(!1),[p,h]=e.useState(0),g=e.useRef("widget_error"),m=e.useRef(null),v=l&&"/login"!==l,y=e.useCallback(()=>{const e=window.turnstile;if(c.current&&(null==e?void 0:e.remove)){try{e.remove(c.current)}catch(e){}c.current=null}},[]),w=e.useCallback(()=>{var e;y(),d?null==i||i(g.current,null!==(e=m.current)&&void 0!==e?e:void 0):null==i||i("user_cancelled")},[i,y,d]);e.useEffect(()=>()=>{y()},[y]),e.useEffect(()=>{var e;return u.current=document.activeElement,null===(e=a.current)||void 0===e||e.focus(),()=>{u.current&&"function"==typeof u.current.focus&&u.current.focus()}},[]),e.useEffect(()=>{const e=e=>{if("Escape"===e.key)return e.preventDefault(),void w();if("Tab"===e.key&&a.current){const t=a.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r||(e.preventDefault(),n.focus())}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w]),e.useEffect(()=>{A.current||!s.current||d||(A.current=!0,Wp().then(()=>{const e=window.turnstile;if(!e||!s.current)return Dp("Turnstile API not available after script load"),g.current="api_unavailable",void f(!0);c.current=e.render(s.current,{sitekey:n,callback:e=>{Pp("Visible challenge completed"),r(e)},"error-callback":e=>(Dp("Turnstile challenge failed:",e),m.current=e,g.current="widget_error",y(),f(!0),!0),"expired-callback":()=>{Dp("Turnstile token expired"),g.current="token_expired",y(),f(!0)}})}).catch(e=>{Dp("Failed to load Turnstile script:",e),g.current="script_load_failed",f(!0)}))},[n,r,d,y]);const b=e.createElement(e.Fragment,null,e.createElement("div",{"aria-hidden":"true",style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.5)",zIndex:999998}}),e.createElement("div",{ref:a,role:"dialog","aria-modal":"true","aria-labelledby":"qa-bot-turnstile-label",tabIndex:-1,style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:999999,background:"white",padding:"24px",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.3)",maxWidth:"90vw",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'}},e.createElement("span",{id:"qa-bot-turnstile-label",className:"sr-only",style:{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap"}},"Verification challenge"),d?e.createElement("div",{style:{fontSize:"14px",lineHeight:"1.5",color:"#333"}},0===p?e.createElement("p",{style:{margin:"0 0 16px 0"}},"Verification failed. You can try again",v&&e.createElement(e.Fragment,null,", or"," ",e.createElement("a",{href:l,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primaryColor, #107180)",fontWeight:"bold"}},"log in")," ","to skip verification"),"."):e.createElement(e.Fragment,null,e.createElement("p",{style:{margin:"0 0 8px 0"}},"Verification is still not working. This can be caused by browser extensions (ad blockers, privacy tools) or VPN connections."),e.createElement("p",{style:{margin:"0 0 16px 0"}},"Try disabling extensions, using a private/incognito window,",v&&e.createElement(e.Fragment,null," ",e.createElement("a",{href:l,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primaryColor, #107180)",fontWeight:"bold"}},"logging in"),",")," ","or using a different browser.")),e.createElement("div",{style:{display:"flex",gap:"8px"}},e.createElement("button",{type:"button",onClick:()=>{y(),A.current=!1,h(e=>e+1),f(!1)},style:{padding:"8px 16px",background:"var(--primaryColor, #107180)",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"14px"}},"Try again"),e.createElement("button",{type:"button",onClick:w,style:{padding:"8px 16px",background:"#f0f0f0",color:"#333",border:"1px solid #ccc",borderRadius:"4px",cursor:"pointer",fontSize:"14px"}},"Close"))):e.createElement(e.Fragment,null,e.createElement("div",{ref:s,style:{borderRadius:"8px",overflow:"hidden"}}),e.createElement("button",{type:"button",onClick:w,style:{marginTop:"16px",padding:"8px 16px",background:"#f0f0f0",color:"#333",border:"1px solid #ccc",borderRadius:"4px",cursor:"pointer",fontSize:"14px"}},"Cancel"))));return o.createPortal(b,document.body)};function Xp(e){const{confidence:t,tools_used:n,metadata:r}=e;if(!(t||n&&0!==n.length))return"";const o=[];return t&&o.push(`• Confidence: ${t}`),n&&n.length>0&&o.push(`• Tools used: ${n.join(", ")}`),(null==r?void 0:r.agent)&&o.push(`• Agent: ${r.agent}`),`---\n${o.join("\n")}`}function Jp(t){let{getState:n,onResubmit:r,trackEvent:o,loginUrl:i}=t;var l;const[s,a]=e.useState(null),[A,c]=e.useState(0),u=n(),d={},f="true"===d.VITE_FORCE_TURNSTILE_WIDGET,p=null!==(l=u.siteKey)&&void 0!==l?l:f?d.VITE_TURNSTILE_SITE_KEY:null;return p&&(f||s!==p)?e.createElement(Kp,{key:A,siteKey:p,loginUrl:i,onVerify:async e=>{const t=p;u.token=e,null==o||o({type:"chatbot_turnstile_completed"});"needs_another_challenge"===await r(e)?c(e=>e+1):a(t)},onError:(e,t)=>{var n;const r=null===(n=u.pendingQuery)||void 0===n?void 0:n.queryId,i=p;u.token=null,u.pendingQuery=null,u.needsChallenge=!1,u.siteKey=null,a(i),null==o||o({type:"chatbot_turnstile_error",queryId:r,failureReason:e,cloudflareErrorCode:t})}}):null}const Zp="#1a5b6e",$p="#107180",eh="Arial, sans-serif",th="Q&A Bot",nh="/chat-icon.svg",rh="Type your question here...",oh="Select an option to continue",ih=!1,lh="Ask me a question!",sh="/login",ah={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:5e3,showCharacterCount:!1,allowNewline:!0,blockSpam:!1},chatWindow:{defaultOpen:!1,showScrollbar:!1},botBubble:{simulateStream:!0,streamSpeed:10,showAvatar:!1},userBubble:{showAvatar:!1},notification:{disabled:!0,showCount:!1},audio:{disabled:!0},emoji:{disabled:!0},fileAttachment:{disabled:!0}},Ah=e.forwardRef((t,n)=>{var r,o,i;const{apiKey:l,qaEndpoint:s,ratingEndpoint:a,agentRatingEndpoint:c,welcomeMessage:u,open:d,onOpenChange:f,isLoggedIn:p,allowAnonAccess:h=!1,actingUser:g,primaryColor:m,secondaryColor:v,botName:y,logo:w,placeholder:b,errorMessage:x,embedded:k,footerText:E,footerLink:C,tooltipText:P,loginUrl:S,turnstileSiteKey:D,backendId:B,resourceContext:I,customFlow:T,onAnalyticsEvent:Q}=t,M=e.useRef(`bot_${Math.random().toString(36).substr(2,9)}`);e.useEffect(()=>{xp()},[]);const O=e.useRef(null);null===O.current&&(O.current=Ip(),kp("CREATED",O.current));const L=e.useRef(!1),R=e.useRef({getSessionId:()=>O.current,isResetting:()=>L.current}),j=e.useRef(null),N=function(t,n){const[r,o]=e.useState(null),[i,l]=e.useState("idle"),s=e.useRef(null),a=e.useRef(null),A=e.useRef(!0),c=e.useCallback(()=>{const e=window.turnstile;if(a.current&&(null==e?void 0:e.remove)){try{e.remove(a.current)}catch(e){}a.current=null}s.current&&(s.current.remove(),s.current=null)},[]);return e.useEffect(()=>{if(A.current=!0,!t)return l("idle"),void o(null);l("loading");const e=document.createElement("div");return e.style.position="fixed",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0",e.style.height="0",e.style.overflow="hidden",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),s.current=e,Wp().then(()=>{if(!A.current)return;const e=window.turnstile;if(!e||!s.current)return Dp("Turnstile API not available for silent verification"),l("failed"),void(null==n||n({type:"chatbot_turnstile_silent_failed",failureReason:"api_unavailable"}));const r=e.render(s.current,{sitekey:t,execution:"render","refresh-expired":"auto",callback:e=>{A.current&&(Pp("Silent verification succeeded"),o(e),l("verified"))},"error-callback":e=>!A.current||(Dp("Turnstile silent verification failed:",e),o(null),l("failed"),null==n||n({type:"chatbot_turnstile_silent_failed",failureReason:"widget_error",cloudflareErrorCode:e}),!0),"expired-callback":()=>{A.current&&(Pp("Token expired, awaiting refresh"),o(null),l("loading"))}});a.current=r}).catch(e=>{A.current&&(Dp("Failed to load Turnstile script for silent verification:",e),l("failed"),null==n||n({type:"chatbot_turnstile_silent_failed",failureReason:"script_load_failed"}))}),()=>{A.current=!1,c()}},[t,c]),{token:r,status:i,reset:e.useCallback(()=>{const e=window.turnstile;a.current&&(null==e?void 0:e.reset)&&(o(null),l("loading"),e.reset(a.current),Pp("Token consumed, resetting widget for fresh token"))},[])}}(D,e=>{var t;null===(t=j.current)||void 0===t||t.call(j,e)}),F=e.useRef(null);F.current=N.token;const[H,z]=e.useState(p);e.useEffect(()=>{z(p)},[p]);const U=void 0!==k?k:ih,_=e.useCallback(e=>{var t;Q&&Q(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(t=O.current)&&void 0!==t?t:void 0,pageUrl:"undefined"!=typeof window?window.location.href:void 0,isEmbedded:U}))},[Q,U]);e.useEffect(()=>{j.current=e=>_(e)},[_]);const q=e.useMemo(()=>{const t=Object.assign({},ah);t.general=Object.assign(Object.assign({},t.general),{primaryColor:m||Zp,secondaryColor:v||$p,fontFamily:eh,embedded:U});const n=!1===H?[e.createElement(Np,{key:"history-button"}),e.createElement(ap,{key:"login-button",loginUrl:S||sh,isHeaderButton:!0})]:[e.createElement(Np,{key:"history-button"}),e.createElement(Ap,{key:"user-icon"})];t.header={title:e.createElement("span",{style:{fontSize:14,fontWeight:500}},y||th),showAvatar:!0,avatar:w||nh,buttons:[...n,A.CLOSE_CHAT_BUTTON]},t.chatInput=Object.assign(Object.assign({},t.chatInput),{disabled:!1,enabledPlaceholderText:b||rh,disabledPlaceholderText:x||oh}),t.tooltip=Object.assign(Object.assign({},t.tooltip),{text:P||lh});const r=E?C?e.createElement("a",{href:C,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},E):e.createElement("span",{key:"footer-text"},E):null;return t.footer={text:null!=r?r:void 0,buttons:[e.createElement(zp,{key:"new-chat-button"})]},t.chatWindow=Object.assign(Object.assign({},t.chatWindow),{defaultOpen:!!U}),t.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbStopStreamMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},t},[m,v,y,w,b,x,U,P,H,S,E,C]),V=e.useRef(null),G=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.useMemo(()=>{const e=(e,n)=>{if(t.current){const n=getComputedStyle(t.current).getPropertyValue(e);if(n&&""!==n.trim())return n.trim();if(t.current.parentElement){const n=getComputedStyle(t.current.parentElement).getPropertyValue(e);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:e("--primaryColor",n.primaryColor),secondaryColor:e("--secondaryColor",n.secondaryColor),fontFamily:e("--fontFamily",n.fontFamily)}},[t,n]);return r}(V,q.general);((t,n)=>{e.useEffect(()=>{n.current&&(t?n.current.classList.add("bot-logged-in"):n.current.classList.remove("bot-logged-in"))},[t,n])})(!1!==H,V),(t=>{let{settings:n,themeColors:r}=t;e.useEffect(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty(`--${t}`,n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),e.useEffect(()=>{var t,r;(null===(t=n.header)||void 0===t?void 0:t.title)&&"string"==typeof n.header.title&&(n.header.title=e.createElement("div",{key:"header-title"},e.createElement("h1",{className:"sr-only"},n.header.title),e.createElement("span",{"aria-hidden":"true"},n.header.title))),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!0},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(r=n.header)||void 0===r?void 0:r.avatar}),n.event=Object.assign(Object.assign({},n.event),{rcbToggleChatWindow:!0})},[n])})({settings:q,themeColors:G});const W=e.useMemo(()=>{const t=(t=>{let{endpoint:n,ratingEndpoint:r,agentRatingEndpoint:o,apiKey:i,sessionId:l,isResetting:s=()=>!1,isLoggedIn:a,allowAnonAccess:A=!1,loginUrl:c="/login",trackEvent:u,getTurnstileToken:d,resetTurnstileToken:f,backendId:p,resourceContext:h}=t;if(!1===a&&!A)return null==u||u({type:"chatbot_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:e.createElement(ap,{loginUrl:c}),chatDisabled:!0,path:"qa_loop"}};let g=null,m=null,v=!1;const y={siteKey:null,token:null,pendingQuery:null,needsChallenge:!1};let w=null;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{var t;w=e.injectMessage.bind(e);const{userInput:a}=e;if((!s||!s())&&a&&""!==a.trim()){if("👍 Helpful"===a||"👎 Not helpful"===a){if(g){const e="👍 Helpful"===a,t="agent"===m?o:r;if(t)try{const n={"Content-Type":"application/json"};i&&(n["X-API-KEY"]=i);const r=l();r&&(n["X-Session-ID"]=r,n["X-Query-ID"]=g);const o="agent"===m?{query_id:g,rating:e?"helpful":"not_helpful",session_id:r}:{sessionId:r,queryId:g,rating:e?1:0};await fetch(t,{method:"POST",headers:n,credentials:"include",body:JSON.stringify(o)}),null==u||u({type:"chatbot_rating_sent",queryId:g,rating:e?"helpful":"not_helpful"})}catch(e){Dp("Error sending feedback:",e)}}return"Thanks for the feedback!"}try{const r=pp();g=r,null==u||u({type:"chatbot_question_sent",queryId:r,questionLength:a.length});const o={"Content-Type":"application/json"};i&&(o["X-API-KEY"]=i);const s=l();s&&(o["X-Session-ID"]=s,o["X-Query-ID"]=r),o["X-Origin"]=h||"access";const A={query:a,question_id:r};s&&(A.session_id=s),p&&(A._backend=p),h&&(A.rp_name=h,A.resource_context=h);const c=null==d?void 0:d();c&&(A.turnstile_token=c),kp("SENT to API",{session_id:s,question_id:r});const w=Date.now(),b=await fetch(n,{method:"POST",headers:o,credentials:"include",body:JSON.stringify(A)});if(!b.ok)throw new Error(`API returned ${b.status}`);if((b.headers.get("content-type")||"").includes("text/event-stream")){null==f||f();const n=null===(t=b.body)||void 0===t?void 0:t.getReader();if(!n)throw new Error("Response body is not readable");const o=new TextDecoder;let i="",l="",s=!1;try{for(;;){const{done:t,value:r}=await n.read();if(t)break;i+=o.decode(r,{stream:!0});let a=i.indexOf("\n\n");for(;-1!==a;){const t=i.slice(0,a);i=i.slice(a+2);let n,r="",o="";for(const e of t.split("\n"))e.startsWith("event: ")?r=e.slice(7):e.startsWith("data: ")&&(o=e.slice(6));if(r&&o){try{n=JSON.parse(o)}catch(e){Sp("Failed to parse SSE data:",o),a=i.indexOf("\n\n");continue}if("status"===r){const t=n.message||"Processing...";await e.streamMessage(`_${t}_`,"BOT"),s=!0}else if("token"===r){l+=n.content||"";const t=Yp(l);await e.streamMessage(t,"BOT")}else if("done"===r){const t=n.metadata||{};if(m=t.rating_target||null,v=!0===t.is_final_response,l)await e.endStreamMessage("BOT");else{const t=n.response||"";if(t){const n=Yp(t);await e.streamMessage(n,"BOT"),s=!0}s&&await e.endStreamMessage("BOT")}}else if("error"===r){const t=n.message||"An error occurred";Dp("SSE error event:",t),s?(await e.streamMessage(t,"BOT"),await e.endStreamMessage("BOT")):await e.injectMessage(t)}a=i.indexOf("\n\n")}else a=i.indexOf("\n\n")}}s&&await e.endStreamMessage("BOT")}catch(t){if(Dp("Error reading SSE stream:",t),!s)throw t;await e.streamMessage("I had trouble completing the response. Please try again.","BOT"),await e.endStreamMessage("BOT")}const a=Date.now()-w;return void(null==u||u({type:"chatbot_answer_received",queryId:r,responseTimeMs:a,success:!0,responseLength:l.length}))}const x=Date.now()-w,k=await b.json();if(k.requires_turnstile)return null==u||u({type:"chatbot_turnstile_shown",queryId:r}),y.siteKey=k.site_key,y.pendingQuery={query:a,sessionId:s,queryId:r},y.needsChallenge=!0,"One moment — verifying your session…";null==f||f();const E=k.response||k.answer||k.text||k.message;if(!E)throw new Error("Invalid response format from API");const C=k.metadata||{};m=C.rating_target||null,v=!0===C.is_final_response;const P=Yp(E),S=hp()?Xp(k):"",D=S?`${P}\n\n${S}`:P;return await e.injectMessage(D),void(null==u||u({type:"chatbot_answer_received",queryId:r,responseTimeMs:x,success:!0,responseLength:E.length,hasMetadata:!!S}))}catch(e){return Dp("Error in Q&A flow:",e),null==u||u({type:"chatbot_answer_error",queryId:null!=g?g:void 0,errorType:e instanceof Error?e.message:"unknown"}),"I apologize, but I'm having trouble processing your question. Please try again later."}}},options:e=>s&&s()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput||y.needsChallenge?[]:v&&m&&("agent"===m?o:r)?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,component:e.createElement(Jp,{getState:()=>y,onResubmit:async e=>{var t;if(!y.pendingQuery||!w)return Dp("Turnstile resubmit called without pending query or injectMessage"),"error";try{const r={"Content-Type":"application/json"};i&&(r["X-API-KEY"]=i),y.pendingQuery.sessionId&&(r["X-Session-ID"]=y.pendingQuery.sessionId,r["X-Query-ID"]=y.pendingQuery.queryId),r["X-Origin"]=h||"access";const o={query:y.pendingQuery.query,question_id:y.pendingQuery.queryId,turnstile_token:e};y.pendingQuery.sessionId&&(o.session_id=y.pendingQuery.sessionId),p&&(o._backend=p),h&&(o.rp_name=h,o.resource_context=h);const l=await fetch(n,{method:"POST",headers:r,credentials:"include",body:JSON.stringify(o)}),s=y.pendingQuery.queryId;if(!l.ok)throw new Error(`API returned ${l.status} after Turnstile`);if((l.headers.get("content-type")||"").includes("text/event-stream")){const e=null===(t=l.body)||void 0===t?void 0:t.getReader();if(!e)throw new Error("Response body is not readable");const n=new TextDecoder;let r="",o="",i={};for(;;){const{done:t,value:l}=await e.read();if(t)break;r+=n.decode(l,{stream:!0});let s=r.indexOf("\n\n");for(;-1!==s;){const e=r.slice(0,s);r=r.slice(s+2);let t="",n="";for(const r of e.split("\n"))r.startsWith("event: ")?t=r.slice(7):r.startsWith("data: ")&&(n=r.slice(6));if(t&&n)try{const e=JSON.parse(n);"token"===t?o+=e.content||"":"done"===t&&(i=e.metadata||{})}catch(e){}s=r.indexOf("\n\n")}}if(y.token=null,y.pendingQuery=null,y.needsChallenge=!1,y.siteKey=null,!o)throw new Error("No content received from stream");m=i.rating_target||null,v=!0===i.is_final_response,g=s;const a=Yp(o);return await w(a),null==u||u({type:"chatbot_answer_received",queryId:s,success:!0,responseLength:o.length}),"success"}const a=await l.json();if(a.requires_turnstile)return y.siteKey=a.site_key,y.token=null,await w("Still verifying — please complete the challenge again."),"needs_another_challenge";y.token=null,y.pendingQuery=null,y.needsChallenge=!1,y.siteKey=null;const A=a.response||a.answer||a.text||a.message;if(!A)throw new Error("Invalid response format from API");const c=a.metadata||{};m=c.rating_target||null,v=!0===c.is_final_response,g=s;const d=Yp(A),f=hp()?Xp(a):"",b=f?`${d}\n\n${f}`:d;return await w(b),null==u||u({type:"chatbot_answer_received",queryId:s,success:!0,responseLength:A.length}),"success"}catch(e){return Dp("Error resubmitting after Turnstile:",e),y.token=null,y.pendingQuery=null,y.needsChallenge=!1,y.siteKey=null,await(null==w?void 0:w("I had trouble processing your question after verification. Please try again.")),"error"}},trackEvent:u,loginUrl:c}),path:"qa_loop"}}})({endpoint:s,ratingEndpoint:a,agentRatingEndpoint:c,apiKey:l,sessionId:R.current.getSessionId,isResetting:R.current.isResetting,isLoggedIn:H,allowAnonAccess:h,loginUrl:S||sh,trackEvent:_,getTurnstileToken:()=>F.current,resetTurnstileToken:()=>N.reset(),backendId:B,resourceContext:I}),n={message:u,renderMarkdown:["BOT"],transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},t),T||{})},[l,s,a,c,u,H,h,S,T,g,_,I,B]),Y=e.useMemo(()=>{return[()=>bn(t),ns({markdownComponent:rp}),()=>is(e)];var e,t},[]);return e.useEffect(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),qp(),e.useEffect(()=>{const e=V.current;if(!e)return;const t=e=>{var t,n,r;const o=null===(n=(t=e.target).closest)||void 0===n?void 0:n.call(t,"a");o&&o.closest(".rcb-chat-body-container")&&(o.classList.contains("qa-bot-login-button")||o.closest(".rcb-options-container")||_({type:"chatbot_link_clicked",linkUrl:o.href,linkText:(null===(r=o.textContent)||void 0===r?void 0:r.trim())||""}))};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},[_]),e.useEffect(()=>{if(!U){const e=e=>{const t=e.data.newState;null==f||f(t);const n=O.current;_(t?{type:"chatbot_open"}:{type:"chatbot_close",messageCount:n?Mp(n):0,durationMs:n?Op(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[U,f,_]),e.createElement("div",{className:"qa-bot "+((null===(r=q.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:V,role:"region","aria-label":`${y||th}${(null===(o=q.general)||void 0===o?void 0:o.embedded)?" - Embedded":""}`},e.createElement(Rp,{getSessionId:()=>O.current,setSessionId:e=>{const t=O.current;O.current=e,kp("RESTORED",`${null==t?void 0:t.slice(-12)} -> ${e.slice(-12)}`)},resetSession:()=>{const e=O.current;L.current=!0,O.current=Ip(),kp("RESET",`${null==e?void 0:e.slice(-12)} -> ${O.current.slice(-12)}`)},clearResettingFlag:()=>{L.current=!1}},e.createElement(lp,{trackEvent:_},e.createElement(Ot,null,e.createElement("div",null,e.createElement(_p,null),e.createElement(op,{ref:n,embedded:(null===(i=q.general)||void 0===i?void 0:i.embedded)||!1,currentOpen:d||!1,enabled:!1!==H,onSetEnabled:e=>z(!!e&&void 0)}),e.createElement(Nt,{key:`chatbot-${M.current}-${H}`,settings:q,flow:W,plugins:Y}),e.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region",style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0}}),e.createElement("div",{id:"chat-input-help",className:"sr-only",style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0}},"Type your message and press Enter to send. Use arrow keys to navigate through response options."))))))});Ah.displayName="QABot";const ch=()=>{const[t,n]=e.useState(!1),r=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!r())throw new Error("Screen capture is not available in this environment");try{n(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),t=document.createElement("video");t.srcObject=e,await new Promise(e=>{t.onloadedmetadata=()=>{t.play(),e()}});const r=document.createElement("canvas");r.width=t.videoWidth,r.height=t.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(t,0,0,r.width,r.height);const i=await new Promise(e=>r.toBlob(e,"image/png"));if(!i)throw new Error("Could not create image blob");const l=(new Date).toISOString().replace(/[:.]/g,"-"),s=new File([i],`screenshot-${l}.png`,{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),n(!1),s}catch(e){throw Dp("Error capturing screenshot:",e),n(!1),e}},isCapturing:t,isScreenCaptureAvailable:r()}},uh=t=>e.createElement(Fp,t,e.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElement("polyline",{points:"17 8 12 3 7 8"}),e.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),dh=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error(`Failed to read file ${e.name}`));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error(`Failed to read file ${e.name}`)),r.readAsDataURL(e)}),fh=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`;const ph=e.forwardRef((t,n)=>{var{defaultOpen:r}=t,o=a(t,["defaultOpen"]);const[i,l]=e.useState(r||!1),A=e.useRef(null);return e.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;l(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;l(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;l(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),e.createElement(Ah,s({ref:A},o,{open:i,onOpenChange:l}))});function hh(n){if(!(n.target&&n.target instanceof HTMLElement))return void Dp("QA Bot: A valid target DOM element is required");const{target:r}=n,o=a(n,["target"]),i=t.createRoot(r),l={current:null};return i.render(e.createElement(e.StrictMode,null,e.createElement(ph,s({ref:e=>{l.current=e}},o)))),{addMessage:e=>{var t;return null===(t=l.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=l.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{l.current=null,i.unmount()}}}ph.displayName="ProgrammaticQABot",exports.FileUploadComponent=t=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:i=!1,className:l}=t;const[s,a]=e.useState(!1),[A,c]=e.useState([]),[u,d]=e.useState(null),f=e.useRef(null),{captureScreenshot:p,isCapturing:h,isScreenCaptureAvailable:g}=ch(),m=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},v=e=>{if(!e||0===e.length)return void Sp("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return Dp("FileUploadComponent: Error converting files to array:",e),void m("Error processing selected files. Please try again.")}const r=[...A,...t];c(r);const o=t.length,i=t.map(e=>e.name).join(", ");m(`${o} file${o>1?"s":""} selected: ${i}`),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},y=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?a(!0):"dragleave"===e.type&&a(!1)},w=()=>{try{f.current&&f.current.click()}catch(e){Dp("FileUploadComponent: Error in handleButtonClick:",e),m("Error opening file selection dialog. Please try again.")}},b=()=>{d(null)},x=i&&g;return e.createElement("div",{className:`file-upload-container ${l||""}`,style:{padding:"16px",margin:"8px 0"}},x&&e.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},e.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await p();v([e]),m("Screenshot captured successfully")}catch(e){m("Error capturing screenshot. Please try again.")}})()},disabled:h,"aria-describedby":"screenshot-help","aria-label":h?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:h?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),e.createElement("circle",{cx:"12",cy:"13",r:"4"})),h?"Taking screenshot...":"Take screenshot..."),e.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),e.createElement("div",{className:"file-upload-dropzone "+(s?"active":""),onDragEnter:y,onDragLeave:y,onDragOver:y,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),a(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&v(e.dataTransfer.files)}catch(e){Dp("FileUploadComponent: Error in handleDrop:",e),m("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:s?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},e.createElement("input",{ref:f,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&v(e.target.files)}catch(e){Dp("FileUploadComponent: Error in handleFileSelect:",e),m("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),e.createElement("div",{className:"upload-content",onClick:w,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},e.createElement(uh,null),e.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),e.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),A.length>0&&e.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},e.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),A.map((t,r)=>e.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:e=>{e.stopPropagation(),(e=>{d(e)})(t)}},e.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=A.filter((t,n)=>n!==e);c(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":`Remove ${t.name}`},"×"),t.name," (",fh(t.size),")"))))),(()=>{if(!u)return null;const t=u.type.startsWith("image/"),n=u.type.startsWith("text/"),r="application/pdf"===u.type;return e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:b},e.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{onClick:b,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),e.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},u.name),t&&e.createElement("img",{src:URL.createObjectURL(u),alt:u.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&e.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(u)),r&&e.createElement("iframe",{src:URL.createObjectURL(u),style:{width:"100%",height:"70vh",border:"none"},title:u.name}),!t&&!n&&!r&&e.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())},exports.QABot=Ah,exports.applyFlowSettings=function(e,t){if(!t||0===Object.keys(t).length)return e;const n={};for(const[r,o]of Object.entries(e)){let e=Object.assign({},o);if(t.disableOnOptions&&void 0===e.chatDisabled){const t=!(!e.options&&!e.checkboxes);e.chatDisabled=t}n[r]=e}return n},exports.default=hh,exports.fileToBase64=dh,exports.filesToBase64=e=>Promise.all(e.map(dh)),exports.formatFileSize=fh,exports.qaBot=hh,exports.useScreenshotCapture=ch,exports.validateFileSize=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t},exports.withHistory=function(e){return async t=>{await t.injectMessage(e)}},exports.withHistoryFn=function(e){return async t=>{const n=await e(t);await t.injectMessage(n)}};
8
+ */var rn,on;const ln=nn(function(){if(on)return rn;on=1;var e=/["'&<>]/;return rn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,i="",l=0,s=0;for(l=r.index;l<n.length;l++){switch(n.charCodeAt(l)){case 34:o="&quot;";break;case 38:o="&amp;";break;case 39:o="&#39;";break;case 60:o="&lt;";break;case 62:o="&gt;";break;default:continue}s!==l&&(i+=n.substring(s,l)),s=l+1,i+=o}return s!==l?i+n.substring(s,l):i}}());function sn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const an=/(url|image|image-set)\(/i;class An extends tn{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(an)&&delete t[e]}),t}}const cn=/^<(!doctype|(html|head|body)(\s|>))/i,un=/^(aria-|data-|\w+:)/iu,dn=/{{{(\w+)\/?}}}/;function fn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let pn=class{constructor(e,t={},n=[],r=[]){var o;if(sn(this,"allowed",void 0),sn(this,"banned",void 0),sn(this,"blocked",void 0),sn(this,"container",void 0),sn(this,"content",[]),sn(this,"props",void 0),sn(this,"matchers",void 0),sn(this,"filters",void 0),sn(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new An],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:Xt),this.banned=new Set(Kt),this.blocked=new Set(t.blockList)}applyAttributeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.attribute?n.attribute(e,t):t,t)}applyNodeFilters(e,t){return this.filters.reduce((t,n)=>null!==t&&"function"==typeof n.node?n.node(e,t):t,t)}applyMatchers(e,t){const n={},{props:r}=this;let o=e,i=0,l=null;return this.matchers.forEach(e=>{const s=e.asTag().toLowerCase(),a=this.getTagConfig(s);if(r[e.inverseName]||!this.isTagAllowed(s)||!this.canRenderChild(t,a))return;let A="";for(;o&&(l=e.match(o));){const{index:t,length:s,match:a,valid:c,void:u,...d}=l,f=e.propName+String(i);t>0&&(A+=o.slice(0,t)),c?(A+=u?`{{{${f}/}}}`:`{{{${f}}}}${a}{{{/${f}}}}`,this.keyIndex+=1,i+=1,n[f]={children:a,matcher:e,props:{...r,...d,key:this.keyIndex}}):A+=a,e.greedy?(o=A+o.slice(t+s),A=""):o=o.slice(t+(s||a.length))}e.greedy||(o=A+o)}),0===i?e:this.replaceTokens(o,n)}canRenderChild(e,t){return!(!e.tagName||!t.tagName||e.void)&&(e.children.length>0?e.children.includes(t.tagName):!(e.invalid.length>0&&e.invalid.includes(t.tagName))&&(t.parent.length>0?t.parent.includes(e.tagName):!(!e.self&&e.tagName===t.tagName)&&!!(e&&e.content&t.type)))}convertLineBreaks(e){const{noHtml:t,disableLineBreaks:n}=this.props;if(t||n||e.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return e;let r=e.replace(/\r\n/g,"\n");return r=r.replace(/\n{3,}/g,"\n\n\n"),r=r.replace(/\n/g,"<br/>"),r}createContainer(e){var t;const n=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||fn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(cn)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?ln(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:i,value:l}=o,s=i.toLowerCase(),a=Jt[s]||Jt[i];if(!this.isSafe(e)||!s.match(un)&&(!t&&(!a||2===a)||s.startsWith("on")||l.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let A="style"===s?this.extractStyleAttribute(e):l;4===a?A=!0:3===a?A=Number.parseFloat(String(A)):5!==a&&(A=String(A)),n[Zt[s]||s]=this.applyAttributeFilters(s,A),r+=1}),0!==r)?n:null}extractStyleAttribute(e){const t={};return Array.from(e.style).forEach(n=>{const r=e.style[n];("string"==typeof r||"number"==typeof r)&&(t[n.replace(/-([a-z])/g,(e,t)=>String(t).toUpperCase())]=r)}),t}getTagConfig(e){const t={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return Yt[e]?{...t,...Yt[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:i,transform:l,transformOnlyAllowList:s}=this.props;let a=[],A="";return[...t.childNodes].forEach(t=>{if(1===t.nodeType){const u=t.nodeName.toLowerCase(),d=this.getTagConfig(u);A&&(a.push(A),A="");const f=this.applyNodeFilters(u,t);if(!f)return;let p;if(l&&(!s||this.isTagAllowed(u))){this.keyIndex+=1;const t=this.keyIndex;p=this.parseNode(f,d);const n=l(f,p,d);if(null===n)return;if(typeof n<"u")return void a.push(e.cloneElement(n,{key:t}));this.keyIndex=t-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!i&&!this.canRenderChild(n,d))a=[...a,...this.parseNode(f,d.tagName?d:n)];else{var c;this.keyIndex+=1;const t=this.extractAttributes(f),n={tagName:u};t&&(n.attributes=t),d.void&&(n.selfClose=d.void),a.push(e.createElement(en,{...n,key:this.keyIndex},null!==(c=p)&&void 0!==c?c:this.parseNode(f,d)))}}else if(3===t.nodeType){const e=r&&!o?t.textContent:this.applyMatchers(t.textContent||"",n);Array.isArray(e)?a=[...a,...e]:A+=e}}),A&&a.push(A),a}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(dn);){const[e,i]=o,l=o.index,s=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[i])throw new Error(`Token "${i}" found but no matching element to replace with.`);l>0&&(n.push(r.slice(0,l)),r=r.slice(l));const{children:a,matcher:A,props:c}=t[i];let u;if(s)u=e.length,n.push(A.createElement(a,c));else{const o=r.match(new RegExp(`{{{/${i}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${i}".`);u=o.index+o[0].length,n.push(A.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function hn(t){var n;const{attributes:r,className:o,containerTagName:i,content:l,emptyContent:s,parsedContent:a,tagName:A,noWrap:c}=t,u=null!==(n=i??A)&&void 0!==n?n:"span",d="fragment"===u||c;let f;if(a)f=a;else{const e=new pn(l??"",t).parse();e.length>0&&(f=e)}return f||(f=s),d?e.createElement(e.Fragment,null,f):e.createElement(en,{attributes:r,className:o,tagName:u},f)}function gn(t){const{attributes:n,className:r,content:o="",disableFilters:i=!1,disableMatchers:l=!1,emptyContent:s=null,filters:a=[],matchers:A=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:f=!1,...p}=t,h=l?[]:A,g=i?[]:a,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const y=m.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new pn(y,p,h,g),b=v.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return e.createElement(hn,{attributes:n,className:r,containerTagName:t.containerTagName,emptyContent:s,noWrap:f,parsedContent:0===b.length?void 0:b,tagName:d})}const mn=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(gn,{content:"string"==typeof e?e:""})}),vn={autoConfig:!0},yn=(e,t,n)=>{var r;if(!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderHtml)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)},wn=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const i=e[o];"<"===i?r?(t.push(n),n=i):(r=!0,n=i):">"===i?(n+=i,t.push(n),n="",r=!1):r?n+=i:t.push(i)}return""!==n&&t.push(n),t},bn=t=>{const{getFlow:n}=Ht(),{messages:r,replaceMessages:o}=zt(),{settings:i}=_t(),{hasChatHistoryLoaded:l}=Vt(),s={...t,...vn},a=s.htmlComponent?s.htmlComponent:mn;e.useEffect(()=>{var e,t;if(l){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=i.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=a)}o(n)}},[l]);const A=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();"string"==typeof e.data.message.content&&yn(e,n(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=wn),e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};Ut(N.PRE_INJECT_MESSAGE,A),Ut(N.CHUNK_STREAM_MESSAGE,A),Ut(N.START_STREAM_MESSAGE,A),Ut(N.START_SIMULATE_STREAM_MESSAGE,A),Ut(N.START_SPEAK_AUDIO,async e=>{yn(e,n(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=s&&s.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const xn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,En={};function Cn(e,t){return(En.jsx?kn:xn).test(e)}const Pn=/[ \t\n\f\r]/g;function Sn(e){return""===e.replace(Pn,"")}class Dn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Bn(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Dn(n,r,t)}function In(e){return e.toLowerCase()}Dn.prototype.property={},Dn.prototype.normal={},Dn.prototype.space=null;class Tn{constructor(e,t){this.property=e,this.attribute=t}}Tn.prototype.space=null,Tn.prototype.boolean=!1,Tn.prototype.booleanish=!1,Tn.prototype.overloadedBoolean=!1,Tn.prototype.number=!1,Tn.prototype.commaSeparated=!1,Tn.prototype.spaceSeparated=!1,Tn.prototype.commaOrSpaceSeparated=!1,Tn.prototype.mustUseProperty=!1,Tn.prototype.defined=!1;let Qn=0;const Mn=Hn(),On=Hn(),Ln=Hn(),Rn=Hn(),jn=Hn(),Nn=Hn(),Fn=Hn();function Hn(){return 2**++Qn}const zn=Object.freeze(Object.defineProperty({__proto__:null,boolean:Mn,booleanish:On,commaOrSpaceSeparated:Fn,commaSeparated:Nn,number:Rn,overloadedBoolean:Ln,spaceSeparated:jn},Symbol.toStringTag,{value:"Module"})),Un=Object.keys(zn);class _n extends Tn{constructor(e,t,n,r){let o=-1;if(super(e,t),qn(this,"space",r),"number"==typeof n)for(;++o<Un.length;){const e=Un[o];qn(this,Un[o],(n&zn[e])===zn[e])}}}function qn(e,t,n){n&&(e[t]=n)}_n.prototype.defined=!0;const Vn={}.hasOwnProperty;function Gn(e){const t={},n={};let r;for(r in e.properties)if(Vn.call(e.properties,r)){const o=e.properties[r],i=new _n(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[In(r)]=r,n[In(i.attribute)]=r}return new Dn(t,n,e.space)}const Wn=Gn({space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Yn=Gn({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Kn(e,t){return t in e?e[t]:t}function Xn(e,t){return Kn(e,t.toLowerCase())}const Jn=Gn({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Xn,properties:{xmlns:null,xmlnsXLink:null}}),Zn=Gn({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:On,ariaAutoComplete:null,ariaBusy:On,ariaChecked:On,ariaColCount:Rn,ariaColIndex:Rn,ariaColSpan:Rn,ariaControls:jn,ariaCurrent:null,ariaDescribedBy:jn,ariaDetails:null,ariaDisabled:On,ariaDropEffect:jn,ariaErrorMessage:null,ariaExpanded:On,ariaFlowTo:jn,ariaGrabbed:On,ariaHasPopup:null,ariaHidden:On,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jn,ariaLevel:Rn,ariaLive:null,ariaModal:On,ariaMultiLine:On,ariaMultiSelectable:On,ariaOrientation:null,ariaOwns:jn,ariaPlaceholder:null,ariaPosInSet:Rn,ariaPressed:On,ariaReadOnly:On,ariaRelevant:null,ariaRequired:On,ariaRoleDescription:jn,ariaRowCount:Rn,ariaRowIndex:Rn,ariaRowSpan:Rn,ariaSelected:On,ariaSetSize:Rn,ariaSort:null,ariaValueMax:Rn,ariaValueMin:Rn,ariaValueNow:Rn,ariaValueText:null,role:null}}),$n=Gn({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Xn,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nn,acceptCharset:jn,accessKey:jn,action:null,allow:null,allowFullScreen:Mn,allowPaymentRequest:Mn,allowUserMedia:Mn,alt:null,as:null,async:Mn,autoCapitalize:null,autoComplete:jn,autoFocus:Mn,autoPlay:Mn,blocking:jn,capture:null,charSet:null,checked:Mn,cite:null,className:jn,cols:Rn,colSpan:null,content:null,contentEditable:On,controls:Mn,controlsList:jn,coords:Rn|Nn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Mn,defer:Mn,dir:null,dirName:null,disabled:Mn,download:Ln,draggable:On,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Mn,formTarget:null,headers:jn,height:Rn,hidden:Mn,high:Rn,href:null,hrefLang:null,htmlFor:jn,httpEquiv:jn,id:null,imageSizes:null,imageSrcSet:null,inert:Mn,inputMode:null,integrity:null,is:null,isMap:Mn,itemId:null,itemProp:jn,itemRef:jn,itemScope:Mn,itemType:jn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Mn,low:Rn,manifest:null,max:null,maxLength:Rn,media:null,method:null,min:null,minLength:Rn,multiple:Mn,muted:Mn,name:null,nonce:null,noModule:Mn,noValidate:Mn,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:Mn,optimum:Rn,pattern:null,ping:jn,placeholder:null,playsInline:Mn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Mn,referrerPolicy:null,rel:jn,required:Mn,reversed:Mn,rows:Rn,rowSpan:Rn,sandbox:jn,scope:null,scoped:Mn,seamless:Mn,selected:Mn,shadowRootClonable:Mn,shadowRootDelegatesFocus:Mn,shadowRootMode:null,shape:null,size:Rn,sizes:null,slot:null,span:Rn,spellCheck:On,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Rn,step:null,style:null,tabIndex:Rn,target:null,title:null,translate:null,type:null,typeMustMatch:Mn,useMap:null,value:On,width:Rn,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jn,axis:null,background:null,bgColor:null,border:Rn,borderColor:null,bottomMargin:Rn,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Mn,declare:Mn,event:null,face:null,frame:null,frameBorder:null,hSpace:Rn,leftMargin:Rn,link:null,longDesc:null,lowSrc:null,marginHeight:Rn,marginWidth:Rn,noResize:Mn,noHref:Mn,noShade:Mn,noWrap:Mn,object:null,profile:null,prompt:null,rev:null,rightMargin:Rn,rules:null,scheme:null,scrolling:On,standby:null,summary:null,text:null,topMargin:Rn,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Rn,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Mn,disableRemotePlayback:Mn,prefix:null,property:null,results:Rn,security:null,unselectable:null}}),er=Gn({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:Kn,properties:{about:Fn,accentHeight:Rn,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Rn,amplitude:Rn,arabicForm:null,ascent:Rn,attributeName:null,attributeType:null,azimuth:Rn,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Rn,by:null,calcMode:null,capHeight:Rn,className:jn,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:Rn,diffuseConstant:Rn,direction:null,display:null,dur:null,divisor:Rn,dominantBaseline:null,download:Mn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Rn,enableBackground:null,end:null,event:null,exponent:Rn,externalResourcesRequired:null,fill:null,fillOpacity:Rn,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:Nn,g2:Nn,glyphName:Nn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Rn,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Rn,horizOriginX:Rn,horizOriginY:Rn,id:null,ideographic:Rn,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Rn,k:Rn,k1:Rn,k2:Rn,k3:Rn,k4:Rn,kernelMatrix:Fn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Rn,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Rn,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:Rn,overlineThickness:Rn,paintOrder:null,panose1:null,path:null,pathLength:Rn,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Rn,pointsAtY:Rn,pointsAtZ:Rn,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Fn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Fn,rev:Fn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Fn,requiredFeatures:Fn,requiredFonts:Fn,requiredFormats:Fn,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:Rn,specularExponent:Rn,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Rn,strikethroughThickness:Rn,string:null,stroke:null,strokeDashArray:Fn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Rn,strokeOpacity:Rn,strokeWidth:null,style:null,surfaceScale:Rn,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Fn,tabIndex:Rn,tableValues:null,target:null,targetX:Rn,targetY:Rn,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Fn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Rn,underlineThickness:Rn,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Rn,values:null,vAlphabetic:Rn,vMathematical:Rn,vectorEffect:null,vHanging:Rn,vIdeographic:Rn,version:null,vertAdvY:Rn,vertOriginX:Rn,vertOriginY:Rn,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Rn,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),tr=/^data[-\w.:]+$/i,nr=/-[a-z]/g,rr=/[A-Z]/g;function or(e){return"-"+e.toLowerCase()}function ir(e){return e.charAt(1).toUpperCase()}const lr={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"},sr=Bn([Yn,Wn,Jn,Zn,$n],"html"),ar=Bn([Yn,Wn,Jn,Zn,er],"svg");function Ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cr,ur,dr,fr={};var pr=function(){if(dr)return fr;dr=1;var e=fr&&fr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fr,"__esModule",{value:!0}),fr.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),i="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;i?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(ur)return cr;ur=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,a="";function A(e){return e?e.replace(s,a):a}return cr=function(s,c){if("string"!=typeof s)throw new TypeError("First argument must be a string");if(!s)return[];c=c||{};var u=1,d=1;function f(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=s,!c.silent)throw t}function m(e){var t=e.exec(s);if(t){var n=t[0];return f(n),s=s.slice(n.length),t}}function v(){m(n)}function y(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=p();if("/"==s.charAt(0)&&"*"==s.charAt(1)){for(var t=2;a!=s.charAt(t)&&("*"!=s.charAt(t)||"/"!=s.charAt(t+1));)++t;if(t+=2,a===s.charAt(t-1))return g("End of comment missing");var n=s.slice(2,t-2);return d+=2,f(n),s=s.slice(t),d+=2,e({type:"comment",comment:n})}}function b(){var t=p(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var s=m(i),c=t({type:"declaration",property:A(n[0].replace(e,a)),value:s?A(s[0].replace(e,a)):a});return m(l),c}}return h.prototype.content=s,v(),function(){var e,t=[];for(y(t);e=b();)!1!==e&&(t.push(e),y(t));return t}()},cr}());return fr}();const hr=Ar(pr),gr=hr.default||hr,mr=yr("end"),vr=yr("start");function yr(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function wr(e){return e&&"object"==typeof e?"position"in e||"type"in e?xr(e.position):"start"in e||"end"in e?xr(e):"line"in e||"column"in e?br(e):"":""}function br(e){return kr(e&&e.line)+":"+kr(e&&e.column)}function xr(e){return br(e&&e.start)+"-"+br(e&&e.end)}function kr(e){return e&&"number"==typeof e?e:1}class Er extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=l?l.line:void 0,this.name=wr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Er.prototype.file="",Er.prototype.name="",Er.prototype.reason="",Er.prototype.message="",Er.prototype.stack="",Er.prototype.column=void 0,Er.prototype.line=void 0,Er.prototype.ancestors=void 0,Er.prototype.cause=void 0,Er.prototype.fatal=void 0,Er.prototype.place=void 0,Er.prototype.ruleId=void 0,Er.prototype.source=void 0;const Cr={}.hasOwnProperty,Pr=new Map,Sr=/[A-Z]/g,Dr=/-([a-z])/g,Br=new Set(["table","tbody","thead","tfoot","tr"]),Ir=new Set(["td","th"]),Tr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Qr(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const l=Array.isArray(o.children),s=vr(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const l=Array.isArray(o.children)?n:t;return i?l(r,o,i):l(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?ar:sr,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Mr(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Mr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const i=Nr(e,t.tagName,!1),l=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Cr.call(t.properties,o)){const i=jr(e,o,t.properties[o]);if(i){const[o,l]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof l&&Ir.has(t.tagName)?r=l:n[o]=l}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Rr(e,t);return Br.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&Sn(e.value):Sn(e)}(e)})),Or(e,l,i,t),Lr(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Fr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const i=null===t.name?e.Fragment:Nr(e,t.name,!0),l=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];t.type;const o=t.expression;o.type;const i=o.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Fr(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];t.type,i=e.evaluater.evaluateExpression(t.expression)}else Fr(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=Rr(e,t);return Or(e,l,i,t),Lr(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Lr(r,Rr(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function Or(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Lr(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Rr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Pr;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;l=e+"-"+t,o.set(e,t+1)}}const s=Mr(e,i,l);void 0!==s&&n.push(s)}return n}function jr(e,t,n){const r=function(e,t){const n=In(t);let r=t,o=Tn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&tr.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(nr,ir);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!nr.test(e)){let n=e.replace(rr,or);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=_n}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):function(e){return e.join(" ").trim()}(n)),"style"===r.property){let t="object"==typeof n?n:function(e,t){const n={};try{gr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Tr+"#cannot-parse-style-attribute",r}}return n;function r(e,t){let r=e;"--"!==r.slice(0,2)&&("-ms-"===r.slice(0,4)&&(r="ms-"+r.slice(4)),r=r.replace(Dr,zr)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Cr.call(e,n)&&(t[Hr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?lr[r.property]||r.property:r.attribute,n]}}function Nr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Cn(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:!(!o||"Literal"!==t.type),optional:!1}:t}r=n}else r=Cn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Cr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Fr(e)}function Fr(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Tr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Hr(e){let t=e.replace(Sr,Ur);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function zr(e,t){return t.toUpperCase()}function Ur(e){return"-"+e.toLowerCase()}const _r={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"]},qr={};function Vr(e,t,n){if(function(e){return!(!e||"object"!=typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Gr(e.children,t,n)}return Array.isArray(e)?Gr(e,t,n):""}function Gr(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Vr(e[o],t,n);return r.join("")}const Wr=document.createElement("i");function Yr(e){const t="&"+e+";";Wr.innerHTML=t;const n=Wr.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function Kr(e,t,n,r){const o=e.length;let i,l=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)i=r.slice(l,l+1e4),i.unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function Xr(e,t){return e.length>0?(Kr(e,e.length,0,t),e):t}const Jr={}.hasOwnProperty;function Zr(e){const t={};let n=-1;for(;++n<e.length;)$r(t,e[n]);return t}function $r(e,t){let n;for(n in t){const r=(Jr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){Jr.call(r,i)||(r[i]=[]);const e=o[i];eo(r[i],Array.isArray(e)?e:e?[e]:[])}}}function eo(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Kr(e,0,0,r)}function to(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function no(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ro=go(/[A-Za-z]/),oo=go(/[\dA-Za-z]/),io=go(/[#-'*+\--9=?A-Z^-~]/);function lo(e){return null!==e&&(e<32||127===e)}const so=go(/\d/),ao=go(/[\dA-Fa-f]/),Ao=go(/[!-/:-@[-`{-~]/);function co(e){return null!==e&&e<-2}function uo(e){return null!==e&&(e<0||32===e)}function fo(e){return-2===e||-1===e||32===e}const po=go(new RegExp("\\p{P}|\\p{S}","u")),ho=go(/\s/);function go(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function mo(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(37===i&&oo(e.charCodeAt(n+1))&&oo(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(l=String.fromCharCode(i,t),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function vo(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){return fo(r)?(e.enter(n),l(r)):t(r)};function l(r){return fo(r)&&i++<o?(e.consume(r),l):(e.exit(n),t(r))}}const yo={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),vo(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):co(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const wo={tokenize:function(e){const t=this,n=[];let r,o,i,l=0;return s;function s(r){if(l<n.length){const o=n[l];return t.containerState=o[1],e.attempt(o[0].continuation,a,A)(r)}return A(r)}function a(e){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}m(l);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Kr(t.events,i+1,0,t.events.slice(n)),t.events.length=s,A(e)}return s(e)}function A(o){if(l===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return p(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bo,c,u)(o)}function c(e){return r&&v(),m(l),d(e)}function u(e){return t.parser.lazy[t.now().line]=l!==n.length,i=t.now().offset,p(e)}function d(n){return t.containerState={},e.attempt(bo,f,p)(n)}function f(e){return l++,n.push([t.currentConstruct,t.containerState]),d(e)}function p(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):co(n)?(e.consume(n),g(e.exit("chunkFlow")),l=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){if(o){s=t.events[a][1].end;break}o=!0}for(m(l),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;Kr(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},bo={tokenize:function(e,t,n){return vo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function xo(e){return null===e||uo(e)||ho(e)?1:po(e)?2:void 0}function ko(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Eo={name:"attention",resolveAll:function(e,t){let n,r,o,i,l,s,a,A,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};Co(u,-s),Co(d,s),i={type:s>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[c][1].start={...l.end},a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=Xr(a,[["enter",e[n][1],t],["exit",e[n][1],t]])),a=Xr(a,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),a=Xr(a,ko(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),a=Xr(a,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(A=2,a=Xr(a,[["enter",e[c][1],t],["exit",e[c][1],t]])):A=0,Kr(e,n-1,c-n+3,a),c=n+a.length-A-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=xo(r);let i;return function(t){return i=t,e.enter("attentionSequence"),l(t)};function l(s){if(s===i)return e.consume(s),l;const a=e.exit("attentionSequence"),A=xo(s),c=!A||2===A&&o||n.includes(s),u=!o||2===o&&A||n.includes(r);return a._open=!!(42===i?c:c&&(o||!u)),a._close=!!(42===i?u:u&&(A||!c)),t(s)}}};function Co(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Po={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return ro(t)?(e.consume(t),i):64===t?n(t):a(t)}function i(e){return 43===e||45===e||46===e||oo(e)?(r=1,l(e)):a(e)}function l(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||oo(t))&&r++<32?(e.consume(t),l):(r=0,a(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||lo(r)?n(r):(e.consume(r),s)}function a(t){return 64===t?(e.consume(t),A):io(t)?(e.consume(t),a):n(t)}function A(e){return oo(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,A):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||oo(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const So={partial:!0,tokenize:function(e,t,n){return function(t){return fo(t)?vo(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||co(e)?t(e):n(e)}}};const Do={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return fo(t)?vo(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(Do,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return fo(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Bo={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return Ao(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const Io={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),o=31,i=oo,A(t))}function a(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=ao,A):(e.enter("characterReferenceValue"),o=7,i=so,A(t))}function A(s){if(59===s&&l){const o=e.exit("characterReferenceValue");return i!==oo||Yr(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&l++<o?(e.consume(s),A):n(s)}}};const To={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},Qo={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return l;function l(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a}function a(t){return e.enter("codeFencedFence"),fo(t)?vo(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),fo(t)?vo(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||co(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,l=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return l=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}(t)};function a(t){return t===i?(s++,e.consume(t),a):s<3?n(t):(e.exit("codeFencedFenceSequence"),fo(t)?vo(e,A,"whitespace")(t):A(t))}function A(n){return null===n||co(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(To,f,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||co(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),A(t)):fo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),vo(e,u,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),c)}function u(t){return null===t||co(t)?A(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||co(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),A(t)):96===t&&t===i?n(t):(e.consume(t),d)}function f(t){return e.attempt(o,v,p)(t)}function p(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return l>0&&fo(t)?vo(e,g,"linePrefix",l+1)(t):g(t)}function g(t){return null===t||co(t)?e.check(To,f,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||co(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Mo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),vo(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):co(t)?e.attempt(Oo,i,s)(t):(e.enter("codeFlowValue"),l(t))}function l(t){return null===t||co(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),l)}function s(n){return e.exit("codeIndented"),t(n)}}},Oo={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):vo(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):co(e)?o(e):n(e)}}};const Lo={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}for(t=o-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),l(t)};function l(t){return 96===t?(e.consume(t),i++,l):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,A(t)):co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),a(t))}function a(t){return null===t||32===t||96===t||co(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),a)}function A(n){return 96===n?(e.consume(n),r++,A):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",a(n))}}};class Ro{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&jo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),jo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);jo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);jo(this.left,t.reverse())}}}function jo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function No(e){const t={};let n,r,o,i,l,s,a,A=-1;const c=new Ro(e);for(;++A<c.length;){for(;A in t;)A=t[A];if(n=c.get(A),A&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(A-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Fo(c,A)),A=t[A],a=!0);else if(n[1]._container){for(o=A,r=void 0;o--;)if(i=c.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type)break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,A),l.unshift(n),c.splice(r,A-r+1,l))}}return Kr(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!a}function Fo(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[],l=n._tokenizer||r.parser[n.contentType](n.start),s=l.events,a=[],A={};let c,u,d=-1,f=n,p=0,h=0;const g=[h];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),u&&l.defineSkip(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++d<s.length;)"exit"===s[d][0]&&"enter"===s[d-1][0]&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(h=d+1,g.push(h),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const t=s.slice(g[d],g[d+1]),n=i.pop();a.push([n,n+t.length-1]),e.splice(n,2,t)}for(a.reverse(),d=-1;++d<a.length;)A[p+a[d][0]]=p+a[d][1],p+=a[d][1]-a[d][0]-1;return A}const Ho={resolve:function(e){return No(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):co(t)?e.check(zo,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},zo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),vo(e,o,"linePrefix")};function o(o){if(null===o||co(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Uo(e,t,n,r,o,i,l,s,a){const A=a||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),u):null===t||32===t||41===t||lo(t)?n(t):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t))};function u(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),u(t)):null===t||60===t||co(t)?n(t):(e.consume(t),92===t?f:d)}function f(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function p(o){return c||null!==o&&41!==o&&!uo(o)?c<A&&40===o?(e.consume(o),c++,p):41===o?(e.consume(o),c--,p):null===o||32===o||40===o||lo(o)?n(o):(e.consume(o),92===o?h:p):(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function _o(e,t,n,r,o,i){const l=this;let s,a=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),A};function A(u){return a>999||null===u||91===u||93===u&&!s||94===u&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(u):93===u?(e.exit(i),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):co(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),A):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||co(t)||a++>999?(e.exit("chunkString"),A(t)):(e.consume(t),s||(s=!fo(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}}function qo(e,t,n,r,o,i){let l;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),l=40===t?41:t,s):n(t)};function s(n){return n===l?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),a(n))}function a(t){return t===l?(e.exit(i),s(l)):null===t?n(t):co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),vo(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),A(t))}function A(t){return t===l||null===t||co(t)?(e.exit("chunkString"),a(t)):(e.consume(t),92===t?c:A)}function c(t){return t===l||92===t?(e.consume(t),A):A(t)}}function Vo(e,t){let n;return function r(o){return co(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):fo(o)?vo(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Go={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return _o.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=no(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return uo(t)?Vo(e,s)(t):s(t)}function s(t){return Uo(e,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function a(t){return e.attempt(Wo,A,A)(t)}function A(t){return fo(t)?vo(e,c,"whitespace")(t):c(t)}function c(i){return null===i||co(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},Wo={partial:!0,tokenize:function(e,t,n){return function(t){return uo(t)?Vo(e,r)(t):n(t)};function r(t){return qo(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return fo(t)?vo(e,i,"whitespace")(t):i(t)}function i(e){return null===e||co(e)?t(e):n(e)}}};const Yo={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return co(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Ko={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;return"whitespace"===e[i][1].type&&(i+=2),o-2>i&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4),o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},Kr(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||uo(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),l(n)):null===n||co(n)?(e.exit("atxHeading"),t(n)):fo(n)?vo(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function l(t){return 35===t?(e.consume(t),l):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||uo(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const Xo=["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"],Jo=["pre","script","style","textarea"],Zo={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){const r=this;let o,i,l,s,a;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),A}(t)};function A(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,f):63===s?(e.consume(s),o=3,r.interrupt?t:O):ro(s)?(e.consume(s),l=String.fromCharCode(s),p):n(s)}function c(i){return 45===i?(e.consume(i),o=2,u):91===i?(e.consume(i),o=5,s=0,d):ro(i)?(e.consume(i),o=4,r.interrupt?t:O):n(i)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:P:d):n(o)}function f(t){return ro(t)?(e.consume(t),l=String.fromCharCode(t),p):n(t)}function p(s){if(null===s||47===s||62===s||uo(s)){const a=47===s,A=l.toLowerCase();return a||i||!Jo.includes(A)?Xo.includes(l.toLowerCase())?(o=6,a?(e.consume(s),h):r.interrupt?t(s):P(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):m(s)):(o=1,r.interrupt?t(s):P(s))}return 45===s||oo(s)?(e.consume(s),l+=String.fromCharCode(s),p):n(s)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:P):n(o)}function g(t){return fo(t)?(e.consume(t),g):E(t)}function m(t){return 47===t?(e.consume(t),E):58===t||95===t||ro(t)?(e.consume(t),v):fo(t)?(e.consume(t),m):E(t)}function v(t){return 45===t||46===t||58===t||95===t||oo(t)?(e.consume(t),v):y(t)}function y(t){return 61===t?(e.consume(t),w):fo(t)?(e.consume(t),y):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,b):fo(t)?(e.consume(t),w):x(t)}function b(t){return t===a?(e.consume(t),a=null,k):null===t||co(t)?n(t):(e.consume(t),b)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||uo(t)?y(t):(e.consume(t),x)}function k(e){return 47===e||62===e||fo(e)?m(e):n(e)}function E(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||co(t)?P(t):fo(t)?(e.consume(t),C):n(t)}function P(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!co(t)||6!==o&&7!==o?null===t||co(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),P):(e.exit("htmlFlowData"),e.check($o,R,S)(t))}function S(t){return e.check(ei,D,R)(t)}function D(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),B}function B(t){return null===t||co(t)?S(t):(e.enter("htmlFlowData"),P(t))}function I(t){return 45===t?(e.consume(t),O):P(t)}function T(t){return 47===t?(e.consume(t),l="",Q):P(t)}function Q(t){if(62===t){const n=l.toLowerCase();return Jo.includes(n)?(e.consume(t),L):P(t)}return ro(t)&&l.length<8?(e.consume(t),l+=String.fromCharCode(t),Q):P(t)}function M(t){return 93===t?(e.consume(t),O):P(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):P(t)}function L(t){return null===t||co(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),L)}function R(n){return e.exit("htmlFlow"),t(n)}}},$o={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(So,t,n)}}},ei={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return co(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const ti={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,l;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),a):47===t?(e.consume(t),w):63===t?(e.consume(t),v):ro(t)?(e.consume(t),k):n(t)}function a(t){return 45===t?(e.consume(t),A):91===t?(e.consume(t),i=0,f):ro(t)?(e.consume(t),m):n(t)}function A(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):co(t)?(l=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?p:f):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),h):co(t)?(l=p,Q(t)):(e.consume(t),p)}function h(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):p(t)}function m(t){return null===t||62===t?T(t):co(t)?(l=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):co(t)?(l=v,Q(t)):(e.consume(t),v)}function y(e){return 62===e?T(e):v(e)}function w(t){return ro(t)?(e.consume(t),b):n(t)}function b(t){return 45===t||oo(t)?(e.consume(t),b):x(t)}function x(t){return co(t)?(l=x,Q(t)):fo(t)?(e.consume(t),x):T(t)}function k(t){return 45===t||oo(t)?(e.consume(t),k):47===t||62===t||uo(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),T):58===t||95===t||ro(t)?(e.consume(t),C):co(t)?(l=E,Q(t)):fo(t)?(e.consume(t),E):T(t)}function C(t){return 45===t||46===t||58===t||95===t||oo(t)?(e.consume(t),C):P(t)}function P(t){return 61===t?(e.consume(t),S):co(t)?(l=P,Q(t)):fo(t)?(e.consume(t),P):E(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,D):co(t)?(l=S,Q(t)):fo(t)?(e.consume(t),S):(e.consume(t),B)}function D(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):co(t)?(l=D,Q(t)):(e.consume(t),D)}function B(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||uo(t)?E(t):(e.consume(t),B)}function I(e){return 47===e||62===e||uo(e)?E(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return fo(t)?vo(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),l(t)}}};const ni={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&Kr(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,i,l=e.length,s=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=l);const a={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},A={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",a,t],["enter",A,t]],i=Xr(i,e.slice(r+1,r+s+3)),i=Xr(i,[["enter",c,t]]),i=Xr(i,ko(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=Xr(i,[["exit",c,t],e[o-2],e[o-1],["exit",A,t]]),i=Xr(i,e.slice(o+1)),i=Xr(i,[["exit",a,t]]),Kr(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,l=r.events.length;for(;l--;)if(("labelImage"===r.events[l][1].type||"labelLink"===r.events[l][1].type)&&!r.events[l][1]._balanced){o=r.events[l][1];break}return function(t){return o?o._inactive?c(t):(i=r.parser.defined.includes(no(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):n(t)};function s(t){return 40===t?e.attempt(ri,A,i?A:c)(t):91===t?e.attempt(oi,A,i?a:c)(t):i?A(t):c(t)}function a(t){return e.attempt(ii,A,c)(t)}function A(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},ri={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return uo(t)?Vo(e,o)(t):o(t)}function o(t){return 41===t?A(t):Uo(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return uo(t)?Vo(e,s)(t):A(t)}function l(e){return n(e)}function s(t){return 34===t||39===t||40===t?qo(e,a,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):A(t)}function a(t){return uo(t)?Vo(e,A)(t):A(t)}function A(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},oi={tokenize:function(e,t,n){const r=this;return function(t){return _o.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(no(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},ii={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const li={name:"labelStartImage",resolveAll:ni.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const si={name:"labelStartLink",resolveAll:ni.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const ai={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),vo(e,t,"linePrefix")}}};const Ai={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),l(i)):o>=3&&(null===i||co(i))?(e.exit("thematicBreak"),t(i)):n(i)}function l(t){return t===r?(e.consume(t),o++,l):(e.exit("thematicBreakSequence"),fo(t)?vo(e,i,"whitespace")(t):i(t))}}};const ci={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(So,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,vo(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!fo(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(di,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,vo(e,e.attempt(ci,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,l=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:so(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(Ai,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return so(t)&&++l<10?(e.consume(t),s):(!r.interrupt||l<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),a(t)):n(t)}function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(So,r.interrupt?n:A,e.attempt(ui,u,c))}function A(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return fo(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},ui={partial:!0,tokenize:function(e,t,n){const r=this;return vo(e,function(e){const o=r.events[r.events.length-1];return!fo(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},di={partial:!0,tokenize:function(e,t,n){const r=this;return vo(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const fi={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),!o&&"definition"===e[i][1].type&&(o=i);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",l,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=l,e.push(["exit",l,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let l,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){l="paragraph"===r.events[s][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!l?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t))};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),fo(t)?vo(e,l,"lineSuffix")(t):l(t))}function l(r){return null===r||co(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const pi={tokenize:function(e){const t=this,n=e.attempt(So,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,vo(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ho,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const hi={resolveAll:yi()},gi=vi("string"),mi=vi("text");function vi(e){return{resolveAll:yi("text"===e?wi:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,l);return i;function i(e){return a(e)?o(e):l(e)}function l(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return a(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function a(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function yi(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):(!t[o]||"data"!==t[o][1].type)&&(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function wi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,l=o.length,s=-1,a=0;for(;l--;){const e=o[l];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)a++,s--;if(s)break;s=-1}else if(-2===e)i=!0,a++;else if(-1!==e){l++;break}}if(a){const o={type:n===e.length||i||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const bi={42:ci,43:ci,45:ci,48:ci,49:ci,50:ci,51:ci,52:ci,53:ci,54:ci,55:ci,56:ci,57:ci,62:Do},xi={91:Go},ki={[-2]:Mo,[-1]:Mo,32:Mo},Ei={35:Ko,42:Ai,45:[fi,Ai],60:Zo,61:fi,95:Ai,96:Qo,126:Qo},Ci={38:Io,92:Bo},Pi={[-5]:ai,[-4]:ai,[-3]:ai,33:li,38:Io,42:Eo,60:[Po,ti],91:si,92:[Yo,Bo],93:ni,95:Eo,96:Lo},Si={null:[Eo,hi]},Di=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:xi,disable:{null:[]},document:bi,flow:Ei,flowInitial:ki,insideSpan:Si,string:Ci,text:Pi},Symbol.toStringTag,{value:"Module"}));function Bi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let l=[],s=[];const a={attempt:h(function(e,t){g(e,t.from)}),check:h(p),consume:function(e){co(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,m()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),A.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),A.events.push(["enter",n,A]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=d(),A.events.push(["exit",t,A]),t},interrupt:h(p,{interrupt:!0})},A={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,m()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let l;if("string"==typeof i)l=i;else switch(i){case-5:l="\r";break;case-4:l="\n";break;case-3:l="\r\n";break;case-2:l=t?" ":"\t";break;case-1:if(!t&&o)continue;l=" ";break;default:l=String.fromCharCode(i)}o=-2===i,r.push(l)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){return l=Xr(l,e),function(){let e;for(;r._index<l.length;){const t=l[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)f(t.charCodeAt(r._bufferIndex));else f(t)}}(),null!==l[l.length-1]?[]:(g(t,0),A.events=ko(i,A.events,A),A.events)}};let c=t.tokenize.call(A,a);return t.resolveAll&&i.push(t),A;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,i)];else{if(l=e.slice(n,o),r>-1){const e=l[0];"string"==typeof e?l[0]=e.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}(l,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function f(e){c=c(e)}function p(e,t){t.restore()}function h(e,t){return function(n,o,i){let l,c,u,f;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return p([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function p(e){return l=e,c=0,0===e.length?i:h(e[c])}function h(e){return function(n){return f=function(){const e=d(),t=A.previous,n=A.currentConstruct,o=A.events.length,i=Array.from(s);return{from:o,restore:l};function l(){r=e,A.previous=t,A.currentConstruct=n,A.events.length=o,s=i,m()}}(),u=e,e.partial||(A.currentConstruct=e),e.name&&A.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(A),t):A,a,g,v)(n)}}function g(t){return e(u,f),o}function v(e){return f.restore(),++c<l.length?h(l[c]):i}}}function g(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&Kr(A.events,t,A.events.length-t,e.resolve(A.events.slice(t),A)),e.resolveTo&&(A.events=e.resolveTo(A.events,A))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const Ii=/[\0\t\n\r]/g;const Ti=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Qi(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return to(n.slice(t?2:1),t?16:10)}return Yr(n)||e}const Mi={}.hasOwnProperty;function Oi(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(J),blockQuote:i(G),characterEscape:C,characterReference:C,codeFenced:i(W),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(W,l),codeText:i(Y,l),codeTextData:C,data:C,codeFlowValue:C,definition:i(K),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(X),hardBreakEscape:i(Z),hardBreakTrailing:i(Z),htmlFlow:i($,l),htmlFlowData:C,htmlText:i($,l),htmlTextData:C,image:i(ee),label:l,link:i(te),listItem:i(re),listItemValue:d,listOrdered:i(ne,u),listUnordered:i(ne),paragraph:i(oe),reference:F,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(J),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:a(),atxHeadingSequence:b,autolink:a(),autolinkEmail:V,autolinkProtocol:q,blockQuote:a(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:U,characterReference:_,codeFenced:a(g),codeFencedFence:h,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:P,codeIndented:a(m),codeText:a(T),codeTextData:P,data:P,definition:a(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:y,emphasis:a(),hardBreakEscape:a(D),hardBreakTrailing:a(D),htmlFlow:a(B),htmlFlowData:P,htmlText:a(I),htmlTextData:P,image:a(M),label:L,labelText:O,lineEnding:S,link:a(Q),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:H,resourceDestinationString:R,resourceTitleString:j,resource:N,setextHeading:a(E),setextHeadingLineSequence:k,setextHeadingText:x,strong:a(),thematicBreak:a()}};Ri(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:A,buffer:l,resume:c,data:n},a=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])a.push(u);else{u=o(e,a.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];Mi.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},i),e[u][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Ni).call(i,void 0,e[0])}for(r.position={start:Li(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Li(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,i,l,s=t-1,a=-1,A=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?a++:a--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!l&&!a&&!i&&(i=s),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!a&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===a&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=s;for(o=void 0;l--;){const t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",A=!0),t[1].type="lineEnding",o=l}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,l=!0}}}return e[t][1]._spread=A,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Li(t.start),end:void 0}}function a(e){return t;function t(t){e&&e.call(this,t),A.call(this,t)}}function A(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+wr({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ni).call(this,e,r[0])),n.position.end=Li(e.end)}function c(){return function(e){return Vr(e,"boolean"!=typeof qr.includeImageAlt||qr.includeImageAlt,"boolean"!=typeof qr.includeHtml||qr.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function p(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=no(this.sliceSerialize(e)).toLowerCase()}function y(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function b(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function k(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=le(),n.position={start:Li(e.start),end:void 0},t.push(n)),this.stack.push(n)}function P(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Li(e.end)}function S(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=Li(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),P.call(this,e))}function D(){this.data.atHardBreak=!0}function B(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Ti,Qi)}(t),n.identifier=no(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function R(){const e=this.resume();this.stack[this.stack.length-1].url=e}function j(){const e=this.resume();this.stack[this.stack.length-1].title=e}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function H(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=no(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function z(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=to(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Yr(t);this.stack[this.stack.length-1].value+=r}function _(e){this.stack.pop().position.end=Li(e.end)}function q(e){P.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function V(e){P.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function K(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function X(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function le(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!No(e););return e}(function(e){const t={constructs:Zr([Di,...(e||{}).extensions||[]]),content:n(yo),defined:[],document:n(wo),flow:n(pi),lazy:{},string:n(gi),text:n(mi)};return t;function n(e){return function(n){return Bi(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,l){const s=[];let a,A,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(Ii.lastIndex=c,a=Ii.exec(o),u=a&&void 0!==a.index?a.index:o.length,d=o.charCodeAt(u),!a){n=o.slice(c);break}if(10===d&&c===u&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),c<u&&(s.push(o.slice(c,u)),t+=u-c),d){case 0:s.push(65533),t++;break;case 9:for(A=4*Math.ceil(t/4),s.push(-2);t++<A;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return l&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function Li(e){return{line:e.line,column:e.column,offset:e.offset}}function Ri(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ri(e,r):ji(e,r)}}function ji(e,t){let n;for(n in t)if(Mi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ni(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wr({start:t.start,end:t.end})+") is still open")}function Fi(e){const t=this;t.parser=function(n){return Oi(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Hi(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&"text"===l.type?l.value+=r:o.push({type:"text",value:r}),o}function zi(e){return e.spread??e.children.length>1}function Ui(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(_i(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(_i(t.slice(o),o>0,!1)),i.join("")}function _i(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const qi={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=mo(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,s+=1,e.footnoteCounts.set(r,s);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const A={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,A),e.applyData(t,A)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hi(e,t);const o={src:mo(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:mo(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hi(e,t);const o={href:mo(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:mo(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=zi(n[r])}return t}(n):zi(t),i={},l=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?l.push(e):l.push(...e.children)}const a=r[r.length-1];a&&(o||"element"!==a.type||"p"!==a.tagName)&&l.push({type:"text",value:"\n"});const A={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,A),e.applyData(t,A)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=vr(t.children[1]),l=mr(t.children[t.children.length-1]);i&&l&&(r.position={start:i,end:l}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,l=i?i.length:t.children.length;let s=-1;const a=[];for(;++s<l;){const n=t.children[s],r={},l=i?i[s]:void 0;l&&(r.align=l);let A={type:"element",tagName:o,properties:r,children:[]};n&&(A.children=e.all(n),e.patch(n,A),A=e.applyData(n,A)),a.push(A)}const A={type:"element",tagName:"tr",properties:{},children:e.wrap(a,!0)};return e.patch(t,A),e.applyData(t,A)},text:function(e,t){const n={type:"text",value:Ui(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Vi,yaml:Vi,definition:Vi,footnoteDefinition:Vi};function Vi(){}const Gi="object"==typeof self?self:globalThis,Wi=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case 0:case-1:return n(l,o);case 1:{const e=n([],o);for(const t of l)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of l)e[r(t)]=r(n);return e}case 3:return n(new Date(l),o);case 4:{const{source:e,flags:t}=l;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of l)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of l)e.add(r(t));return e}case 7:{const{name:e,message:t}=l;return n(new Gi[e](t),o)}case 8:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:e}=new Uint8Array(l);return n(new DataView(e),l)}}return n(new Gi[i](l),o)};return r})(new Map,e)(0),Yi="",{toString:Ki}={},{keys:Xi}=Object,Ji=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Ki.call(e).slice(8,-1);switch(n){case"Array":return[1,Yi];case"Object":return[2,Yi];case"Date":return[3,Yi];case"RegExp":return[4,Yi];case"Map":return[5,Yi];case"Set":return[6,Yi];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},Zi=([e,t])=>0===e&&("function"===t||"symbol"===t),$i=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[l,s]=Ji(r);switch(l){case 0:{let t=r;switch(s){case"bigint":l=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([l,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([l,e],r);for(const t of r)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],a=o([l,n],r);for(const t of Xi(r))(e||!Zi(Ji(r[t])))&&n.push([i(t),i(r[t])]);return a}case 3:return o([l,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([l,{source:e,flags:t}],r)}case 5:{const t=[],n=o([l,t],r);for(const[n,o]of r)(e||!Zi(Ji(n))&&!Zi(Ji(o)))&&t.push([i(n),i(o)]);return n}case 6:{const t=[],n=o([l,t],r);for(const n of r)(e||!Zi(Ji(n)))&&t.push(i(n));return n}}const{message:a}=r;return o([l,{name:s,message:a}],r)};return i})(!(t||n),!!t,new Map,r)(e),r},el="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Wi($i(e,t)):structuredClone(e):(e,t)=>Wi($i(e,t));function tl(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nl(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const rl=function(e){if(null==e)return il;if("function"==typeof e)return ol(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=rl(e[n]);return ol(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return ol(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return ol(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function ol(e){return function(t,n,r){return!(!function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)||!e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function il(){return!0}const ll=[],sl=!0,al=!1;function Al(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=rl(o),l=r?-1:1;!function e(o,s,a){const A=o&&"object"==typeof o?o:{};if("string"==typeof A.type){const e="string"==typeof A.tagName?A.tagName:"string"==typeof A.name?A.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let A,c,u,d=ll;if((!t||i(o,s,a[a.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[sl,e]:null==e?ll:[e]}(n(o,a)),d[0]===al))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+l,u=a.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(A=e(n,c,u)(),A[0]===al)return A;c="number"==typeof A[1]?A[1]:c+l}}return d}}(e,void 0,[])()}function cl(e,t,n,r){let o,i,l;"function"==typeof t?(i=void 0,l=t,o=n):(i=t,l=n,o=r),Al(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},o)}const ul={}.hasOwnProperty,dl={};function fl(e,t){const n=t||dl,r=new Map,o=new Map,i=new Map,l={...qi,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=vl(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=vl(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:hl,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:l,one:function(e,t){const n=e.type,r=s.handlers[n];if(ul.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=el(n);return r.children=s.all(e),r}return el(e)}return(s.options.unknownHandler||gl)(s,e,t)},options:n,patch:pl,wrap:ml};return cl(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}function pl(e,t){e.position&&(t.position=function(e){const t=vr(e),n=mr(e);if(t&&n)return{start:t,end:n}}(e))}function hl(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,el(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function gl(e,t){const n=t.data||{},r=!("value"in t)||ul.call(n,"hProperties")||ul.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function ml(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function vl(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function yl(e,t){const n=fl(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||tl,r=e.options.footnoteBackLabel||nl,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[a]);if(!o)continue;const i=e.all(o),l=String(o.identifier).toUpperCase(),A=mo(l.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(l);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(a,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+A+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(a,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){const e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...u)}else i.push(...u);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+A},children:e.wrap(i,!0)};e.patch(o,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...el(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function wl(e,t){return e&&"run"in e?async function(n,r){const o=yl(n,{file:r,...t});await e.run(o,r)}:function(n,r){return yl(n,{file:r,...e||t})}}function bl(e){if(e)throw e}var xl,kl;var El=function(){if(kl)return xl;kl=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),i=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!i)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},l=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return xl=function e(){var t,n,r,a,A,c,u=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof u&&(p=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(u,n),u!==(a=s(t,n))&&(p&&a&&(i(a)||(A=o(a)))?(A?(A=!1,c=r&&o(r)?r:[]):c=r&&i(r)?r:{},l(u,{name:n,newValue:e(p,c,a)})):typeof a<"u"&&l(u,{name:n,newValue:a}));return u},xl}();const Cl=Ar(El);function Pl(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Sl(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...l){const s=e[++n];let a=-1;if(i)r(i);else{for(;++a<t.length;)(null===l[a]||void 0===l[a])&&(l[a]=t[a]);t=l,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let l;r&&t.push(o);try{l=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(l&&l.then&&"function"==typeof l.then?l.then(i,o):l instanceof Error?o(l):i(l))}function o(e,...r){n||(n=!0,t(e,...r))}function i(e){o(null,e)}}(s,o)(...l):r(null,...l)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const Dl={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Bl(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=l));return r===o?o=l:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Bl(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Bl(e);let t,n=e.length,r=-1,o=0,i=-1,l=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==l&&(l=1):i>-1&&(l=-1);else if(t){o=n+1;break}}return i<0||r<0||0===l||1===l&&i===r-1&&i===o+1?"":e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Bl(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Bl(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,l=-1,s=0,a=-1;for(;++a<=e.length;){if(a<e.length)n=e.codePointAt(a);else{if(47===n)break;n=47}if(47===n){if(l!==a-1&&1!==s)if(l!==a-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),l=a,s=0;continue}}else if(o.length>0){o="",i=0,l=a,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(l+1,a):o=e.slice(l+1,a),i=a-l-1;l=a,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);return 0===n.length&&!t&&(n="."),n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/"),t?"/"+n:n}(t)},sep:"/"};function Bl(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Il={cwd:function(){return"/"}};function Tl(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Ql(e){if("string"==typeof e)e=new URL(e);else if(!Tl(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Ml=["history","path","basename","stem","extname","dirname"];class Ol{constructor(e){let t;var n;t=e?Tl(e)?{path:e}:"string"==typeof e||(n=e)&&"object"==typeof n&&"byteLength"in n&&"byteOffset"in n?{value:e}:e:{},this.cwd="cwd"in t?"":Il.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Ml.length;){const e=Ml[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Ml.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?Dl.basename(this.path):void 0}set basename(e){Rl(e,"basename"),Ll(e,"basename"),this.path=Dl.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Dl.dirname(this.path):void 0}set dirname(e){jl(this.basename,"dirname"),this.path=Dl.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Dl.extname(this.path):void 0}set extname(e){if(Ll(e,"extname"),jl(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Dl.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Tl(e)&&(e=Ql(e)),Rl(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Dl.basename(this.path,this.extname):void 0}set stem(e){Rl(e,"stem"),Ll(e,"stem"),this.path=Dl.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Er(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Ll(e,t){if(e&&e.includes(Dl.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Dl.sep+"`")}function Rl(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function jl(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Nl=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Fl={}.hasOwnProperty;class Hl extends Nl{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=Sl()}copy(){const e=new Hl;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Cl(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(ql("data",this.frozen),this.namespace[e]=t,this):Fl.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ql("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=Wl(e),n=this.parser||this.Parser;return Ul("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ul("process",this.parser||this.Parser),_l("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=Wl(e),l=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(l,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var l;"string"==typeof(l=i)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(l)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ul("processSync",this.parser||this.Parser),_l("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,bl(e),t=r}),Gl("processSync","process",n),t}run(e,t,n){Vl(e),this.freeze();const r=this.transformers;return!n&&"function"==typeof t&&(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const l=Wl(t);r.run(e,l,function(t,r,l){const s=r||e;t?i(t):o?o(s):n(void 0,s,l)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){bl(e),n=t,r=!0}),Gl("runSync","run",r),n}stringify(e,t){this.freeze();const n=Wl(t),r=this.compiler||this.Compiler;return _l("stringify",r),Vl(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(ql("use",this.frozen),null!=e)if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?l(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))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");l(e.plugins),e.settings&&(r.settings=Cl(!0,r.settings,e.settings))}function l(e){let t=-1;if(null!=e){if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const l=n[o][1];Pl(l)&&Pl(r)&&(r=Cl(!0,l,r)),n[o]=[e,r,...i]}}}}const zl=(new Hl).freeze();function Ul(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function _l(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function ql(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vl(e){if(!Pl(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Gl(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Wl(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Ol(e)}const Yl=[],Kl={allowDangerousHtml:!0},Xl=/^(https?|ircs?|mailto|xmpp)$/i,Jl=[{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:"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 Zl(e){const t=e.allowedElements,r=e.allowElement,o=e.children||"",i=e.className,l=e.components,s=e.disallowedElements,a=e.rehypePlugins||Yl,A=e.remarkPlugins||Yl,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Kl}:Kl,u=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||$l,p=zl().use(Fi).use(A).use(wl,c).use(a),h=new Ol;"string"==typeof o&&(h.value=o);for(const t of Jl)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const g=p.parse(h);let m=p.runSync(g,h);return i&&(m={type:"element",tagName:"div",properties:{className:i},children:"root"===m.type?m.children:[m]}),cl(m,function(e,n,o){if("raw"===e.type&&o&&"number"==typeof n)return u?o.children.splice(n,1):o.children[n]={type:"text",value:e.value},n;if("element"===e.type){let t;for(t in _r)if(Object.hasOwn(_r,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=_r[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=f(String(n||""),t,e))}}if("element"===e.type){let i=t?!t.includes(e.tagName):!!s&&s.includes(e.tagName);if(!i&&r&&"number"==typeof n&&(i=!r(e,n,o)),i&&o&&"number"==typeof n)return d&&e.children?o.children.splice(n,1,...e.children):o.children.splice(n,1),n}}),Qr(m,{Fragment:n.Fragment,components:l,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0})}function $l(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||Xl.test(e.slice(0,t))?e:""}const es=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(Zl,{components:{p:({...e})=>n.jsx("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>n.jsx("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>n.jsx("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>n.jsx("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?n.jsx("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):n.jsx("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:n.jsx("code",{children:t})}),blockquote:({...e})=>n.jsx("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),ts={autoConfig:!0},ns=t=>()=>(t=>{const{getFlow:n}=Ht(),{messages:r,replaceMessages:o}=zt(),{settings:i}=_t(),{hasChatHistoryLoaded:l}=Vt(),s={...t,...ts},a=s.markdownComponent?s.markdownComponent:es;e.useEffect(()=>{var e,t;if(l){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=i.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=a)}o(n)}},[l]);const A=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,n(),r)&&(e.data.message.contentWrapper=a,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};Ut(N.PRE_INJECT_MESSAGE,A),Ut(N.CHUNK_STREAM_MESSAGE,A),Ut(N.START_STREAM_MESSAGE,A),Ut(N.START_SIMULATE_STREAM_MESSAGE,A);const c={name:"@rcb-plugins/markdown-renderer"};return null!=s&&s.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(t),rs={autoConfig:!0,promptBaseColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"},promptHoveredColors:{info:"#0056b3",warning:"#d39e00",error:"#c82333",success:"#218838"},textAreaHighlightColors:{info:"#007bff",warning:"#ffc107",error:"#dc3545",success:"#28a745"}},os=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const i=o[n];return"function"==typeof i?i:void 0},is=t=>{const{showToast:n}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=Je();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:r}=Ht(),{styles:o,updateStyles:i,replaceStyles:l}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=It();return{styles:e,replaceStyles:t,updateStyles:n}})(),s=(e=>({...rs,...e,promptBaseColors:{...rs.promptBaseColors},promptHoveredColors:{...rs.promptHoveredColors},textAreaHighlightColors:{...rs.textAreaHighlightColors}}))(t),[a,A]=e.useState(0),c=e.useRef({});Ut(N.USER_SUBMIT_TEXT,e=>{const t=e,l=os(t,r(),"validateTextInput");if(!l)return;const u=l(t.data.inputText);if(null!=u&&u.success||e.preventDefault(),!u.promptContent)return;0===a&&(c.current=structuredClone(o));const d=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(u,s);i(d),n(u.promptContent,u.promptDuration??3e3),A(e=>e+1)}),Ut(N.USER_UPLOAD_FILE,e=>{var t,o;const i=e,l=null==(o=null==(t=i.data)?void 0:t.files)?void 0:o[0];if(!l)return console.error("No file uploaded."),void e.preventDefault();const s=os(i,r(),"validateFileInput");if(!s)return void console.error("Validator not found for file input.");const a=s(l);if(!a.success)return console.error("Validation failed:",a),a.promptContent&&n(a.promptContent,a.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",a)}),Ut(N.DISMISS_TOAST,()=>{A(e=>e-1)}),e.useEffect(()=>{0===a&&setTimeout(()=>{l(c.current)})},[a,l]);const u={name:"@rcb-plugins/input-validator"};return s.autoConfig&&(u.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),u};function ls(){}function ss(){}const as=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,As=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cs={};function us(e,t){return(cs.jsx?As:as).test(e)}const ds=/[ \t\n\f\r]/g;function fs(e){return""===e.replace(ds,"")}class ps{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function hs(e,t){const n={},r={};for(const t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ps(n,r,t)}function gs(e){return e.toLowerCase()}ps.prototype.normal={},ps.prototype.property={},ps.prototype.space=void 0;class ms{constructor(e,t){this.attribute=t,this.property=e}}ms.prototype.attribute="",ms.prototype.booleanish=!1,ms.prototype.boolean=!1,ms.prototype.commaOrSpaceSeparated=!1,ms.prototype.commaSeparated=!1,ms.prototype.defined=!1,ms.prototype.mustUseProperty=!1,ms.prototype.number=!1,ms.prototype.overloadedBoolean=!1,ms.prototype.property="",ms.prototype.spaceSeparated=!1,ms.prototype.space=void 0;let vs=0;const ys=Ps(),ws=Ps(),bs=Ps(),xs=Ps(),ks=Ps(),Es=Ps(),Cs=Ps();function Ps(){return 2**++vs}var Ss=Object.freeze({__proto__:null,boolean:ys,booleanish:ws,commaOrSpaceSeparated:Cs,commaSeparated:Es,number:xs,overloadedBoolean:bs,spaceSeparated:ks});const Ds=Object.keys(Ss);class Bs extends ms{constructor(e,t,n,r){let o=-1;if(super(e,t),Is(this,"space",r),"number"==typeof n)for(;++o<Ds.length;){const e=Ds[o];Is(this,Ds[o],(n&Ss[e])===Ss[e])}}}function Is(e,t,n){n&&(e[t]=n)}function Ts(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new Bs(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[gs(r)]=r,n[gs(i.attribute)]=r}return new ps(t,n,e.space)}Bs.prototype.defined=!0;const Qs=Ts({properties:{ariaActiveDescendant:null,ariaAtomic:ws,ariaAutoComplete:null,ariaBusy:ws,ariaChecked:ws,ariaColCount:xs,ariaColIndex:xs,ariaColSpan:xs,ariaControls:ks,ariaCurrent:null,ariaDescribedBy:ks,ariaDetails:null,ariaDisabled:ws,ariaDropEffect:ks,ariaErrorMessage:null,ariaExpanded:ws,ariaFlowTo:ks,ariaGrabbed:ws,ariaHasPopup:null,ariaHidden:ws,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ks,ariaLevel:xs,ariaLive:null,ariaModal:ws,ariaMultiLine:ws,ariaMultiSelectable:ws,ariaOrientation:null,ariaOwns:ks,ariaPlaceholder:null,ariaPosInSet:xs,ariaPressed:ws,ariaReadOnly:ws,ariaRelevant:null,ariaRequired:ws,ariaRoleDescription:ks,ariaRowCount:xs,ariaRowIndex:xs,ariaRowSpan:xs,ariaSelected:ws,ariaSetSize:xs,ariaSort:null,ariaValueMax:xs,ariaValueMin:xs,ariaValueNow:xs,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function Ms(e,t){return t in e?e[t]:t}function Os(e,t){return Ms(e,t.toLowerCase())}const Ls=Ts({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Es,acceptCharset:ks,accessKey:ks,action:null,allow:null,allowFullScreen:ys,allowPaymentRequest:ys,allowUserMedia:ys,alt:null,as:null,async:ys,autoCapitalize:null,autoComplete:ks,autoFocus:ys,autoPlay:ys,blocking:ks,capture:null,charSet:null,checked:ys,cite:null,className:ks,cols:xs,colSpan:null,content:null,contentEditable:ws,controls:ys,controlsList:ks,coords:xs|Es,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ys,defer:ys,dir:null,dirName:null,disabled:ys,download:bs,draggable:ws,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ys,formTarget:null,headers:ks,height:xs,hidden:bs,high:xs,href:null,hrefLang:null,htmlFor:ks,httpEquiv:ks,id:null,imageSizes:null,imageSrcSet:null,inert:ys,inputMode:null,integrity:null,is:null,isMap:ys,itemId:null,itemProp:ks,itemRef:ks,itemScope:ys,itemType:ks,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ys,low:xs,manifest:null,max:null,maxLength:xs,media:null,method:null,min:null,minLength:xs,multiple:ys,muted:ys,name:null,nonce:null,noModule:ys,noValidate:ys,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:ys,optimum:xs,pattern:null,ping:ks,placeholder:null,playsInline:ys,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ys,referrerPolicy:null,rel:ks,required:ys,reversed:ys,rows:xs,rowSpan:xs,sandbox:ks,scope:null,scoped:ys,seamless:ys,selected:ys,shadowRootClonable:ys,shadowRootDelegatesFocus:ys,shadowRootMode:null,shape:null,size:xs,sizes:null,slot:null,span:xs,spellCheck:ws,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xs,step:null,style:null,tabIndex:xs,target:null,title:null,translate:null,type:null,typeMustMatch:ys,useMap:null,value:ws,width:xs,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ks,axis:null,background:null,bgColor:null,border:xs,borderColor:null,bottomMargin:xs,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ys,declare:ys,event:null,face:null,frame:null,frameBorder:null,hSpace:xs,leftMargin:xs,link:null,longDesc:null,lowSrc:null,marginHeight:xs,marginWidth:xs,noResize:ys,noHref:ys,noShade:ys,noWrap:ys,object:null,profile:null,prompt:null,rev:null,rightMargin:xs,rules:null,scheme:null,scrolling:ws,standby:null,summary:null,text:null,topMargin:xs,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xs,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ys,disableRemotePlayback:ys,prefix:null,property:null,results:xs,security:null,unselectable:null},space:"html",transform:Os}),Rs=Ts({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Cs,accentHeight:xs,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xs,amplitude:xs,arabicForm:null,ascent:xs,attributeName:null,attributeType:null,azimuth:xs,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xs,by:null,calcMode:null,capHeight:xs,className:ks,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:xs,diffuseConstant:xs,direction:null,display:null,dur:null,divisor:xs,dominantBaseline:null,download:ys,dx:null,dy:null,edgeMode:null,editable:null,elevation:xs,enableBackground:null,end:null,event:null,exponent:xs,externalResourcesRequired:null,fill:null,fillOpacity:xs,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:Es,g2:Es,glyphName:Es,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xs,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xs,horizOriginX:xs,horizOriginY:xs,id:null,ideographic:xs,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xs,k:xs,k1:xs,k2:xs,k3:xs,k4:xs,kernelMatrix:Cs,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xs,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xs,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:xs,overlineThickness:xs,paintOrder:null,panose1:null,path:null,pathLength:xs,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ks,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xs,pointsAtY:xs,pointsAtZ:xs,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cs,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cs,rev:Cs,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cs,requiredFeatures:Cs,requiredFonts:Cs,requiredFormats:Cs,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:xs,specularExponent:xs,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xs,strikethroughThickness:xs,string:null,stroke:null,strokeDashArray:Cs,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xs,strokeOpacity:xs,strokeWidth:null,style:null,surfaceScale:xs,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cs,tabIndex:xs,tableValues:null,target:null,targetX:xs,targetY:xs,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cs,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xs,underlineThickness:xs,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xs,values:null,vAlphabetic:xs,vMathematical:xs,vectorEffect:null,vHanging:xs,vIdeographic:xs,version:null,vertAdvY:xs,vertOriginX:xs,vertOriginY:xs,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xs,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ms}),js=Ts({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),Ns=Ts({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Os}),Fs=Ts({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),Hs={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"},zs=/[A-Z]/g,Us=/-[a-z]/g,_s=/^data[-\w.:]+$/i;function qs(e){return"-"+e.toLowerCase()}function Vs(e){return e.charAt(1).toUpperCase()}const Gs=hs([Qs,Ls,js,Ns,Fs],"html"),Ws=hs([Qs,Rs,js,Ns,Fs],"svg");var Ys="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ks(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xs={},Js=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Zs=/\n/g,$s=/^\s*/,ea=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,ta=/^:\s*/,na=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ra=/^[;\s]*/,oa=/^\s+|\s+$/g,ia="";function la(e){return e?e.replace(oa,ia):ia}var sa=Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.default=function(e,t){var n=null;if(!e||"string"!=typeof e)return n;var r=(0,aa.default)(e),o="function"==typeof t;return r.forEach(function(e){if("declaration"===e.type){var r=e.property,i=e.value;o?t(r,i,e):i&&((n=n||{})[r]=i)}}),n};var aa=sa(function(e,t){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(e){var t=e.match(Zs);t&&(n+=t.length);var o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function i(){var e={line:n,column:r};return function(t){return t.position=new l(e),A(),t}}function l(e){this.start=e,this.end={line:n,column:r},this.source=t.source}function s(o){var i=new Error(t.source+":"+n+":"+r+": "+o);if(i.reason=o,i.filename=t.source,i.line=n,i.column=r,i.source=e,!t.silent)throw i}function a(t){var n=t.exec(e);if(n){var r=n[0];return o(r),e=e.slice(r.length),n}}function A(){a($s)}function c(e){var t;for(e=e||[];t=u();)!1!==t&&e.push(t);return e}function u(){var t=i();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;ia!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,ia===e.charAt(n-1))return s("End of comment missing");var l=e.slice(2,n-2);return r+=2,o(l),e=e.slice(n),r+=2,t({type:"comment",comment:l})}}function d(){var e=i(),t=a(ea);if(t){if(u(),!a(ta))return s("property missing ':'");var n=a(na),r=e({type:"declaration",property:la(t[0].replace(Js,ia)),value:n?la(n[0].replace(Js,ia)):ia});return a(ra),r}}return l.prototype.content=e,A(),function(){var e,t=[];for(c(t);e=d();)!1!==e&&(t.push(e),c(t));return t}()});var Aa={};Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.camelCase=void 0;var ca=/^--[a-zA-Z0-9_-]+$/,ua=/-([a-z])/g,da=/^[^-]+$/,fa=/^-(webkit|moz|ms|o|khtml)-/,pa=/^-(ms)-/,ha=function(e,t){return t.toUpperCase()},ga=function(e,t){return"".concat(t,"-")};Aa.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||da.test(e)||ca.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(pa,ga):e.replace(fa,ga)).replace(ua,ha))};var ma=(Ys&&Ys.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Xs),va=Aa;function ya(e,t){var n={};return e&&"string"==typeof e?((0,ma.default)(e,function(e,r){e&&r&&(n[(0,va.camelCase)(e,t)]=r)}),n):n}ya.default=ya;var wa=Ks(ya);const ba=ka("end"),xa=ka("start");function ka(e){return function(t){const n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function Ea(e){return e&&"object"==typeof e?"position"in e||"type"in e?Pa(e.position):"start"in e||"end"in e?Pa(e):"line"in e||"column"in e?Ca(e):"":""}function Ca(e){return Sa(e&&e.line)+":"+Sa(e&&e.column)}function Pa(e){return Ca(e&&e.start)+"-"+Ca(e&&e.end)}function Sa(e){return e&&"number"==typeof e?e:1}class Da extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},i=!1;if(t&&(o="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!o.cause&&e&&(i=!0,r=e.message,o.cause=e),!o.ruleId&&!o.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?o.ruleId=n:(o.source=n.slice(0,e),o.ruleId=n.slice(e+1))}if(!o.place&&o.ancestors&&o.ancestors){const e=o.ancestors[o.ancestors.length-1];e&&(o.place=e.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=Ea(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=i&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Da.prototype.file="",Da.prototype.name="",Da.prototype.reason="",Da.prototype.message="",Da.prototype.stack="",Da.prototype.column=void 0,Da.prototype.line=void 0,Da.prototype.ancestors=void 0,Da.prototype.cause=void 0,Da.prototype.fatal=void 0,Da.prototype.place=void 0,Da.prototype.ruleId=void 0,Da.prototype.source=void 0;const Ba={}.hasOwnProperty,Ia=new Map,Ta=/[A-Z]/g,Qa=new Set(["table","tbody","thead","tfoot","tr"]),Ma=new Set(["td","th"]),Oa="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function La(e,t){if(!t||void 0===t.Fragment)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if("function"!=typeof t.jsxDEV)throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=function(e,t){return n;function n(n,r,o,i){const l=Array.isArray(o.children),s=xa(n);return t(r,o,i,l,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}(n,t.jsxDEV)}else{if("function"!=typeof t.jsx)throw new TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw new TypeError("Expected `jsxs` in production options");r=function(e,t,n){return r;function r(e,r,o,i){const l=Array.isArray(o.children)?n:t;return i?l(r,o,i):l(r,o)}}(0,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?Ws:Gs,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},i=Ra(o,e,void 0);return i&&"string"!=typeof i?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function Ra(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=Ws,e.schema=o);e.ancestors.push(t);const i=za(e,t.tagName,!1),l=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Ba.call(t.properties,o)){const i=Ha(e,o,t.properties[o]);if(i){const[o,l]=i;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof l&&Ma.has(t.tagName)?r=l:n[o]=l}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let s=Fa(e,t);Qa.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!("object"==typeof(t=e)?"text"===t.type&&fs(t.value):fs(t));var t}));return ja(e,l,i,t),Na(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ua(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=Ws,e.schema=o);e.ancestors.push(t);const i=null===t.name?e.Fragment:za(e,t.name,!0),l=function(e,t){const n={};for(const r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){const t=r.data.estree.body[0];ls(t.type);const o=t.expression;ls(o.type);const i=o.properties[0];ls(i.type),Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else Ua(e,t.position);else{const o=r.name;let i;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){const t=r.value.data.estree.body[0];ls(t.type),i=e.evaluater.evaluateExpression(t.expression)}else Ua(e,t.position);else i=null===r.value||r.value;n[o]=i}return n}(e,t),s=Fa(e,t);return ja(e,l,i,t),Na(l,s),e.ancestors.pop(),e.schema=r,e.create(t,i,l,n)}(e,t,n):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ua(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Na(r,Fa(e,t)),e.create(t,e.Fragment,r,n)}(e,t,n):"text"===t.type?function(e,t){return t.value}(0,t):void 0}function ja(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Na(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fa(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Ia;for(;++r<t.children.length;){const i=t.children[r];let l;if(e.passKeys){const e="element"===i.type?i.tagName:"mdxJsxFlowElement"===i.type||"mdxJsxTextElement"===i.type?i.name:void 0;if(e){const t=o.get(e)||0;l=e+"-"+t,o.set(e,t+1)}}const s=Ra(e,i,l);void 0!==s&&n.push(s)}return n}function Ha(e,t,n){const r=function(e,t){const n=gs(t);let r=t,o=ms;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&_s.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(Us,Vs);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!Us.test(e)){let n=e.replace(zs,qs);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Bs}return new o(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?function(e){const t={};return(""===e[e.length-1]?[...e,""]:e).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()}(n):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return wa(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const n=t,r=new Da("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Oa+"#cannot-parse-style-attribute",r}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Ba.call(e,n)&&(t[_a(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Hs[r.property]||r.property:r.attribute,n]}}function za(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=us(e[o])?{type:"Identifier",name:e[o]}:{type:"Literal",value:e[o]};n=n?{type:"MemberExpression",object:n,property:t,computed:Boolean(o&&"Literal"===t.type),optional:!1}:t}r=n}else r=us(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){const t=r.value;return Ba.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ua(e)}function Ua(e,t){const n=new Da("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Oa+"#cannot-handle-mdx-estrees-without-createevaluater",n}function _a(e){let t=e.replace(Ta,qa);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function qa(e){return"-"+e.toLowerCase()}const Va={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"]},Ga={};function Wa(e,t){return Ya(e,"boolean"!=typeof Ga.includeImageAlt||Ga.includeImageAlt,"boolean"!=typeof Ga.includeHtml||Ga.includeHtml)}function Ya(e,t,n){if(function(e){return Boolean(e&&"object"==typeof e)}(e)){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ka(e.children,t,n)}return Array.isArray(e)?Ka(e,t,n):""}function Ka(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Ya(e[o],t,n);return r.join("")}const Xa=document.createElement("i");function Ja(e){const t="&"+e+";";Xa.innerHTML=t;const n=Xa.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}function Za(e,t,n,r){const o=e.length;let i,l=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)i=Array.from(r),i.unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)i=r.slice(l,l+1e4),i.unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function $a(e,t){return e.length>0?(Za(e,e.length,0,t),e):t}const eA={}.hasOwnProperty;function tA(e){const t={};let n=-1;for(;++n<e.length;)nA(t,e[n]);return t}function nA(e,t){let n;for(n in t){const r=(eA.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let i;if(o)for(i in o){eA.call(r,i)||(r[i]=[]);const e=o[i];rA(r[i],Array.isArray(e)?e:e?[e]:[])}}}function rA(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Za(e,0,0,r)}function oA(e,t){const n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||!(65535&~n)||65534==(65535&n)||n>1114111?"�":String.fromCodePoint(n)}function iA(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lA=vA(/[A-Za-z]/),sA=vA(/[\dA-Za-z]/),aA=vA(/[#-'*+\--9=?A-Z^-~]/);function AA(e){return null!==e&&(e<32||127===e)}const cA=vA(/\d/),uA=vA(/[\dA-Fa-f]/),dA=vA(/[!-/:-@[-`{-~]/);function fA(e){return null!==e&&e<-2}function pA(e){return null!==e&&(e<0||32===e)}function hA(e){return-2===e||-1===e||32===e}const gA=vA(/\p{P}|\p{S}/u),mA=vA(/\s/);function vA(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function yA(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let l="";if(37===i&&sA(e.charCodeAt(n+1))&&sA(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(l=String.fromCharCode(i));else if(i>55295&&i<57344){const t=e.charCodeAt(n+1);i<56320&&t>56319&&t<57344?(l=String.fromCharCode(i,t),o=1):l="�"}else l=String.fromCharCode(i);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+o+1,l=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function wA(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return function(r){if(hA(r))return e.enter(n),l(r);return t(r)};function l(r){return hA(r)&&i++<o?(e.consume(r),l):(e.exit(n),t(r))}}const bA={tokenize:function(e){const t=e.attempt(this.parser.constructs.contentInitial,function(n){if(null===n)return void e.consume(n);return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),wA(e,t,"linePrefix")},function(t){return e.enter("paragraph"),r(t)});let n;return t;function r(t){const r=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){return null===t?(e.exit("chunkText"),e.exit("paragraph"),void e.consume(t)):fA(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const xA={tokenize:function(e){const t=this,n=[];let r,o,i,l=0;return s;function s(r){if(l<n.length){const o=n[l];return t.containerState=o[1],e.attempt(o[0].continuation,a,A)(r)}return A(r)}function a(e){if(l++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,i=n;for(;i--;)if("exit"===t.events[i][0]&&"chunkFlow"===t.events[i][1].type){o=t.events[i][1].end;break}m(l);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Za(t.events,i+1,0,t.events.slice(n)),t.events.length=s,A(e)}return s(e)}function A(o){if(l===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return p(o);t.interrupt=Boolean(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(kA,c,u)(o)}function c(e){return r&&v(),m(l),d(e)}function u(e){return t.parser.lazy[t.now().line]=l!==n.length,i=t.now().offset,p(e)}function d(n){return t.containerState={},e.attempt(kA,f,p)(n)}function f(e){return l++,n.push([t.currentConstruct,t.containerState]),d(e)}function p(n){return null===n?(r&&v(),m(0),void e.consume(n)):(r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:o}),h(n))}function h(n){return null===n?(g(e.exit("chunkFlow"),!0),m(0),void e.consume(n)):fA(n)?(e.consume(n),g(e.exit("chunkFlow")),l=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){const s=t.sliceStream(e);if(n&&s.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(s),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<i&&(!r.events[e][1].end||r.events[e][1].end.offset>i))return;const n=t.events.length;let o,s,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){if(o){s=t.events[a][1].end;break}o=!0}for(m(l),e=n;e<t.events.length;)t.events[e][1].end={...s},e++;Za(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function m(r){let o=n.length;for(;o-- >r;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},kA={tokenize:function(e,t,n){return wA(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function EA(e){return null===e||pA(e)||mA(e)?1:gA(e)?2:void 0}function CA(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const PA={name:"attention",resolveAll:function(e,t){let n,r,o,i,l,s,a,A,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};SA(u,-s),SA(d,s),i={type:s>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:s>1?"strong":"emphasis",start:{...i.start},end:{...l.end}},e[n][1].end={...i.start},e[c][1].start={...l.end},a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=$a(a,[["enter",e[n][1],t],["exit",e[n][1],t]])),a=$a(a,[["enter",r,t],["enter",i,t],["exit",i,t],["enter",o,t]]),a=$a(a,CA(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),a=$a(a,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(A=2,a=$a(a,[["enter",e[c][1],t],["exit",e[c][1],t]])):A=0,Za(e,n-1,c-n+3,a),c=n+a.length-A-2;break}c=-1;for(;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=EA(r);let i;return function(t){return i=t,e.enter("attentionSequence"),l(t)};function l(s){if(s===i)return e.consume(s),l;const a=e.exit("attentionSequence"),A=EA(s),c=!A||2===A&&o||n.includes(s),u=!o||2===o&&A||n.includes(r);return a._open=Boolean(42===i?c:c&&(o||!u)),a._close=Boolean(42===i?u:u&&(A||!c)),t(s)}}};function SA(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const DA={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return lA(t)?(e.consume(t),i):64===t?n(t):a(t)}function i(e){return 43===e||45===e||46===e||sA(e)?(r=1,l(e)):a(e)}function l(t){return 58===t?(e.consume(t),r=0,s):(43===t||45===t||46===t||sA(t))&&r++<32?(e.consume(t),l):(r=0,a(t))}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||AA(r)?n(r):(e.consume(r),s)}function a(t){return 64===t?(e.consume(t),A):aA(t)?(e.consume(t),a):n(t)}function A(e){return sA(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,A):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||sA(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const BA={partial:!0,tokenize:function(e,t,n){return function(t){return hA(t)?wA(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||fA(e)?t(e):n(e)}}};const IA={continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(hA(t))return wA(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(IA,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return hA(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const TA={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return dA(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const QA={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,i,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),o=31,i=sA,A(t))}function a(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=uA,A):(e.enter("characterReferenceValue"),o=7,i=cA,A(t))}function A(s){if(59===s&&l){const o=e.exit("characterReferenceValue");return i!==sA||Ja(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&l++<o?(e.consume(s),A):n(s)}}};const MA={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},OA={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return l;function l(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a}function a(t){return e.enter("codeFencedFence"),hA(t)?wA(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):A(t)}function A(t){return t===i?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===i?(o++,e.consume(t),c):o>=s?(e.exit("codeFencedFenceSequence"),hA(t)?wA(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||fA(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let i,l=0,s=0;return function(t){return function(t){const n=r.events[r.events.length-1];return l=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,i=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),a(t)}(t)};function a(t){return t===i?(s++,e.consume(t),a):s<3?n(t):(e.exit("codeFencedFenceSequence"),hA(t)?wA(e,A,"whitespace")(t):A(t))}function A(n){return null===n||fA(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(MA,f,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||fA(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),A(t)):hA(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),wA(e,u,"whitespace")(t)):96===t&&t===i?n(t):(e.consume(t),c)}function u(t){return null===t||fA(t)?A(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||fA(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),A(t)):96===t&&t===i?n(t):(e.consume(t),d)}function f(t){return e.attempt(o,v,p)(t)}function p(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return l>0&&hA(t)?wA(e,g,"linePrefix",l+1)(t):g(t)}function g(t){return null===t||fA(t)?e.check(MA,f,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||fA(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const LA={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),wA(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?i(e):n(e)}function i(t){return null===t?s(t):fA(t)?e.attempt(RA,i,s)(t):(e.enter("codeFlowValue"),l(t))}function l(t){return null===t||fA(t)?(e.exit("codeFlowValue"),i(t)):(e.consume(t),l)}function s(n){return e.exit("codeIndented"),t(n)}}},RA={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):fA(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):wA(e,i,"linePrefix",5)(t)}function i(e){const i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):fA(e)?o(e):n(e)}}};const jA={name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,o=3;if(!("lineEnding"!==e[o][1].type&&"space"!==e[o][1].type||"lineEnding"!==e[r][1].type&&"space"!==e[r][1].type))for(t=o;++t<r;)if("codeTextData"===e[t][1].type){e[o][1].type="codeTextPadding",e[r][1].type="codeTextPadding",o+=2,r-=2;break}t=o-1,r++;for(;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):t!==r&&"lineEnding"!==e[t][1].type||(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,o,i=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),l(t)};function l(t){return 96===t?(e.consume(t),i++,l):(e.exit("codeTextSequence"),s(t))}function s(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):96===t?(o=e.enter("codeTextSequence"),r=0,A(t)):fA(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("codeTextData"),a(t))}function a(t){return null===t||32===t||96===t||fA(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),a)}function A(n){return 96===n?(e.consume(n),r++,A):r===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",a(n))}}};class NA{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=null==t?Number.POSITIVE_INFINITY:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&FA(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),FA(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),FA(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);FA(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);FA(this.left,t.reverse())}}}function FA(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function HA(e){const t={};let n,r,o,i,l,s,a,A=-1;const c=new NA(e);for(;++A<c.length;){for(;A in t;)A=t[A];if(n=c.get(A),A&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(A-1)[1].type&&(s=n[1]._tokenizer.events,o=0,o<s.length&&"lineEndingBlank"===s[o][1].type&&(o+=2),o<s.length&&"content"===s[o][1].type))for(;++o<s.length&&"content"!==s[o][1].type;)"chunkText"===s[o][1].type&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,zA(c,A)),A=t[A],a=!0);else if(n[1]._container){for(o=A,r=void 0;o--;)if(i=c.get(o),"lineEnding"===i[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),i[1].type="lineEnding",r=o);else if("linePrefix"!==i[1].type&&"listItemIndent"!==i[1].type)break;r&&(n[1].end={...c.get(r)[1].start},l=c.slice(r,A),l.unshift(n),c.splice(r,A-r+1,l))}}return Za(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!a}function zA(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const s=l.events,a=[],A={};let c,u,d=-1,f=n,p=0,h=0;const g=[h];for(;f;){for(;e.get(++o)[1]!==f;);i.push(o),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),u&&l.defineSkip(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),u=f,f=f.next}for(f=n;++d<s.length;)"exit"===s[d][0]&&"enter"===s[d-1][0]&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(h=d+1,g.push(h),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const t=s.slice(g[d],g[d+1]),n=i.pop();a.push([n,n+t.length-1]),e.splice(n,2,t)}for(a.reverse(),d=-1;++d<a.length;)A[p+a[d][0]]=p+a[d][1],p+=a[d][1]-a[d][0]-1;return A}const UA={resolve:function(e){return HA(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):fA(t)?e.check(_A,i,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function i(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},_A={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),wA(e,o,"linePrefix")};function o(o){if(null===o||fA(o))return n(o);const i=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function qA(e,t,n,r,o,i,l,s,a){const A=a||Number.POSITIVE_INFINITY;let c=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(i),e.consume(t),e.exit(i),u;if(null===t||32===t||41===t||AA(t))return n(t);return e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),p(t)};function u(n){return 62===n?(e.enter(i),e.consume(n),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),u(t)):null===t||60===t||fA(t)?n(t):(e.consume(t),92===t?f:d)}function f(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function p(o){return c||null!==o&&41!==o&&!pA(o)?c<A&&40===o?(e.consume(o),c++,p):41===o?(e.consume(o),c--,p):null===o||32===o||40===o||AA(o)?n(o):(e.consume(o),92===o?h:p):(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function VA(e,t,n,r,o,i){const l=this;let s,a=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(i),A};function A(u){return a>999||null===u||91===u||93===u&&!s||94===u&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(u):93===u?(e.exit(i),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):fA(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),A):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||fA(t)||a++>999?(e.exit("chunkString"),A(t)):(e.consume(t),s||(s=!hA(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),a++,c):c(t)}}function GA(e,t,n,r,o,i){let l;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),l=40===t?41:t,s;return n(t)};function s(n){return n===l?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(i),a(n))}function a(t){return t===l?(e.exit(i),s(l)):null===t?n(t):fA(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),wA(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),A(t))}function A(t){return t===l||null===t||fA(t)?(e.exit("chunkString"),a(t)):(e.consume(t),92===t?c:A)}function c(t){return t===l||92===t?(e.consume(t),A):A(t)}}function WA(e,t){let n;return function r(o){if(fA(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(hA(o))return wA(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}const YA={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return VA.call(r,e,i,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function i(t){return o=iA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return pA(t)?WA(e,s)(t):s(t)}function s(t){return qA(e,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function a(t){return e.attempt(KA,A,A)(t)}function A(t){return hA(t)?wA(e,c,"whitespace")(t):c(t)}function c(i){return null===i||fA(i)?(e.exit("definition"),r.parser.defined.push(o),t(i)):n(i)}}},KA={partial:!0,tokenize:function(e,t,n){return function(t){return pA(t)?WA(e,r)(t):n(t)};function r(t){return GA(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return hA(t)?wA(e,i,"whitespace")(t):i(t)}function i(e){return null===e||fA(e)?t(e):n(e)}}};const XA={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return fA(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const JA={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,i=3;"whitespace"===e[i][1].type&&(i+=2);o-2>i&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(i===o-1||o-4>i&&"whitespace"===e[o-2][1].type)&&(o-=i+1===o?2:4);o>i&&(n={type:"atxHeadingText",start:e[i][1].start,end:e[o][1].end},r={type:"chunkText",start:e[i][1].start,end:e[o][1].end,contentType:"text"},Za(e,i,o-i+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e},tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||pA(t)?(e.exit("atxHeadingSequence"),i(t)):n(t)}function i(n){return 35===n?(e.enter("atxHeadingSequence"),l(n)):null===n||fA(n)?(e.exit("atxHeading"),t(n)):hA(n)?wA(e,i,"whitespace")(n):(e.enter("atxHeadingText"),s(n))}function l(t){return 35===t?(e.consume(t),l):(e.exit("atxHeadingSequence"),i(t))}function s(t){return null===t||35===t||pA(t)?(e.exit("atxHeadingText"),i(t)):(e.consume(t),s)}}};const ZA=["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"],$A=["pre","script","style","textarea"],ec={concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},tokenize:function(e,t,n){const r=this;let o,i,l,s,a;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),A}(t)};function A(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,f):63===s?(e.consume(s),o=3,r.interrupt?t:O):lA(s)?(e.consume(s),l=String.fromCharCode(s),p):n(s)}function c(i){return 45===i?(e.consume(i),o=2,u):91===i?(e.consume(i),o=5,s=0,d):lA(i)?(e.consume(i),o=4,r.interrupt?t:O):n(i)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const i="CDATA[";return o===i.charCodeAt(s++)?(e.consume(o),6===s?r.interrupt?t:P:d):n(o)}function f(t){return lA(t)?(e.consume(t),l=String.fromCharCode(t),p):n(t)}function p(s){if(null===s||47===s||62===s||pA(s)){const a=47===s,A=l.toLowerCase();return a||i||!$A.includes(A)?ZA.includes(l.toLowerCase())?(o=6,a?(e.consume(s),h):r.interrupt?t(s):P(s)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):i?g(s):m(s)):(o=1,r.interrupt?t(s):P(s))}return 45===s||sA(s)?(e.consume(s),l+=String.fromCharCode(s),p):n(s)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:P):n(o)}function g(t){return hA(t)?(e.consume(t),g):E(t)}function m(t){return 47===t?(e.consume(t),E):58===t||95===t||lA(t)?(e.consume(t),v):hA(t)?(e.consume(t),m):E(t)}function v(t){return 45===t||46===t||58===t||95===t||sA(t)?(e.consume(t),v):y(t)}function y(t){return 61===t?(e.consume(t),w):hA(t)?(e.consume(t),y):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,b):hA(t)?(e.consume(t),w):x(t)}function b(t){return t===a?(e.consume(t),a=null,k):null===t||fA(t)?n(t):(e.consume(t),b)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||pA(t)?y(t):(e.consume(t),x)}function k(e){return 47===e||62===e||hA(e)?m(e):n(e)}function E(t){return 62===t?(e.consume(t),C):n(t)}function C(t){return null===t||fA(t)?P(t):hA(t)?(e.consume(t),C):n(t)}function P(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!fA(t)||6!==o&&7!==o?null===t||fA(t)?(e.exit("htmlFlowData"),S(t)):(e.consume(t),P):(e.exit("htmlFlowData"),e.check(tc,R,S)(t))}function S(t){return e.check(nc,D,R)(t)}function D(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),B}function B(t){return null===t||fA(t)?S(t):(e.enter("htmlFlowData"),P(t))}function I(t){return 45===t?(e.consume(t),O):P(t)}function T(t){return 47===t?(e.consume(t),l="",Q):P(t)}function Q(t){if(62===t){const n=l.toLowerCase();return $A.includes(n)?(e.consume(t),L):P(t)}return lA(t)&&l.length<8?(e.consume(t),l+=String.fromCharCode(t),Q):P(t)}function M(t){return 93===t?(e.consume(t),O):P(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):P(t)}function L(t){return null===t||fA(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),L)}function R(n){return e.exit("htmlFlow"),t(n)}}},tc={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(BA,t,n)}}},nc={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){if(fA(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}};const rc={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,i,l;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),a):47===t?(e.consume(t),w):63===t?(e.consume(t),v):lA(t)?(e.consume(t),k):n(t)}function a(t){return 45===t?(e.consume(t),A):91===t?(e.consume(t),i=0,f):lA(t)?(e.consume(t),m):n(t)}function A(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):fA(t)?(l=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),6===i?p:f):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),h):fA(t)?(l=p,Q(t)):(e.consume(t),p)}function h(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):p(t)}function m(t){return null===t||62===t?T(t):fA(t)?(l=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):fA(t)?(l=v,Q(t)):(e.consume(t),v)}function y(e){return 62===e?T(e):v(e)}function w(t){return lA(t)?(e.consume(t),b):n(t)}function b(t){return 45===t||sA(t)?(e.consume(t),b):x(t)}function x(t){return fA(t)?(l=x,Q(t)):hA(t)?(e.consume(t),x):T(t)}function k(t){return 45===t||sA(t)?(e.consume(t),k):47===t||62===t||pA(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),T):58===t||95===t||lA(t)?(e.consume(t),C):fA(t)?(l=E,Q(t)):hA(t)?(e.consume(t),E):T(t)}function C(t){return 45===t||46===t||58===t||95===t||sA(t)?(e.consume(t),C):P(t)}function P(t){return 61===t?(e.consume(t),S):fA(t)?(l=P,Q(t)):hA(t)?(e.consume(t),P):E(t)}function S(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,D):fA(t)?(l=S,Q(t)):hA(t)?(e.consume(t),S):(e.consume(t),B)}function D(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):fA(t)?(l=D,Q(t)):(e.consume(t),D)}function B(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||pA(t)?E(t):(e.consume(t),B)}function I(e){return 47===e||62===e||pA(e)?E(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return hA(t)?wA(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),l(t)}}};const oc={name:"labelEnd",resolveAll:function(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){const e="labelImage"===r.type?4:2;r.type="data",t+=e}}e.length!==n.length&&Za(e,0,e.length,n);return e},resolveTo:function(e,t){let n,r,o,i,l=e.length,s=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(o=l);const a={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},A={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[o-2][1].start}};return i=[["enter",a,t],["enter",A,t]],i=$a(i,e.slice(r+1,r+s+3)),i=$a(i,[["enter",c,t]]),i=$a(i,CA(t.parser.constructs.insideSpan.null,e.slice(r+s+4,o-3),t)),i=$a(i,[["exit",c,t],e[o-2],e[o-1],["exit",A,t]]),i=$a(i,e.slice(o+1)),i=$a(i,[["exit",a,t]]),Za(e,r,e.length,i),e},tokenize:function(e,t,n){const r=this;let o,i,l=r.events.length;for(;l--;)if(("labelImage"===r.events[l][1].type||"labelLink"===r.events[l][1].type)&&!r.events[l][1]._balanced){o=r.events[l][1];break}return function(t){if(!o)return n(t);if(o._inactive)return c(t);return i=r.parser.defined.includes(iA(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s};function s(t){return 40===t?e.attempt(ic,A,i?A:c)(t):91===t?e.attempt(lc,A,i?a:c)(t):i?A(t):c(t)}function a(t){return e.attempt(sc,A,c)(t)}function A(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},ic={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return pA(t)?WA(e,o)(t):o(t)}function o(t){return 41===t?A(t):qA(e,i,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return pA(t)?WA(e,s)(t):A(t)}function l(e){return n(e)}function s(t){return 34===t||39===t||40===t?GA(e,a,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):A(t)}function a(t){return pA(t)?WA(e,A)(t):A(t)}function A(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},lc={tokenize:function(e,t,n){const r=this;return function(t){return VA.call(r,e,o,i,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(iA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function i(e){return n(e)}}},sc={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}};const ac={name:"labelStartImage",resolveAll:oc.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),o};function o(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):n(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Ac={name:"labelStartLink",resolveAll:oc.resolveAll,tokenize:function(e,t,n){const r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),o};function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const cc={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),wA(e,t,"linePrefix")}}};const uc={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,i(e)}(t)};function i(i){return i===r?(e.enter("thematicBreakSequence"),l(i)):o>=3&&(null===i||fA(i))?(e.exit("thematicBreak"),t(i)):n(i)}function l(t){return t===r?(e.consume(t),o++,l):(e.exit("thematicBreakSequence"),hA(t)?wA(e,i,"whitespace")(t):i(t))}}};const dc={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(BA,o,i);function o(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,wA(e,t,"listItemIndent",r.containerState.size+1)(n)}function i(n){return r.containerState.furtherBlankLines||!hA(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pc,t,l)(n))}function l(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,wA(e,e.attempt(dc,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,l=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:cA(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(uc,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(t)}return n(t)};function s(t){return cA(t)&&++l<10?(e.consume(t),s):(!r.interrupt||l<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),a(t)):n(t)}function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(BA,r.interrupt?n:A,e.attempt(fc,u,c))}function A(e){return r.containerState.initialBlankLine=!0,i++,u(e)}function c(t){return hA(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},fc={partial:!0,tokenize:function(e,t,n){const r=this;return wA(e,function(e){const o=r.events[r.events.length-1];return!hA(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},pc={partial:!0,tokenize:function(e,t,n){const r=this;return wA(e,function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}};const hc={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){n=i;break}"paragraph"===e[i][1].type&&(r=i)}else"content"===e[i][1].type&&e.splice(i,1),o||"definition"!==e[i][1].type||(o=i);const l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",l,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=l;return e.push(["exit",l,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let l,s=r.events.length;for(;s--;)if("lineEnding"!==r.events[s][1].type&&"linePrefix"!==r.events[s][1].type&&"content"!==r.events[s][1].type){l="paragraph"===r.events[s][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||l))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),i(t)}(t);return n(t)};function i(t){return t===o?(e.consume(t),i):(e.exit("setextHeadingLineSequence"),hA(t)?wA(e,l,"lineSuffix")(t):l(t))}function l(r){return null===r||fA(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const gc={tokenize:function(e){const t=this,n=e.attempt(BA,function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n},e.attempt(this.parser.constructs.flowInitial,r,wA(e,e.attempt(this.parser.constructs.flow,r,e.attempt(UA,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const mc={resolveAll:bc()},vc=wc("string"),yc=wc("text");function wc(e){return{resolveAll:bc("text"===e?xc:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,i,l);return i;function i(e){return a(e)?o(e):l(e)}function l(e){if(null!==e)return t.enter("data"),t.consume(e),s;t.consume(e)}function s(e){return a(e)?(t.exit("data"),o(e)):(t.consume(e),s)}function a(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o<t.length;){const e=t[o];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function bc(e){return function(t,n){let r,o=-1;for(;++o<=t.length;)void 0===r?t[o]&&"data"===t[o][1].type&&(r=o,o++):t[o]&&"data"===t[o][1].type||(o!==r+2&&(t[r][1].end=t[o-1][1].end,t.splice(r+2,o-r-2),o=r+2),r=void 0);return e?e(t,n):t}}function xc(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){const r=e[n-1][1],o=t.sliceStream(r);let i,l=o.length,s=-1,a=0;for(;l--;){const e=o[l];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)a++,s--;if(s)break;s=-1}else if(-2===e)i=!0,a++;else if(-1!==e){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const o={type:n===e.length||i||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:r.start._bufferIndex+s,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}const kc={42:dc,43:dc,45:dc,48:dc,49:dc,50:dc,51:dc,52:dc,53:dc,54:dc,55:dc,56:dc,57:dc,62:IA},Ec={91:YA},Cc={[-2]:LA,[-1]:LA,32:LA},Pc={35:JA,42:uc,45:[hc,uc],60:ec,61:hc,95:uc,96:OA,126:OA},Sc={38:QA,92:TA},Dc={[-5]:cc,[-4]:cc,[-3]:cc,33:ac,38:QA,42:PA,60:[DA,rc],91:Ac,92:[XA,TA],93:oc,95:PA,96:jA},Bc={null:[PA,mc]};var Ic=Object.freeze({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:Ec,disable:{null:[]},document:kc,flow:Pc,flowInitial:Cc,insideSpan:Bc,string:Sc,text:Dc});function Tc(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let l=[],s=[];const a={attempt:g(function(e,t){m(e,t.from)}),check:g(h),consume:function(e){fA(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,v()):-1!==e&&(r.column++,r.offset++);r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++));A.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),A.events.push(["enter",n,A]),s.push(n),n},exit:function(e){const t=s.pop();return t.end=d(),A.events.push(["exit",t,A]),t},interrupt:g(h,{interrupt:!0})},A={code:null,containerState:{},defineSkip:function(e){o[e.line]=e.column,v()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let l;if("string"==typeof i)l=i;else switch(i){case-5:l="\r";break;case-4:l="\n";break;case-3:l="\r\n";break;case-2:l=t?" ":"\t";break;case-1:if(!t&&o)continue;l=" ";break;default:l=String.fromCharCode(i)}o=-2===i,r.push(l)}return r.join("")}(u(e),t)},sliceStream:u,write:function(e){if(l=$a(l,e),f(),null!==l[l.length-1])return[];return m(t,0),A.events=CA(i,A.events,A),A.events}};let c=t.tokenize.call(A,a);return t.resolveAll&&i.push(t),A;function u(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let l;if(n===o)l=[e[n].slice(r,i)];else{if(l=e.slice(n,o),r>-1){const e=l[0];"string"==typeof e?l[0]=e.slice(r):l.shift()}i>0&&l.push(e[o].slice(0,i))}return l}(l,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:i}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:i}}function f(){let e;for(;r._index<l.length;){const t=l[r._index];if("string"==typeof t)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)p(t.charCodeAt(r._bufferIndex));else p(t)}}function p(e){c=c(e)}function h(e,t){t.restore()}function g(e,t){return function(n,o,i){let l,c,u,f;return Array.isArray(n)?p(n):"tokenize"in n?p([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return p([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function p(e){return l=e,c=0,0===e.length?i:h(e[c])}function h(e){return function(n){f=function(){const e=d(),t=A.previous,n=A.currentConstruct,o=A.events.length,i=Array.from(s);return{from:o,restore:l};function l(){r=e,A.previous=t,A.currentConstruct=n,A.events.length=o,s=i,v()}}(),u=e,e.partial||(A.currentConstruct=e);if(e.name&&A.parser.constructs.disable.null.includes(e.name))return m();return e.tokenize.call(t?Object.assign(Object.create(A),t):A,a,g,m)(n)}}function g(t){return e(u,f),o}function m(e){return f.restore(),++c<l.length?h(l[c]):i}}}function m(e,t){e.resolveAll&&!i.includes(e)&&i.push(e),e.resolve&&Za(A.events,t,A.events.length-t,e.resolve(A.events.slice(t),A)),e.resolveTo&&(A.events=e.resolveTo(A.events,A))}function v(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const Qc=/[\0\t\n\r]/g;const Mc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Oc(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return oA(n.slice(t?2:1),t?16:10)}return Ja(n)||e}const Lc={}.hasOwnProperty;function Rc(e,t,n){return"string"!=typeof t&&(n=t,t=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(te),autolinkProtocol:C,autolinkEmail:C,atxHeading:i(J),blockQuote:i(G),characterEscape:C,characterReference:C,codeFenced:i(W),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:i(W,l),codeText:i(Y,l),codeTextData:C,data:C,codeFlowValue:C,definition:i(K),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:i(X),hardBreakEscape:i(Z),hardBreakTrailing:i(Z),htmlFlow:i($,l),htmlFlowData:C,htmlText:i($,l),htmlTextData:C,image:i(ee),label:l,link:i(te),listItem:i(re),listItemValue:d,listOrdered:i(ne,u),listUnordered:i(ne),paragraph:i(oe),reference:F,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:i(J),strong:i(ie),thematicBreak:i(se)},exit:{atxHeading:a(),atxHeadingSequence:b,autolink:a(),autolinkEmail:V,autolinkProtocol:q,blockQuote:a(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:z,characterReferenceMarkerNumeric:z,characterReferenceValue:U,characterReference:_,codeFenced:a(g),codeFencedFence:h,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:P,codeIndented:a(m),codeText:a(T),codeTextData:P,data:P,definition:a(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:y,emphasis:a(),hardBreakEscape:a(D),hardBreakTrailing:a(D),htmlFlow:a(B),htmlFlowData:P,htmlText:a(I),htmlTextData:P,image:a(M),label:L,labelText:O,lineEnding:S,link:a(Q),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:H,resourceDestinationString:R,resourceTitleString:j,resource:N,setextHeading:a(E),setextHeadingLineSequence:k,setextHeadingText:x,strong:a(),thematicBreak:a()}};Nc(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const i={stack:[r],tokenStack:[],config:t,enter:s,exit:A,buffer:l,resume:c,data:n},a=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])a.push(u);else{u=o(e,a.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];Lc.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},i),e[u][1])}if(i.tokenStack.length>0){const e=i.tokenStack[i.tokenStack.length-1];(e[1]||Hc).call(i,void 0,e[0])}for(r.position={start:jc(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:jc(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,i,l,s=t-1,a=-1,A=!1;for(;++s<=n;){const t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?a++:a--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||l||a||i||(i=s),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!a&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===a&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=s;for(o=void 0;l--;){const t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",A=!0),t[1].type="lineEnding",o=l}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}i&&(!o||i<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){const o={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=o,e.splice(s,0,["enter",o,t[2]]),s++,n++,i=void 0,l=!0}}}return e[t][1]._spread=A,n}function i(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:jc(t.start),end:void 0}}function a(e){return t;function t(t){e&&e.call(this,t),A.call(this,t)}}function A(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+Ea({start:e.start,end:e.end})+"): it’s not open");if(r[0].type!==e.type)if(t)t.call(this,e,r[0]);else{(r[1]||Hc).call(this,e,r[0])}n.position.end=jc(e.end)}function c(){return Wa(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function f(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function p(){const e=this.resume();this.stack[this.stack.length-1].meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}function v(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iA(this.sliceSerialize(e)).toLowerCase()}function y(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function b(e){const t=this.stack[this.stack.length-1];if(!t.depth){const n=this.sliceSerialize(e).length;t.depth=n}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function k(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function C(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];n&&"text"===n.type||(n=le(),n.position={start:jc(e.start),end:void 0},t.push(n)),this.stack.push(n)}function P(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=jc(e.end)}function S(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=jc(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(C.call(this,e),P.call(this,e))}function D(){this.data.atHardBreak=!0}function B(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(Mc,Oc)}(t),n.identifier=iA(t).toLowerCase()}function L(){const e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];if(this.data.inReference=!0,"link"===n.type){const t=e.children;n.children=t}else n.alt=t}function R(){const e=this.resume();this.stack[this.stack.length-1].url=e}function j(){const e=this.resume();this.stack[this.stack.length-1].title=e}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function H(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=iA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function z(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;if(n)r=oA(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0;else{r=Ja(t)}this.stack[this.stack.length-1].value+=r}function _(e){this.stack.pop().position.end=jc(e.end)}function q(e){P.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function V(e){P.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function K(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function X(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function ie(){return{type:"strong",children:[]}}function le(){return{type:"text",value:""}}function se(){return{type:"thematicBreak"}}}(n)(function(e){for(;!HA(e););return e}(function(e){const t={constructs:tA([Ic,...(e||{}).extensions||[]]),content:n(bA),defined:[],document:n(xA),flow:n(gc),lazy:{},string:n(vc),text:n(yc)};return t;function n(e){return function(n){return Tc(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,i,l){const s=[];let a,A,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(Qc.lastIndex=c,a=Qc.exec(o),u=a&&void 0!==a.index?a.index:o.length,d=o.charCodeAt(u),!a){n=o.slice(c);break}if(10===d&&c===u&&e)s.push(-3),e=void 0;else switch(e&&(s.push(-5),e=void 0),c<u&&(s.push(o.slice(c,u)),t+=u-c),d){case 0:s.push(65533),t++;break;case 9:for(A=4*Math.ceil(t/4),s.push(-2);t++<A;)s.push(-1);break;case 10:s.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return l&&(e&&s.push(-5),n&&s.push(n),s.push(null)),s}}()(e,t,!0))))}function jc(e){return{line:e.line,column:e.column,offset:e.offset}}function Nc(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Nc(e,r):Fc(e,r)}}function Fc(e,t){let n;for(n in t)if(Lc.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Hc(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ea({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ea({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ea({start:t.start,end:t.end})+") is still open")}function zc(e){const t=this;t.parser=function(n){return Rc(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Uc(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&"text"===i.type?i.value="["+i.value:o.unshift({type:"text",value:"["});const l=o[o.length-1];return l&&"text"===l.type?l.value+=r:o.push({type:"text",value:r}),o}function _c(e){const t=e.spread;return null==t?e.children.length>1:t}function qc(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(Vc(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(Vc(t.slice(o),o>0,!1)),i.join("")}function Vc(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;9===t||32===t;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const Gc={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){const n="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=yA(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let l,s=e.footnoteCounts.get(r);void 0===s?(s=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=i+1,s+=1,e.footnoteCounts.set(r,s);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const A={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,A),e.applyData(t,A)},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Uc(e,t);const o={src:yA(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)},image:function(e,t){const n={src:yA(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Uc(e,t);const o={href:yA(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)},link:function(e,t){const n={href:yA(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=_c(n[r])}return t}(n):_c(t),i={},l=[];if("boolean"==typeof t.checked){const e=r[0];let n;e&&"element"===e.type&&"p"===e.tagName?n=e:(n={type:"element",tagName:"p",properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const e=r[s];(o||0!==s||"element"!==e.type||"p"!==e.tagName)&&l.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?l.push(e):l.push(...e.children)}const a=r[r.length-1];a&&(o||"element"!==a.type||"p"!==a.tagName)&&l.push({type:"text",value:"\n"});const A={type:"element",tagName:"li",properties:i,children:l};return e.patch(t,A),e.applyData(t,A)},list:function(e,t){const n={},r=e.all(t);let o=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++o<r.length;){const e=r[o];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),o.push(n)}if(n.length>0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},i=xa(t.children[1]),l=ba(t.children[t.children.length-1]);i&&l&&(r.position={start:i,end:l}),o.push(r)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",i=n&&"table"===n.type?n.align:void 0,l=i?i.length:t.children.length;let s=-1;const a=[];for(;++s<l;){const n=t.children[s],r={},l=i?i[s]:void 0;l&&(r.align=l);let A={type:"element",tagName:o,properties:r,children:[]};n&&(A.children=e.all(n),e.patch(n,A),A=e.applyData(n,A)),a.push(A)}const A={type:"element",tagName:"tr",properties:{},children:e.wrap(a,!0)};return e.patch(t,A),e.applyData(t,A)},text:function(e,t){const n={type:"text",value:qc(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:Wc,yaml:Wc,definition:Wc,footnoteDefinition:Wc};function Wc(){}const Yc="object"==typeof self?self:globalThis,Kc=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[i,l]=t[o];switch(i){case 0:case-1:return n(l,o);case 1:{const e=n([],o);for(const t of l)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of l)e[r(t)]=r(n);return e}case 3:return n(new Date(l),o);case 4:{const{source:e,flags:t}=l;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of l)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of l)e.add(r(t));return e}case 7:{const{name:e,message:t}=l;return n(new Yc[e](t),o)}case 8:return n(BigInt(l),o);case"BigInt":return n(Object(BigInt(l)),o);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:e}=new Uint8Array(l);return n(new DataView(e),l)}}return n(new Yc[i](l),o)};return r})(new Map,e)(0),Xc="",{toString:Jc}={},{keys:Zc}=Object,$c=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Jc.call(e).slice(8,-1);switch(n){case"Array":return[1,Xc];case"Object":return[2,Xc];case"Date":return[3,Xc];case"RegExp":return[4,Xc];case"Map":return[5,Xc];case"Set":return[6,Xc];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},eu=([e,t])=>0===e&&("function"===t||"symbol"===t),tu=(e,{json:t,lossy:n}={})=>{const r=[];return((e,t,n,r)=>{const o=(e,t)=>{const o=r.push(e)-1;return n.set(t,o),o},i=r=>{if(n.has(r))return n.get(r);let[l,s]=$c(r);switch(l){case 0:{let t=r;switch(s){case"bigint":l=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);t=null;break;case"undefined":return o([-1],r)}return o([l,t],r)}case 1:{if(s){let e=r;return"DataView"===s?e=new Uint8Array(r.buffer):"ArrayBuffer"===s&&(e=new Uint8Array(r)),o([s,[...e]],r)}const e=[],t=o([l,e],r);for(const t of r)e.push(i(t));return t}case 2:{if(s)switch(s){case"BigInt":return o([s,r.toString()],r);case"Boolean":case"Number":case"String":return o([s,r.valueOf()],r)}if(t&&"toJSON"in r)return i(r.toJSON());const n=[],a=o([l,n],r);for(const t of Zc(r))!e&&eu($c(r[t]))||n.push([i(t),i(r[t])]);return a}case 3:return o([l,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([l,{source:e,flags:t}],r)}case 5:{const t=[],n=o([l,t],r);for(const[n,o]of r)(e||!eu($c(n))&&!eu($c(o)))&&t.push([i(n),i(o)]);return n}case 6:{const t=[],n=o([l,t],r);for(const n of r)!e&&eu($c(n))||t.push(i(n));return n}}const{message:a}=r;return o([l,{name:s,message:a}],r)};return i})(!(t||n),!!t,new Map,r)(e),r};var nu="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Kc(tu(e,t)):structuredClone(e):(e,t)=>Kc(tu(e,t));function ru(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function ou(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const iu=function(e){if(null==e)return su;if("function"==typeof e)return lu(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=iu(e[n]);return lu(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}(e):function(e){const t=e;return lu(n);function n(n){const r=n;let o;for(o in e)if(r[o]!==t[o])return!1;return!0}}(e);if("string"==typeof e)return function(e){return lu(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function lu(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function su(){return!0}const au=[],Au=!0,cu=!1;function uu(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const i=iu(o),l=r?-1:1;!function e(o,s,a){const A=o&&"object"==typeof o?o:{};if("string"==typeof A.type){const e="string"==typeof A.tagName?A.tagName:"string"==typeof A.name?A.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let A,c,u,d=au;if((!t||i(o,s,a[a.length-1]||void 0))&&(d=function(e){if(Array.isArray(e))return e;if("number"==typeof e)return[Au,e];return null==e?au:[e]}(n(o,a)),d[0]===cu))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+l,u=a.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(A=e(n,c,u)(),A[0]===cu)return A;c="number"==typeof A[1]?A[1]:c+l}}return d}}(e,void 0,[])()}function du(e,t,n,r){let o,i,l;"function"==typeof t&&"function"!=typeof n?(i=void 0,l=t,o=n):(i=t,l=n,o=r),uu(e,i,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},o)}const fu={}.hasOwnProperty,pu={};function hu(e,t){e.position&&(t.position=function(e){const t=xa(e),n=ba(e);if(t&&n)return{start:t,end:n}}(e))}function gu(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;if("string"==typeof t)if("element"===n.type)n.tagName=t;else{n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}}"element"===n.type&&o&&Object.assign(n.properties,nu(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function mu(e,t){const n=t.data||{},r=!("value"in t)||fu.call(n,"hProperties")||fu.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:e.all(t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}function vu(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function yu(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function wu(e,t){const n=function(e,t){const n=t||pu,r=new Map,o=new Map,i=new Map,l={...Gc,...n.handlers},s={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=s.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=yu(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=yu(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:gu,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:l,one:function(e,t){const n=e.type,r=s.handlers[n];if(fu.call(s.handlers,n)&&r)return r(s,e,t);if(s.options.passThrough&&s.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=nu(n);return r.children=s.all(e),r}return nu(e)}return(s.options.unknownHandler||mu)(s,e,t)},options:n,patch:hu,wrap:vu};return du(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){const t="definition"===e.type?r:o,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),s}(e,t),r=n.one(e,void 0),o=function(e){const t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ru,r=e.options.footnoteBackLabel||ou,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[a]);if(!o)continue;const i=e.all(o),l=String(o.identifier).toUpperCase(),A=yA(l.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(l);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(a,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+A+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(a,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=i[i.length-1];if(f&&"element"===f.type&&"p"===f.tagName){const e=f.children[f.children.length-1];e&&"text"===e.type?e.value+=" ":f.children.push({type:"text",value:" "}),f.children.push(...u)}else i.push(...u);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+A},children:e.wrap(i,!0)};e.patch(o,p),s.push(p)}if(0!==s.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...nu(l),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:"\n"}]}}(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:"\n"},o),i}function bu(e,t){return e&&"run"in e?async function(n,r){const o=wu(n,{file:r,...t});await e.run(o,r)}:function(n,r){return wu(n,{file:r,...e||t})}}function xu(e){if(e)throw e}var ku=Object.prototype.hasOwnProperty,Eu=Object.prototype.toString,Cu=Object.defineProperty,Pu=Object.getOwnPropertyDescriptor,Su=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Eu.call(e)},Du=function(e){if(!e||"[object Object]"!==Eu.call(e))return!1;var t,n=ku.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&ku.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||ku.call(e,t)},Bu=function(e,t){Cu&&"__proto__"===t.name?Cu(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Iu=function(e,t){if("__proto__"===t){if(!ku.call(e,t))return;if(Pu)return Pu(e,t).value}return e[t]},Tu=function e(){var t,n,r,o,i,l,s=arguments[0],a=1,A=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},a=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});a<A;++a)if(null!=(t=arguments[a]))for(n in t)r=Iu(s,n),s!==(o=Iu(t,n))&&(c&&o&&(Du(o)||(i=Su(o)))?(i?(i=!1,l=r&&Su(r)?r:[]):l=r&&Du(r)?r:{},Bu(s,{name:n,newValue:e(c,l,o)})):void 0!==o&&Bu(s,{name:n,newValue:o}));return s},Qu=Ks(Tu);function Mu(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Ou(){const e=[],t={run:function(...t){let n=-1;const r=t.pop();if("function"!=typeof r)throw new TypeError("Expected function as last argument, not "+r);!function o(i,...l){const s=e[++n];let a=-1;if(i)r(i);else{for(;++a<t.length;)null!==l[a]&&void 0!==l[a]||(l[a]=t[a]);t=l,s?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let l;r&&t.push(o);try{l=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(l&&l.then&&"function"==typeof l.then?l.then(i,o):l instanceof Error?o(l):i(l))}function o(e,...r){n||(n=!0,t(e,...r))}function i(e){o(null,e)}}(s,o)(...l):r(null,...l)}}(null,...t)},use:function(n){if("function"!=typeof n)throw new TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}const Lu={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Ru(e);let n,r=0,o=-1,i=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else o<0&&(n=!0,o=i+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(47===e.codePointAt(i)){if(n){r=i+1;break}}else l<0&&(n=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(o=i):(s=-1,o=l));r===o?o=l:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(Ru(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},extname:function(e){Ru(e);let t,n=e.length,r=-1,o=0,i=-1,l=0;for(;n--;){const s=e.codePointAt(n);if(47!==s)r<0&&(t=!0,r=n+1),46===s?i<0?i=n:1!==l&&(l=1):i>-1&&(l=-1);else if(t){o=n+1;break}}if(i<0||r<0||0===l||1===l&&i===r-1&&i===o+1)return"";return e.slice(i,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)Ru(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Ru(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",i=0,l=-1,s=0,a=-1;for(;++a<=e.length;){if(a<e.length)n=e.codePointAt(a);else{if(47===n)break;n=47}if(47===n){if(l===a-1||1===s);else if(l!==a-1&&2===s){if(o.length<2||2!==i||46!==o.codePointAt(o.length-1)||46!==o.codePointAt(o.length-2))if(o.length>2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",i=0):(o=o.slice(0,r),i=o.length-1-o.lastIndexOf("/")),l=a,s=0;continue}}else if(o.length>0){o="",i=0,l=a,s=0;continue}t&&(o=o.length>0?o+"/..":"..",i=2)}else o.length>0?o+="/"+e.slice(l+1,a):o=e.slice(l+1,a),i=a-l-1;l=a,s=0}else 46===n&&s>-1?s++:s=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.codePointAt(e.length-1)&&(n+="/");return t?"/"+n:n}(t)},sep:"/"};function Ru(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ju={cwd:function(){return"/"}};function Nu(e){return Boolean(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Fu(e){if("string"==typeof e)e=new URL(e);else if(!Nu(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){const e=t.codePointAt(n+2);if(70===e||102===e){const e=new TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}const Hu=["history","path","basename","stem","extname","dirname"];class zu{constructor(e){let t;t=e?Nu(e)?{path:e}:"string"==typeof e||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":ju.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n,r=-1;for(;++r<Hu.length;){const e=Hu[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)Hu.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?Lu.basename(this.path):void 0}set basename(e){_u(e,"basename"),Uu(e,"basename"),this.path=Lu.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Lu.dirname(this.path):void 0}set dirname(e){qu(this.basename,"dirname"),this.path=Lu.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Lu.extname(this.path):void 0}set extname(e){if(Uu(e,"extname"),qu(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Lu.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Nu(e)&&(e=Fu(e)),_u(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Lu.basename(this.path,this.extname):void 0}set stem(e){_u(e,"stem"),Uu(e,"stem"),this.path=Lu.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Da(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return new TextDecoder(e||void 0).decode(this.value)}}function Uu(e,t){if(e&&e.includes(Lu.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Lu.sep+"`")}function _u(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function qu(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Vu=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Gu={}.hasOwnProperty;class Wu extends Vu{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=Ou()}copy(){const e=new Wu;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Qu(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(Ju("data",this.frozen),this.namespace[e]=t,this):Gu.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ju("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const r=t.call(e,...n);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=ed(e),n=this.parser||this.Parser;return Ku("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Ku("process",this.parser||this.Parser),Xu("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const i=ed(e),l=n.parse(i);function s(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(l,i,function(e,t,r){if(e||!t||!r)return s(e);const o=t,i=n.stringify(o,r);var l;"string"==typeof(l=i)||function(e){return Boolean(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(l)?r.value=i:r.result=i,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Ku("processSync",this.parser||this.Parser),Xu("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,xu(e),t=r}),$u("processSync","process",n),t}run(e,t,n){Zu(e),this.freeze();const r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?o(void 0,n):new Promise(o);function o(o,i){const l=ed(t);r.run(e,l,function(t,r,l){const s=r||e;t?i(t):o?o(s):n(void 0,s,l)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){xu(e),n=t,r=!0}),$u("runSync","run",r),n}stringify(e,t){this.freeze();const n=ed(t),r=this.compiler||this.Compiler;return Xu("stringify",r),Zu(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(Ju("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?l(e):i(e)}return this;function o(e){if("function"==typeof e)s(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;s(t,n)}else i(e)}}function i(e){if(!("plugins"in e)&&!("settings"in e))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");l(e.plugins),e.settings&&(r.settings=Qu(!0,r.settings,e.settings))}function l(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError("Expected a list of plugins, not `"+e+"`");for(;++t<e.length;){o(e[t])}}}function s(e,t){let r=-1,o=-1;for(;++r<n.length;)if(n[r][0]===e){o=r;break}if(-1===o)n.push([e,...t]);else if(t.length>0){let[r,...i]=t;const l=n[o][1];Mu(l)&&Mu(r)&&(r=Qu(!0,l,r)),n[o]=[e,r,...i]}}}}const Yu=(new Wu).freeze();function Ku(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Xu(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ju(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Zu(e){if(!Mu(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function $u(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ed(e){return function(e){return Boolean(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new zu(e)}const td=[],nd={allowDangerousHtml:!0},rd=/^(https?|ircs?|mailto|xmpp)$/i,od=[{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:"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 id(e){const t=function(e){const t=e.rehypePlugins||td,n=e.remarkPlugins||td,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nd}:nd,o=Yu().use(zc).use(n).use(bu,r).use(t);return o}(e),r=function(e){const t=e.children||"",n=new zu;"string"==typeof t&&(n.value=t);return n}(e);return function(e,t){const r=t.allowedElements,o=t.allowElement,i=t.components,l=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,A=t.urlTransform||ld;for(const e of od)Object.hasOwn(t,e.from)&&ss((e.from,e.to&&e.to,e.id));t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:"root"===e.type?e.children:[e]});return du(e,c),La(e,{Fragment:n.Fragment,components:i,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0});function c(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return s?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in Va)if(Object.hasOwn(Va,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Va[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=A(String(n||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!l&&l.includes(e.tagName);if(!i&&o&&"number"==typeof t&&(i=!o(e,t,n)),i&&n&&"number"==typeof t)return a&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}(t.runSync(t.parse(r),r),e)}function ld(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return-1===t||-1!==o&&t>o||-1!==n&&t>n||-1!==r&&t>r||rd.test(e.slice(0,t))?e:""}function sd(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}function ad(e,t,n){const r=iu((n||{}).ignore||[]),o=function(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const e=n[r];t.push([Ad(e[0]),cd(e[1])])}return t}(t);let i=-1;for(;++i<o.length;)uu(e,"text",l);function l(e,t){let n,l=-1;for(;++l<t.length;){const e=t[l],o=n?n.children:void 0;if(r(e,o?o.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){const n=t[t.length-1],r=o[i][0],l=o[i][1];let s=0;const a=n.children.indexOf(e);let A=!1,c=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){const n=u.index,o={index:u.index,input:u.input,stack:[...t,e]};let i=l(...u,o);if("string"==typeof i&&(i=i.length>0?{type:"text",value:i}:void 0),!1===i?r.lastIndex=n+1:(s!==n&&c.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(i)?c.push(...i):i&&c.push(i),s=n+u[0].length,A=!0),!r.global)break;u=r.exec(e.value)}A?(s<e.value.length&&c.push({type:"text",value:e.value.slice(s)}),n.children.splice(a,1,...c)):c=[e];return a+c.length}(e,t)}}function Ad(e){return"string"==typeof e?new RegExp(function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(e),"g"):e}function cd(e){return"function"==typeof e?e:function(){return e}}const ud="phrasing",dd=["autolink","link","image","label"];function fd(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pd(e){this.config.enter.autolinkProtocol.call(this,e)}function hd(e){this.config.exit.autolinkProtocol.call(this,e)}function gd(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function md(e){this.config.exit.autolinkEmail.call(this,e)}function vd(e){this.exit(e)}function yd(e){ad(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wd],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,bd]],{ignore:["link","linkReference"]})}function wd(e,t,n,r,o){let i="";if(!xd(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",i="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const l=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=sd(e,"(");let i=sd(e,")");for(;-1!==r&&o>i;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[e,n]}(n+r);if(!l[0])return!1;const s={type:"link",title:null,url:i+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[s,{type:"text",value:l[1]}]:s}function bd(e,t,n,r){return!(!xd(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xd(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||mA(n)||gA(n))&&(!t||47!==n)}function kd(){this.buffer()}function Ed(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Cd(){this.buffer()}function Pd(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Sd(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=iA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Dd(e){this.exit(e)}function Bd(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=iA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Id(e){this.exit(e)}function Td(e,t,n,r){const o=n.createTracker(r);let i=o.move("[^");const l=n.enter("footnoteReference"),s=n.enter("reference");return i+=o.move(n.safe(n.associationId(e),{after:"]",before:i})),s(),l(),i+=o.move("]"),i}function Qd(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:function(e,n,r,o){const i=r.createTracker(o);let l=i.move("[^");const s=r.enter("footnoteDefinition"),a=r.enter("label");l+=i.move(r.safe(r.associationId(e),{before:l,after:"]"})),a(),l+=i.move("]:"),e.children&&e.children.length>0&&(i.shift(4),l+=i.move((t?"\n":" ")+r.indentLines(r.containerFlow(e,i.current()),t?Od:Md)));return s(),l},footnoteReference:Td},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}}function Md(e,t,n){return 0===t?e:Od(e,t,n)}function Od(e,t,n){return(n?"":" ")+e}Td.peek=function(){return"["};const Ld=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function Rd(e){this.enter({type:"delete",children:[]},e)}function jd(e){this.exit(e)}function Nd(e,t,n,r){const o=n.createTracker(r),i=n.enter("strikethrough");let l=o.move("~~");return l+=n.containerPhrasing(e,{...o.current(),before:l,after:"~"}),l+=o.move("~~"),i(),l}function Fd(e){return e.length}function Hd(e){return null==e?"":String(e)}function zd(e){const t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:82===t||114===t?114:0}function Ud(e,t,n){return">"+(n?"":" ")+e}function _d(e,t){return qd(e,t.inConstruct,!0)&&!qd(e,t.notInConstruct,!1)}function qd(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Vd(e,t,n,r){let o=-1;for(;++o<n.unsafe.length;)if("\n"===n.unsafe[o].character&&_d(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function Gd(e,t,n){return(n?"":" ")+e}function Wd(e){const t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Yd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Kd(e,t,n){const r=EA(e),o=EA(t);return void 0===r?void 0===o?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===o?{inside:!1,outside:!1}:1===o?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Xd(e,t,n,r){const o=function(e){const t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),i=n.enter("emphasis"),l=n.createTracker(r),s=l.move(o);let a=l.move(n.containerPhrasing(e,{after:o,before:s,...l.current()}));const A=a.charCodeAt(0),c=Kd(r.before.charCodeAt(r.before.length-1),A,o);c.inside&&(a=Yd(A)+a.slice(1));const u=a.charCodeAt(a.length-1),d=Kd(r.after.charCodeAt(0),u,o);d.inside&&(a=a.slice(0,-1)+Yd(u));const f=l.move(o);return i(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+a+f}function Jd(e){return e.value||""}function Zd(e,t,n,r){const o=Wd(n),i='"'===o?"Quote":"Apostrophe",l=n.enter("image");let s=n.enter("label");const a=n.createTracker(r);let A=a.move("![");return A+=a.move(n.safe(e.alt,{before:A,after:"]",...a.current()})),A+=a.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),A+=a.move("<"),A+=a.move(n.safe(e.url,{before:A,after:">",...a.current()})),A+=a.move(">")):(s=n.enter("destinationRaw"),A+=a.move(n.safe(e.url,{before:A,after:e.title?" ":")",...a.current()}))),s(),e.title&&(s=n.enter(`title${i}`),A+=a.move(" "+o),A+=a.move(n.safe(e.title,{before:A,after:o,...a.current()})),A+=a.move(o),s()),A+=a.move(")"),l(),A}function $d(e,t,n,r){const o=e.referenceType,i=n.enter("imageReference");let l=n.enter("label");const s=n.createTracker(r);let a=s.move("![");const A=n.safe(e.alt,{before:a,after:"]",...s.current()});a+=s.move(A+"]["),l();const c=n.stack;n.stack=[],l=n.enter("reference");const u=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=c,i(),"full"!==o&&A&&A===u?"shortcut"===o?a=a.slice(0,-1):a+=s.move("]"):a+=s.move(u+"]"),a}function ef(e,t,n){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const e=n.unsafe[i],t=n.compilePattern(e);let o;if(e.atBreak)for(;o=t.exec(r);){let e=o.index;10===r.charCodeAt(e)&&13===r.charCodeAt(e-1)&&e--,r=r.slice(0,e)+" "+r.slice(o.index+1)}}return o+r+o}function tf(e,t){const n=Wa(e);return Boolean(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function nf(e,t,n,r){const o=Wd(n),i='"'===o?"Quote":"Apostrophe",l=n.createTracker(r);let s,a;if(tf(e,n)){const t=n.stack;n.stack=[],s=n.enter("autolink");let r=l.move("<");return r+=l.move(n.containerPhrasing(e,{before:r,after:">",...l.current()})),r+=l.move(">"),s(),n.stack=t,r}s=n.enter("link"),a=n.enter("label");let A=l.move("[");return A+=l.move(n.containerPhrasing(e,{before:A,after:"](",...l.current()})),A+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),A+=l.move("<"),A+=l.move(n.safe(e.url,{before:A,after:">",...l.current()})),A+=l.move(">")):(a=n.enter("destinationRaw"),A+=l.move(n.safe(e.url,{before:A,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${i}`),A+=l.move(" "+o),A+=l.move(n.safe(e.title,{before:A,after:o,...l.current()})),A+=l.move(o),a()),A+=l.move(")"),s(),A}function rf(e,t,n,r){const o=e.referenceType,i=n.enter("linkReference");let l=n.enter("label");const s=n.createTracker(r);let a=s.move("[");const A=n.containerPhrasing(e,{before:a,after:"]",...s.current()});a+=s.move(A+"]["),l();const c=n.stack;n.stack=[],l=n.enter("reference");const u=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=c,i(),"full"!==o&&A&&A===u?"shortcut"===o?a=a.slice(0,-1):a+=s.move("]"):a+=s.move(u+"]"),a}function of(e){const t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lf(e){const t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}Nd.peek=function(){return"~"},Xd.peek=function(e,t,n){return n.options.emphasis||"*"},Jd.peek=function(){return"<"},Zd.peek=function(){return"!"},$d.peek=function(){return"!"},ef.peek=function(){return"`"},nf.peek=function(e,t,n){return tf(e,n)?"<":"["},rf.peek=function(){return"["};const sf=iu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function af(e,t,n,r){const o=function(e){const t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),i=n.enter("strong"),l=n.createTracker(r),s=l.move(o+o);let a=l.move(n.containerPhrasing(e,{after:o,before:s,...l.current()}));const A=a.charCodeAt(0),c=Kd(r.before.charCodeAt(r.before.length-1),A,o);c.inside&&(a=Yd(A)+a.slice(1));const u=a.charCodeAt(a.length-1),d=Kd(r.after.charCodeAt(0),u,o);d.inside&&(a=a.slice(0,-1)+Yd(u));const f=l.move(o+o);return i(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+a+f}af.peek=function(e,t,n){return n.options.strong||"*"};const Af={blockquote:function(e,t,n,r){const o=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const l=n.indentLines(n.containerFlow(e,i.current()),Ud);return o(),l},break:Vd,code:function(e,t,n,r){const o=function(e){const t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),i=e.value||"",l="`"===o?"GraveAccent":"Tilde";if(function(e,t){return Boolean(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}(e,n)){const e=n.enter("codeIndented"),t=n.indentLines(i,Gd);return e(),t}const s=n.createTracker(r),a=o.repeat(Math.max(function(e,t){const n=String(e);let r=n.indexOf(t),o=r,i=0,l=0;if("string"!=typeof t)throw new TypeError("Expected substring");for(;-1!==r;)r===o?++i>l&&(l=i):i=1,o=r+t.length,r=n.indexOf(t,o);return l}(i,o)+1,3)),A=n.enter("codeFenced");let c=s.move(a);if(e.lang){const t=n.enter(`codeFencedLang${l}`);c+=s.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){const t=n.enter(`codeFencedMeta${l}`);c+=s.move(" "),c+=s.move(n.safe(e.meta,{before:c,after:"\n",encode:["`"],...s.current()})),t()}return c+=s.move("\n"),i&&(c+=s.move(i+"\n")),c+=s.move(a),A(),c},definition:function(e,t,n,r){const o=Wd(n),i='"'===o?"Quote":"Apostrophe",l=n.enter("definition");let s=n.enter("label");const a=n.createTracker(r);let A=a.move("[");return A+=a.move(n.safe(n.associationId(e),{before:A,after:"]",...a.current()})),A+=a.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),A+=a.move("<"),A+=a.move(n.safe(e.url,{before:A,after:">",...a.current()})),A+=a.move(">")):(s=n.enter("destinationRaw"),A+=a.move(n.safe(e.url,{before:A,after:e.title?" ":"\n",...a.current()}))),s(),e.title&&(s=n.enter(`title${i}`),A+=a.move(" "+o),A+=a.move(n.safe(e.title,{before:A,after:o,...a.current()})),A+=a.move(o),s()),l(),A},emphasis:Xd,hardBreak:Vd,heading:function(e,t,n,r){const o=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(r);if(function(e,t){let n=!1;return du(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,cu}),Boolean((!e.depth||e.depth<3)&&Wa(e)&&(t.options.setext||n))}(e,n)){const t=n.enter("headingSetext"),r=n.enter("phrasing"),l=n.containerPhrasing(e,{...i.current(),before:"\n",after:"\n"});return r(),t(),l+"\n"+(1===o?"=":"-").repeat(l.length-(Math.max(l.lastIndexOf("\r"),l.lastIndexOf("\n"))+1))}const l="#".repeat(o),s=n.enter("headingAtx"),a=n.enter("phrasing");i.move(l+" ");let A=n.containerPhrasing(e,{before:"# ",after:"\n",...i.current()});return/^[\t ]/.test(A)&&(A=Yd(A.charCodeAt(0))+A.slice(1)),A=A?l+" "+A:l,n.options.closeAtx&&(A+=" "+l),a(),s(),A},html:Jd,image:Zd,imageReference:$d,inlineCode:ef,link:nf,linkReference:rf,list:function(e,t,n,r){const o=n.enter("list"),i=n.bulletCurrent;let l=e.ordered?function(e){const t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):of(n);const s=e.ordered?"."===l?")":".":function(e){const t=of(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n);let a=!(!t||!n.bulletLastUsed)&&l===n.bulletLastUsed;if(!e.ordered){const t=e.children?e.children[0]:void 0;if("*"!==l&&"-"!==l||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(a=!0),lf(n)===l&&t){let t=-1;for(;++t<e.children.length;){const n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){a=!0;break}}}}a&&(l=s),n.bulletCurrent=l;const A=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=i,o(),A},listItem:function(e,t,n,r){const o=function(e){const t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n);let i=n.bulletCurrent||of(n);t&&"list"===t.type&&t.ordered&&(i=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+i);let l=i.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(l=4*Math.ceil(l/4));const s=n.createTracker(r);s.move(i+" ".repeat(l-i.length)),s.shift(l);const a=n.enter("listItem"),A=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){if(t)return(n?"":" ".repeat(l))+e;return(n?i:i+" ".repeat(l-i.length))+e});return a(),A},paragraph:function(e,t,n,r){const o=n.enter("paragraph"),i=n.enter("phrasing"),l=n.containerPhrasing(e,r);return i(),o(),l},root:function(e,t,n,r){const o=e.children.some(function(e){return sf(e)});return(o?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:af,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){const r=(lf(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}};function cf(e){const t=e._align;this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function uf(e){this.exit(e),this.data.inTable=void 0}function df(e){this.enter({type:"tableRow",children:[]},e)}function ff(e){this.exit(e)}function pf(e){this.enter({type:"tableCell",children:[]},e)}function hf(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gf));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gf(e,t){return"|"===t?t:e}function mf(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=Af.inlineCode(e,t,n);n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&"));return r},table:function(e,t,n,r){return s(function(e,t,n){const r=e.children;let o=-1;const i=[],l=t.enter("table");for(;++o<r.length;)i[o]=a(r[o],t,n);return l(),i}(e,n,r),e.align)},tableCell:l,tableRow:function(e,t,n,r){const o=a(e,n,r),i=s([o]);return i.slice(0,i.indexOf("\n"))}}};function l(e,t,n,r){const o=n.enter("tableCell"),l=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:i,after:i});return l(),o(),s}function s(e,t){return function(e,t){const n=t||{},r=(n.align||[]).concat(),o=n.stringLength||Fd,i=[],l=[],s=[],a=[];let A=0,c=-1;for(;++c<e.length;){const t=[],r=[];let i=-1;for(e[c].length>A&&(A=e[c].length);++i<e[c].length;){const l=Hd(e[c][i]);if(!1!==n.alignDelimiters){const e=o(l);r[i]=e,(void 0===a[i]||e>a[i])&&(a[i]=e)}t.push(l)}l[c]=t,s[c]=r}let u=-1;if("object"==typeof r&&"length"in r)for(;++u<A;)i[u]=zd(r[u]);else{const e=zd(r);for(;++u<A;)i[u]=e}u=-1;const d=[],f=[];for(;++u<A;){const e=i[u];let t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let o=!1===n.alignDelimiters?1:Math.max(1,a[u]-t.length-r.length);const l=t+"-".repeat(o)+r;!1!==n.alignDelimiters&&(o=t.length+o+r.length,o>a[u]&&(a[u]=o),f[u]=o),d[u]=l}l.splice(1,0,d),s.splice(1,0,f),c=-1;const p=[];for(;++c<l.length;){const e=l[c],t=s[c];u=-1;const r=[];for(;++u<A;){const o=e[u]||"";let l="",s="";if(!1!==n.alignDelimiters){const e=a[u]-(t[u]||0),n=i[u];114===n?l=" ".repeat(e):99===n?e%2?(l=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):(l=" ".repeat(e/2),s=l):s=" ".repeat(e)}!1===n.delimiterStart||u||r.push("|"),!1===n.padding||!1===n.alignDelimiters&&""===o||!1===n.delimiterStart&&!u||r.push(" "),!1!==n.alignDelimiters&&r.push(l),r.push(o),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),!1===n.delimiterEnd&&u===A-1||r.push("|")}p.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return p.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:o})}function a(e,t,n){const r=e.children;let o=-1;const i=[],s=t.enter("tableRow");for(;++o<r.length;)i[o]=l(r[o],0,t,n);return s(),i}}function vf(e){const t=this.stack[this.stack.length-2];t.type,t.checked="taskListCheckValueChecked"===e.type}function yf(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){const e=this.stack[this.stack.length-1];e.type;const n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,i=-1;for(;++i<r.length;){const e=r[i];if("paragraph"===e.type){o=e;break}}o===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function wf(e,t,n,r){const o=e.children[0],i="boolean"==typeof e.checked&&o&&"paragraph"===o.type,l="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);i&&s.move(l);let a=Af.listItem(e,t,n,{...r,...s.current()});return i&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+l})),a}const bf={tokenize:function(e,t,n){let r=0;return function t(i){if((87===i||119===i)&&r<3)return r++,e.consume(i),t;if(46===i&&3===r)return e.consume(i),o;return n(i)};function o(e){return null===e?n(e):t(e)}},partial:!0},xf={tokenize:function(e,t,n){let r,o,i;return l;function l(t){return 46===t||95===t?e.check(Ef,a,s)(t):null===t||pA(t)||mA(t)||45!==t&&gA(t)?a(t):(i=!0,e.consume(t),l)}function s(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),l}function a(e){return o||r||!i?n(e):t(e)}},partial:!0},kf={tokenize:function(e,t){let n=0,r=0;return o;function o(l){return 40===l?(n++,e.consume(l),o):41===l&&r<n?i(l):33===l||34===l||38===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||60===l||63===l||93===l||95===l||126===l?e.check(Ef,t,i)(l):null===l||pA(l)||mA(l)?t(l):(e.consume(l),o)}function i(t){return 41===t&&r++,e.consume(t),o}},partial:!0},Ef={tokenize:function(e,t,n){return r;function r(l){return 33===l||34===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||63===l||95===l||126===l?(e.consume(l),r):38===l?(e.consume(l),i):93===l?(e.consume(l),o):60===l||null===l||pA(l)||mA(l)?t(l):n(l)}function o(e){return null===e||40===e||91===e||pA(e)||mA(e)?t(e):r(e)}function i(e){return lA(e)?l(e):n(e)}function l(t){return 59===t?(e.consume(t),r):lA(t)?(e.consume(t),l):n(t)}},partial:!0},Cf={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return sA(e)?n(e):t(e)}},partial:!0},Pf={name:"wwwAutolink",tokenize:function(e,t,n){const r=this;return function(t){if(87!==t&&119!==t||!Tf.call(r,r.previous)||Lf(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(bf,e.attempt(xf,e.attempt(kf,o),n),n)(t)};function o(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:Tf},Sf={name:"protocolAutolink",tokenize:function(e,t,n){const r=this;let o="",i=!1;return function(t){if((72===t||104===t)&&Qf.call(r,r.previous)&&!Lf(r.events))return e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(t),e.consume(t),l;return n(t)};function l(t){if(lA(t)&&o.length<5)return o+=String.fromCodePoint(t),e.consume(t),l;if(58===t){const n=o.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),i?a:(i=!0,s)):n(t)}function a(t){return null===t||AA(t)||pA(t)||mA(t)||gA(t)?n(t):e.attempt(xf,e.attempt(kf,A),n)(t)}function A(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:Qf},Df={name:"emailAutolink",tokenize:function(e,t,n){const r=this;let o,i;return function(t){if(!Of(t)||!Mf.call(r,r.previous)||Lf(r.events))return n(t);return e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(t)};function l(t){return Of(t)?(e.consume(t),l):64===t?(e.consume(t),s):n(t)}function s(t){return 46===t?e.check(Cf,A,a)(t):45===t||95===t||sA(t)?(i=!0,e.consume(t),s):A(t)}function a(t){return e.consume(t),o=!0,s}function A(l){return i&&o&&lA(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(l)):n(l)}},previous:Mf},Bf={};let If=48;for(;If<123;)Bf[If]=Df,If++,58===If?If=65:91===If&&(If=97);function Tf(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||pA(e)}function Qf(e){return!lA(e)}function Mf(e){return!(47===e||Of(e))}function Of(e){return 43===e||45===e||46===e||95===e||sA(e)}function Lf(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}Bf[43]=Df,Bf[45]=Df,Bf[46]=Df,Bf[95]=Df,Bf[72]=[Df,Sf],Bf[104]=[Df,Sf],Bf[87]=[Df,Pf],Bf[119]=[Df,Pf];const Rf={tokenize:function(e,t,n){const r=this;return wA(e,function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function jf(e,t,n){const r=this;let o=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){l=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!l||!l._balanced)return n(o);const s=iA(r.sliceSerialize({start:l.end,end:r.now()}));if(94!==s.codePointAt(0)||!i.includes(s.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function Nf(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function Ff(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(s){if(l>999||93===s&&!i||null===s||91===s||pA(s))return n(s);if(93===s){e.exit("chunkString");const i=e.exit("gfmFootnoteCallString");return o.includes(iA(r.sliceSerialize(i)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return pA(s)||(i=!0),l++,e.consume(s),92===s?A:a}function A(t){return 91===t||92===t||93===t?(e.consume(t),l++,a):a(t)}}function Hf(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,l,s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),a};function a(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",A):n(t)}function A(t){if(s>999||93===t&&!l||null===t||91===t||pA(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return i=iA(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return pA(t)||(l=!0),s++,e.consume(t),92===t?c:A}function c(t){return 91===t||92===t||93===t?(e.consume(t),s++,A):A(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(i)||o.push(i),wA(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function zf(e,t,n){return e.check(BA,t,e.attempt(Rf,t,n))}function Uf(e){e.exit("gfmFootnoteDefinition")}function _f(e){let t=(e||{}).singleTilde;const n={name:"strikethrough",tokenize:function(e,n,r){const o=this.previous,i=this.events;let l=0;return function(t){if(126===o&&"characterEscape"!==i[i.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),s(t)};function s(i){const a=EA(o);if(126===i)return l>1?r(i):(e.consume(i),l++,s);if(l<2&&!t)return r(i);const A=e.exit("strikethroughSequenceTemporary"),c=EA(i);return A._open=!c||2===c&&Boolean(a),A._close=!a||2===a&&Boolean(c),n(i)}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";const o={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},i={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},l=[["enter",o,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",i,t]],s=t.parser.constructs.insideSpan.null;s&&Za(l,l.length,0,CA(s,e.slice(r+1,n),t)),Za(l,l.length,0,[["exit",i,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",o,t]]),Za(e,r-1,n-r+3,l),n=r+l.length-2;break}}n=-1;for(;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}};return null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}}class qf{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let o=0;if(0===n&&0===r.length)return;for(;o<e.map.length;){if(e.map[o][0]===t)return e.map[o][1]+=n,void e.map[o][2].push(...r);o+=1}e.map.push([t,n,r])}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(const t of r)e.push(t);r=n.pop()}this.map.length=0}}function Vf(e,t){let n=!1;const r=[];for(;t<e.length;){const o=e[t];if(n){if("enter"===o[0])"tableContent"===o[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===o[1].type){if("tableDelimiterMarker"===e[t-1][1].type){const e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===o[1].type)break}else"enter"===o[0]&&"tableDelimiterRow"===o[1].type&&(n=!0);t+=1}return r}function Gf(e,t,n){const r=this;let o,i=0,l=0;return function(e){let t=r.events.length-1;for(;t>-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,i="tableHead"===o||"tableRow"===o?w:s;if(i===w&&r.parser.lazy[r.now().line])return n(e);return i(e)};function s(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return a(e);return o=!0,l+=1,a(e)}(t)}function a(t){return null===t?n(t):fA(t)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):hA(t)?wA(e,a,"whitespace")(t):(l+=1,o&&(o=!1,i+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,a):(e.enter("data"),A(t)))}function A(t){return null===t||124===t||pA(t)?(e.exit("data"),a(t)):(e.consume(t),92===t?c:A)}function c(t){return 92===t||124===t?(e.consume(t),A):A(t)}function u(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,hA(t)?wA(e,d,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):d(t))}function d(t){return 45===t||58===t?p(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),f):y(t)}function f(t){return hA(t)?wA(e,p,"whitespace")(t):p(t)}function p(t){return 58===t?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(l+=1,h(t)):null===t||fA(t)?v(t):y(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):y(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):(e.exit("tableDelimiterFiller"),m(t))}function m(t){return hA(t)?wA(e,v,"whitespace")(t):v(t)}function v(n){return 124===n?d(n):(null===n||fA(n))&&o&&i===l?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):y(n)}function y(e){return n(e)}function w(t){return e.enter("tableRow"),b(t)}function b(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),b):null===n||fA(n)?(e.exit("tableRow"),t(n)):hA(n)?wA(e,b,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||pA(t)?(e.exit("data"),b(t)):(e.consume(t),92===t?k:x)}function k(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function Wf(e,t){let n,r,o,i=-1,l=!0,s=0,a=[0,0,0,0],A=[0,0,0,0],c=!1,u=0;const d=new qf;for(;++i<e.length;){const f=e[i],p=f[1];"enter"===f[0]?"tableHead"===p.type?(c=!1,0!==u&&(Kf(d,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(i,0,[["enter",n,t]])):"tableRow"===p.type||"tableDelimiterRow"===p.type?(l=!0,o=void 0,a=[0,0,0,0],A=[0,i+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(i,0,[["enter",r,t]])),s="tableDelimiterRow"===p.type?2:r?3:1):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type?"tableCellDivider"===p.type&&(l?l=!1:(0!==a[1]&&(A[0]=A[1],o=Yf(d,t,a,s,void 0,o)),a=A,A=[a[1],i,0,0])):(l=!1,0===A[2]&&(0!==a[1]&&(A[0]=A[1],o=Yf(d,t,a,s,void 0,o),a=[0,0,0,0]),A[2]=i)):"tableHead"===p.type?(c=!0,u=i):"tableRow"===p.type||"tableDelimiterRow"===p.type?(u=i,0!==a[1]?(A[0]=A[1],o=Yf(d,t,a,s,i,o)):0!==A[1]&&(o=Yf(d,t,A,s,i,o)),s=0):!s||"data"!==p.type&&"tableDelimiterMarker"!==p.type&&"tableDelimiterFiller"!==p.type||(A[3]=i)}for(0!==u&&Kf(d,t,u,n,r),d.consume(t.events),i=-1;++i<t.events.length;){const e=t.events[i];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=Vf(t.events,i))}return e}function Yf(e,t,n,r,o,i){const l=1===r?"tableHeader":2===r?"tableDelimiter":"tableData";0!==n[0]&&(i.end=Object.assign({},Xf(t.events,n[0])),e.add(n[0],0,[["exit",i,t]]));const s=Xf(t.events,n[1]);if(i={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",i,t]]),0!==n[2]){const o=Xf(t.events,n[2]),i=Xf(t.events,n[3]),l={type:"tableContent",start:Object.assign({},o),end:Object.assign({},i)};if(e.add(n[2],0,[["enter",l,t]]),2!==r){const r=t.events[n[2]],o=t.events[n[3]];if(r[1].end=Object.assign({},o[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",l,t]])}return void 0!==o&&(i.end=Object.assign({},Xf(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function Kf(e,t,n,r,o){const i=[],l=Xf(t.events,n);o&&(o.end=Object.assign({},l),i.push(["exit",o,t])),r.end=Object.assign({},l),i.push(["exit",r,t]),e.add(n+1,0,i)}function Xf(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const Jf={name:"tasklistCheck",tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return pA(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),i):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),i):n(t)}function i(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(t)}function l(r){return fA(r)?t(r):hA(r)?e.check({tokenize:Zf},t,n)(r):n(r)}}};function Zf(e,t,n){return wA(e,function(e){return null===e?n(e):t(e)},"whitespace")}const $f={};function ep(e){const t=e||$f,n=this.data(),r=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),i=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);r.push(function(e){return tA([{text:Bf},{document:{91:{name:"gfmFootnoteDefinition",tokenize:Hf,continuation:{tokenize:zf},exit:Uf}},text:{91:{name:"gfmFootnoteCall",tokenize:Ff},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jf,resolveTo:Nf}}},_f(e),{flow:{null:{name:"table",tokenize:Gf,resolveAll:Wf}}},{text:{91:Jf}}])}(t)),o.push([{transforms:[yd],enter:{literalAutolink:fd,literalAutolinkEmail:pd,literalAutolinkHttp:pd,literalAutolinkWww:pd},exit:{literalAutolink:vd,literalAutolinkEmail:md,literalAutolinkHttp:hd,literalAutolinkWww:gd}},{enter:{gfmFootnoteCallString:kd,gfmFootnoteCall:Ed,gfmFootnoteDefinitionLabelString:Cd,gfmFootnoteDefinition:Pd},exit:{gfmFootnoteCallString:Sd,gfmFootnoteCall:Dd,gfmFootnoteDefinitionLabelString:Bd,gfmFootnoteDefinition:Id}},{canContainEols:["delete"],enter:{strikethrough:Rd},exit:{strikethrough:jd}},{enter:{table:cf,tableData:pf,tableHeader:pf,tableRow:df},exit:{codeText:hf,table:uf,tableData:ff,tableHeader:ff,tableRow:ff}},{exit:{taskListCheckValueChecked:vf,taskListCheckValueUnchecked:vf,paragraph:yf}}]),i.push(function(e){return{extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ud,notInConstruct:dd},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ud,notInConstruct:dd},{character:":",before:"[ps]",after:"\\/",inConstruct:ud,notInConstruct:dd}]},Qd(e),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ld}],handlers:{delete:Nd}},mf(e),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wf}}]}}(t))}const tp="rgba(0, 0, 0, 0.3)",np={p:t=>{let{children:n}=t;return e.createElement("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"}},n)},ul:t=>{let{children:n}=t;return e.createElement("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"}},n)},ol:t=>{let{children:n}=t;return e.createElement("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"}},n)},li:t=>{let{children:n}=t;return e.createElement("li",{style:{marginBottom:"1px",lineHeight:1.4}},n)},code:t=>{let{className:n,children:r}=t;return/\blanguage-/.test(n||"")?e.createElement("pre",{style:{backgroundColor:tp,padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"}},e.createElement("code",null,r)):e.createElement("code",{style:{backgroundColor:tp,padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"}},r)},blockquote:t=>{let{children:n}=t;return e.createElement("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid rgba(255, 255, 255, 0.4)",color:"inherit",fontStyle:"italic"}},n)},a:t=>{let{children:n,href:r}=t;return e.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline",fontWeight:600}},n)},table:t=>{let{children:n}=t;return e.createElement("table",{style:{borderCollapse:"collapse",width:"100%",margin:"0.5em 0",fontSize:"0.95em",color:"#fff"}},n)},th:t=>{let{children:n}=t;return e.createElement("th",{style:{border:"1px solid rgba(255, 255, 255, 0.4)",padding:"6px 10px",textAlign:"left",verticalAlign:"top",fontWeight:600,color:"#fff",backgroundColor:"rgba(255, 255, 255, 0.15)",overflowWrap:"normal",wordBreak:"normal"}},n)},td:t=>{let{children:n}=t;return e.createElement("td",{style:{border:"1px solid rgba(255, 255, 255, 0.4)",padding:"6px 10px",textAlign:"left",verticalAlign:"top",color:"#fff",overflowWrap:"normal",wordBreak:"normal"}},n)}},rp=t=>{let{children:n}=t;return e.createElement("div",{style:{whiteSpace:"normal"}},e.createElement(id,{remarkPlugins:[ep],components:np},"string"==typeof n?n:""))},op=e.forwardRef((t,n)=>{let{embedded:r,currentOpen:o,enabled:i,onSetEnabled:l}=t;const s=zt(),a=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=V();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),A=e.useRef(!1),c=e.useRef(!1);return e.useEffect(()=>{!r&&a&&a.toggleChatWindow&&(A.current===o||c.current||(setTimeout(()=>{a&&a.toggleChatWindow&&a.toggleChatWindow(o)},0),A.current=null!=o&&o),c.current=!1)},[o,r,a]),e.useEffect(()=>{const e=()=>{c.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),e.useImperativeHandle(n,()=>({addMessage:e=>{s&&s.injectMessage&&s.injectMessage(e)},openChat:()=>{!r&&a&&a.toggleChatWindow&&a.toggleChatWindow(!0)},closeChat:()=>{!r&&a&&a.toggleChatWindow&&a.toggleChatWindow(!1)},toggleChat:()=>{!r&&a&&a.toggleChatWindow&&a.toggleChatWindow()},setBotEnabled:e=>{l&&l(e)}}),[s,a,r,l]),null});op.displayName="BotController";const ip=e.createContext(null),lp=t=>{let{trackEvent:n,children:r}=t;const o=e.useRef(n);return o.current=n,e.createElement(ip.Provider,{value:{trackEvent:e=>o.current(e)}},r)},sp=()=>{const t=e.useContext(ip);return t||{trackEvent:()=>{}}},ap=t=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:i=!1}=t;const{trackEvent:l}=sp(),s=i?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return e.createElement(e.Fragment,null,i&&e.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),e.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:`qa-bot-login-button ${i?"qa-bot-header-login-button":""} ${r}`,style:Object.assign(Object.assign({},s),o),onClick:()=>{l({type:"chatbot_login_clicked",loginUrl:n})}},"Log In"))},Ap=()=>e.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},e.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElement("circle",{cx:"12",cy:"7",r:"4"}))),cp=[];for(let e=0;e<256;++e)cp.push((e+256).toString(16).slice(1));let up;const dp=new Uint8Array(16);var fp={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function pp(e,t,n){if(fp.randomUUID&&!e)return fp.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!up){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");up=crypto.getRandomValues.bind(crypto)}return up(dp)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(cp[e[t+0]]+cp[e[t+1]]+cp[e[t+2]]+cp[e[t+3]]+"-"+cp[e[t+4]]+cp[e[t+5]]+"-"+cp[e[t+6]]+cp[e[t+7]]+"-"+cp[e[t+8]]+cp[e[t+9]]+"-"+cp[e[t+10]]+cp[e[t+11]]+cp[e[t+12]]+cp[e[t+13]]+cp[e[t+14]]+cp[e[t+15]]).toLowerCase()}(r)}function hp(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const gp="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",mp="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",vp="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",yp="background: #f97316; color: white; padding: 2px 6px; border-radius: 3px;",wp="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",bp="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",xp=()=>{hp()&&console.log("%c QA Bot Core %c v0.5.0 ",wp,bp)},kp=function(e){if(hp()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(`%c[Session]%c ${e}`,gp,"",...n)}},Ep=function(e){if(hp()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(`%c[History]%c ${e}`,mp,"",...n)}},Cp=(e,t)=>{hp()&&console.log(`%c[Message]%c ${e}`,vp,"",t)},Pp=function(e){if(hp()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log(`%c[Turnstile]%c ${e}`,yp,"",...n)}},Sp=function(){console.warn(...arguments)},Dp=function(){console.error(...arguments)},Bp="qa_bot_session_messages",Ip=()=>`qa_bot_session_${pp()}`,Tp=()=>{try{const e=localStorage.getItem(Bp);return e?JSON.parse(e):{}}catch(e){return{}}},Qp=(e,t,n,r,o)=>{const i=Tp();!i[e]&&(i[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},Ep("NEW session created",{sessionId:e.slice(-12)}));if(i[e].messages.some(e=>e.id===t))return void Ep("DUPLICATE message skipped",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r});const l={id:t,content:n,sender:r,type:o,timestamp:Date.now()};i[e].messages.push(l),Ep("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:i[e].messages.length});const s=i[e].messages,a=s.find(e=>{var t;return"bot"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())&&e.content.length>=100});if(a){const t=a.content;i[e].preview=t.slice(0,50)+(t.length>50?"...":"")}else{const t=s.find(e=>{var t;return"user"===e.sender.toLowerCase()&&(null===(t=e.content)||void 0===t?void 0:t.trim())});if(t&&!i[e].preview){const n=t.content;i[e].preview=n.slice(0,50)+(n.length>50?"...":"")}}(e=>{var t;const n=()=>Object.values(e).reduce((e,t)=>e+t.messages.length,0);for(;n()>100&&Object.keys(e).length>1;){const n=null===(t=Object.entries(e).sort((e,t)=>{let[,n]=e,[,r]=t;return new Date(n.startedAt).getTime()-new Date(r.startedAt).getTime()})[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(Bp,JSON.stringify(e))})(i),Ep("STORAGE state",{ourSessions:Object.keys(i).length,ourTotalMessages:Object.values(i).reduce((e,t)=>e+t.messages.length,0)})},Mp=e=>{var t,n;return null!==(n=null===(t=Tp()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},Op=e=>{const t=Tp()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},Lp=e.createContext(void 0),Rp=t=>{let{children:n,getSessionId:r,setSessionId:o,resetSession:i,clearResettingFlag:l}=t;return e.createElement(Lp.Provider,{value:{getSessionId:r,setSessionId:o,resetSession:i,clearResettingFlag:l}},n)},jp=()=>{const t=e.useContext(Lp);if(!t)throw new Error("useSession must be used within a SessionProvider");return t},Np=()=>{const[t,n]=e.useState(!1),[r,o]=e.useState([]),[i,l]=e.useState(null),[s,a]=e.useState(0),A=e.useRef(null),c=e.useRef(null),{replaceMessages:u}=zt(),{toggleTextAreaDisabled:d}=qt(),{setSessionId:f,getSessionId:p}=jp();e.useEffect(()=>{var e,r;const o=e=>{A.current&&!A.current.contains(e.target)&&c.current&&!c.current.contains(e.target)&&n(!1)},i=null!==(r=null===(e=A.current)||void 0===e?void 0:e.getRootNode())&&void 0!==r?r:document;return t&&i.addEventListener("mousedown",o),()=>{i.removeEventListener("mousedown",o)}},[t]);const h=e=>{var t;const r=p();if(Ep("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==r?void 0:r.slice(-12)}),e===r)return Ep("RESTORE skipped - already on this session"),void n(!1);const o=(e=>{var t;return(null===(t=Tp()[e])||void 0===t?void 0:t.messages)||[]})(e).filter(e=>{var t;return null===(t=e.content)||void 0===t?void 0:t.trim()});Ep("Stored messages from our localStorage",{count:o.length,ids:o.map(e=>e.id.slice(-8))});const i=o.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));f(e),Ep("Session ID updated",{newSession:e.slice(-12)}),u(i),Ep("replaceMessages called",{count:i.length}),(e=>{setTimeout(()=>{const t=(e||document).querySelector(".rcb-chat-body-container");t&&t.querySelectorAll(".rcb-bot-message").forEach(e=>{var t;let n=e.innerHTML,r=!1;n.includes("](")&&(n=n.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),r=!0),n.includes("&lt;a href=")&&(n=n.replace(/&lt;a\s+href=["']([^"']+)["'][^&]*&gt;([^&]+)&lt;\/a&gt;/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),(n.includes("&lt;a ")||(null===(t=e.textContent)||void 0===t?void 0:t.includes("<a href=")))&&(e.textContent||"").includes("<a href=")&&(n=n.replace(/&lt;a\s+href="([^"]+)"[^&]*&gt;([^&]+)&lt;\/a&gt;/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),r&&(e.innerHTML=n)})},50)})(null===(t=c.current)||void 0===t?void 0:t.getRootNode()),d(!1),Ep("Chat input enabled after restore"),n(!1)};return e.createElement("div",{style:{position:"relative"}},e.createElement("button",{ref:c,className:"history-button",onClick:()=>{if(!t&&(o((()=>{const e=Tp();return Object.entries(e).map(e=>{let[t,n]=e;return Object.assign({sessionId:t},n)}).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime())})()),c.current)){const e=c.current.closest(".rcb-chat-window");if(e){const t=e.getBoundingClientRect(),n=c.current.getBoundingClientRect();l(t.width+3),a(t.right-n.right-18+4)}}n(!t)},style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"18px",display:"flex",border:"none",cursor:"pointer",padding:0},"aria-label":"View chat history",title:"View chat history","aria-expanded":t,"aria-haspopup":"menu"},e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("circle",{cx:"12",cy:"12",r:"10"}),e.createElement("polyline",{points:"12 6 12 12 16 14"}))),t&&e.createElement("div",{ref:A,role:"menu",style:{position:"absolute",right:s?`-${s}px`:"-18px",top:"100%",marginTop:"8px",width:i?`${i}px`:"550px",backgroundColor:"white",borderRadius:0,borderBottom:"3px solid var(--primaryColor, #1a5b6e)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",maxHeight:"250px",overflowY:"auto",zIndex:1e3}},0===r.length?e.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):r.map(t=>e.createElement("button",{key:t.sessionId,role:"menuitem",onClick:()=>h(t.sessionId),style:{width:"100%",padding:"10px 14px",border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left",display:"flex",flexDirection:"column",gap:"2px",borderBottom:"1px solid #eee"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},e.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.preview||"New conversation"),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},(e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/864e5);return 0===r?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):1===r?"Yesterday":r<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})})(t.startedAt))))))},Fp=t=>{var{width:n=24,height:r=24,color:o="currentColor",children:i}=t,l=a(t,["width","height","color","children"]);return e.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},l),i)},Hp=t=>e.createElement(Fp,t,e.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),zp=()=>{const{restartFlow:t}=Ht(),{setTextAreaValue:n}=qt(),{getSessionId:r,resetSession:o,clearResettingFlag:i}=jp(),{trackEvent:l}=sp();return e.createElement("button",{onClick:async()=>{const e=r(),s=e?Mp(e):0;l({type:"chatbot_new_chat",previousMessageCount:s}),o(),await n(""),await t(),setTimeout(()=>{i()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},e.createElement(Hp,{width:16,height:16}),"New Chat")};function Up(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(Up).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return Up(t.children)}return""}const _p=()=>{const{getSessionId:t}=jp(),n=e.useCallback(e=>{var n;const r=null===(n=e.data)||void 0===n?void 0:n.message;if(!(null==r?void 0:r.id))return;const o=r.sender,i=r.type||"string";let l;if(l="string"==typeof r.content?r.content:Up(r.content),Cp("TRACKED",{id:r.id,sender:o,content:l.substring(0,50)+(l.length>50?"...":"")}),l.includes("rcb-options-container"))return;if(!l.trim())return;const s=t();Qp(s,r.id,l,o,i)},[t]);return e.useEffect(()=>(window.addEventListener("rcb-pre-inject-message",n),window.addEventListener("rcb-stop-stream-message",n),()=>{window.removeEventListener("rcb-pre-inject-message",n),window.removeEventListener("rcb-stop-stream-message",n)}),[n]),null},qp=()=>(e.useEffect(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let i=[];if(o.length>0){const e=o[o.length-1],t=Array.from(e.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);if(t.length>0){const e=t[t.length-1];i=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===i.length)return;const l=i.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=l<i.length-1?l+1:0,i[t].setAttribute("tabindex","0"),i.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),i[t].classList.add("keyboard-focused"),i[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=l>0?l-1:i.length-1,i[t].setAttribute("tabindex","0"),i.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),i[t].classList.add("keyboard-focused"),i[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&i.includes(document.activeElement)){const e=document.activeElement;if(e.classList.contains("rcb-checkbox-row-container")||e.closest(".rcb-checkbox-row-container")){const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.querySelector(".rcb-checkbox-label"),o=r?r.textContent:e.textContent||"checkbox",i=e.querySelector(".rcb-checkbox-mark"),l=i&&i.style.backgroundColor?"checked":"unchecked";t(`${o} ${l}`)}else{const n=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(n);const r=e.textContent||e.innerText;t(`Selected: ${r}`)}}break;case"Home":e.preventDefault(),i.length>0&&(i[0].setAttribute("tabindex","0"),i.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),i[0].classList.add("keyboard-focused"),i[0].focus());break;case"End":if(e.preventDefault(),i.length>0){const e=i.length-1;i[e].setAttribute("tabindex","0"),i.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),i[e].classList.add("keyboard-focused"),i[e].focus()}}},t=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>{document.body.contains(t)&&document.body.removeChild(t)},1e3)},n=(e=null)=>{let n=e;if(n||(n=document.querySelector(".rcb-chat-window"),n||(n=document.querySelector('[class*="rcb-chat"]')),n||(n=document.querySelector(".qa-bot"))),!n)return;const r=null!==n.closest(".embedded-qa-bot"),o=Array.from(n.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(0===o.length)return;const i=o[o.length-1],l=Array.from(i.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let s=[];if(l.length>0){const e=l[l.length-1];s=Array.from(e.querySelectorAll(".rcb-options"))}if(0===s.length){let e=i.querySelector(".rcb-checkbox-container");if(!e&&n&&(e=n.querySelector(".rcb-checkbox-container")),e&&null!==e.offsetParent){const t=Array.from(e.querySelectorAll(".rcb-checkbox-row-container")).filter(e=>null!==e.offsetParent&&"none"!==e.style.display);if(t.length>0){const n=e.querySelector(".rcb-checkbox-next-button"),o=[...t];if(n&&null!==n.offsetParent&&o.push(n),o.forEach((e,t)=>{e.setAttribute("tabindex",0===t?"0":"-1"),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),t.length>1){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select/deselect, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}return void setTimeout(()=>{o[0]&&null!==o[0].offsetParent&&!r&&o[0].focus()},150)}}}if(s.length>0){if(s.forEach((e,t)=>{const n=0===t?"0":"-1";e.setAttribute("tabindex",n),e.setAttribute("role","option"),e.setAttribute("aria-posinset",t+1),e.setAttribute("aria-setsize",s.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),s.length>1){const e=l.length>0?l[l.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove());const t=document.createElement("div");t.className="keyboard-nav-hint",t.textContent="Use arrow keys ↕ to navigate, Enter to select, or click any option",t.style.cssText="font-size: 12px !important; color: #666 !important; margin-bottom: 8px !important; font-style: italic !important; display: block !important;",e.insertBefore(t,e.firstChild)}}else{const e=l.length>0?l[l.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{s[0]&&null!==s[0].offsetParent&&!r&&(s[0].focus(),s.length>1&&t(`${s.length} options available. Use arrow keys to navigate.`))},200)}},r=new MutationObserver(e=>{e.forEach(e=>{if("childList"===e.type){const t=Array.from(e.addedNodes),r=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-options-container")||e.classList?.contains("rcb-options")||e.querySelector?.(".rcb-options-container")||e.querySelector?.(".rcb-options"))),o=t.some(e=>e.nodeType===Node.ELEMENT_NODE&&(e.classList?.contains("rcb-checkbox-container")||e.querySelector?.(".rcb-checkbox-container")));if(r||o){let t=e.target;for(;t&&!t.classList?.contains("qa-bot")&&!t.classList?.contains("rcb-chat-window");)t=t.parentElement;(t||document).querySelectorAll(".rcb-options[tabindex], .rcb-checkbox-row-container[tabindex], .rcb-checkbox-next-button[tabindex]").forEach(e=>{e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused")}),setTimeout(()=>n(t),100)}}})});r.observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("keydown",e),n();const o=setInterval(()=>{document.querySelectorAll(".qa-bot").forEach(e=>{const t=e.querySelectorAll(".rcb-options-container .rcb-options").length>0,r=e.querySelectorAll(".rcb-checkbox-row-container").length>0;if(t){const t=e.querySelectorAll(".rcb-options[tabindex]").length;e.querySelectorAll(".rcb-options").length>t&&n(e)}if(r){const t=e.querySelectorAll(".rcb-checkbox-row-container[tabindex]").length;e.querySelectorAll(".rcb-checkbox-row-container").length>t&&n(e)}})},1e3);return()=>{document.removeEventListener("keydown",e),r.disconnect(),clearInterval(o)}},[]),null);let Vp=!1,Gp=null;function Wp(){return Vp?Promise.resolve():Gp||(Gp=new Promise((e,t)=>{const n=document.createElement("script");n.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",n.async=!0,n.onload=()=>{Vp=!0,Pp("Script loaded"),e()},n.onerror=()=>{Gp=null,t(new Error("Failed to load Turnstile script"))},document.head.appendChild(n)}),Gp)}const Yp=e=>{if(!e||"string"!=typeof e)return e;let t=e.replace(/\[(https?:\/\/[^\s]+?)\](?!\()/gi,"[$1]($1)");return t=t.replace(/(?<!\]\(|href=["']|\[)https?:\/\/[^\s[\]()]+/gi,e=>{let t=e,n="";const r=t.match(/([.,;:!?]+)$/);return r&&(n=r[1],t=t.slice(0,-n.length)),`[${t}](${t})${n}`}),t},Kp=t=>{let{siteKey:n,onVerify:r,onError:i,loginUrl:l}=t;const s=e.useRef(null),a=e.useRef(null),A=e.useRef(!1),c=e.useRef(null),u=e.useRef(null),[d,f]=e.useState(!1),[p,h]=e.useState(0),g=e.useRef("widget_error"),m=e.useRef(null),v=l&&"/login"!==l,y=e.useCallback(()=>{const e=window.turnstile;if(c.current&&(null==e?void 0:e.remove)){try{e.remove(c.current)}catch(e){}c.current=null}},[]),w=e.useCallback(()=>{var e;y(),d?null==i||i(g.current,null!==(e=m.current)&&void 0!==e?e:void 0):null==i||i("user_cancelled")},[i,y,d]);e.useEffect(()=>()=>{y()},[y]),e.useEffect(()=>{var e;return u.current=document.activeElement,null===(e=a.current)||void 0===e||e.focus(),()=>{u.current&&"function"==typeof u.current.focus&&u.current.focus()}},[]),e.useEffect(()=>{const e=e=>{if("Escape"===e.key)return e.preventDefault(),void w();if("Tab"===e.key&&a.current){const t=a.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):e.shiftKey||document.activeElement!==r||(e.preventDefault(),n.focus())}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[w]),e.useEffect(()=>{A.current||!s.current||d||(A.current=!0,Wp().then(()=>{const e=window.turnstile;if(!e||!s.current)return Dp("Turnstile API not available after script load"),g.current="api_unavailable",void f(!0);c.current=e.render(s.current,{sitekey:n,callback:e=>{Pp("Visible challenge completed"),r(e)},"error-callback":e=>(Dp("Turnstile challenge failed:",e),m.current=e,g.current="widget_error",y(),f(!0),!0),"expired-callback":()=>{Dp("Turnstile token expired"),g.current="token_expired",y(),f(!0)}})}).catch(e=>{Dp("Failed to load Turnstile script:",e),g.current="script_load_failed",f(!0)}))},[n,r,d,y]);const b=e.createElement(e.Fragment,null,e.createElement("div",{"aria-hidden":"true",style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.5)",zIndex:999998}}),e.createElement("div",{ref:a,role:"dialog","aria-modal":"true","aria-labelledby":"qa-bot-turnstile-label",tabIndex:-1,style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:999999,background:"white",padding:"24px",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.3)",maxWidth:"90vw",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'}},e.createElement("span",{id:"qa-bot-turnstile-label",className:"sr-only",style:{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap"}},"Verification challenge"),d?e.createElement("div",{style:{fontSize:"14px",lineHeight:"1.5",color:"#333"}},0===p?e.createElement("p",{style:{margin:"0 0 16px 0"}},"Verification failed. You can try again",v&&e.createElement(e.Fragment,null,", or"," ",e.createElement("a",{href:l,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primaryColor, #107180)",fontWeight:"bold"}},"log in")," ","to skip verification"),"."):e.createElement(e.Fragment,null,e.createElement("p",{style:{margin:"0 0 8px 0"}},"Verification is still not working. This can be caused by browser extensions (ad blockers, privacy tools) or VPN connections."),e.createElement("p",{style:{margin:"0 0 16px 0"}},"Try disabling extensions, using a private/incognito window,",v&&e.createElement(e.Fragment,null," ",e.createElement("a",{href:l,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primaryColor, #107180)",fontWeight:"bold"}},"logging in"),",")," ","or using a different browser.")),e.createElement("div",{style:{display:"flex",gap:"8px"}},e.createElement("button",{type:"button",onClick:()=>{y(),A.current=!1,h(e=>e+1),f(!1)},style:{padding:"8px 16px",background:"var(--primaryColor, #107180)",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"14px"}},"Try again"),e.createElement("button",{type:"button",onClick:w,style:{padding:"8px 16px",background:"#f0f0f0",color:"#333",border:"1px solid #ccc",borderRadius:"4px",cursor:"pointer",fontSize:"14px"}},"Close"))):e.createElement(e.Fragment,null,e.createElement("div",{ref:s,style:{borderRadius:"8px",overflow:"hidden"}}),e.createElement("button",{type:"button",onClick:w,style:{marginTop:"16px",padding:"8px 16px",background:"#f0f0f0",color:"#333",border:"1px solid #ccc",borderRadius:"4px",cursor:"pointer",fontSize:"14px"}},"Cancel"))));return o.createPortal(b,document.body)};function Xp(e){const{confidence:t,tools_used:n,metadata:r}=e;if(!(t||n&&0!==n.length))return"";const o=[];return t&&o.push(`• Confidence: ${t}`),n&&n.length>0&&o.push(`• Tools used: ${n.join(", ")}`),(null==r?void 0:r.agent)&&o.push(`• Agent: ${r.agent}`),`---\n${o.join("\n")}`}function Jp(t){let{getState:n,onResubmit:r,trackEvent:o,loginUrl:i}=t;var l;const[s,a]=e.useState(null),[A,c]=e.useState(0),u=n(),d={},f="true"===d.VITE_FORCE_TURNSTILE_WIDGET,p=null!==(l=u.siteKey)&&void 0!==l?l:f?d.VITE_TURNSTILE_SITE_KEY:null;return p&&(f||s!==p)?e.createElement(Kp,{key:A,siteKey:p,loginUrl:i,onVerify:async e=>{const t=p;u.token=e,null==o||o({type:"chatbot_turnstile_completed"});"needs_another_challenge"===await r(e)?c(e=>e+1):a(t)},onError:(e,t)=>{var n;const r=null===(n=u.pendingQuery)||void 0===n?void 0:n.queryId,i=p;u.token=null,u.pendingQuery=null,u.needsChallenge=!1,u.siteKey=null,a(i),null==o||o({type:"chatbot_turnstile_error",queryId:r,failureReason:e,cloudflareErrorCode:t})}}):null}const Zp="#1a5b6e",$p="#107180",eh="Arial, sans-serif",th="Q&A Bot",nh="/chat-icon.svg",rh="Type your question here...",oh="Select an option to continue",ih=!1,lh="Ask me a question!",sh="/login",ah={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:5e3,showCharacterCount:!1,allowNewline:!0,blockSpam:!1},chatWindow:{defaultOpen:!1,showScrollbar:!1},botBubble:{simulateStream:!0,streamSpeed:10,showAvatar:!1},userBubble:{showAvatar:!1},notification:{disabled:!0,showCount:!1},audio:{disabled:!0},emoji:{disabled:!0},fileAttachment:{disabled:!0}},Ah=e.forwardRef((t,n)=>{var r,o,i;const{apiKey:l,qaEndpoint:s,ratingEndpoint:a,agentRatingEndpoint:c,welcomeMessage:u,open:d,onOpenChange:f,isLoggedIn:p,allowAnonAccess:h=!1,actingUser:g,primaryColor:m,secondaryColor:v,botName:y,logo:w,placeholder:b,errorMessage:x,embedded:k,footerText:E,footerLink:C,tooltipText:P,loginUrl:S,turnstileSiteKey:D,backendId:B,resourceContext:I,customFlow:T,onAnalyticsEvent:Q}=t,M=e.useRef(`bot_${Math.random().toString(36).substr(2,9)}`);e.useEffect(()=>{xp()},[]);const O=e.useRef(null);null===O.current&&(O.current=Ip(),kp("CREATED",O.current));const L=e.useRef(!1),R=e.useRef({getSessionId:()=>O.current,isResetting:()=>L.current}),j=e.useRef(null),N=function(t,n){const[r,o]=e.useState(null),[i,l]=e.useState("idle"),s=e.useRef(null),a=e.useRef(null),A=e.useRef(!0),c=e.useCallback(()=>{const e=window.turnstile;if(a.current&&(null==e?void 0:e.remove)){try{e.remove(a.current)}catch(e){}a.current=null}s.current&&(s.current.remove(),s.current=null)},[]);return e.useEffect(()=>{if(A.current=!0,!t)return l("idle"),void o(null);l("loading");const e=document.createElement("div");return e.style.position="fixed",e.style.left="-9999px",e.style.top="-9999px",e.style.width="0",e.style.height="0",e.style.overflow="hidden",e.setAttribute("aria-hidden","true"),document.body.appendChild(e),s.current=e,Wp().then(()=>{if(!A.current)return;const e=window.turnstile;if(!e||!s.current)return Dp("Turnstile API not available for silent verification"),l("failed"),void(null==n||n({type:"chatbot_turnstile_silent_failed",failureReason:"api_unavailable"}));const r=e.render(s.current,{sitekey:t,execution:"render","refresh-expired":"auto",callback:e=>{A.current&&(Pp("Silent verification succeeded"),o(e),l("verified"))},"error-callback":e=>!A.current||(Dp("Turnstile silent verification failed:",e),o(null),l("failed"),null==n||n({type:"chatbot_turnstile_silent_failed",failureReason:"widget_error",cloudflareErrorCode:e}),!0),"expired-callback":()=>{A.current&&(Pp("Token expired, awaiting refresh"),o(null),l("loading"))}});a.current=r}).catch(e=>{A.current&&(Dp("Failed to load Turnstile script for silent verification:",e),l("failed"),null==n||n({type:"chatbot_turnstile_silent_failed",failureReason:"script_load_failed"}))}),()=>{A.current=!1,c()}},[t,c]),{token:r,status:i,reset:e.useCallback(()=>{const e=window.turnstile;a.current&&(null==e?void 0:e.reset)&&(o(null),l("loading"),e.reset(a.current),Pp("Token consumed, resetting widget for fresh token"))},[])}}(D,e=>{var t;null===(t=j.current)||void 0===t||t.call(j,e)}),F=e.useRef(null);F.current=N.token;const[H,z]=e.useState(p);e.useEffect(()=>{z(p)},[p]);const U=void 0!==k?k:ih,_=e.useCallback(e=>{var t;Q&&Q(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(t=O.current)&&void 0!==t?t:void 0,pageUrl:"undefined"!=typeof window?window.location.href:void 0,isEmbedded:U}))},[Q,U]);e.useEffect(()=>{j.current=e=>_(e)},[_]);const q=e.useMemo(()=>{const t=Object.assign({},ah);t.general=Object.assign(Object.assign({},t.general),{primaryColor:m||Zp,secondaryColor:v||$p,fontFamily:eh,embedded:U});const n=!1===H?[e.createElement(Np,{key:"history-button"}),e.createElement(ap,{key:"login-button",loginUrl:S||sh,isHeaderButton:!0})]:[e.createElement(Np,{key:"history-button"}),e.createElement(Ap,{key:"user-icon"})];t.header={title:e.createElement("span",{style:{fontSize:14,fontWeight:500}},y||th),showAvatar:!0,avatar:w||nh,buttons:[...n,A.CLOSE_CHAT_BUTTON]},t.chatInput=Object.assign(Object.assign({},t.chatInput),{disabled:!1,enabledPlaceholderText:b||rh,disabledPlaceholderText:x||oh}),t.tooltip=Object.assign(Object.assign({},t.tooltip),{text:P||lh});const r=E?C?e.createElement("a",{href:C,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},E):e.createElement("span",{key:"footer-text"},E):null;return t.footer={text:null!=r?r:void 0,buttons:[e.createElement(zp,{key:"new-chat-button"})]},t.chatWindow=Object.assign(Object.assign({},t.chatWindow),{defaultOpen:!!U}),t.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbStopStreamMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},t},[m,v,y,w,b,x,U,P,H,S,E,C]),V=e.useRef(null),G=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=e.useMemo(()=>{const e=(e,n)=>{if(t.current){const n=getComputedStyle(t.current).getPropertyValue(e);if(n&&""!==n.trim())return n.trim();if(t.current.parentElement){const n=getComputedStyle(t.current.parentElement).getPropertyValue(e);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:e("--primaryColor",n.primaryColor),secondaryColor:e("--secondaryColor",n.secondaryColor),fontFamily:e("--fontFamily",n.fontFamily)}},[t,n]);return r}(V,q.general);((t,n)=>{e.useEffect(()=>{n.current&&(t?n.current.classList.add("bot-logged-in"):n.current.classList.remove("bot-logged-in"))},[t,n])})(!1!==H,V),(t=>{let{settings:n,themeColors:r}=t;e.useEffect(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty(`--${t}`,n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),e.useEffect(()=>{var t,r;(null===(t=n.header)||void 0===t?void 0:t.title)&&"string"==typeof n.header.title&&(n.header.title=e.createElement("div",{key:"header-title"},e.createElement("h1",{className:"sr-only"},n.header.title),e.createElement("span",{"aria-hidden":"true"},n.header.title))),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!0},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(r=n.header)||void 0===r?void 0:r.avatar}),n.event=Object.assign(Object.assign({},n.event),{rcbToggleChatWindow:!0})},[n])})({settings:q,themeColors:G});const W=e.useMemo(()=>{const t=(t=>{let{endpoint:n,ratingEndpoint:r,agentRatingEndpoint:o,apiKey:i,sessionId:l,isResetting:s=()=>!1,isLoggedIn:a,allowAnonAccess:A=!1,loginUrl:c="/login",trackEvent:u,getTurnstileToken:d,resetTurnstileToken:f,backendId:p,resourceContext:h}=t;if(!1===a&&!A)return null==u||u({type:"chatbot_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:e.createElement(ap,{loginUrl:c}),chatDisabled:!0,path:"qa_loop"}};let g=null,m=null,v=!1;const y={siteKey:null,token:null,pendingQuery:null,needsChallenge:!1};let w=null;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{var t;w=e.injectMessage.bind(e);const{userInput:a}=e;if((!s||!s())&&a&&""!==a.trim()){if("👍 Helpful"===a||"👎 Not helpful"===a){if(g){const e="👍 Helpful"===a,t="agent"===m?o:r;if(t)try{const n={"Content-Type":"application/json"};i&&(n["X-API-KEY"]=i);const r=l();r&&(n["X-Session-ID"]=r,n["X-Query-ID"]=g);const o="agent"===m?{query_id:g,rating:e?"helpful":"not_helpful",session_id:r}:{sessionId:r,queryId:g,rating:e?1:0};await fetch(t,{method:"POST",headers:n,credentials:"include",body:JSON.stringify(o)}),null==u||u({type:"chatbot_rating_sent",queryId:g,rating:e?"helpful":"not_helpful"})}catch(e){Dp("Error sending feedback:",e)}}return"Thanks for the feedback!"}try{const r=pp();g=r,null==u||u({type:"chatbot_question_sent",queryId:r,questionLength:a.length});const o={"Content-Type":"application/json"};i&&(o["X-API-KEY"]=i);const s=l();s&&(o["X-Session-ID"]=s,o["X-Query-ID"]=r),o["X-Origin"]=h||"access";const A={query:a,question_id:r};s&&(A.session_id=s),p&&(A._backend=p),h&&(A.rp_name=h,A.resource_context=h);const c=null==d?void 0:d();c&&(A.turnstile_token=c),kp("SENT to API",{session_id:s,question_id:r});const w=Date.now(),b=await fetch(n,{method:"POST",headers:o,credentials:"include",body:JSON.stringify(A)});if(!b.ok)throw new Error(`API returned ${b.status}`);if((b.headers.get("content-type")||"").includes("text/event-stream")){null==f||f();const n=null===(t=b.body)||void 0===t?void 0:t.getReader();if(!n)throw new Error("Response body is not readable");const o=new TextDecoder;let i="",l="",s=!1;try{for(;;){const{done:t,value:r}=await n.read();if(t)break;i+=o.decode(r,{stream:!0});let a=i.indexOf("\n\n");for(;-1!==a;){const t=i.slice(0,a);i=i.slice(a+2);let n,r="",o="";for(const e of t.split("\n"))e.startsWith("event: ")?r=e.slice(7):e.startsWith("data: ")&&(o=e.slice(6));if(r&&o){try{n=JSON.parse(o)}catch(e){Sp("Failed to parse SSE data:",o),a=i.indexOf("\n\n");continue}if("status"===r){const t=n.message||"Processing...";await e.streamMessage(`_${t}_`,"BOT"),s=!0}else if("token"===r){l+=n.content||"";const t=Yp(l);await e.streamMessage(t,"BOT")}else if("done"===r){const t=n.metadata||{};if(m=t.rating_target||null,v=!0===t.is_final_response,l)await e.endStreamMessage("BOT");else{const t=n.response||"";if(t){const n=Yp(t);await e.streamMessage(n,"BOT"),s=!0}s&&await e.endStreamMessage("BOT")}}else if("error"===r){const t=n.message||"An error occurred";Dp("SSE error event:",t),s?(await e.streamMessage(t,"BOT"),await e.endStreamMessage("BOT")):await e.injectMessage(t)}a=i.indexOf("\n\n")}else a=i.indexOf("\n\n")}}s&&await e.endStreamMessage("BOT")}catch(t){if(Dp("Error reading SSE stream:",t),!s)throw t;await e.streamMessage("I had trouble completing the response. Please try again.","BOT"),await e.endStreamMessage("BOT")}const a=Date.now()-w;return void(null==u||u({type:"chatbot_answer_received",queryId:r,responseTimeMs:a,success:!0,responseLength:l.length}))}const x=Date.now()-w,k=await b.json();if(k.requires_turnstile)return null==u||u({type:"chatbot_turnstile_shown",queryId:r}),y.siteKey=k.site_key,y.pendingQuery={query:a,sessionId:s,queryId:r},y.needsChallenge=!0,"One moment — verifying your session…";null==f||f();const E=k.response||k.answer||k.text||k.message;if(!E)throw new Error("Invalid response format from API");const C=k.metadata||{};m=C.rating_target||null,v=!0===C.is_final_response;const P=Yp(E),S=hp()?Xp(k):"",D=S?`${P}\n\n${S}`:P;return await e.injectMessage(D),void(null==u||u({type:"chatbot_answer_received",queryId:r,responseTimeMs:x,success:!0,responseLength:E.length,hasMetadata:!!S}))}catch(e){return Dp("Error in Q&A flow:",e),null==u||u({type:"chatbot_answer_error",queryId:null!=g?g:void 0,errorType:e instanceof Error?e.message:"unknown"}),"I apologize, but I'm having trouble processing your question. Please try again later."}}},options:e=>s&&s()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput||y.needsChallenge?[]:v&&m&&("agent"===m?o:r)?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,component:e.createElement(Jp,{getState:()=>y,onResubmit:async e=>{var t;if(!y.pendingQuery||!w)return Dp("Turnstile resubmit called without pending query or injectMessage"),"error";try{const r={"Content-Type":"application/json"};i&&(r["X-API-KEY"]=i),y.pendingQuery.sessionId&&(r["X-Session-ID"]=y.pendingQuery.sessionId,r["X-Query-ID"]=y.pendingQuery.queryId),r["X-Origin"]=h||"access";const o={query:y.pendingQuery.query,question_id:y.pendingQuery.queryId,turnstile_token:e};y.pendingQuery.sessionId&&(o.session_id=y.pendingQuery.sessionId),p&&(o._backend=p),h&&(o.rp_name=h,o.resource_context=h);const l=await fetch(n,{method:"POST",headers:r,credentials:"include",body:JSON.stringify(o)}),s=y.pendingQuery.queryId;if(!l.ok)throw new Error(`API returned ${l.status} after Turnstile`);if((l.headers.get("content-type")||"").includes("text/event-stream")){const e=null===(t=l.body)||void 0===t?void 0:t.getReader();if(!e)throw new Error("Response body is not readable");const n=new TextDecoder;let r="",o="",i={};for(;;){const{done:t,value:l}=await e.read();if(t)break;r+=n.decode(l,{stream:!0});let s=r.indexOf("\n\n");for(;-1!==s;){const e=r.slice(0,s);r=r.slice(s+2);let t="",n="";for(const r of e.split("\n"))r.startsWith("event: ")?t=r.slice(7):r.startsWith("data: ")&&(n=r.slice(6));if(t&&n)try{const e=JSON.parse(n);"token"===t?o+=e.content||"":"done"===t&&(i=e.metadata||{})}catch(e){}s=r.indexOf("\n\n")}}if(y.token=null,y.pendingQuery=null,y.needsChallenge=!1,y.siteKey=null,!o)throw new Error("No content received from stream");m=i.rating_target||null,v=!0===i.is_final_response,g=s;const a=Yp(o);return await w(a),null==u||u({type:"chatbot_answer_received",queryId:s,success:!0,responseLength:o.length}),"success"}const a=await l.json();if(a.requires_turnstile)return y.siteKey=a.site_key,y.token=null,await w("Still verifying — please complete the challenge again."),"needs_another_challenge";y.token=null,y.pendingQuery=null,y.needsChallenge=!1,y.siteKey=null;const A=a.response||a.answer||a.text||a.message;if(!A)throw new Error("Invalid response format from API");const c=a.metadata||{};m=c.rating_target||null,v=!0===c.is_final_response,g=s;const d=Yp(A),f=hp()?Xp(a):"",b=f?`${d}\n\n${f}`:d;return await w(b),null==u||u({type:"chatbot_answer_received",queryId:s,success:!0,responseLength:A.length}),"success"}catch(e){return Dp("Error resubmitting after Turnstile:",e),y.token=null,y.pendingQuery=null,y.needsChallenge=!1,y.siteKey=null,await(null==w?void 0:w("I had trouble processing your question after verification. Please try again.")),"error"}},trackEvent:u,loginUrl:c}),path:"qa_loop"}}})({endpoint:s,ratingEndpoint:a,agentRatingEndpoint:c,apiKey:l,sessionId:R.current.getSessionId,isResetting:R.current.isResetting,isLoggedIn:H,allowAnonAccess:h,loginUrl:S||sh,trackEvent:_,getTurnstileToken:()=>F.current,resetTurnstileToken:()=>N.reset(),backendId:B,resourceContext:I}),n={message:u,renderMarkdown:["BOT"],transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},t),T||{})},[l,s,a,c,u,H,h,S,T,g,_,I,B]),Y=e.useMemo(()=>{return[()=>bn(t),ns({markdownComponent:rp}),()=>is(e)];var e,t},[]);return e.useEffect(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),qp(),e.useEffect(()=>{const e=V.current;if(!e)return;const t=e=>{var t,n,r;const o=null===(n=(t=e.target).closest)||void 0===n?void 0:n.call(t,"a");o&&o.closest(".rcb-chat-body-container")&&(o.classList.contains("qa-bot-login-button")||o.closest(".rcb-options-container")||_({type:"chatbot_link_clicked",linkUrl:o.href,linkText:(null===(r=o.textContent)||void 0===r?void 0:r.trim())||""}))};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},[_]),e.useEffect(()=>{if(!U){const e=e=>{const t=e.data.newState;null==f||f(t);const n=O.current;_(t?{type:"chatbot_open"}:{type:"chatbot_close",messageCount:n?Mp(n):0,durationMs:n?Op(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[U,f,_]),e.createElement("div",{className:"qa-bot "+((null===(r=q.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:V,role:"region","aria-label":`${y||th}${(null===(o=q.general)||void 0===o?void 0:o.embedded)?" - Embedded":""}`},e.createElement(Rp,{getSessionId:()=>O.current,setSessionId:e=>{const t=O.current;O.current=e,kp("RESTORED",`${null==t?void 0:t.slice(-12)} -> ${e.slice(-12)}`)},resetSession:()=>{const e=O.current;L.current=!0,O.current=Ip(),kp("RESET",`${null==e?void 0:e.slice(-12)} -> ${O.current.slice(-12)}`)},clearResettingFlag:()=>{L.current=!1}},e.createElement(lp,{trackEvent:_},e.createElement(Ot,null,e.createElement("div",null,e.createElement(_p,null),e.createElement(op,{ref:n,embedded:(null===(i=q.general)||void 0===i?void 0:i.embedded)||!1,currentOpen:d||!1,enabled:!1!==H,onSetEnabled:e=>z(!!e&&void 0)}),e.createElement(Nt,{key:`chatbot-${M.current}-${H}`,settings:q,flow:W,plugins:Y}),e.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region",style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0}}),e.createElement("div",{id:"chat-input-help",className:"sr-only",style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0}},"Type your message and press Enter to send. Use arrow keys to navigate through response options."))))))});Ah.displayName="QABot";const ch=()=>{const[t,n]=e.useState(!1),r=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!r())throw new Error("Screen capture is not available in this environment");try{n(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),t=document.createElement("video");t.srcObject=e,await new Promise(e=>{t.onloadedmetadata=()=>{t.play(),e()}});const r=document.createElement("canvas");r.width=t.videoWidth,r.height=t.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(t,0,0,r.width,r.height);const i=await new Promise(e=>r.toBlob(e,"image/png"));if(!i)throw new Error("Could not create image blob");const l=(new Date).toISOString().replace(/[:.]/g,"-"),s=new File([i],`screenshot-${l}.png`,{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),n(!1),s}catch(e){throw Dp("Error capturing screenshot:",e),n(!1),e}},isCapturing:t,isScreenCaptureAvailable:r()}},uh=t=>e.createElement(Fp,t,e.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElement("polyline",{points:"17 8 12 3 7 8"}),e.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),dh=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error(`Failed to read file ${e.name}`));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error(`Failed to read file ${e.name}`)),r.readAsDataURL(e)}),fh=e=>e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`;const ph=e.forwardRef((t,n)=>{var{defaultOpen:r}=t,o=a(t,["defaultOpen"]);const[i,l]=e.useState(r||!1),A=e.useRef(null);return e.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;l(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;l(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;l(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),e.createElement(Ah,s({ref:A},o,{open:i,onOpenChange:l}))});function hh(n){if(!(n.target&&n.target instanceof HTMLElement))return void Dp("QA Bot: A valid target DOM element is required");const{target:r}=n,o=a(n,["target"]),i=t.createRoot(r),l={current:null};return i.render(e.createElement(e.StrictMode,null,e.createElement(ph,s({ref:e=>{l.current=e}},o)))),{addMessage:e=>{var t;return null===(t=l.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=l.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{l.current=null,i.unmount()}}}ph.displayName="ProgrammaticQABot",exports.FileUploadComponent=t=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:i=!1,className:l}=t;const[s,a]=e.useState(!1),[A,c]=e.useState([]),[u,d]=e.useState(null),f=e.useRef(null),{captureScreenshot:p,isCapturing:h,isScreenCaptureAvailable:g}=ch(),m=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},v=e=>{if(!e||0===e.length)return void Sp("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return Dp("FileUploadComponent: Error converting files to array:",e),void m("Error processing selected files. Please try again.")}const r=[...A,...t];c(r);const o=t.length,i=t.map(e=>e.name).join(", ");m(`${o} file${o>1?"s":""} selected: ${i}`),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},y=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?a(!0):"dragleave"===e.type&&a(!1)},w=()=>{try{f.current&&f.current.click()}catch(e){Dp("FileUploadComponent: Error in handleButtonClick:",e),m("Error opening file selection dialog. Please try again.")}},b=()=>{d(null)},x=i&&g;return e.createElement("div",{className:`file-upload-container ${l||""}`,style:{padding:"16px",margin:"8px 0"}},x&&e.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},e.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await p();v([e]),m("Screenshot captured successfully")}catch(e){m("Error capturing screenshot. Please try again.")}})()},disabled:h,"aria-describedby":"screenshot-help","aria-label":h?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:h?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),e.createElement("circle",{cx:"12",cy:"13",r:"4"})),h?"Taking screenshot...":"Take screenshot..."),e.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),e.createElement("div",{className:"file-upload-dropzone "+(s?"active":""),onDragEnter:y,onDragLeave:y,onDragOver:y,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),a(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&v(e.dataTransfer.files)}catch(e){Dp("FileUploadComponent: Error in handleDrop:",e),m("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:s?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},e.createElement("input",{ref:f,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&v(e.target.files)}catch(e){Dp("FileUploadComponent: Error in handleFileSelect:",e),m("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),e.createElement("div",{className:"upload-content",onClick:w,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},e.createElement(uh,null),e.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),e.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),A.length>0&&e.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},e.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),A.map((t,r)=>e.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:e=>{e.stopPropagation(),(e=>{d(e)})(t)}},e.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=A.filter((t,n)=>n!==e);c(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":`Remove ${t.name}`},"×"),t.name," (",fh(t.size),")"))))),(()=>{if(!u)return null;const t=u.type.startsWith("image/"),n=u.type.startsWith("text/"),r="application/pdf"===u.type;return e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:b},e.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{onClick:b,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),e.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},u.name),t&&e.createElement("img",{src:URL.createObjectURL(u),alt:u.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&e.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(u)),r&&e.createElement("iframe",{src:URL.createObjectURL(u),style:{width:"100%",height:"70vh",border:"none"},title:u.name}),!t&&!n&&!r&&e.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())},exports.QABot=Ah,exports.applyFlowSettings=function(e,t){if(!t||0===Object.keys(t).length)return e;const n={};for(const[r,o]of Object.entries(e)){let e=Object.assign({},o);if(t.disableOnOptions&&void 0===e.chatDisabled){const t=!(!e.options&&!e.checkboxes);e.chatDisabled=t}n[r]=e}return n},exports.default=hh,exports.fileToBase64=dh,exports.filesToBase64=e=>Promise.all(e.map(dh)),exports.formatFileSize=fh,exports.qaBot=hh,exports.useScreenshotCapture=ch,exports.validateFileSize=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t},exports.withHistory=function(e){return async t=>{await t.injectMessage(e)}},exports.withHistoryFn=function(e){return async t=>{const n=await e(t);await t.injectMessage(n)}};
9
9
  //# sourceMappingURL=qa-bot-core.umd.cjs.map