@snf/qa-bot-core 0.2.33-rc.1 → 0.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/static/js/main.js +1 -1
- package/build/static/js/main.js.map +1 -1
- package/dist/qa-bot-core.js +2 -2
- package/dist/qa-bot-core.js.map +1 -1
- package/dist/qa-bot-core.standalone.js +1 -1
- package/dist/qa-bot-core.standalone.js.map +1 -1
- package/dist/qa-bot-core.umd.cjs +2 -2
- package/dist/qa-bot-core.umd.cjs.map +1 -1
- package/dist/types/utils/logger.d.ts +1 -1
- package/package.json +1 -1
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
* Copyright(c) 2015 Andreas Lubbe
|
|
34
34
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
35
35
|
* MIT Licensed
|
|
36
|
-
*/var qb,Vb;var Wb=function(){if(Vb)return qb;Vb=1;var e=/["'&<>]/;return qb=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,a="",i=0,l=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}l!==i&&(a+=n.substring(l,i)),l=i+1,a+=o}return l!==i?a+n.substring(l,i):a},qb}();const Yb=Ub(Wb);function Gb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xb=/(url|image|image-set)\(/i;class Kb extends Hb{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(Xb)&&delete t[e]}),t}}const Jb=/^<(!doctype|(html|head|body)(\s|>))/i,$b=/^(aria-|data-|\w+:)/iu,Zb=/{{{(\w+)\/?}}}/;function ey(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let ty=class{constructor(e,t={},n=[],r=[]){var o;Gb(this,"allowed",void 0),Gb(this,"banned",void 0),Gb(this,"blocked",void 0),Gb(this,"container",void 0),Gb(this,"content",[]),Gb(this,"props",void 0),Gb(this,"matchers",void 0),Gb(this,"filters",void 0),Gb(this,"keyIndex",void 0),this.props=t,this.matchers=n,this.filters=[...r,new Kb],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:Nb),this.banned=new Set(Rb),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,a=0,i=null;return this.matchers.forEach(e=>{const l=e.asTag().toLowerCase(),s=this.getTagConfig(l);if(r[e.inverseName]||!this.isTagAllowed(l)||!this.canRenderChild(t,s))return;let c="";for(;o&&(i=e.match(o));){const{index:t,length:l,match:s,valid:u,void:A,...d}=i,f=e.propName+String(a);t>0&&(c+=o.slice(0,t)),u?(c+=A?`{{{${f}/}}}`:`{{{${f}}}}${s}{{{/${f}}}}`,this.keyIndex+=1,a+=1,n[f]={children:s,matcher:e,props:{...r,...d,key:this.keyIndex}}):c+=s,e.greedy?(o=c+o.slice(t+l),c=""):o=o.slice(t+(l||s.length))}e.greedy||(o=c+o)}),0===a?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||ey)();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);return e.match(Jb)||(o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?Yb(e):e)),o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:a,value:i}=o,l=a.toLowerCase(),s=Fb[l]||Fb[a];if(!this.isSafe(e)||!l.match($b)&&(!t&&(!s||2===s)||l.startsWith("on")||i.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c="style"===l?this.extractStyleAttribute(e):i;4===s?c=!0:3===s?c=Number.parseFloat(String(c)):5!==s&&(c=String(c)),n[jb[l]||l]=this.applyAttributeFilters(l,c),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 Lb[e]?{...t,...Lb[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(e,t){const{noHtml:n,noHtmlExceptMatchers:r,allowElements:o,transform:a,transformOnlyAllowList:i}=this.props;let l=[],s="";return[...e.childNodes].forEach(e=>{if(1===e.nodeType){const u=e.nodeName.toLowerCase(),A=this.getTagConfig(u);s&&(l.push(s),s="");const d=this.applyNodeFilters(u,e);if(!d)return;let f;if(a&&(!i||this.isTagAllowed(u))){this.keyIndex+=1;const e=this.keyIndex;f=this.parseNode(d,A);const t=a(d,f,A);if(null===t)return;if(typeof t<"u")return void l.push(z.cloneElement(t,{key:e}));this.keyIndex=e-1}if(this.banned.has(u))return;if(n||r&&"br"!==u||!this.isTagAllowed(u)||!o&&!this.canRenderChild(t,A))l=[...l,...this.parseNode(d,A.tagName?A:t)];else{var c;this.keyIndex+=1;const e=this.extractAttributes(d),t={tagName:u};e&&(t.attributes=e),A.void&&(t.selfClose=A.void),l.push(z.createElement(_b,{...t,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(d,A)))}}else if(3===e.nodeType){const o=n&&!r?e.textContent:this.applyMatchers(e.textContent||"",t);Array.isArray(o)?l=[...l,...o]:s+=o}}),s&&l.push(s),l}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(Zb);){const[e,a]=o,i=o.index,l=e.includes("/");i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:s,matcher:c,props:u}=t[a];let A;if(l)A=e.length,n.push(c.createElement(s,u));else{const o=r.match(new RegExp(`{{{/${a}}}}`));A=o.index+o[0].length,n.push(c.createElement(this.replaceTokens(r.slice(e.length,o.index),t),u))}r=r.slice(A)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function ny(e){var t;const{attributes:n,className:r,containerTagName:o,content:a,emptyContent:i,parsedContent:l,tagName:s,noWrap:c}=e,u=null!==(t=o??s)&&void 0!==t?t:"span",A="fragment"===u||c;let d;if(l)d=l;else{const t=new ty(a??"",e).parse();t.length>0&&(d=t)}return d||(d=i),A?z.createElement(z.Fragment,null,d):z.createElement(_b,{attributes:n,className:r,tagName:u},d)}function ry(e){const{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:a=!1,emptyContent:i=null,filters:l=[],matchers:s=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:A="span",noWrap:d=!1,...f}=e,p=a?[]:s,h=o?[]:l,g=u?[u]:[],m=c?[c]:[];p.forEach(e=>{e.onBeforeParse&&g.push(e.onBeforeParse.bind(e)),e.onAfterParse&&m.push(e.onAfterParse.bind(e))});const v=g.reduce((t,n)=>n(t,e),r??""),b=new ty(v,f,p,h),y=m.reduce((t,n)=>n(t,e),b.parse());return z.createElement(ny,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:i,noWrap:d,parsedContent:0===y.length?void 0:y,tagName:A})}const oy=({children:e})=>aA.jsx("div",{style:{whiteSpace:"normal"},children:aA.jsx(ry,{content:"string"==typeof e?e:""})}),ay={autoConfig:!0},iy=(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)},ly=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const a=e[o];"<"===a?r?(t.push(n),n=a):(r=!0,n=a):">"===a?(n+=a,t.push(n),n="",r=!1):r?n+=a:t.push(a)}return""!==n&&t.push(n),t},sy=e=>{const{getFlow:t}=Pb(),{messages:n,replaceMessages:r}=Bb(),{settings:o}=Tb(),{hasChatHistoryLoaded:a}=Qb(),i={...e,...ay},l=i.htmlComponent?i.htmlComponent:oy;j.useEffect(()=>{var e,t;if(a){const a=[...n];for(let n=0;n<a.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=a[n];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=l)}r(a)}},[a]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();"string"==typeof e.data.message.content&&iy(e,t(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=ly),e.data.message.contentWrapper=l,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};Db(Sm.PRE_INJECT_MESSAGE,s),Db(Sm.CHUNK_STREAM_MESSAGE,s),Db(Sm.START_STREAM_MESSAGE,s),Db(Sm.START_SIMULATE_STREAM_MESSAGE,s),Db(Sm.START_SPEAK_AUDIO,async e=>{iy(e,t(),"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!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c},cy=e=>()=>sy(e);const uy=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ay=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dy={};function fy(e,t){return(dy.jsx?Ay:uy).test(e)}const py=/[ \t\n\f\r]/g;function hy(e){return""===e.replace(py,"")}class gy{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function my(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 gy(n,r,t)}function vy(e){return e.toLowerCase()}gy.prototype.property={},gy.prototype.normal={},gy.prototype.space=null;class by{constructor(e,t){this.property=e,this.attribute=t}}by.prototype.space=null,by.prototype.boolean=!1,by.prototype.booleanish=!1,by.prototype.overloadedBoolean=!1,by.prototype.number=!1,by.prototype.commaSeparated=!1,by.prototype.spaceSeparated=!1,by.prototype.commaOrSpaceSeparated=!1,by.prototype.mustUseProperty=!1,by.prototype.defined=!1;let yy=0;const wy=By(),xy=By(),ky=By(),Ey=By(),Sy=By(),Cy=By(),Py=By();function By(){return 2**++yy}const Dy=Object.freeze(Object.defineProperty({__proto__:null,boolean:wy,booleanish:xy,commaOrSpaceSeparated:Py,commaSeparated:Cy,number:Ey,overloadedBoolean:ky,spaceSeparated:Sy},Symbol.toStringTag,{value:"Module"})),Ty=Object.keys(Dy);class Iy extends by{constructor(e,t,n,r){let o=-1;if(super(e,t),Qy(this,"space",r),"number"==typeof n)for(;++o<Ty.length;){const e=Ty[o];Qy(this,Ty[o],(n&Dy[e])===Dy[e])}}}function Qy(e,t,n){n&&(e[t]=n)}Iy.prototype.defined=!0;const My={}.hasOwnProperty;function Oy(e){const t={},n={};let r;for(r in e.properties)if(My.call(e.properties,r)){const o=e.properties[r],a=new Iy(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[vy(r)]=r,n[vy(a.attribute)]=r}return new gy(t,n,e.space)}const Ly=Oy({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}}),Ry=Oy({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Ny(e,t){return t in e?e[t]:t}function Fy(e,t){return Ny(e,t.toLowerCase())}const jy=Oy({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Fy,properties:{xmlns:null,xmlnsXLink:null}}),zy=Oy({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:xy,ariaAutoComplete:null,ariaBusy:xy,ariaChecked:xy,ariaColCount:Ey,ariaColIndex:Ey,ariaColSpan:Ey,ariaControls:Sy,ariaCurrent:null,ariaDescribedBy:Sy,ariaDetails:null,ariaDisabled:xy,ariaDropEffect:Sy,ariaErrorMessage:null,ariaExpanded:xy,ariaFlowTo:Sy,ariaGrabbed:xy,ariaHasPopup:null,ariaHidden:xy,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Sy,ariaLevel:Ey,ariaLive:null,ariaModal:xy,ariaMultiLine:xy,ariaMultiSelectable:xy,ariaOrientation:null,ariaOwns:Sy,ariaPlaceholder:null,ariaPosInSet:Ey,ariaPressed:xy,ariaReadOnly:xy,ariaRelevant:null,ariaRequired:xy,ariaRoleDescription:Sy,ariaRowCount:Ey,ariaRowIndex:Ey,ariaRowSpan:Ey,ariaSelected:xy,ariaSetSize:Ey,ariaSort:null,ariaValueMax:Ey,ariaValueMin:Ey,ariaValueNow:Ey,ariaValueText:null,role:null}}),_y=Oy({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Fy,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cy,acceptCharset:Sy,accessKey:Sy,action:null,allow:null,allowFullScreen:wy,allowPaymentRequest:wy,allowUserMedia:wy,alt:null,as:null,async:wy,autoCapitalize:null,autoComplete:Sy,autoFocus:wy,autoPlay:wy,blocking:Sy,capture:null,charSet:null,checked:wy,cite:null,className:Sy,cols:Ey,colSpan:null,content:null,contentEditable:xy,controls:wy,controlsList:Sy,coords:Ey|Cy,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wy,defer:wy,dir:null,dirName:null,disabled:wy,download:ky,draggable:xy,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wy,formTarget:null,headers:Sy,height:Ey,hidden:wy,high:Ey,href:null,hrefLang:null,htmlFor:Sy,httpEquiv:Sy,id:null,imageSizes:null,imageSrcSet:null,inert:wy,inputMode:null,integrity:null,is:null,isMap:wy,itemId:null,itemProp:Sy,itemRef:Sy,itemScope:wy,itemType:Sy,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wy,low:Ey,manifest:null,max:null,maxLength:Ey,media:null,method:null,min:null,minLength:Ey,multiple:wy,muted:wy,name:null,nonce:null,noModule:wy,noValidate:wy,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:wy,optimum:Ey,pattern:null,ping:Sy,placeholder:null,playsInline:wy,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wy,referrerPolicy:null,rel:Sy,required:wy,reversed:wy,rows:Ey,rowSpan:Ey,sandbox:Sy,scope:null,scoped:wy,seamless:wy,selected:wy,shadowRootClonable:wy,shadowRootDelegatesFocus:wy,shadowRootMode:null,shape:null,size:Ey,sizes:null,slot:null,span:Ey,spellCheck:xy,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ey,step:null,style:null,tabIndex:Ey,target:null,title:null,translate:null,type:null,typeMustMatch:wy,useMap:null,value:xy,width:Ey,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Sy,axis:null,background:null,bgColor:null,border:Ey,borderColor:null,bottomMargin:Ey,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wy,declare:wy,event:null,face:null,frame:null,frameBorder:null,hSpace:Ey,leftMargin:Ey,link:null,longDesc:null,lowSrc:null,marginHeight:Ey,marginWidth:Ey,noResize:wy,noHref:wy,noShade:wy,noWrap:wy,object:null,profile:null,prompt:null,rev:null,rightMargin:Ey,rules:null,scheme:null,scrolling:xy,standby:null,summary:null,text:null,topMargin:Ey,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ey,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:wy,disableRemotePlayback:wy,prefix:null,property:null,results:Ey,security:null,unselectable:null}}),Hy=Oy({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:Ny,properties:{about:Py,accentHeight:Ey,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ey,amplitude:Ey,arabicForm:null,ascent:Ey,attributeName:null,attributeType:null,azimuth:Ey,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ey,by:null,calcMode:null,capHeight:Ey,className:Sy,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:Ey,diffuseConstant:Ey,direction:null,display:null,dur:null,divisor:Ey,dominantBaseline:null,download:wy,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ey,enableBackground:null,end:null,event:null,exponent:Ey,externalResourcesRequired:null,fill:null,fillOpacity:Ey,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:Cy,g2:Cy,glyphName:Cy,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ey,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ey,horizOriginX:Ey,horizOriginY:Ey,id:null,ideographic:Ey,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ey,k:Ey,k1:Ey,k2:Ey,k3:Ey,k4:Ey,kernelMatrix:Py,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ey,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:Ey,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:Ey,overlineThickness:Ey,paintOrder:null,panose1:null,path:null,pathLength:Ey,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Sy,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ey,pointsAtY:Ey,pointsAtZ:Ey,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Py,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Py,rev:Py,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Py,requiredFeatures:Py,requiredFonts:Py,requiredFormats:Py,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:Ey,specularExponent:Ey,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ey,strikethroughThickness:Ey,string:null,stroke:null,strokeDashArray:Py,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ey,strokeOpacity:Ey,strokeWidth:null,style:null,surfaceScale:Ey,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Py,tabIndex:Ey,tableValues:null,target:null,targetX:Ey,targetY:Ey,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Py,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ey,underlineThickness:Ey,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ey,values:null,vAlphabetic:Ey,vMathematical:Ey,vectorEffect:null,vHanging:Ey,vIdeographic:Ey,version:null,vertAdvY:Ey,vertOriginX:Ey,vertOriginY:Ey,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ey,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Uy=/^data[-\w.:]+$/i,qy=/-[a-z]/g,Vy=/[A-Z]/g;function Wy(e){return"-"+e.toLowerCase()}function Yy(e){return e.charAt(1).toUpperCase()}const Gy={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"},Xy=my([Ry,Ly,jy,zy,_y],"html"),Ky=my([Ry,Ly,jy,zy,Hy],"svg");function Jy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $y,Zy,ew,tw={};var nw=function(){if(ew)return tw;ew=1;var e=tw&&tw.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tw,"__esModule",{value:!0}),tw.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),a="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;a?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(Zy)return $y;Zy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,l=/^\s+|\s+$/g,s="";function c(e){return e?e.replace(l,s):s}return $y=function(l,u){if("string"!=typeof l)throw new TypeError("First argument must be a string");if(!l)return[];u=u||{};var A=1,d=1;function f(e){var n=e.match(t);n&&(A+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:A,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:A,column:d},this.source=u.source}function g(e){var t=new Error(u.source+":"+A+":"+d+": "+e);if(t.reason=e,t.filename=u.source,t.line=A,t.column=d,t.source=l,!u.silent)throw t}function m(e){var t=e.exec(l);if(t){var n=t[0];return f(n),l=l.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var e=p();if("/"==l.charAt(0)&&"*"==l.charAt(1)){for(var t=2;s!=l.charAt(t)&&("*"!=l.charAt(t)||"/"!=l.charAt(t+1));)++t;if(t+=2,s===l.charAt(t-1))return g("End of comment missing");var n=l.slice(2,t-2);return d+=2,f(n),l=l.slice(t),d+=2,e({type:"comment",comment:n})}}function w(){var t=p(),n=m(r);if(n){if(y(),!m(o))return g("property missing ':'");var l=m(a),u=t({type:"declaration",property:c(n[0].replace(e,s)),value:l?c(l[0].replace(e,s)):s});return m(i),u}}return h.prototype.content=l,v(),function(){var e,t=[];for(b(t);e=w();)!1!==e&&(t.push(e),b(t));return t}()},$y}());return tw}();const rw=Jy(nw),ow=rw.default||rw,aw=lw("end"),iw=lw("start");function lw(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 sw(e){return e&&"object"==typeof e?"position"in e||"type"in e?uw(e.position):"start"in e||"end"in e?uw(e):"line"in e||"column"in e?cw(e):"":""}function cw(e){return Aw(e&&e.line)+":"+Aw(e&&e.column)}function uw(e){return cw(e&&e.start)+"-"+cw(e&&e.end)}function Aw(e){return e&&"number"==typeof e?e:1}class dw extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},a=!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&&(a=!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 i=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=i?i.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=i?i.line:void 0,this.name=sw(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=a&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}dw.prototype.file="",dw.prototype.name="",dw.prototype.reason="",dw.prototype.message="",dw.prototype.stack="",dw.prototype.column=void 0,dw.prototype.line=void 0,dw.prototype.ancestors=void 0,dw.prototype.cause=void 0,dw.prototype.fatal=void 0,dw.prototype.place=void 0,dw.prototype.ruleId=void 0,dw.prototype.source=void 0;const fw={}.hasOwnProperty,pw=new Map,hw=/[A-Z]/g,gw=/-([a-z])/g,mw=new Set(["table","tbody","thead","tfoot","tr"]),vw=new Set(["td","th"]),bw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yw(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,a){const i=Array.isArray(o.children),l=iw(n);return t(r,o,a,i,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.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,a){const i=Array.isArray(o.children)?n:t;return a?i(r,o,a):i(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?Ky:Xy,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},a=ww(o,e,void 0);return a&&"string"!=typeof a?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function ww(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=Ky,e.schema=o),e.ancestors.push(t);const a=Cw(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&fw.call(t.properties,o)){const a=Sw(e,o,t.properties[o]);if(a){const[o,i]=a;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&vw.has(t.tagName)?r=i:n[o]=i}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let l=Ew(e,t);return mw.has(t.tagName)&&(l=l.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&hy(e.value):hy(e)}(e)})),xw(e,i,a,t),kw(i,l),e.ancestors.pop(),e.schema=r,e.create(t,a,i,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)}Pw(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=Ky,e.schema=o),e.ancestors.push(t);const a=null===t.name?e.Fragment:Cw(e,t.name,!0),i=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 a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Pw(e,t.position);else{const o=r.name;let a;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,a=e.evaluater.evaluateExpression(t.expression)}else Pw(e,t.position);else a=null===r.value||r.value;n[o]=a}return n}(e,t),l=Ew(e,t);return xw(e,i,a,t),kw(i,l),e.ancestors.pop(),e.schema=r,e.create(t,a,i,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);Pw(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return kw(r,Ew(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 xw(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ew(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:pw;for(;++r<t.children.length;){const a=t.children[r];let i;if(e.passKeys){const e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){const t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}const l=ww(e,a,i);void 0!==l&&n.push(l)}return n}function Sw(e,t,n){const r=function(e,t){const n=vy(t);let r=t,o=by;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Uy.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(qy,Yy);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!qy.test(e)){let n=e.replace(Vy,Wy);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Iy}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{ow(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new dw("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=bw+"#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(gw,Dw)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)fw.call(e,n)&&(t[Bw(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Gy[r.property]||r.property:r.attribute,n]}}function Cw(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=fy(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=fy(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 fw.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Pw(e)}function Pw(e,t){const n=new dw("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=bw+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Bw(e){let t=e.replace(hw,Tw);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Dw(e,t){return t.toUpperCase()}function Tw(e){return"-"+e.toLowerCase()}const Iw={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"]},Qw={};function Mw(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 Ow(e.children,t,n)}return Array.isArray(e)?Ow(e,t,n):""}function Ow(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Mw(e[o],t,n);return r.join("")}const Lw=document.createElement("i");function Rw(e){const t="&"+e+";";Lw.innerHTML=t;const n=Lw.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function Nw(e,t,n,r){const o=e.length;let a,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function Fw(e,t){return e.length>0?(Nw(e,e.length,0,t),e):t}const jw={}.hasOwnProperty;function zw(e){const t={};let n=-1;for(;++n<e.length;)_w(t,e[n]);return t}function _w(e,t){let n;for(n in t){const r=(jw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){jw.call(r,a)||(r[a]=[]);const e=o[a];Hw(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Hw(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Nw(e,0,0,r)}function Uw(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 qw(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Vw=rx(/[A-Za-z]/),Ww=rx(/[\dA-Za-z]/),Yw=rx(/[#-'*+\--9=?A-Z^-~]/);function Gw(e){return null!==e&&(e<32||127===e)}const Xw=rx(/\d/),Kw=rx(/[\dA-Fa-f]/),Jw=rx(/[!-/:-@[-`{-~]/);function $w(e){return null!==e&&e<-2}function Zw(e){return null!==e&&(e<0||32===e)}function ex(e){return-2===e||-1===e||32===e}const tx=rx(new RegExp("\\p{P}|\\p{S}","u")),nx=rx(/\s/);function rx(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function ox(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let i="";if(37===a&&Ww(e.charCodeAt(n+1))&&Ww(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(i=String.fromCharCode(a,t),o=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ax(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return function(r){return ex(r)?(e.enter(n),i(r)):t(r)};function i(r){return ex(r)&&a++<o?(e.consume(r),i):(e.exit(n),t(r))}}const ix={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"),ax(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)):$w(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const lx={tokenize:function(e){const t=this,n=[];let r,o,a,i=0;return l;function l(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,s,c)(r)}return c(r)}function s(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){o=t.events[a][1].end;break}m(i);let l=n;for(;l<t.events.length;)t.events[l][1].end={...o},l++;return Nw(t.events,a+1,0,t.events.slice(n)),t.events.length=l,c(e)}return l(e)}function c(o){if(i===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(sx,u,A)(o)}function u(e){return r&&v(),m(i),d(e)}function A(e){return t.parser.lazy[t.now().line]=i!==n.length,a=t.now().offset,p(e)}function d(n){return t.containerState={},e.attempt(sx,f,p)(n)}function f(e){return i++,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)):$w(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,l):(e.consume(n),h)}function g(e,n){const l=t.sliceStream(e);if(n&&l.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(l),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<a&&(!r.events[e][1].end||r.events[e][1].end.offset>a))return;const n=t.events.length;let o,l,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){if(o){l=t.events[s][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...l},e++;Nw(t.events,s+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}}},sx={tokenize:function(e,t,n){return ax(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function cx(e){return null===e||Zw(e)||nx(e)?1:tx(e)?2:void 0}function ux(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Ax={name:"attention",resolveAll:function(e,t){let n,r,o,a,i,l,s,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;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[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const A={...e[n][1].end},d={...e[u][1].start};dx(A,-l),dx(d,l),a={type:l>1?"strongSequence":"emphasisSequence",start:A,end:{...e[n][1].end}},i={type:l>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:d},o={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:l>1?"strong":"emphasis",start:{...a.start},end:{...i.end}},e[n][1].end={...a.start},e[u][1].start={...i.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=Fw(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=Fw(s,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",o,t]]),s=Fw(s,ux(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=Fw(s,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=Fw(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,Nw(e,n-1,u-n+3,s),u=n+s.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=cx(r);let a;return function(t){return a=t,e.enter("attentionSequence"),i(t)};function i(l){if(l===a)return e.consume(l),i;const s=e.exit("attentionSequence"),c=cx(l),u=!c||2===c&&o||n.includes(l),A=!o||2===o&&c||n.includes(r);return s._open=!!(42===a?u:u&&(o||!A)),s._close=!!(42===a?A:A&&(c||!u)),t(l)}}};function dx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const fx={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 Vw(t)?(e.consume(t),a):64===t?n(t):s(t)}function a(e){return 43===e||45===e||46===e||Ww(e)?(r=1,i(e)):s(e)}function i(t){return 58===t?(e.consume(t),r=0,l):(43===t||45===t||46===t||Ww(t))&&r++<32?(e.consume(t),i):(r=0,s(t))}function l(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||Gw(r)?n(r):(e.consume(r),l)}function s(t){return 64===t?(e.consume(t),c):Yw(t)?(e.consume(t),s):n(t)}function c(e){return Ww(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):A(n)}function A(t){if((45===t||Ww(t))&&r++<63){const n=45===t?A:u;return e.consume(t),n}return n(t)}}};const px={partial:!0,tokenize:function(e,t,n){return function(t){return ex(t)?ax(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||$w(e)?t(e):n(e)}}};const hx={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return ex(t)?ax(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(hx,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 ex(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const gx={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 Jw(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const mx={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,a,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),l};function l(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,a=Ww,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Kw,c):(e.enter("characterReferenceValue"),o=7,a=Xw,c(t))}function c(l){if(59===l&&i){const o=e.exit("characterReferenceValue");return a!==Ww||Rw(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(l)}return a(l)&&i++<o?(e.consume(l),c):n(l)}}};const vx={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)}}},bx={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s}function s(t){return e.enter("codeFencedFence"),ex(t)?ax(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===a?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===a?(o++,e.consume(t),u):o>=l?(e.exit("codeFencedFenceSequence"),ex(t)?ax(e,A,"whitespace")(t):A(t)):n(t)}function A(r){return null===r||$w(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let a,i=0,l=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,a=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),s(t)}(t)};function s(t){return t===a?(l++,e.consume(t),s):l<3?n(t):(e.exit("codeFencedFenceSequence"),ex(t)?ax(e,c,"whitespace")(t):c(t))}function c(n){return null===n||$w(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(vx,f,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||$w(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):ex(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ax(e,A,"whitespace")(t)):96===t&&t===a?n(t):(e.consume(t),u)}function A(t){return null===t||$w(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||$w(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===a?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 i>0&&ex(t)?ax(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||$w(t)?e.check(vx,f,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||$w(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const yx={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),ax(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?a(e):n(e)}function a(t){return null===t?l(t):$w(t)?e.attempt(wx,a,l)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||$w(t)?(e.exit("codeFlowValue"),a(t)):(e.consume(t),i)}function l(n){return e.exit("codeIndented"),t(n)}}},wx={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):$w(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):ax(e,a,"linePrefix",5)(t)}function a(e){const a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$w(e)?o(e):n(e)}}};const xx={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,a=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),a++,i):(e.exit("codeTextSequence"),l(t))}function l(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),l):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):$w(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):(e.enter("codeTextData"),s(t))}function s(t){return null===t||32===t||96===t||$w(t)?(e.exit("codeTextData"),l(t)):(e.consume(t),s)}function c(n){return 96===n?(e.consume(n),r++,c):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",s(n))}}};class kx{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&&Ex(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),Ex(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ex(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);Ex(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ex(this.left,t.reverse())}}}function Ex(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 Sx(e){const t={};let n,r,o,a,i,l,s,c=-1;const u=new kx(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(l=n[1]._tokenizer.events,o=0,o<l.length&&"lineEndingBlank"===l[o][1].type&&(o+=2),o<l.length&&"content"===l[o][1].type))for(;++o<l.length&&"content"!==l[o][1].type;)"chunkText"===l[o][1].type&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Cx(u,c)),c=t[c],s=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(a=u.get(o),"lineEnding"===a[1].type||"lineEndingBlank"===a[1].type)"enter"===a[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),a[1].type="lineEnding",r=o);else if("linePrefix"!==a[1].type)break;r&&(n[1].end={...u.get(r)[1].start},i=u.slice(r,c),i.unshift(n),u.splice(r,c-r+1,i))}}return Nw(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!s}function Cx(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const a=[],i=n._tokenizer||r.parser[n.contentType](n.start),l=i.events,s=[],c={};let u,A,d=-1,f=n,p=0,h=0;const g=[h];for(;f;){for(;e.get(++o)[1]!==f;);a.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),A&&i.defineSkip(f.start),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(u),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),A=f,f=f.next}for(f=n;++d<l.length;)"exit"===l[d][0]&&"enter"===l[d-1][0]&&l[d][1].type===l[d-1][1].type&&l[d][1].start.line!==l[d][1].end.line&&(h=d+1,g.push(h),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(i.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const t=l.slice(g[d],g[d+1]),n=a.pop();s.push([n,n+t.length-1]),e.splice(n,2,t)}for(s.reverse(),d=-1;++d<s.length;)c[p+s[d][0]]=p+s[d][1],p+=s[d][1]-s[d][0]-1;return c}const Px={resolve:function(e){return Sx(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):$w(t)?e.check(Bx,a,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Bx={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"),ax(e,o,"linePrefix")};function o(o){if(null===o||$w(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Dx(e,t,n,r,o,a,i,l,s){const c=s||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(a),e.consume(t),e.exit(a),A):null===t||32===t||41===t||Gw(t)?n(t):(e.enter(r),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),p(t))};function A(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(l),A(t)):null===t||60===t||$w(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 u||null!==o&&41!==o&&!Zw(o)?u<c&&40===o?(e.consume(o),u++,p):41===o?(e.consume(o),u--,p):null===o||32===o||40===o||Gw(o)?n(o):(e.consume(o),92===o?h:p):(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function Tx(e,t,n,r,o,a){const i=this;let l,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(a),c};function c(A){return s>999||null===A||91===A||93===A&&!l||94===A&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(A):93===A?(e.exit(a),e.enter(o),e.consume(A),e.exit(o),e.exit(r),t):$w(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(A))}function u(t){return null===t||91===t||93===t||$w(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),l||(l=!ex(t)),92===t?A:u)}function A(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function Ix(e,t,n,r,o,a){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,l):n(t)};function l(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(a),s(n))}function s(t){return t===i?(e.exit(a),l(i)):null===t?n(t):$w(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ax(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===i||null===t||$w(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===i||92===t?(e.consume(t),c):c(t)}}function Qx(e,t){let n;return function r(o){return $w(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ex(o)?ax(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Mx={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return Tx.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function a(t){return o=qw(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return Zw(t)?Qx(e,l)(t):l(t)}function l(t){return Dx(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(Ox,c,c)(t)}function c(t){return ex(t)?ax(e,u,"whitespace")(t):u(t)}function u(a){return null===a||$w(a)?(e.exit("definition"),r.parser.defined.push(o),t(a)):n(a)}}},Ox={partial:!0,tokenize:function(e,t,n){return function(t){return Zw(t)?Qx(e,r)(t):n(t)};function r(t){return Ix(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return ex(t)?ax(e,a,"whitespace")(t):a(t)}function a(e){return null===e||$w(e)?t(e):n(e)}}};const Lx={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return $w(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Rx={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,a=3;return"whitespace"===e[a][1].type&&(a+=2),o-2>a&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(a===o-1||o-4>a&&"whitespace"===e[o-2][1].type)&&(o-=a+1===o?2:4),o>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[o][1].end},r={type:"chunkText",start:e[a][1].start,end:e[o][1].end,contentType:"text"},Nw(e,a,o-a+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||Zw(t)?(e.exit("atxHeadingSequence"),a(t)):n(t)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||$w(n)?(e.exit("atxHeading"),t(n)):ex(n)?ax(e,a,"whitespace")(n):(e.enter("atxHeadingText"),l(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),a(t))}function l(t){return null===t||35===t||Zw(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),l)}}};const Nx=["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"],Fx=["pre","script","style","textarea"],jx={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,a,i,l,s;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(l){return 33===l?(e.consume(l),u):47===l?(e.consume(l),a=!0,f):63===l?(e.consume(l),o=3,r.interrupt?t:O):Vw(l)?(e.consume(l),i=String.fromCharCode(l),p):n(l)}function u(a){return 45===a?(e.consume(a),o=2,A):91===a?(e.consume(a),o=5,l=0,d):Vw(a)?(e.consume(a),o=4,r.interrupt?t:O):n(a)}function A(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const a="CDATA[";return o===a.charCodeAt(l++)?(e.consume(o),6===l?r.interrupt?t:C:d):n(o)}function f(t){return Vw(t)?(e.consume(t),i=String.fromCharCode(t),p):n(t)}function p(l){if(null===l||47===l||62===l||Zw(l)){const s=47===l,c=i.toLowerCase();return s||a||!Fx.includes(c)?Nx.includes(i.toLowerCase())?(o=6,s?(e.consume(l),h):r.interrupt?t(l):C(l)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(l):a?g(l):m(l)):(o=1,r.interrupt?t(l):C(l))}return 45===l||Ww(l)?(e.consume(l),i+=String.fromCharCode(l),p):n(l)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:C):n(o)}function g(t){return ex(t)?(e.consume(t),g):E(t)}function m(t){return 47===t?(e.consume(t),E):58===t||95===t||Vw(t)?(e.consume(t),v):ex(t)?(e.consume(t),m):E(t)}function v(t){return 45===t||46===t||58===t||95===t||Ww(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),y):ex(t)?(e.consume(t),b):m(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,w):ex(t)?(e.consume(t),y):x(t)}function w(t){return t===s?(e.consume(t),s=null,k):null===t||$w(t)?n(t):(e.consume(t),w)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Zw(t)?b(t):(e.consume(t),x)}function k(e){return 47===e||62===e||ex(e)?m(e):n(e)}function E(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||$w(t)?C(t):ex(t)?(e.consume(t),S):n(t)}function C(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),I):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!$w(t)||6!==o&&7!==o?null===t||$w(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),C):(e.exit("htmlFlowData"),e.check(zx,R,P)(t))}function P(t){return e.check(_x,B,R)(t)}function B(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),D}function D(t){return null===t||$w(t)?P(t):(e.enter("htmlFlowData"),C(t))}function T(t){return 45===t?(e.consume(t),O):C(t)}function I(t){return 47===t?(e.consume(t),i="",Q):C(t)}function Q(t){if(62===t){const n=i.toLowerCase();return Fx.includes(n)?(e.consume(t),L):C(t)}return Vw(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):C(t)}function M(t){return 93===t?(e.consume(t),O):C(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):C(t)}function L(t){return null===t||$w(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),L)}function R(n){return e.exit("htmlFlow"),t(n)}}},zx={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(px,t,n)}}},_x={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return $w(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 Hx={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,a,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),y):63===t?(e.consume(t),v):Vw(t)?(e.consume(t),k):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,f):Vw(t)?(e.consume(t),m):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),A):$w(t)?(i=u,Q(t)):(e.consume(t),u)}function A(t){return 45===t?(e.consume(t),d):u(t)}function d(e){return 62===e?I(e):45===e?A(e):u(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(a++)?(e.consume(t),6===a?p:f):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),h):$w(t)?(i=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?I(t):93===t?(e.consume(t),g):p(t)}function m(t){return null===t||62===t?I(t):$w(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):$w(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?I(e):v(e)}function y(t){return Vw(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||Ww(t)?(e.consume(t),w):x(t)}function x(t){return $w(t)?(i=x,Q(t)):ex(t)?(e.consume(t),x):I(t)}function k(t){return 45===t||Ww(t)?(e.consume(t),k):47===t||62===t||Zw(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),I):58===t||95===t||Vw(t)?(e.consume(t),S):$w(t)?(i=E,Q(t)):ex(t)?(e.consume(t),E):I(t)}function S(t){return 45===t||46===t||58===t||95===t||Ww(t)?(e.consume(t),S):C(t)}function C(t){return 61===t?(e.consume(t),P):$w(t)?(i=C,Q(t)):ex(t)?(e.consume(t),C):E(t)}function P(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,B):$w(t)?(i=P,Q(t)):ex(t)?(e.consume(t),P):(e.consume(t),D)}function B(t){return t===o?(e.consume(t),o=void 0,T):null===t?n(t):$w(t)?(i=B,Q(t)):(e.consume(t),B)}function D(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Zw(t)?E(t):(e.consume(t),D)}function T(e){return 47===e||62===e||Zw(e)?E(e):n(e)}function I(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 ex(t)?ax(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}};const Ux={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&&Nw(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,a,i=e.length,l=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){l=2;break}}else"labelEnd"===n.type&&(o=i);const s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+l+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",s,t],["enter",c,t]],a=Fw(a,e.slice(r+1,r+l+3)),a=Fw(a,[["enter",u,t]]),a=Fw(a,ux(t.parser.constructs.insideSpan.null,e.slice(r+l+4,o-3),t)),a=Fw(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Fw(a,e.slice(o+1)),a=Fw(a,[["exit",s,t]]),Nw(e,r,e.length,a),e},tokenize:function(e,t,n){const r=this;let o,a,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?u(t):(a=r.parser.defined.includes(qw(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),l):n(t)};function l(t){return 40===t?e.attempt(qx,c,a?c:u)(t):91===t?e.attempt(Vx,c,a?s:u)(t):a?c(t):u(t)}function s(t){return e.attempt(Wx,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}},qx={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 Zw(t)?Qx(e,o)(t):o(t)}function o(t){return 41===t?c(t):Dx(e,a,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return Zw(t)?Qx(e,l)(t):c(t)}function i(e){return n(e)}function l(t){return 34===t||39===t||40===t?Ix(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return Zw(t)?Qx(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},Vx={tokenize:function(e,t,n){const r=this;return function(t){return Tx.call(r,e,o,a,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(qw(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},Wx={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 Yx={name:"labelStartImage",resolveAll:Ux.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"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Gx={name:"labelStartLink",resolveAll:Ux.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 Xx={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ax(e,t,"linePrefix")}}};const Kx={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,a(e)}(t)};function a(a){return a===r?(e.enter("thematicBreakSequence"),i(a)):o>=3&&(null===a||$w(a))?(e.exit("thematicBreak"),t(a)):n(a)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),ex(t)?ax(e,a,"whitespace")(t):a(t))}}};const Jx={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(px,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ax(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!ex(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(Zx,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ax(e,e.attempt(Jx,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 a=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=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:Xw(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(Kx,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(t)}return n(t)};function l(t){return Xw(t)&&++i<10?(e.consume(t),l):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),s(t)):n(t)}function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(px,r.interrupt?n:c,e.attempt($x,A,u))}function c(e){return r.containerState.initialBlankLine=!0,a++,A(e)}function u(t){return ex(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),A):n(t)}function A(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},$x={partial:!0,tokenize:function(e,t,n){const r=this;return ax(e,function(e){const o=r.events[r.events.length-1];return!ex(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},Zx={partial:!0,tokenize:function(e,t,n){const r=this;return ax(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 ek={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),!o&&"definition"===e[a][1].type&&(o=a);const i={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",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let i,l=r.events.length;for(;l--;)if("lineEnding"!==r.events[l][1].type&&"linePrefix"!==r.events[l][1].type&&"content"!==r.events[l][1].type){i="paragraph"===r.events[l][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),a(t)}(t))};function a(t){return t===o?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),ex(t)?ax(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||$w(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const tk={tokenize:function(e){const t=this,n=e.attempt(px,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,ax(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Px,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 nk={resolveAll:ik()},rk=ak("string"),ok=ak("text");function ak(e){return{resolveAll:ik("text"===e?lk:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,a,i);return a;function a(e){return s(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),l;t.consume(e)}function l(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),l)}function s(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 ik(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 lk(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 a,i=o.length,l=-1,s=0;for(;i--;){const e=o[i];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)s++,l--;if(l)break;l=-1}else if(-2===e)a=!0,s++;else if(-1!==e){i++;break}}if(s){const o={type:n===e.length||a||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},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 sk={42:Jx,43:Jx,45:Jx,48:Jx,49:Jx,50:Jx,51:Jx,52:Jx,53:Jx,54:Jx,55:Jx,56:Jx,57:Jx,62:hx},ck={91:Mx},uk={[-2]:yx,[-1]:yx,32:yx},Ak={35:Rx,42:Kx,45:[ek,Kx],60:jx,61:ek,95:Kx,96:bx,126:bx},dk={38:mx,92:gx},fk={[-5]:Xx,[-4]:Xx,[-3]:Xx,33:Yx,38:mx,42:Ax,60:[fx,Hx],91:Gx,92:[Lx,gx],93:Ux,95:Ax,96:xx},pk={null:[Ax,nk]},hk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:ck,disable:{null:[]},document:sk,flow:Ak,flowInitial:uk,insideSpan:pk,string:dk,text:fk},Symbol.toStringTag,{value:"Module"}));function gk(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={},a=[];let i=[],l=[];const s={attempt:h(function(e,t){g(e,t.from)}),check:h(p),consume:function(e){$w(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===i[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),c.events.push(["enter",n,c]),l.push(n),n},exit:function(e){const t=l.pop();return t.end=d(),c.events.push(["exit",t,c]),t},interrupt:h(p,{interrupt:!0})},c={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 a=e[n];let i;if("string"==typeof a)i=a;else switch(a){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(a)}o=-2===a,r.push(i)}return r.join("")}(A(e),t)},sliceStream:A,write:function(e){return i=Fw(i,e),function(){let e;for(;r._index<i.length;){const t=i[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!==i[i.length-1]?[]:(g(t,0),c.events=ux(a,c.events,c),c.events)}};let u=t.tokenize.call(c,s);return t.resolveAll&&a.push(t),c;function A(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,a)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}a>0&&i.push(e[o].slice(0,a))}return i}(i,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:a}}function f(e){u=u(e)}function p(e,t){t.restore()}function h(e,t){return function(n,o,a){let i,u,A,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 i=e,u=0,0===e.length?a:h(e[u])}function h(e){return function(n){return f=function(){const e=d(),t=c.previous,n=c.currentConstruct,o=c.events.length,a=Array.from(l);return{from:o,restore:i};function i(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,l=a,m()}}(),A=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,g,v)(n)}}function g(t){return e(A,f),o}function v(e){return f.restore(),++u<i.length?h(i[u]):a}}}function g(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Nw(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const mk=/[\0\t\n\r]/g;const vk=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bk(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Uw(n.slice(t?2:1),t?16:10)}return Rw(n)||e}const yk={}.hasOwnProperty;function wk(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:a(te),autolinkProtocol:S,autolinkEmail:S,atxHeading:a(J),blockQuote:a(W),characterEscape:S,characterReference:S,codeFenced:a(Y),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(Y,i),codeText:a(G,i),codeTextData:S,data:S,codeFlowValue:S,definition:a(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(K),hardBreakEscape:a($),hardBreakTrailing:a($),htmlFlow:a(Z,i),htmlFlowData:S,htmlText:a(Z,i),htmlTextData:S,image:a(ee),label:i,link:a(te),listItem:a(re),listItemValue:d,listOrdered:a(ne,A),listUnordered:a(ne),paragraph:a(oe),reference:j,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(J),strong:a(ae),thematicBreak:a(le)},exit:{atxHeading:s(),atxHeadingSequence:w,autolink:s(),autolinkEmail:V,autolinkProtocol:q,blockQuote:s(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:_,characterReferenceMarkerNumeric:_,characterReferenceValue:H,characterReference:U,codeFenced:s(g),codeFencedFence:h,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:C,codeIndented:s(m),codeText:s(I),codeTextData:C,data:C,definition:s(),definitionDestinationString:y,definitionLabelString:v,definitionTitleString:b,emphasis:s(),hardBreakEscape:s(B),hardBreakTrailing:s(B),htmlFlow:s(D),htmlFlowData:C,htmlText:s(T),htmlTextData:C,image:s(M),label:L,labelText:O,lineEnding:P,link:s(Q),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:z,resourceDestinationString:R,resourceTitleString:N,resource:F,setextHeading:s(E),setextHeadingLineSequence:k,setextHeadingText:x,strong:s(),thematicBreak:s()}};kk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const a={stack:[r],tokenStack:[],config:t,enter:l,exit:c,buffer:i,resume:u,data:n},s=[];let A=-1;for(;++A<e.length;)if("listOrdered"===e[A][1].type||"listUnordered"===e[A][1].type)if("enter"===e[A][0])s.push(A);else{A=o(e,s.pop(),A)}for(A=-1;++A<e.length;){const n=t[e[A][0]];yk.call(n,e[A][1].type)&&n[e[A][1].type].call(Object.assign({sliceSerialize:e[A][2].sliceSerialize},a),e[A][1])}if(a.tokenStack.length>0){const e=a.tokenStack[a.tokenStack.length-1];(e[1]||Sk).call(a,void 0,e[0])}for(r.position={start:xk(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:xk(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},A=-1;++A<t.transforms.length;)r=t.transforms[A](r)||r;return r}function o(e,t,n){let r,o,a,i,l=t-1,s=-1,c=!1;for(;++l<=n;){const t=e[l];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!i&&!s&&!a&&(a=l),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=l;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}a&&(!o||a<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||l,0,["exit",r,t[2]]),l++,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(l,0,["enter",o,t[2]]),l++,n++,a=void 0,i=!0}}}return e[t][1]._spread=c,n}function a(e,t){return n;function n(n){l.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(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:xk(t.start),end:void 0}}function s(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+sw({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Sk).call(this,e,r[0])),n.position.end=xk(e.end)}function u(){return function(e){return Mw(e,"boolean"!=typeof Qw.includeImageAlt||Qw.includeImageAlt,"boolean"!=typeof Qw.includeHtml||Qw.includeHtml)}(this.stack.pop())}function A(){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=qw(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function y(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(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 S(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=ie(),n.position={start:xk(e.start),end:void 0},t.push(n)),this.stack.push(n)}function C(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=xk(e.end)}function P(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=xk(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(S.call(this,e),C.call(this,e))}function B(){this.data.atHardBreak=!0}function D(){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 I(){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(vk,bk)}(t),n.identifier=qw(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 N(){const e=this.resume();this.stack[this.stack.length-1].title=e}function F(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function z(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=qw(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function _(e){this.data.characterReferenceType=e.type}function H(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=Uw(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Rw(t);this.stack[this.stack.length-1].value+=r}function U(e){this.stack.pop().position.end=xk(e.end)}function q(e){C.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function V(e){C.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function W(){return{type:"blockquote",children:[]}}function Y(){return{type:"code",lang:null,meta:null,value:""}}function G(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function $(){return{type:"break"}}function Z(){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 ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Sx(e););return e}(function(e){const t={constructs:zw([hk,...(e||{}).extensions||[]]),content:n(ix),defined:[],document:n(lx),flow:n(tk),lazy:{},string:n(rk),text:n(ok)};return t;function n(e){return function(n){return gk(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,a,i){const l=[];let s,c,u,A,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(a||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(mk.lastIndex=u,s=mk.exec(o),A=s&&void 0!==s.index?s.index:o.length,d=o.charCodeAt(A),!s){n=o.slice(u);break}if(10===d&&u===A&&e)l.push(-3),e=void 0;else switch(e&&(l.push(-5),e=void 0),u<A&&(l.push(o.slice(u,A)),t+=A-u),d){case 0:l.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),l.push(-2);t++<c;)l.push(-1);break;case 10:l.push(-4),t=1;break;default:e=!0,t=1}u=A+1}return i&&(e&&l.push(-5),n&&l.push(n),l.push(null)),l}}()(e,t,!0))))}function xk(e){return{line:e.line,column:e.column,offset:e.offset}}function kk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?kk(e,r):Ek(e,r)}}function Ek(e,t){let n;for(n in t)if(yk.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 Sk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sw({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sw({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sw({start:t.start,end:t.end})+") is still open")}function Ck(e){const t=this;t.parser=function(n){return wk(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Pk(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),a=o[0];a&&"text"===a.type?a.value="["+a.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function Bk(e){return e.spread??e.children.length>1}function Dk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const a=[];for(;r;)a.push(Tk(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(Tk(t.slice(o),o>0,!1)),a.join("")}function Tk(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 Ik={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=ox(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let i,l=e.footnoteCounts.get(r);void 0===l?(l=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=a+1,l+=1,e.footnoteCounts.set(r,l);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,s);const c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},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 Pk(e,t);const o={src:ox(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){const n={src:ox(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 Pk(e,t);const o={href:ox(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){const n={href:ox(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=Bk(n[r])}return t}(n):Bk(t),a={},i=[];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:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const e=r[l];(o||0!==l||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const s=r[r.length-1];s&&(o||"element"!==s.type||"p"!==s.tagName)&&i.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:a,children:i};return e.patch(t,c),e.applyData(t,c)},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 a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},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)},a=iw(t.children[1]),i=aw(t.children[t.children.length-1]);a&&i&&(r.position={start:a,end:i}),o.push(r)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)},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",a=n&&"table"===n.type?n.align:void 0,i=a?a.length:t.children.length;let l=-1;const s=[];for(;++l<i;){const n=t.children[l],r={},i=a?a[l]:void 0;i&&(r.align=i);let c={type:"element",tagName:o,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Dk(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:Qk,yaml:Qk,definition:Qk,footnoteDefinition:Qk};function Qk(){}const Mk="object"==typeof self?self:globalThis,Ok=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[a,i]=t[o];switch(a){case 0:case-1:return n(i,o);case 1:{const e=n([],o);for(const t of i)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),o);case 4:{const{source:e,flags:t}=i;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of i)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of i)e.add(r(t));return e}case 7:{const{name:e,message:t}=i;return n(new Mk[e](t),o)}case 8:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new Mk[a](i),o)};return r})(new Map,e)(0),Lk="",{toString:Rk}={},{keys:Nk}=Object,Fk=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Rk.call(e).slice(8,-1);switch(n){case"Array":return[1,Lk];case"Object":return[2,Lk];case"Date":return[3,Lk];case"RegExp":return[4,Lk];case"Map":return[5,Lk];case"Set":return[6,Lk];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},jk=([e,t])=>0===e&&("function"===t||"symbol"===t),zk=(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},a=r=>{if(n.has(r))return n.get(r);let[i,l]=Fk(r);switch(i){case 0:{let t=r;switch(l){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(l){let e=r;return"DataView"===l?e=new Uint8Array(r.buffer):"ArrayBuffer"===l&&(e=new Uint8Array(r)),o([l,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(a(t));return t}case 2:{if(l)switch(l){case"BigInt":return o([l,r.toString()],r);case"Boolean":case"Number":case"String":return o([l,r.valueOf()],r)}if(t&&"toJSON"in r)return a(r.toJSON());const n=[],s=o([i,n],r);for(const t of Nk(r))(e||!jk(Fk(r[t])))&&n.push([a(t),a(r[t])]);return s}case 3:return o([i,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([i,{source:e,flags:t}],r)}case 5:{const t=[],n=o([i,t],r);for(const[n,o]of r)(e||!jk(Fk(n))&&!jk(Fk(o)))&&t.push([a(n),a(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!jk(Fk(n)))&&t.push(a(n));return n}}const{message:s}=r;return o([i,{name:l,message:s}],r)};return a})(!(t||n),!!t,new Map,r)(e),r},_k="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Ok(zk(e,t)):structuredClone(e):(e,t)=>Ok(zk(e,t));function Hk(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 Uk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const qk=function(e){if(null==e)return Wk;if("function"==typeof e)return Vk(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qk(e[n]);return Vk(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 Vk(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 Vk(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function Vk(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 Wk(){return!0}const Yk=[],Gk=!0,Xk=!1;function Kk(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const a=qk(o),i=r?-1:1;!function e(o,l,s){const c=o&&"object"==typeof o?o:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,A,d=Yk;if((!t||a(o,l,s[s.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[Gk,e]:null==e?Yk:[e]}(n(o,s)),d[0]===Xk))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(u=(r?t.children.length:-1)+i,A=s.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,A)(),c[0]===Xk)return c;u="number"==typeof c[1]?c[1]:u+i}}return d}}(e,void 0,[])()}function Jk(e,t,n,r){let o,a,i;"function"==typeof t?(a=void 0,i=t,o=n):(a=t,i=n,o=r),Kk(e,a,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return i(e,r,n)},o)}const $k={}.hasOwnProperty,Zk={};function eE(e,t){const n=t||Zk,r=new Map,o=new Map,a=new Map,i={...Ik,...n.handlers},l={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=l.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=aE(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=aE(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:nE,definitionById:r,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=l.handlers[n];if($k.call(l.handlers,n)&&r)return r(l,e,t);if(l.options.passThrough&&l.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=_k(n);return r.children=l.all(e),r}return _k(e)}return(l.options.unknownHandler||rE)(l,e,t)},options:n,patch:tE,wrap:oE};return Jk(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)}}),l}function tE(e,t){e.position&&(t.position=function(e){const t=iw(e),n=aw(e);if(t&&n)return{start:t,end:n}}(e))}function nE(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,_k(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function rE(e,t){const n=t.data||{},r=!("value"in t)||$k.call(n,"hProperties")||$k.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 oE(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 aE(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function iE(e,t){const n=eE(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||Hk,r=e.options.footnoteBackLabel||Uk,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let s=-1;for(;++s<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[s]);if(!o)continue;const a=e.all(o),i=String(o.identifier).toUpperCase(),c=ox(i.toLowerCase());let u=0;const A=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++u<=d;){A.length>0&&A.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,u);"string"==typeof e&&(e={type:"text",value:e}),A.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=a[a.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(...A)}else a.push(...A);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(o,p),l.push(p)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{..._k(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:"\n"},o),a}function lE(e,t){return e&&"run"in e?async function(n,r){const o=iE(n,{file:r,...t});await e.run(o,r)}:function(n,r){return iE(n,{file:r,...e||t})}}function sE(e){if(e)throw e}var cE,uE;var AE=function(){if(uE)return cE;uE=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)},a=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),a=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!a)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},i=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},l=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return cE=function e(){var t,n,r,s,c,u,A=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof A&&(p=A,A=arguments[1]||{},d=2),(null==A||"object"!=typeof A&&"function"!=typeof A)&&(A={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(A,n),A!==(s=l(t,n))&&(p&&s&&(a(s)||(c=o(s)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},i(A,{name:n,newValue:e(p,u,s)})):typeof s<"u"&&i(A,{name:n,newValue:s}));return A},cE}();const dE=Jy(AE);function fE(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 pE(){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(a,...i){const l=e[++n];let s=-1;if(a)r(a);else{for(;++s<t.length;)(null===i[s]||void 0===i[s])&&(i[s]=t[s]);t=i,l?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let i;r&&t.push(o);try{i=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(i&&i.then&&"function"==typeof i.then?i.then(a,o):i instanceof Error?o(i):a(i))}function o(e,...r){n||(n=!0,t(e,...r))}function a(e){o(null,e)}}(l,o)(...i):r(null,...i)}}(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 hE={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');gE(e);let n,r=0,o=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else o<0&&(n=!0,o=a+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,l=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1),l>-1&&(e.codePointAt(a)===t.codePointAt(l--)?l<0&&(o=a):(l=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(gE(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){gE(e);let t,n=e.length,r=-1,o=0,a=-1,i=0;for(;n--;){const l=e.codePointAt(n);if(47!==l)r<0&&(t=!0,r=n+1),46===l?a<0?a=n:1!==i&&(i=1):a>-1&&(i=-1);else if(t){o=n+1;break}}return a<0||r<0||0===i||1===i&&a===r-1&&a===o+1?"":e.slice(a,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)gE(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){gE(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",a=0,i=-1,l=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else{if(47===n)break;n=47}if(47===n){if(i!==s-1&&1!==l)if(i!==s-1&&2===l){if(o.length<2||2!==a||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="",a=0):(o=o.slice(0,r),a=o.length-1-o.lastIndexOf("/")),i=s,l=0;continue}}else if(o.length>0){o="",a=0,i=s,l=0;continue}t&&(o=o.length>0?o+"/..":"..",a=2)}else o.length>0?o+="/"+e.slice(i+1,s):o=e.slice(i+1,s),a=s-i-1;i=s,l=0}else 46===n&&l>-1?l++:l=-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 gE(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mE={cwd:function(){return"/"}};function vE(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function bE(e){if("string"==typeof e)e=new URL(e);else if(!vE(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 yE=["history","path","basename","stem","extname","dirname"];class wE{constructor(e){let t;var n;t=e?vE(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?"":mE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<yE.length;){const e=yE[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)yE.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?hE.basename(this.path):void 0}set basename(e){kE(e,"basename"),xE(e,"basename"),this.path=hE.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?hE.dirname(this.path):void 0}set dirname(e){EE(this.basename,"dirname"),this.path=hE.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?hE.extname(this.path):void 0}set extname(e){if(xE(e,"extname"),EE(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=hE.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){vE(e)&&(e=bE(e)),kE(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?hE.basename(this.path,this.extname):void 0}set stem(e){kE(e,"stem"),xE(e,"stem"),this.path=hE.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 dw(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 xE(e,t){if(e&&e.includes(hE.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+hE.sep+"`")}function kE(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function EE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const SE=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},CE={}.hasOwnProperty;class PE extends SE{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=pE()}copy(){const e=new PE;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(dE(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(IE("data",this.frozen),this.namespace[e]=t,this):CE.call(this.namespace,e)&&this.namespace[e]||void 0:e?(IE("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=OE(e),n=this.parser||this.Parser;return DE("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),DE("process",this.parser||this.Parser),TE("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const a=OE(e),i=n.parse(a);function l(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(i,a,function(e,t,r){if(e||!t||!r)return l(e);const o=t,a=n.stringify(o,r);var i;"string"==typeof(i=a)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(i)?r.value=a:r.result=a,l(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),DE("processSync",this.parser||this.Parser),TE("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,sE(e),t=r}),ME("processSync","process",n),t}run(e,t,n){QE(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,a){const i=OE(t);r.run(e,i,function(t,r,i){const l=r||e;t?a(t):o?o(l):n(void 0,l,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){sE(e),n=t,r=!0}),ME("runSync","run",r),n}stringify(e,t){this.freeze();const n=OE(t),r=this.compiler||this.Compiler;return TE("stringify",r),QE(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(IE("use",this.frozen),null!=e)if("function"==typeof e)l(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?i(e):a(e)}return this;function o(e){if("function"==typeof e)l(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;l(t,n)}else a(e)}}function a(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");i(e.plugins),e.settings&&(r.settings=dE(!0,r.settings,e.settings))}function i(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 l(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,...a]=t;const i=n[o][1];fE(i)&&fE(r)&&(r=dE(!0,i,r)),n[o]=[e,r,...a]}}}}const BE=(new PE).freeze();function DE(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function TE(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function IE(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 QE(e){if(!fE(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function ME(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function OE(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new wE(e)}const LE=[],RE={allowDangerousHtml:!0},NE=/^(https?|ircs?|mailto|xmpp)$/i,FE=[{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 jE(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,a=e.components,i=e.disallowedElements,l=e.rehypePlugins||LE,s=e.remarkPlugins||LE,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...RE}:RE,u=e.skipHtml,A=e.unwrapDisallowed,d=e.urlTransform||zE,f=BE().use(Ck).use(s).use(lE,c).use(l),p=new wE;"string"==typeof r&&(p.value=r);for(const t of FE)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const h=f.parse(p);let g=f.runSync(h,p);return o&&(g={type:"element",tagName:"div",properties:{className:o},children:"root"===g.type?g.children:[g]}),Jk(g,function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return u?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in Iw)if(Object.hasOwn(Iw,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Iw[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let a=t?!t.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&n&&"number"==typeof r&&(a=!n(e,r,o)),a&&o&&"number"==typeof r)return A&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}}),yw(g,{Fragment:aA.Fragment,components:a,ignoreInvalidStyle:!0,jsx:aA.jsx,jsxs:aA.jsxs,passKeys:!0,passNode:!0})}function zE(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||NE.test(e.slice(0,t))?e:""}const _E=({children:e})=>aA.jsx("div",{style:{whiteSpace:"normal"},children:aA.jsx(jE,{components:{p:({...e})=>aA.jsx("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>aA.jsx("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>aA.jsx("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>aA.jsx("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?aA.jsx("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):aA.jsx("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:aA.jsx("code",{children:t})}),blockquote:({...e})=>aA.jsx("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),HE={autoConfig:!0},UE=e=>()=>(e=>{const{getFlow:t}=Pb(),{messages:n,replaceMessages:r}=Bb(),{settings:o}=Tb(),{hasChatHistoryLoaded:a}=Qb(),i={...e,...HE},l=i.markdownComponent?i.markdownComponent:_E;j.useEffect(()=>{var e,t;if(a){const a=[...n];for(let n=0;n<a.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=a[n];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=l)}r(a)}},[a]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.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,t(),r)&&(e.data.message.contentWrapper=l,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};Db(Sm.PRE_INJECT_MESSAGE,s),Db(Sm.CHUNK_STREAM_MESSAGE,s),Db(Sm.START_STREAM_MESSAGE,s),Db(Sm.START_SIMULATE_STREAM_MESSAGE,s);const c={name:"@rcb-plugins/markdown-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(e),qE={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"}},VE=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const a=o[n];return"function"==typeof a?a:void 0},WE=e=>{const{showToast:t}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=Fv();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:n}=Pb(),{styles:r,updateStyles:o,replaceStyles:a}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=mb();return{styles:e,replaceStyles:t,updateStyles:n}})(),i=(e=>({...qE,...e,promptBaseColors:{...qE.promptBaseColors},promptHoveredColors:{...qE.promptHoveredColors},textAreaHighlightColors:{...qE.textAreaHighlightColors}}))(e),[l,s]=j.useState(0),c=j.useRef({});Db(Sm.USER_SUBMIT_TEXT,e=>{const a=e,u=VE(a,n(),"validateTextInput");if(!u)return;const A=u(a.data.inputText);if(null!=A&&A.success||e.preventDefault(),!A.promptContent)return;0===l&&(c.current=structuredClone(r));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})(A,i);o(d),t(A.promptContent,A.promptDuration??3e3),s(e=>e+1)}),Db(Sm.USER_UPLOAD_FILE,e=>{var r,o;const a=e,i=null==(o=null==(r=a.data)?void 0:r.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const l=VE(a,n(),"validateFileInput");if(!l)return void console.error("Validator not found for file input.");const s=l(i);if(!s.success)return console.error("Validation failed:",s),s.promptContent&&t(s.promptContent,s.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",s)}),Db(Sm.DISMISS_TOAST,()=>{s(e=>e-1)}),j.useEffect(()=>{0===l&&setTimeout(()=>{a(c.current)})},[l,a]);const u={name:"@rcb-plugins/input-validator"};return i.autoConfig&&(u.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),u},YE=e=>()=>WE(e),GE=j.forwardRef(({embedded:e,currentOpen:t,enabled:n,onSetEnabled:r},o)=>{const a=Bb(),i=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=Qm();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),l=j.useRef(!1),s=j.useRef(!1);return j.useEffect(()=>{!e&&i&&i.toggleChatWindow&&(l.current===t||s.current||(setTimeout(()=>{i&&i.toggleChatWindow&&i.toggleChatWindow(t)},0),l.current=null!=t&&t),s.current=!1)},[t,e,i]),j.useEffect(()=>{const e=()=>{s.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),j.useImperativeHandle(o,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!e&&i&&i.toggleChatWindow&&i.toggleChatWindow(!0)},closeChat:()=>{!e&&i&&i.toggleChatWindow&&i.toggleChatWindow(!1)},toggleChat:()=>{!e&&i&&i.toggleChatWindow&&i.toggleChatWindow()},setBotEnabled:e=>{r&&r(e)}}),[a,i,e,r]),null});GE.displayName="BotController";const XE=j.createContext(null),KE=({trackEvent:e,children:t})=>{const n=j.useRef(e);return n.current=e,z.createElement(XE.Provider,{value:{trackEvent:e=>n.current(e)}},t)},JE=()=>{const e=j.useContext(XE);return e||{trackEvent:()=>{}}},$E=({loginUrl:e,className:t="",style:n,isHeaderButton:r=!1})=>{const{trackEvent:o}=JE(),a=r?{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 z.createElement(z.Fragment,null,r&&z.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 "),z.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:`qa-bot-login-button ${r?"qa-bot-header-login-button":""} ${t}`,style:Object.assign(Object.assign({},a),n),onClick:()=>{o({type:"chatbot_login_clicked",loginUrl:e})}},"Log In"))},ZE=()=>z.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"},z.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"},z.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),z.createElement("circle",{cx:"12",cy:"7",r:"4"}))),eS=[];for(let e=0;e<256;++e)eS.push((e+256).toString(16).slice(1));let tS;const nS=new Uint8Array(16);var rS={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function oS(e,t,n){if(rS.randomUUID&&!e)return rS.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!tS){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tS=crypto.getRandomValues.bind(crypto)}return tS(nS)}();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(eS[e[t+0]]+eS[e[t+1]]+eS[e[t+2]]+eS[e[t+3]]+"-"+eS[e[t+4]]+eS[e[t+5]]+"-"+eS[e[t+6]]+eS[e[t+7]]+"-"+eS[e[t+8]]+eS[e[t+9]]+"-"+eS[e[t+10]]+eS[e[t+11]]+eS[e[t+12]]+eS[e[t+13]]+eS[e[t+14]]+eS[e[t+15]]).toLowerCase()}(r)}function aS(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const iS="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",lS="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",sS="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",cS="background: #f97316; color: white; padding: 2px 6px; border-radius: 3px;",uS="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",AS="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",dS=()=>{aS()&&console.log("%c QA Bot Core %c v0.2.33-rc.1 ",uS,AS)},fS=(e,...t)=>{aS()&&console.log(`%c[Session]%c ${e}`,iS,"",...t)},pS=(e,...t)=>{aS()&&console.log(`%c[History]%c ${e}`,lS,"",...t)},hS=(e,t)=>{aS()&&console.log(`%c[Message]%c ${e}`,sS,"",t)},gS=(e,...t)=>{aS()&&console.log(`%c[Turnstile]%c ${e}`,cS,"",...t)},mS=(...e)=>{console.warn(...e)},vS=(...e)=>{console.error(...e)},bS="qa_bot_session_messages",yS=()=>`qa_bot_session_${oS()}`,wS=()=>{try{const e=localStorage.getItem(bS);return e?JSON.parse(e):{}}catch(e){return{}}},xS=(e,t,n,r,o)=>{const a=wS();!a[e]&&(a[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},pS("NEW session created",{sessionId:e.slice(-12)}));const i=a[e].messages.some(e=>e.id===t);if(i)return void pS("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()};a[e].messages.push(l),pS("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:a[e].messages.length});const s=a[e].messages,c=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(c){const t=c.content;a[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&&!a[e].preview){const n=t.content;a[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])=>new Date(e.startedAt).getTime()-new Date(t.startedAt).getTime())[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(bS,JSON.stringify(e))})(a),pS("STORAGE state",{ourSessions:Object.keys(a).length,ourTotalMessages:Object.values(a).reduce((e,t)=>e+t.messages.length,0)})},kS=e=>{var t,n;return null!==(n=null===(t=wS()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},ES=e=>{const t=wS()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},SS=j.createContext(void 0),CS=({children:e,getSessionId:t,setSessionId:n,resetSession:r,clearResettingFlag:o})=>z.createElement(SS.Provider,{value:{getSessionId:t,setSessionId:n,resetSession:r,clearResettingFlag:o}},e),PS=()=>{const e=j.useContext(SS);if(!e)throw new Error("useSession must be used within a SessionProvider");return e},BS=()=>{const[e,t]=j.useState(!1),[n,r]=j.useState([]),[o,a]=j.useState(null),[i,l]=j.useState(0),s=j.useRef(null),c=j.useRef(null),{replaceMessages:u}=Bb(),{toggleTextAreaDisabled:A}=Ib(),{setSessionId:d,getSessionId:f}=PS();j.useEffect(()=>{var n,r;const o=e=>{s.current&&!s.current.contains(e.target)&&c.current&&!c.current.contains(e.target)&&t(!1)},a=null!==(r=null===(n=s.current)||void 0===n?void 0:n.getRootNode())&&void 0!==r?r:document;return e&&a.addEventListener("mousedown",o),()=>{a.removeEventListener("mousedown",o)}},[e]);const p=e=>{var n;const r=f();if(pS("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==r?void 0:r.slice(-12)}),e===r)return pS("RESTORE skipped - already on this session"),void t(!1);const o=(e=>{var t;return(null===(t=wS()[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()});pS("Stored messages from our localStorage",{count:o.length,ids:o.map(e=>e.id.slice(-8))});const a=o.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));var i;d(e),pS("Session ID updated",{newSession:e.slice(-12)}),u(a),pS("replaceMessages called",{count:a.length}),i=null===(n=c.current)||void 0===n?void 0:n.getRootNode(),setTimeout(()=>{const e=(i||document).querySelector(".rcb-chat-body-container");e&&e.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("<a href=")&&(n=n.replace(/<a\s+href=["']([^"']+)["'][^&]*>([^&]+)<\/a>/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),(n.includes("<a ")||(null===(t=e.textContent)||void 0===t?void 0:t.includes("<a href=")))&&(e.textContent||"").includes("<a href=")&&(n=n.replace(/<a\s+href="([^"]+)"[^&]*>([^&]+)<\/a>/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),r&&(e.innerHTML=n)})},50),A(!1),pS("Chat input enabled after restore"),t(!1)};return z.createElement("div",{style:{position:"relative"}},z.createElement("button",{ref:c,className:"history-button",onClick:()=>{if(!e&&(r((()=>{const e=wS();return Object.entries(e).map(([e,t])=>Object.assign({sessionId:e},t)).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();a(t.width+3),l(t.right-n.right-18+4)}}t(!e)},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":e,"aria-haspopup":"menu"},z.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"},z.createElement("circle",{cx:"12",cy:"12",r:"10"}),z.createElement("polyline",{points:"12 6 12 12 16 14"}))),e&&z.createElement("div",{ref:s,role:"menu",style:{position:"absolute",right:i?`-${i}px`:"-18px",top:"100%",marginTop:"8px",width:o?`${o}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===n.length?z.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):n.map(e=>z.createElement("button",{key:e.sessionId,role:"menuitem",onClick:()=>p(e.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"}},z.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.preview||"New conversation"),z.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"})})(e.startedAt))))))},DS=({width:t=24,height:n=24,color:r="currentColor",children:o,...a})=>z.createElement("svg",e({xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},a),o),TS=e=>z.createElement(DS,e,z.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"})),IS=()=>{const{restartFlow:e}=Pb(),{setTextAreaValue:t}=Ib(),{messages:n}=Bb(),{getSessionId:r,resetSession:o,clearResettingFlag:a}=PS(),{trackEvent:i}=JE();return z.createElement("button",{onClick:async()=>{const n=r(),l=n?kS(n):0;i({type:"chatbot_new_chat",previousMessageCount:l}),o(),await t(""),await e(),setTimeout(()=>{a()},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)"}},z.createElement(TS,{width:16,height:16}),"New Chat")};function QS(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(QS).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return QS(t.children)}return""}const MS=()=>{const{getSessionId:e}=PS(),t=j.useCallback(t=>{var n;const r=null===(n=t.data)||void 0===n?void 0:n.message;if(!(null==r?void 0:r.id))return;const o=r.sender,a=r.type||"string";let i;if(i="string"==typeof r.content?r.content:QS(r.content),hS("TRACKED",{id:r.id,sender:o,content:i.substring(0,50)+(i.length>50?"...":"")}),i.includes("rcb-options-container"))return;if(!i.trim())return;const l=e();xS(l,r.id,i,o,a)},[e]);return j.useEffect(()=>(window.addEventListener("rcb-pre-inject-message",t),()=>{window.removeEventListener("rcb-pre-inject-message",t)}),[t]),null},OS=()=>(j.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 a=[];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];a=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===a.length)return;const i=a.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=i<a.length-1?i+1:0,a[t].setAttribute("tabindex","0"),a.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),a[t].classList.add("keyboard-focused"),a[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=i>0?i-1:a.length-1,a[t].setAttribute("tabindex","0"),a.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),a[t].classList.add("keyboard-focused"),a[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&a.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",a=e.querySelector(".rcb-checkbox-mark"),i=a&&a.style.backgroundColor?"checked":"unchecked";t(`${o} ${i}`)}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(),a.length>0&&(a[0].setAttribute("tabindex","0"),a.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),a[0].classList.add("keyboard-focused"),a[0].focus());break;case"End":if(e.preventDefault(),a.length>0){const e=a.length-1;a[e].setAttribute("tabindex","0"),a.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),a[e].classList.add("keyboard-focused"),a[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 a=o[o.length-1],i=Array.from(a.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let l=[];if(i.length>0){const e=i[i.length-1];l=Array.from(e.querySelectorAll(".rcb-options"))}if(0===l.length){let e=a.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(l.length>0){if(l.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",l.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),l.length>1){const e=i.length>0?i[i.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=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{l[0]&&null!==l[0].offsetParent&&!r&&(l[0].focus(),l.length>1&&t(`${l.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 LS=!1,RS=null;function NS(){return LS?Promise.resolve():RS||(RS=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=()=>{LS=!0,gS("Script loaded"),e()},n.onerror=()=>{RS=null,t(new Error("Failed to load Turnstile script"))},document.head.appendChild(n)}),RS)}const FS=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},jS=({siteKey:e,onVerify:t,onError:n})=>{const r=j.useRef(null),o=j.useRef(!1);return j.useEffect(()=>{!o.current&&r.current&&(o.current=!0,NS().then(()=>{const o=window.turnstile;if(!o||!r.current)return vS("Turnstile API not available after script load"),void(null==n||n());o.render(r.current,{sitekey:e,callback:e=>{gS("Visible challenge completed"),t(e)},"error-callback":()=>{vS("Turnstile challenge failed"),null==n||n()},"expired-callback":()=>{vS("Turnstile token expired"),null==n||n()}})}).catch(e=>{vS("Failed to load Turnstile script:",e),null==n||n()}))},[e,t,n]),z.createElement("div",{style:{padding:"8px 16px"}},z.createElement("div",{ref:r,style:{borderRadius:"8px",overflow:"hidden"}}))};function zS(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 _S({getState:e,onResubmit:t,trackEvent:n,loginUrl:r}){const[o,a]=z.useState(!1),i=e();return z.useEffect(()=>{if(!i.siteKey)return;a(!1);const e=setTimeout(()=>{i.token||(a(!0),null==n||n({type:"chatbot_turnstile_error"}))},5e3);return()=>clearTimeout(e)},[i.siteKey]),i.siteKey?o?z.createElement("div",{style:{padding:"8px 16px",fontSize:"14px",lineHeight:"1.5"}},z.createElement("p",{style:{margin:0}},"I'm having trouble verifying your session. Please try"," ",z.createElement("a",{href:"",onClick:e=>{e.preventDefault(),window.location.reload()},style:{color:"var(--primaryColor, #107180)"}},"refreshing the page"),", or"," ",z.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primaryColor, #107180)",fontWeight:"bold"}},"log in")," ","to continue.")):z.createElement(jS,{siteKey:i.siteKey,onVerify:e=>{i.token=e,null==n||n({type:"chatbot_turnstile_completed"}),t(e)},onError:()=>{mS("Turnstile widget error (may auto-recover)")}}):null}const HS="#1a5b6e",US="#107180",qS="Arial, sans-serif",VS="Q&A Bot",WS="/chat-icon.svg",YS="Type your question here...",GS="Select an option to continue",XS=!1,KS="Ask me a question!",JS="/login",$S={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}},ZS=j.forwardRef((e,t)=>{var n,r,o;const{apiKey:a,qaEndpoint:i,ratingEndpoint:l,capabilitiesEndpoint:s,agentRatingEndpoint:c,welcomeMessage:u,open:A,onOpenChange:d,isLoggedIn:f,allowAnonAccess:p=!1,actingUser:h,primaryColor:g,secondaryColor:m,botName:v,logo:b,placeholder:y,errorMessage:w,embedded:x,footerText:k,footerLink:E,tooltipText:S,loginUrl:C,turnstileSiteKey:P,resourceContext:B,customFlow:D,onAnalyticsEvent:T}=e,I=j.useRef(`bot_${Math.random().toString(36).substr(2,9)}`);j.useEffect(()=>{dS()},[]);const Q=j.useRef(null);null===Q.current&&(Q.current=yS(),fS("CREATED",Q.current));const M=j.useRef(!1),O=j.useRef({getSessionId:()=>Q.current,isResetting:()=>M.current}),L=function(e){const[t,n]=j.useState(null),[r,o]=j.useState("idle"),a=j.useRef(null),i=j.useRef(null),l=j.useRef(!0),s=j.useCallback(()=>{const e=window.turnstile;if(i.current&&(null==e?void 0:e.remove)){try{e.remove(i.current)}catch(e){}i.current=null}a.current&&(a.current.remove(),a.current=null)},[]);return j.useEffect(()=>{if(l.current=!0,!e)return o("idle"),void n(null);o("loading");const t=document.createElement("div");return t.style.position="fixed",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.setAttribute("aria-hidden","true"),document.body.appendChild(t),a.current=t,NS().then(()=>{if(!l.current)return;const t=window.turnstile;if(!t||!a.current)return vS("Turnstile API not available for silent verification"),void o("failed");const r=t.render(a.current,{sitekey:e,execution:"render","refresh-expired":"auto",callback:e=>{l.current&&(gS("Silent verification succeeded"),n(e),o("verified"))},"error-callback":()=>{l.current&&(vS("Turnstile silent verification failed"),o("failed"))},"expired-callback":()=>{l.current&&(gS("Token expired, awaiting refresh"),n(null),o("loading"))}});i.current=r}).catch(e=>{l.current&&(vS("Failed to load Turnstile script for silent verification:",e),o("failed"))}),()=>{l.current=!1,s()}},[e,s]),{token:t,status:r}}(P),R=j.useRef(null);R.current=L.token;const[N,F]=j.useState(f);j.useEffect(()=>{F(f)},[f]);const _=void 0!==x?x:XS,H=j.useCallback(e=>{var t;T&&T(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(t=Q.current)&&void 0!==t?t:void 0,pageUrl:"undefined"!=typeof window?window.location.href:void 0,isEmbedded:_}))},[T,_]),U=j.useMemo(()=>{const e=Object.assign({},$S);e.general=Object.assign(Object.assign({},e.general),{primaryColor:g||HS,secondaryColor:m||US,fontFamily:qS,embedded:_});const t=!1===N?[z.createElement($E,{key:"login-button",loginUrl:C||JS,isHeaderButton:!0})]:[z.createElement(BS,{key:"history-button"}),z.createElement(ZE,{key:"user-icon"})];e.header={title:z.createElement("span",{style:{fontSize:14,fontWeight:500}},v||VS),showAvatar:!0,avatar:b||WS,buttons:[...t,Kg.CLOSE_CHAT_BUTTON]},e.chatInput=Object.assign(Object.assign({},e.chatInput),{disabled:!1,enabledPlaceholderText:y||YS,disabledPlaceholderText:w||GS}),e.tooltip=Object.assign(Object.assign({},e.tooltip),{text:S||KS});const n=k?E?z.createElement("a",{href:E,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},k):z.createElement("span",{key:"footer-text"},k):null;return e.footer={text:n,buttons:[z.createElement(IS,{key:"new-chat-button"})]},e.chatWindow=Object.assign(Object.assign({},e.chatWindow),{defaultOpen:!!_}),e.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},e},[g,m,v,b,y,w,_,S,N,C,k,E]),q=j.useRef(null),V=((e,t={})=>j.useMemo(()=>{const n=(t,n)=>{if(e.current){const n=getComputedStyle(e.current).getPropertyValue(t);if(n&&""!==n.trim())return n.trim();if(e.current.parentElement){const n=getComputedStyle(e.current.parentElement).getPropertyValue(t);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:n("--primaryColor",t.primaryColor),secondaryColor:n("--secondaryColor",t.secondaryColor),fontFamily:n("--fontFamily",t.fontFamily)}},[e,t]))(q,U.general);((e,t)=>{j.useEffect(()=>{t.current&&(e?t.current.classList.add("bot-logged-in"):t.current.classList.remove("bot-logged-in"))},[e,t])})(!1!==N,q),(({settings:e,themeColors:t})=>{j.useEffect(()=>{t&&(Object.entries(t).forEach(([e,t])=>{t&&document.documentElement.style.setProperty(`--${e}`,t)}),t.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",t.primaryColor),t.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",t.secondaryColor))},[t]),j.useEffect(()=>{var t,n;(null===(t=e.header)||void 0===t?void 0:t.title)&&"string"==typeof e.header.title&&(e.header.title=z.createElement("div",{key:"header-title"},z.createElement("h1",{className:"sr-only"},e.header.title),z.createElement("span",{"aria-hidden":"true"},e.header.title))),e.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},e.chatHistory={disabled:!0},e.chatButton=Object.assign(Object.assign({},e.chatButton),{icon:null===(n=e.header)||void 0===n?void 0:n.avatar}),e.event=Object.assign(Object.assign({},e.event),{rcbToggleChatWindow:!0})},[e])})({settings:U,themeColors:V});const W=j.useMemo(()=>{const t=(({endpoint:e,ratingEndpoint:t,agentRatingEndpoint:n,apiKey:r,sessionId:o,isResetting:a=()=>!1,isLoggedIn:i,allowAnonAccess:l=!1,loginUrl:s="/login",actingUser:c,trackEvent:u,getTurnstileToken:A,backendId:d,resourceContext:f})=>{if(!1===i&&!l)return null==u||u({type:"chatbot_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:z.createElement($E,{loginUrl:s}),chatDisabled:!0,path:"qa_loop"}};let p=null,h=null,g=!1;const m={siteKey:null,token:null,pendingQuery:null,needsChallenge:!1};let v=null;if(!e)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async i=>{var l;v=i.injectMessage.bind(i);const{userInput:s}=i;if(a&&a())return null;if(!s||""===s.trim())return null;if("👍 Helpful"===s||"👎 Not helpful"===s){if(p){const e="👍 Helpful"===s,a="agent"===h?n:t;if(a)try{const t={"Content-Type":"application/json"};r&&(t["X-API-KEY"]=r);const n=o();n&&(t["X-Session-ID"]=n,t["X-Query-ID"]=p);const i="agent"===h?{query_id:p,rating:e?"helpful":"not_helpful",session_id:n}:{sessionId:n,queryId:p,rating:e?1:0};await fetch(a,{method:"POST",headers:t,credentials:"include",body:JSON.stringify(i)}),null==u||u({type:"chatbot_rating_sent",queryId:p,rating:e?"helpful":"not_helpful"})}catch(e){vS("Error sending feedback:",e)}}return"Thanks for the feedback!"}try{const t=oS();p=t,null==u||u({type:"chatbot_question_sent",queryId:t,questionLength:s.length});const n={"Content-Type":"application/json"};r&&(n["X-API-KEY"]=r);const a=o();a&&(n["X-Session-ID"]=a,n["X-Query-ID"]=t);const c={query:s,session_id:a,question_id:t};d&&(c._backend=d),f&&(c.resource_context=f);const v=null==A?void 0:A();v&&(c.turnstile_token=v),fS("SENT to API",{session_id:a,question_id:t});const b=Date.now(),y=await fetch(e,{method:"POST",headers:n,credentials:"include",body:JSON.stringify(c)});if(!y.ok)throw new Error(`API returned ${y.status}`);if((y.headers.get("content-type")||"").includes("text/event-stream")){const e=null===(l=y.body)||void 0===l?void 0:l.getReader();if(!e)throw new Error("Response body is not readable");const n=new TextDecoder;let r="",o="",a=!1;try{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="",l="";for(const t of e.split("\n"))t.startsWith("event: ")?n=t.slice(7):t.startsWith("data: ")&&(l=t.slice(6));if(n&&l){try{t=JSON.parse(l)}catch(e){mS("Failed to parse SSE data:",l),s=r.indexOf("\n\n");continue}if("status"===n){const e=t.message||"Processing...";await i.streamMessage(`_${e}_`,"BOT"),a=!0}else if("token"===n){o+=t.content||"";const e=FS(o);await i.streamMessage(e,"BOT")}else if("done"===n){const e=t.metadata||{};if(h=e.rating_target||null,g=!0===e.is_final_response,o)console.log("[SSE DEBUG] done: tokenContent exists, skipping streamMessage, calling endStreamMessage"),await i.endStreamMessage("BOT");else{const e=t.response||"";if(e){const t=FS(e);await i.streamMessage(t,"BOT"),a=!0}a&&await i.endStreamMessage("BOT")}}else if("error"===n){const e=t.message||"An error occurred";vS("SSE error event:",e),a?(await i.streamMessage(e,"BOT"),await i.endStreamMessage("BOT")):await i.injectMessage(e)}s=r.indexOf("\n\n")}else s=r.indexOf("\n\n")}}a&&await i.endStreamMessage("BOT")}catch(e){if(vS("Error reading SSE stream:",e),!a)throw e;await i.streamMessage("I had trouble completing the response. Please try again.","BOT"),await i.endStreamMessage("BOT")}const s=Date.now()-b;return null==u||u({type:"chatbot_answer_received",queryId:t,responseTimeMs:s,success:!0,responseLength:o.length}),null}const w=Date.now()-b,x=await y.json();if(x.requires_turnstile)return null==u||u({type:"chatbot_turnstile_shown",queryId:t}),m.siteKey=x.site_key,m.pendingQuery={query:s,sessionId:a,queryId:t},m.needsChallenge=!0,"One moment — verifying your session…";const k=x.response||x.answer||x.text||x.message;if(!k)throw new Error("Invalid response format from API");const E=x.metadata||{};h=E.rating_target||null,g=!0===E.is_final_response;const S=FS(k),C=aS()?zS(x):"",P=C?`${S}\n\n${C}`:S;return await i.injectMessage(P),null==u||u({type:"chatbot_answer_received",queryId:t,responseTimeMs:w,success:!0,responseLength:k.length,hasMetadata:!!C}),null}catch(e){return vS("Error in Q&A flow:",e),null==u||u({type:"chatbot_answer_error",queryId:null!=p?p: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=>a&&a()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput||m.needsChallenge?[]:g&&h&&("agent"===h?n:t)?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,component:z.createElement(_S,{getState:()=>m,onResubmit:async t=>{var n;if(m.pendingQuery&&v)try{const o={"Content-Type":"application/json"};r&&(o["X-API-KEY"]=r),m.pendingQuery.sessionId&&(o["X-Session-ID"]=m.pendingQuery.sessionId,o["X-Query-ID"]=m.pendingQuery.queryId);const a={query:m.pendingQuery.query,session_id:m.pendingQuery.sessionId,question_id:m.pendingQuery.queryId,turnstile_token:t};d&&(a._backend=d),f&&(a.resource_context=f);const i=await fetch(e,{method:"POST",headers:o,credentials:"include",body:JSON.stringify(a)}),l=m.pendingQuery.queryId;if(!i.ok)throw new Error(`API returned ${i.status} after Turnstile`);if((i.headers.get("content-type")||"").includes("text/event-stream")){const e=null===(n=i.body)||void 0===n?void 0:n.getReader();if(!e)throw new Error("Response body is not readable");const t=new TextDecoder;let r="",o="",a={};for(;;){const{done:n,value:i}=await e.read();if(n)break;r+=t.decode(i,{stream:!0});let l=r.indexOf("\n\n");for(;-1!==l;){const e=r.slice(0,l);r=r.slice(l+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&&(a=e.metadata||{})}catch(e){}l=r.indexOf("\n\n")}}if(m.token=null,m.pendingQuery=null,m.needsChallenge=!1,m.siteKey=null,!o)throw new Error("No content received from stream");h=a.rating_target||null,g=!0===a.is_final_response,p=l;const s=FS(o);return await v(s),void(null==u||u({type:"chatbot_answer_received",queryId:l,success:!0,responseLength:o.length}))}const s=await i.json();if(s.requires_turnstile)return m.siteKey=s.site_key,m.token=null,void await v("Still verifying — please complete the challenge again.");m.token=null,m.pendingQuery=null,m.needsChallenge=!1,m.siteKey=null;const c=s.response||s.answer||s.text||s.message;if(!c)throw new Error("Invalid response format from API");const A=s.metadata||{};h=A.rating_target||null,g=!0===A.is_final_response,p=l;const b=FS(c),y=aS()?zS(s):"",w=y?`${b}\n\n${y}`:b;await v(w),null==u||u({type:"chatbot_answer_received",queryId:l,success:!0,responseLength:c.length})}catch(e){vS("Error resubmitting after Turnstile:",e),m.token=null,m.pendingQuery=null,m.needsChallenge=!1,m.siteKey=null,await(null==v?void 0:v("I had trouble processing your question after verification. Please try again."))}},trackEvent:u,loginUrl:s}),path:"qa_loop"}}})({endpoint:i,ratingEndpoint:l,agentRatingEndpoint:c,apiKey:a,sessionId:O.current.getSessionId,isResetting:O.current.isResetting,isLoggedIn:N,allowAnonAccess:p,loginUrl:C||JS,actingUser:h,trackEvent:H,getTurnstileToken:()=>R.current,backendId:e.backendId,resourceContext:B}),n={message:u,renderMarkdown:["BOT"],transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},t),D||{})},[a,i,l,c,u,N,p,C,D,h,H,B]),Y=j.useMemo(()=>[cy(),UE(),YE()],[]);return j.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)},[]),OS(),j.useEffect(()=>{const e=q.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")||H({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)},[H]),j.useEffect(()=>{if(!_){const e=e=>{const t=e.data.newState;null==d||d(t);const n=Q.current;H(t?{type:"chatbot_open"}:{type:"chatbot_close",messageCount:n?kS(n):0,durationMs:n?ES(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[_,d,H]),z.createElement("div",{className:"qa-bot "+((null===(n=U.general)||void 0===n?void 0:n.embedded)?"embedded-qa-bot":""),ref:q,role:"region","aria-label":`${v||VS}${(null===(r=U.general)||void 0===r?void 0:r.embedded)?" - Embedded":""}`},z.createElement(CS,{getSessionId:()=>Q.current,setSessionId:e=>{const t=Q.current;Q.current=e,fS("RESTORED",`${null==t?void 0:t.slice(-12)} -> ${e.slice(-12)}`)},resetSession:()=>{const e=Q.current;M.current=!0,Q.current=yS(),fS("RESET",`${null==e?void 0:e.slice(-12)} -> ${Q.current.slice(-12)}`)},clearResettingFlag:()=>{M.current=!1}},z.createElement(KE,{trackEvent:H},z.createElement(wb,null,z.createElement("div",null,z.createElement(MS,null),z.createElement(GE,{ref:t,embedded:(null===(o=U.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:A||!1,enabled:!1!==N,onSetEnabled:e=>F(!!e&&void 0)}),z.createElement(Sb,{key:`chatbot-${I.current}-${N}`,settings:U,flow:W,plugins:Y}),z.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}}),z.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."))))))});ZS.displayName="QABot";Xu('.rcb-chat-window{height:800px!important;max-height:80vh!important;max-width:100%;width:550px!important}.rcb-chat-window .rcb-chat-header{align-items:center;display:flex;flex-direction:row;font-weight:700}.rcb-chat-window a{color:#000;font-weight:700;text-decoration:underline}.rcb-chat-window a:hover{color:var(--primaryColor,#107180)}.rcb-chat-window .rcb-bot-message a,.rcb-chat-window .rcb-bot-message a:link,.rcb-chat-window .rcb-bot-message a:visited{color:#fff!important;text-decoration:underline!important}.rcb-chat-window .rcb-bot-message a:hover{opacity:.85;text-decoration:underline!important}.rcb-chat-window .rcb-chat-input-textarea{overflow-y:auto}.rcb-chat-window .rcb-chat-footer-container{font-size:10px}.qa-bot .history-button,.qa-bot .user-login-icon{display:none!important}.qa-bot.bot-logged-in .history-button,.qa-bot.bot-logged-in .user-login-icon{display:flex!important;transform:scale(1.3) translateY(-2px)}.qa-bot.bot-logged-in .history-button:hover{opacity:.8}.qa-bot.bot-logged-in .history-button:focus{outline:2px solid #fff;outline-offset:2px}.embedded-qa-bot .rcb-chat-window{max-width:100%;width:100%!important}.qa-bot.hidden{display:none}.embedded-qa-bot .rcb-bot-message,.embedded-qa-bot .rcb-user-message{max-width:90%!important;word-break:break-word}.embedded-qa-bot .rcb-chat-input-textarea{width:100%!important}.qa-bot-container{max-width:100%;width:100%}.rcb-chat-tooltip{background-color:#1a5b6e;color:#fff}.rcb-chat-tooltip-tail{border-color:#0000 #0000 #0000 #1a5b6e}@keyframes phone-ring{0%{transform:translateX(0) translateY(0) rotate(0deg)}2%{transform:translateX(0) translateY(-8px) rotate(-2deg)}4%{transform:translateX(0) translateY(-6px) rotate(2deg)}6%{transform:translateX(0) translateY(-8px) rotate(-1deg)}8%{transform:translateX(0) translateY(-6px) rotate(1deg)}10%{transform:translateX(0) translateY(-8px) rotate(-2deg)}12%{transform:translateX(0) translateY(-6px) rotate(2deg)}20%{transform:translateX(0) translateY(0) rotate(0deg)}30%{transform:translateX(0) translateY(0) rotate(0deg)}40%{transform:translateX(0) translateY(0) rotate(0deg)}49%{transform:translateX(0) translateY(0) rotate(0deg)}50%{transform:translateX(0) translateY(-8px) rotate(-2deg)}52%{transform:translateX(0) translateY(-6px) rotate(2deg)}54%{transform:translateX(0) translateY(-8px) rotate(-1deg)}56%{transform:translateX(0) translateY(-6px) rotate(1deg)}58%{transform:translateX(0) translateY(-8px) rotate(-2deg)}60%{transform:translateX(0) translateY(-6px) rotate(2deg)}70%{transform:translateX(0) translateY(0) rotate(0deg)}to{transform:translateX(0) translateY(0) rotate(0deg)}}@media (max-width:768px){.rcb-chat-window{max-height:calc(100vh - 100px)!important;max-width:calc(100vw - 40px)!important;width:550px!important}.embedded-chat-container.open{height:400px}.embedded-chat-closed{font-size:14px;height:40px}.embedded-chat-open-btn{font-size:12px;padding:3px 10px}.rcb-bot-message,.rcb-user-message{max-width:85%!important}.rcb-chat-input-textarea{font-size:16px!important;min-height:44px!important}.rcb-chat-header{padding:12px 16px!important}}@media (max-width:480px){.rcb-chat-window{bottom:10px!important;left:10px!important;max-height:calc(100vh - 80px)!important;max-width:calc(100vw - 20px)!important;right:10px!important;width:calc(100vw - 20px)!important}.embedded-chat-container.open{height:350px}.rcb-bot-message,.rcb-user-message{margin-bottom:8px!important;max-width:90%!important}.rcb-chat-header{font-size:14px!important;padding:8px 12px!important}.rcb-chat-button{bottom:20px!important;height:50px!important;right:20px!important;width:50px!important}.rcb-chat-footer-container{font-size:9px!important;padding:8px 12px!important}}@media (max-width:360px){.rcb-chat-window{left:5px!important;max-width:calc(100vw - 10px)!important;right:5px!important;width:calc(100vw - 10px)!important}.rcb-chat-header{font-size:13px!important;padding:6px 8px!important}}.rcb-checkbox-container{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-left:16px!important;max-width:100%!important;padding-top:12px!important}.rcb-checkbox-row-container{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--primaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-row-container:hover{background-color:#e8f4f8!important;border-color:var(--primaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-row-container[data-checked=true]{background-color:var(--primaryColor,#107180)!important;border-color:var(--primaryColor,#107180)!important;color:#fff!important}.rcb-checkbox-row{margin-left:0!important}.rcb-checkbox-mark{height:14px!important;margin-right:6px!important;width:14px!important}.rcb-checkbox-label{font-size:13px!important;margin:0!important;white-space:nowrap!important}.rcb-checkbox-next-button{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;justify-content:center!important;line-height:24px!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-next-button:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.sr-only{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.rcb-chat-input-send-button:focus,.rcb-chat-input-textarea:focus{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-bot-message ol,.rcb-bot-message ul{list-style-position:outside!important;margin:.5em 0!important;padding-left:1.5em!important}.rcb-bot-message li{margin-bottom:.25em!important}.rcb-bot-message li>p{display:inline!important;margin:0!important}.rcb-user-message{word-wrap:break-word!important;overflow:hidden!important;word-break:break-word!important}:focus-visible{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-options-container{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:8px!important;margin:16px!important;padding:0!important}.rcb-options{background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;outline:none!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-options:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-next-button.keyboard-focused,.rcb-checkbox-next-button:focus,.rcb-checkbox-next-button:focus-visible,.rcb-checkbox-row-container.keyboard-focused,.rcb-checkbox-row-container:focus,.rcb-checkbox-row-container:focus-visible,.rcb-options.keyboard-focused,.rcb-options:focus,.rcb-options:focus-visible{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;outline:none!important}.rcb-options:active{background-color:var(--secondaryColor,#107180)!important;border-color:var(--secondaryColor,#107180)!important;color:#fff!important;transform:translateY(0)!important}.keyboard-nav-hint{color:#666!important;font-size:12px!important;font-style:italic!important;margin-bottom:8px!important}@media (prefers-reduced-motion:reduce){.keyboard-nav-hint{display:none!important}}.rcb-options-container [role=button][tabindex="0"],.rcb-options-container button[tabindex="0"]{position:relative!important}.rcb-options-container [role=button][tabindex="0"]:after,.rcb-options-container button[tabindex="0"]:after{color:var(--secondaryColor,#107180)!important;content:"←"!important;font-size:16px!important;opacity:0!important;position:absolute!important;right:12px!important;top:50%!important;transform:translateY(-50%)!important;transition:opacity .2s ease!important}.rcb-options-container [role=button][tabindex="0"]:focus:after,.rcb-options-container button[tabindex="0"]:focus:after{opacity:1!important}.rcb-chat-input-send-button{cursor:pointer!important;opacity:1!important;pointer-events:auto!important;visibility:visible!important}.rcb-chat-input-send-button:not([tabindex]){-webkit-user-select:none;-moz-user-select:none;user-select:none}.rcb-chat-input-container [onclick],.rcb-chat-input-container [role=button],.rcb-chat-input-container div[style*=cursor],.rcb-chat-input-container svg:last-child,.rcb-chat-input-container>div:last-child{tabindex:0!important;cursor:pointer!important}.rcb-chat-footer{margin-top:4px!important;padding-top:0!important}.rcb-chat-footer-container{align-items:center!important;display:flex!important;margin-top:4px!important;padding-top:4px!important}.rcb-chat-footer-container button{order:1!important}.rcb-chat-footer-container a[href*=qa-bot-core]{tab-index:0!important;order:2!important}.rcb-chat-footer-container a[href*=feedback]{tab-index:0!important;order:3!important}@media (prefers-contrast:high){.rcb-chat-window a{background-color:#fff!important;border:1px solid #000!important;color:#000!important}}@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.rcb-chat-input-textarea{user-select:text!important}.rcb-chat-body-container,.rcb-chat-input-textarea,.rcb-chat-window{touch-action:pan-y!important}.embedded-qa-bot,.rcb-chat-window{-webkit-overflow-scrolling:touch!important}.embedded-qa-bot .rcb-chat-input-textarea{touch-action:pan-y!important;user-select:text!important}.embedded-qa-bot .rcb-chat-body-container,.embedded-qa-bot .rcb-chat-window{touch-action:pan-y!important}.rcb-chat-header-container{background:var(--primaryColor,#1a5b6e)!important;background:linear-gradient(135deg,var(--primaryColor,#1a5b6e) 0,var(--secondaryColor,#107180) 100%)!important}.rcb-toggle-button{align-items:center!important;background:var(--primaryColor,#1a5b6e)!important;display:flex!important;justify-content:center!important}.rcb-toggle-button svg{stroke:#fff!important;color:#fff!important}.rcb-toggle-button *,.rcb-toggle-button img,.rcb-toggle-button svg,.rcb-toggle-button>*{box-sizing:border-box!important;height:50px!important;left:0!important;margin:0 auto!important;max-height:50px!important;max-width:50px!important;min-height:50px!important;min-width:50px!important;padding:2px!important;position:relative!important;top:0!important;width:50px!important}.rcb-send-button{background-color:var(--primaryColor,#1a5b6e)!important}',{insertAt:"top"});const eC=z.forwardRef((n,r)=>{var{defaultOpen:o}=n,a=t(n,["defaultOpen"]);const[i,l]=z.useState(o||!1),s=z.useRef(null);return z.useImperativeHandle(r,()=>({addMessage:e=>{var t;null===(t=s.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=s.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;l(!0),null===(e=s.current)||void 0===e||e.openChat()},closeChat:()=>{var e;l(!1),null===(e=s.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;l(e=>!e),null===(e=s.current)||void 0===e||e.toggleChat()}}),[]),z.createElement(ZS,e({ref:s},a,{open:i,onOpenChange:l}))});return eC.displayName="ProgrammaticQABot",function(n){if(!(n.target&&n.target instanceof HTMLElement))return void vS("QA Bot: A valid target DOM element is required");const{target:r}=n,o=t(n,["target"]),a=_.createRoot(r),i={current:null};return a.render(z.createElement(z.StrictMode,null,z.createElement(eC,e({ref:e=>{i.current=e}},o)))),{addMessage:e=>{var t;return null===(t=i.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=i.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{i.current=null,a.unmount()}}}});
|
|
36
|
+
*/var qb,Vb;var Wb=function(){if(Vb)return qb;Vb=1;var e=/["'&<>]/;return qb=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,a="",i=0,l=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:o=""";break;case 38:o="&";break;case 39:o="'";break;case 60:o="<";break;case 62:o=">";break;default:continue}l!==i&&(a+=n.substring(l,i)),l=i+1,a+=o}return l!==i?a+n.substring(l,i):a},qb}();const Yb=Ub(Wb);function Gb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Xb=/(url|image|image-set)\(/i;class Kb extends Hb{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(Xb)&&delete t[e]}),t}}const Jb=/^<(!doctype|(html|head|body)(\s|>))/i,$b=/^(aria-|data-|\w+:)/iu,Zb=/{{{(\w+)\/?}}}/;function ey(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let ty=class{constructor(e,t={},n=[],r=[]){var o;Gb(this,"allowed",void 0),Gb(this,"banned",void 0),Gb(this,"blocked",void 0),Gb(this,"container",void 0),Gb(this,"content",[]),Gb(this,"props",void 0),Gb(this,"matchers",void 0),Gb(this,"filters",void 0),Gb(this,"keyIndex",void 0),this.props=t,this.matchers=n,this.filters=[...r,new Kb],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:Nb),this.banned=new Set(Rb),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,a=0,i=null;return this.matchers.forEach(e=>{const l=e.asTag().toLowerCase(),s=this.getTagConfig(l);if(r[e.inverseName]||!this.isTagAllowed(l)||!this.canRenderChild(t,s))return;let c="";for(;o&&(i=e.match(o));){const{index:t,length:l,match:s,valid:u,void:A,...d}=i,f=e.propName+String(a);t>0&&(c+=o.slice(0,t)),u?(c+=A?`{{{${f}/}}}`:`{{{${f}}}}${s}{{{/${f}}}}`,this.keyIndex+=1,a+=1,n[f]={children:s,matcher:e,props:{...r,...d,key:this.keyIndex}}):c+=s,e.greedy?(o=c+o.slice(t+l),c=""):o=o.slice(t+(l||s.length))}e.greedy||(o=c+o)}),0===a?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||ey)();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);return e.match(Jb)||(o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?Yb(e):e)),o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:a,value:i}=o,l=a.toLowerCase(),s=Fb[l]||Fb[a];if(!this.isSafe(e)||!l.match($b)&&(!t&&(!s||2===s)||l.startsWith("on")||i.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c="style"===l?this.extractStyleAttribute(e):i;4===s?c=!0:3===s?c=Number.parseFloat(String(c)):5!==s&&(c=String(c)),n[jb[l]||l]=this.applyAttributeFilters(l,c),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 Lb[e]?{...t,...Lb[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(e,t){const{noHtml:n,noHtmlExceptMatchers:r,allowElements:o,transform:a,transformOnlyAllowList:i}=this.props;let l=[],s="";return[...e.childNodes].forEach(e=>{if(1===e.nodeType){const u=e.nodeName.toLowerCase(),A=this.getTagConfig(u);s&&(l.push(s),s="");const d=this.applyNodeFilters(u,e);if(!d)return;let f;if(a&&(!i||this.isTagAllowed(u))){this.keyIndex+=1;const e=this.keyIndex;f=this.parseNode(d,A);const t=a(d,f,A);if(null===t)return;if(typeof t<"u")return void l.push(z.cloneElement(t,{key:e}));this.keyIndex=e-1}if(this.banned.has(u))return;if(n||r&&"br"!==u||!this.isTagAllowed(u)||!o&&!this.canRenderChild(t,A))l=[...l,...this.parseNode(d,A.tagName?A:t)];else{var c;this.keyIndex+=1;const e=this.extractAttributes(d),t={tagName:u};e&&(t.attributes=e),A.void&&(t.selfClose=A.void),l.push(z.createElement(_b,{...t,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(d,A)))}}else if(3===e.nodeType){const o=n&&!r?e.textContent:this.applyMatchers(e.textContent||"",t);Array.isArray(o)?l=[...l,...o]:s+=o}}),s&&l.push(s),l}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(Zb);){const[e,a]=o,i=o.index,l=e.includes("/");i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:s,matcher:c,props:u}=t[a];let A;if(l)A=e.length,n.push(c.createElement(s,u));else{const o=r.match(new RegExp(`{{{/${a}}}}`));A=o.index+o[0].length,n.push(c.createElement(this.replaceTokens(r.slice(e.length,o.index),t),u))}r=r.slice(A)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function ny(e){var t;const{attributes:n,className:r,containerTagName:o,content:a,emptyContent:i,parsedContent:l,tagName:s,noWrap:c}=e,u=null!==(t=o??s)&&void 0!==t?t:"span",A="fragment"===u||c;let d;if(l)d=l;else{const t=new ty(a??"",e).parse();t.length>0&&(d=t)}return d||(d=i),A?z.createElement(z.Fragment,null,d):z.createElement(_b,{attributes:n,className:r,tagName:u},d)}function ry(e){const{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:a=!1,emptyContent:i=null,filters:l=[],matchers:s=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:A="span",noWrap:d=!1,...f}=e,p=a?[]:s,h=o?[]:l,g=u?[u]:[],m=c?[c]:[];p.forEach(e=>{e.onBeforeParse&&g.push(e.onBeforeParse.bind(e)),e.onAfterParse&&m.push(e.onAfterParse.bind(e))});const v=g.reduce((t,n)=>n(t,e),r??""),b=new ty(v,f,p,h),y=m.reduce((t,n)=>n(t,e),b.parse());return z.createElement(ny,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:i,noWrap:d,parsedContent:0===y.length?void 0:y,tagName:A})}const oy=({children:e})=>aA.jsx("div",{style:{whiteSpace:"normal"},children:aA.jsx(ry,{content:"string"==typeof e?e:""})}),ay={autoConfig:!0},iy=(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)},ly=e=>{const t=[];let n="",r=!1;for(let o=0;o<e.length;o++){const a=e[o];"<"===a?r?(t.push(n),n=a):(r=!0,n=a):">"===a?(n+=a,t.push(n),n="",r=!1):r?n+=a:t.push(a)}return""!==n&&t.push(n),t},sy=e=>{const{getFlow:t}=Pb(),{messages:n,replaceMessages:r}=Bb(),{settings:o}=Tb(),{hasChatHistoryLoaded:a}=Qb(),i={...e,...ay},l=i.htmlComponent?i.htmlComponent:oy;j.useEffect(()=>{var e,t;if(a){const a=[...n];for(let n=0;n<a.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=a[n];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=l)}r(a)}},[a]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.sender.toUpperCase();"string"==typeof e.data.message.content&&iy(e,t(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=ly),e.data.message.contentWrapper=l,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};Db(Sm.PRE_INJECT_MESSAGE,s),Db(Sm.CHUNK_STREAM_MESSAGE,s),Db(Sm.START_STREAM_MESSAGE,s),Db(Sm.START_SIMULATE_STREAM_MESSAGE,s),Db(Sm.START_SPEAK_AUDIO,async e=>{iy(e,t(),"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!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c},cy=e=>()=>sy(e);const uy=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ay=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dy={};function fy(e,t){return(dy.jsx?Ay:uy).test(e)}const py=/[ \t\n\f\r]/g;function hy(e){return""===e.replace(py,"")}class gy{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function my(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 gy(n,r,t)}function vy(e){return e.toLowerCase()}gy.prototype.property={},gy.prototype.normal={},gy.prototype.space=null;class by{constructor(e,t){this.property=e,this.attribute=t}}by.prototype.space=null,by.prototype.boolean=!1,by.prototype.booleanish=!1,by.prototype.overloadedBoolean=!1,by.prototype.number=!1,by.prototype.commaSeparated=!1,by.prototype.spaceSeparated=!1,by.prototype.commaOrSpaceSeparated=!1,by.prototype.mustUseProperty=!1,by.prototype.defined=!1;let yy=0;const wy=By(),xy=By(),ky=By(),Ey=By(),Sy=By(),Cy=By(),Py=By();function By(){return 2**++yy}const Dy=Object.freeze(Object.defineProperty({__proto__:null,boolean:wy,booleanish:xy,commaOrSpaceSeparated:Py,commaSeparated:Cy,number:Ey,overloadedBoolean:ky,spaceSeparated:Sy},Symbol.toStringTag,{value:"Module"})),Ty=Object.keys(Dy);class Iy extends by{constructor(e,t,n,r){let o=-1;if(super(e,t),Qy(this,"space",r),"number"==typeof n)for(;++o<Ty.length;){const e=Ty[o];Qy(this,Ty[o],(n&Dy[e])===Dy[e])}}}function Qy(e,t,n){n&&(e[t]=n)}Iy.prototype.defined=!0;const My={}.hasOwnProperty;function Oy(e){const t={},n={};let r;for(r in e.properties)if(My.call(e.properties,r)){const o=e.properties[r],a=new Iy(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[vy(r)]=r,n[vy(a.attribute)]=r}return new gy(t,n,e.space)}const Ly=Oy({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}}),Ry=Oy({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Ny(e,t){return t in e?e[t]:t}function Fy(e,t){return Ny(e,t.toLowerCase())}const jy=Oy({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Fy,properties:{xmlns:null,xmlnsXLink:null}}),zy=Oy({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:xy,ariaAutoComplete:null,ariaBusy:xy,ariaChecked:xy,ariaColCount:Ey,ariaColIndex:Ey,ariaColSpan:Ey,ariaControls:Sy,ariaCurrent:null,ariaDescribedBy:Sy,ariaDetails:null,ariaDisabled:xy,ariaDropEffect:Sy,ariaErrorMessage:null,ariaExpanded:xy,ariaFlowTo:Sy,ariaGrabbed:xy,ariaHasPopup:null,ariaHidden:xy,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Sy,ariaLevel:Ey,ariaLive:null,ariaModal:xy,ariaMultiLine:xy,ariaMultiSelectable:xy,ariaOrientation:null,ariaOwns:Sy,ariaPlaceholder:null,ariaPosInSet:Ey,ariaPressed:xy,ariaReadOnly:xy,ariaRelevant:null,ariaRequired:xy,ariaRoleDescription:Sy,ariaRowCount:Ey,ariaRowIndex:Ey,ariaRowSpan:Ey,ariaSelected:xy,ariaSetSize:Ey,ariaSort:null,ariaValueMax:Ey,ariaValueMin:Ey,ariaValueNow:Ey,ariaValueText:null,role:null}}),_y=Oy({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Fy,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cy,acceptCharset:Sy,accessKey:Sy,action:null,allow:null,allowFullScreen:wy,allowPaymentRequest:wy,allowUserMedia:wy,alt:null,as:null,async:wy,autoCapitalize:null,autoComplete:Sy,autoFocus:wy,autoPlay:wy,blocking:Sy,capture:null,charSet:null,checked:wy,cite:null,className:Sy,cols:Ey,colSpan:null,content:null,contentEditable:xy,controls:wy,controlsList:Sy,coords:Ey|Cy,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wy,defer:wy,dir:null,dirName:null,disabled:wy,download:ky,draggable:xy,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wy,formTarget:null,headers:Sy,height:Ey,hidden:wy,high:Ey,href:null,hrefLang:null,htmlFor:Sy,httpEquiv:Sy,id:null,imageSizes:null,imageSrcSet:null,inert:wy,inputMode:null,integrity:null,is:null,isMap:wy,itemId:null,itemProp:Sy,itemRef:Sy,itemScope:wy,itemType:Sy,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wy,low:Ey,manifest:null,max:null,maxLength:Ey,media:null,method:null,min:null,minLength:Ey,multiple:wy,muted:wy,name:null,nonce:null,noModule:wy,noValidate:wy,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:wy,optimum:Ey,pattern:null,ping:Sy,placeholder:null,playsInline:wy,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wy,referrerPolicy:null,rel:Sy,required:wy,reversed:wy,rows:Ey,rowSpan:Ey,sandbox:Sy,scope:null,scoped:wy,seamless:wy,selected:wy,shadowRootClonable:wy,shadowRootDelegatesFocus:wy,shadowRootMode:null,shape:null,size:Ey,sizes:null,slot:null,span:Ey,spellCheck:xy,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ey,step:null,style:null,tabIndex:Ey,target:null,title:null,translate:null,type:null,typeMustMatch:wy,useMap:null,value:xy,width:Ey,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Sy,axis:null,background:null,bgColor:null,border:Ey,borderColor:null,bottomMargin:Ey,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wy,declare:wy,event:null,face:null,frame:null,frameBorder:null,hSpace:Ey,leftMargin:Ey,link:null,longDesc:null,lowSrc:null,marginHeight:Ey,marginWidth:Ey,noResize:wy,noHref:wy,noShade:wy,noWrap:wy,object:null,profile:null,prompt:null,rev:null,rightMargin:Ey,rules:null,scheme:null,scrolling:xy,standby:null,summary:null,text:null,topMargin:Ey,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ey,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:wy,disableRemotePlayback:wy,prefix:null,property:null,results:Ey,security:null,unselectable:null}}),Hy=Oy({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:Ny,properties:{about:Py,accentHeight:Ey,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ey,amplitude:Ey,arabicForm:null,ascent:Ey,attributeName:null,attributeType:null,azimuth:Ey,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ey,by:null,calcMode:null,capHeight:Ey,className:Sy,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:Ey,diffuseConstant:Ey,direction:null,display:null,dur:null,divisor:Ey,dominantBaseline:null,download:wy,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ey,enableBackground:null,end:null,event:null,exponent:Ey,externalResourcesRequired:null,fill:null,fillOpacity:Ey,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:Cy,g2:Cy,glyphName:Cy,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ey,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ey,horizOriginX:Ey,horizOriginY:Ey,id:null,ideographic:Ey,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ey,k:Ey,k1:Ey,k2:Ey,k3:Ey,k4:Ey,kernelMatrix:Py,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ey,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:Ey,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:Ey,overlineThickness:Ey,paintOrder:null,panose1:null,path:null,pathLength:Ey,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Sy,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ey,pointsAtY:Ey,pointsAtZ:Ey,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Py,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Py,rev:Py,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Py,requiredFeatures:Py,requiredFonts:Py,requiredFormats:Py,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:Ey,specularExponent:Ey,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ey,strikethroughThickness:Ey,string:null,stroke:null,strokeDashArray:Py,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ey,strokeOpacity:Ey,strokeWidth:null,style:null,surfaceScale:Ey,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Py,tabIndex:Ey,tableValues:null,target:null,targetX:Ey,targetY:Ey,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Py,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ey,underlineThickness:Ey,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ey,values:null,vAlphabetic:Ey,vMathematical:Ey,vectorEffect:null,vHanging:Ey,vIdeographic:Ey,version:null,vertAdvY:Ey,vertOriginX:Ey,vertOriginY:Ey,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ey,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),Uy=/^data[-\w.:]+$/i,qy=/-[a-z]/g,Vy=/[A-Z]/g;function Wy(e){return"-"+e.toLowerCase()}function Yy(e){return e.charAt(1).toUpperCase()}const Gy={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"},Xy=my([Ry,Ly,jy,zy,_y],"html"),Ky=my([Ry,Ly,jy,zy,Hy],"svg");function Jy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $y,Zy,ew,tw={};var nw=function(){if(ew)return tw;ew=1;var e=tw&&tw.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(tw,"__esModule",{value:!0}),tw.default=function(e,n){var r=null;if(!e||"string"!=typeof e)return r;var o=(0,t.default)(e),a="function"==typeof n;return o.forEach(function(e){if("declaration"===e.type){var t=e.property,o=e.value;a?n(t,o,e):o&&((r=r||{})[t]=o)}}),r};var t=e(function(){if(Zy)return $y;Zy=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,l=/^\s+|\s+$/g,s="";function c(e){return e?e.replace(l,s):s}return $y=function(l,u){if("string"!=typeof l)throw new TypeError("First argument must be a string");if(!l)return[];u=u||{};var A=1,d=1;function f(e){var n=e.match(t);n&&(A+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function p(){var e={line:A,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:A,column:d},this.source=u.source}function g(e){var t=new Error(u.source+":"+A+":"+d+": "+e);if(t.reason=e,t.filename=u.source,t.line=A,t.column=d,t.source=l,!u.silent)throw t}function m(e){var t=e.exec(l);if(t){var n=t[0];return f(n),l=l.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=y();)!1!==t&&e.push(t);return e}function y(){var e=p();if("/"==l.charAt(0)&&"*"==l.charAt(1)){for(var t=2;s!=l.charAt(t)&&("*"!=l.charAt(t)||"/"!=l.charAt(t+1));)++t;if(t+=2,s===l.charAt(t-1))return g("End of comment missing");var n=l.slice(2,t-2);return d+=2,f(n),l=l.slice(t),d+=2,e({type:"comment",comment:n})}}function w(){var t=p(),n=m(r);if(n){if(y(),!m(o))return g("property missing ':'");var l=m(a),u=t({type:"declaration",property:c(n[0].replace(e,s)),value:l?c(l[0].replace(e,s)):s});return m(i),u}}return h.prototype.content=l,v(),function(){var e,t=[];for(b(t);e=w();)!1!==e&&(t.push(e),b(t));return t}()},$y}());return tw}();const rw=Jy(nw),ow=rw.default||rw,aw=lw("end"),iw=lw("start");function lw(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 sw(e){return e&&"object"==typeof e?"position"in e||"type"in e?uw(e.position):"start"in e||"end"in e?uw(e):"line"in e||"column"in e?cw(e):"":""}function cw(e){return Aw(e&&e.line)+":"+Aw(e&&e.column)}function uw(e){return cw(e&&e.start)+"-"+cw(e&&e.end)}function Aw(e){return e&&"number"==typeof e?e:1}class dw extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},a=!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&&(a=!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 i=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=i?i.column:void 0,this.fatal=void 0,this.file,this.message=r,this.line=i?i.line:void 0,this.name=sw(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=a&&o.cause&&"string"==typeof o.cause.stack?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}dw.prototype.file="",dw.prototype.name="",dw.prototype.reason="",dw.prototype.message="",dw.prototype.stack="",dw.prototype.column=void 0,dw.prototype.line=void 0,dw.prototype.ancestors=void 0,dw.prototype.cause=void 0,dw.prototype.fatal=void 0,dw.prototype.place=void 0,dw.prototype.ruleId=void 0,dw.prototype.source=void 0;const fw={}.hasOwnProperty,pw=new Map,hw=/[A-Z]/g,gw=/-([a-z])/g,mw=new Set(["table","tbody","thead","tfoot","tr"]),vw=new Set(["td","th"]),bw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yw(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,a){const i=Array.isArray(o.children),l=iw(n);return t(r,o,a,i,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.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,a){const i=Array.isArray(o.children)?n:t;return a?i(r,o,a):i(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?Ky:Xy,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},a=ww(o,e,void 0);return a&&"string"!=typeof a?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function ww(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=Ky,e.schema=o),e.ancestors.push(t);const a=Cw(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&fw.call(t.properties,o)){const a=Sw(e,o,t.properties[o]);if(a){const[o,i]=a;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&vw.has(t.tagName)?r=i:n[o]=i}}if(r){(n.style||(n.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r}return n}(e,t);let l=Ew(e,t);return mw.has(t.tagName)&&(l=l.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&hy(e.value):hy(e)}(e)})),xw(e,i,a,t),kw(i,l),e.ancestors.pop(),e.schema=r,e.create(t,a,i,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)}Pw(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=Ky,e.schema=o),e.ancestors.push(t);const a=null===t.name?e.Fragment:Cw(e,t.name,!0),i=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 a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Pw(e,t.position);else{const o=r.name;let a;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,a=e.evaluater.evaluateExpression(t.expression)}else Pw(e,t.position);else a=null===r.value||r.value;n[o]=a}return n}(e,t),l=Ew(e,t);return xw(e,i,a,t),kw(i,l),e.ancestors.pop(),e.schema=r,e.create(t,a,i,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);Pw(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return kw(r,Ew(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 xw(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kw(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ew(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:pw;for(;++r<t.children.length;){const a=t.children[r];let i;if(e.passKeys){const e="element"===a.type?a.tagName:"mdxJsxFlowElement"===a.type||"mdxJsxTextElement"===a.type?a.name:void 0;if(e){const t=o.get(e)||0;i=e+"-"+t,o.set(e,t+1)}}const l=ww(e,a,i);void 0!==l&&n.push(l)}return n}function Sw(e,t,n){const r=function(e,t){const n=vy(t);let r=t,o=by;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&Uy.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(qy,Yy);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!qy.test(e)){let n=e.replace(Vy,Wy);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Iy}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{ow(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new dw("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=bw+"#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(gw,Dw)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)fw.call(e,n)&&(t[Bw(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Gy[r.property]||r.property:r.attribute,n]}}function Cw(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=fy(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=fy(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 fw.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Pw(e)}function Pw(e,t){const n=new dw("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=bw+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Bw(e){let t=e.replace(hw,Tw);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function Dw(e,t){return t.toUpperCase()}function Tw(e){return"-"+e.toLowerCase()}const Iw={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"]},Qw={};function Mw(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 Ow(e.children,t,n)}return Array.isArray(e)?Ow(e,t,n):""}function Ow(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=Mw(e[o],t,n);return r.join("")}const Lw=document.createElement("i");function Rw(e){const t="&"+e+";";Lw.innerHTML=t;const n=Lw.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function Nw(e,t,n,r){const o=e.length;let a,i=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function Fw(e,t){return e.length>0?(Nw(e,e.length,0,t),e):t}const jw={}.hasOwnProperty;function zw(e){const t={};let n=-1;for(;++n<e.length;)_w(t,e[n]);return t}function _w(e,t){let n;for(n in t){const r=(jw.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){jw.call(r,a)||(r[a]=[]);const e=o[a];Hw(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Hw(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Nw(e,0,0,r)}function Uw(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 qw(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Vw=rx(/[A-Za-z]/),Ww=rx(/[\dA-Za-z]/),Yw=rx(/[#-'*+\--9=?A-Z^-~]/);function Gw(e){return null!==e&&(e<32||127===e)}const Xw=rx(/\d/),Kw=rx(/[\dA-Fa-f]/),Jw=rx(/[!-/:-@[-`{-~]/);function $w(e){return null!==e&&e<-2}function Zw(e){return null!==e&&(e<0||32===e)}function ex(e){return-2===e||-1===e||32===e}const tx=rx(new RegExp("\\p{P}|\\p{S}","u")),nx=rx(/\s/);function rx(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function ox(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const a=e.charCodeAt(n);let i="";if(37===a&&Ww(e.charCodeAt(n+1))&&Ww(e.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(i=String.fromCharCode(a));else if(a>55295&&a<57344){const t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(i=String.fromCharCode(a,t),o=1):i="�"}else i=String.fromCharCode(a);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function ax(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return function(r){return ex(r)?(e.enter(n),i(r)):t(r)};function i(r){return ex(r)&&a++<o?(e.consume(r),i):(e.exit(n),t(r))}}const ix={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"),ax(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)):$w(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const lx={tokenize:function(e){const t=this,n=[];let r,o,a,i=0;return l;function l(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,s,c)(r)}return c(r)}function s(e){if(i++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&v();const n=t.events.length;let o,a=n;for(;a--;)if("exit"===t.events[a][0]&&"chunkFlow"===t.events[a][1].type){o=t.events[a][1].end;break}m(i);let l=n;for(;l<t.events.length;)t.events[l][1].end={...o},l++;return Nw(t.events,a+1,0,t.events.slice(n)),t.events.length=l,c(e)}return l(e)}function c(o){if(i===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(sx,u,A)(o)}function u(e){return r&&v(),m(i),d(e)}function A(e){return t.parser.lazy[t.now().line]=i!==n.length,a=t.now().offset,p(e)}function d(n){return t.containerState={},e.attempt(sx,f,p)(n)}function f(e){return i++,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)):$w(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,l):(e.consume(n),h)}function g(e,n){const l=t.sliceStream(e);if(n&&l.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(l),t.parser.lazy[e.start.line]){let e=r.events.length;for(;e--;)if(r.events[e][1].start.offset<a&&(!r.events[e][1].end||r.events[e][1].end.offset>a))return;const n=t.events.length;let o,l,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){if(o){l=t.events[s][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...l},e++;Nw(t.events,s+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}}},sx={tokenize:function(e,t,n){return ax(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function cx(e){return null===e||Zw(e)||nx(e)?1:tx(e)?2:void 0}function ux(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Ax={name:"attention",resolveAll:function(e,t){let n,r,o,a,i,l,s,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close)for(n=u;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[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const A={...e[n][1].end},d={...e[u][1].start};dx(A,-l),dx(d,l),a={type:l>1?"strongSequence":"emphasisSequence",start:A,end:{...e[n][1].end}},i={type:l>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:d},o={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:l>1?"strong":"emphasis",start:{...a.start},end:{...i.end}},e[n][1].end={...a.start},e[u][1].start={...i.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=Fw(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=Fw(s,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",o,t]]),s=Fw(s,ux(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=Fw(s,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=Fw(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,Nw(e,n-1,u-n+3,s),u=n+s.length-c-2;break}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=cx(r);let a;return function(t){return a=t,e.enter("attentionSequence"),i(t)};function i(l){if(l===a)return e.consume(l),i;const s=e.exit("attentionSequence"),c=cx(l),u=!c||2===c&&o||n.includes(l),A=!o||2===o&&c||n.includes(r);return s._open=!!(42===a?u:u&&(o||!A)),s._close=!!(42===a?A:A&&(c||!u)),t(l)}}};function dx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const fx={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 Vw(t)?(e.consume(t),a):64===t?n(t):s(t)}function a(e){return 43===e||45===e||46===e||Ww(e)?(r=1,i(e)):s(e)}function i(t){return 58===t?(e.consume(t),r=0,l):(43===t||45===t||46===t||Ww(t))&&r++<32?(e.consume(t),i):(r=0,s(t))}function l(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||Gw(r)?n(r):(e.consume(r),l)}function s(t){return 64===t?(e.consume(t),c):Yw(t)?(e.consume(t),s):n(t)}function c(e){return Ww(e)?u(e):n(e)}function u(n){return 46===n?(e.consume(n),r=0,c):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):A(n)}function A(t){if((45===t||Ww(t))&&r++<63){const n=45===t?A:u;return e.consume(t),n}return n(t)}}};const px={partial:!0,tokenize:function(e,t,n){return function(t){return ex(t)?ax(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||$w(e)?t(e):n(e)}}};const hx={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return ex(t)?ax(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(hx,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 ex(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const gx={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 Jw(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const mx={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,a,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),l};function l(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,a=Ww,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=Kw,c):(e.enter("characterReferenceValue"),o=7,a=Xw,c(t))}function c(l){if(59===l&&i){const o=e.exit("characterReferenceValue");return a!==Ww||Rw(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(l)}return a(l)&&i++<o?(e.consume(l),c):n(l)}}};const vx={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)}}},bx={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){const r=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s}function s(t){return e.enter("codeFencedFence"),ex(t)?ax(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===a?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===a?(o++,e.consume(t),u):o>=l?(e.exit("codeFencedFenceSequence"),ex(t)?ax(e,A,"whitespace")(t):A(t)):n(t)}function A(r){return null===r||$w(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let a,i=0,l=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,a=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),s(t)}(t)};function s(t){return t===a?(l++,e.consume(t),s):l<3?n(t):(e.exit("codeFencedFenceSequence"),ex(t)?ax(e,c,"whitespace")(t):c(t))}function c(n){return null===n||$w(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(vx,f,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||$w(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):ex(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ax(e,A,"whitespace")(t)):96===t&&t===a?n(t):(e.consume(t),u)}function A(t){return null===t||$w(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||$w(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===a?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 i>0&&ex(t)?ax(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||$w(t)?e.check(vx,f,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||$w(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const yx={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),ax(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?a(e):n(e)}function a(t){return null===t?l(t):$w(t)?e.attempt(wx,a,l)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||$w(t)?(e.exit("codeFlowValue"),a(t)):(e.consume(t),i)}function l(n){return e.exit("codeIndented"),t(n)}}},wx={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):$w(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):ax(e,a,"linePrefix",5)(t)}function a(e){const a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$w(e)?o(e):n(e)}}};const xx={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,a=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),i(t)};function i(t){return 96===t?(e.consume(t),a++,i):(e.exit("codeTextSequence"),l(t))}function l(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),l):96===t?(o=e.enter("codeTextSequence"),r=0,c(t)):$w(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l):(e.enter("codeTextData"),s(t))}function s(t){return null===t||32===t||96===t||$w(t)?(e.exit("codeTextData"),l(t)):(e.consume(t),s)}function c(n){return 96===n?(e.consume(n),r++,c):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",s(n))}}};class kx{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&&Ex(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),Ex(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ex(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);Ex(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Ex(this.left,t.reverse())}}}function Ex(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 Sx(e){const t={};let n,r,o,a,i,l,s,c=-1;const u=new kx(e);for(;++c<u.length;){for(;c in t;)c=t[c];if(n=u.get(c),c&&"chunkFlow"===n[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&(l=n[1]._tokenizer.events,o=0,o<l.length&&"lineEndingBlank"===l[o][1].type&&(o+=2),o<l.length&&"content"===l[o][1].type))for(;++o<l.length&&"content"!==l[o][1].type;)"chunkText"===l[o][1].type&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Cx(u,c)),c=t[c],s=!0);else if(n[1]._container){for(o=c,r=void 0;o--;)if(a=u.get(o),"lineEnding"===a[1].type||"lineEndingBlank"===a[1].type)"enter"===a[0]&&(r&&(u.get(r)[1].type="lineEndingBlank"),a[1].type="lineEnding",r=o);else if("linePrefix"!==a[1].type)break;r&&(n[1].end={...u.get(r)[1].start},i=u.slice(r,c),i.unshift(n),u.splice(r,c-r+1,i))}}return Nw(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!s}function Cx(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const a=[],i=n._tokenizer||r.parser[n.contentType](n.start),l=i.events,s=[],c={};let u,A,d=-1,f=n,p=0,h=0;const g=[h];for(;f;){for(;e.get(++o)[1]!==f;);a.push(o),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),A&&i.defineSkip(f.start),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(u),f._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),A=f,f=f.next}for(f=n;++d<l.length;)"exit"===l[d][0]&&"enter"===l[d-1][0]&&l[d][1].type===l[d-1][1].type&&l[d][1].start.line!==l[d][1].end.line&&(h=d+1,g.push(h),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(i.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),d=g.length;d--;){const t=l.slice(g[d],g[d+1]),n=a.pop();s.push([n,n+t.length-1]),e.splice(n,2,t)}for(s.reverse(),d=-1;++d<s.length;)c[p+s[d][0]]=p+s[d][1],p+=s[d][1]-s[d][0]-1;return c}const Px={resolve:function(e){return Sx(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):$w(t)?e.check(Bx,a,o)(t):(e.consume(t),r)}function o(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},Bx={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"),ax(e,o,"linePrefix")};function o(o){if(null===o||$w(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}};function Dx(e,t,n,r,o,a,i,l,s){const c=s||Number.POSITIVE_INFINITY;let u=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(a),e.consume(t),e.exit(a),A):null===t||32===t||41===t||Gw(t)?n(t):(e.enter(r),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),p(t))};function A(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(l),A(t)):null===t||60===t||$w(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 u||null!==o&&41!==o&&!Zw(o)?u<c&&40===o?(e.consume(o),u++,p):41===o?(e.consume(o),u--,p):null===o||32===o||40===o||Gw(o)?n(o):(e.consume(o),92===o?h:p):(e.exit("chunkString"),e.exit(l),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function Tx(e,t,n,r,o,a){const i=this;let l,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(a),c};function c(A){return s>999||null===A||91===A||93===A&&!l||94===A&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(A):93===A?(e.exit(a),e.enter(o),e.consume(A),e.exit(o),e.exit(r),t):$w(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(A))}function u(t){return null===t||91===t||93===t||$w(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),l||(l=!ex(t)),92===t?A:u)}function A(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function Ix(e,t,n,r,o,a){let i;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,l):n(t)};function l(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(a),s(n))}function s(t){return t===i?(e.exit(a),l(i)):null===t?n(t):$w(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),ax(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===i||null===t||$w(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===i||92===t?(e.consume(t),c):c(t)}}function Qx(e,t){let n;return function r(o){return $w(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):ex(o)?ax(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Mx={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return Tx.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function a(t){return o=qw(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return Zw(t)?Qx(e,l)(t):l(t)}function l(t){return Dx(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(Ox,c,c)(t)}function c(t){return ex(t)?ax(e,u,"whitespace")(t):u(t)}function u(a){return null===a||$w(a)?(e.exit("definition"),r.parser.defined.push(o),t(a)):n(a)}}},Ox={partial:!0,tokenize:function(e,t,n){return function(t){return Zw(t)?Qx(e,r)(t):n(t)};function r(t){return Ix(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return ex(t)?ax(e,a,"whitespace")(t):a(t)}function a(e){return null===e||$w(e)?t(e):n(e)}}};const Lx={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return $w(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Rx={name:"headingAtx",resolve:function(e,t){let n,r,o=e.length-2,a=3;return"whitespace"===e[a][1].type&&(a+=2),o-2>a&&"whitespace"===e[o][1].type&&(o-=2),"atxHeadingSequence"===e[o][1].type&&(a===o-1||o-4>a&&"whitespace"===e[o-2][1].type)&&(o-=a+1===o?2:4),o>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[o][1].end},r={type:"chunkText",start:e[a][1].start,end:e[o][1].end,contentType:"text"},Nw(e,a,o-a+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||Zw(t)?(e.exit("atxHeadingSequence"),a(t)):n(t)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||$w(n)?(e.exit("atxHeading"),t(n)):ex(n)?ax(e,a,"whitespace")(n):(e.enter("atxHeadingText"),l(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),a(t))}function l(t){return null===t||35===t||Zw(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),l)}}};const Nx=["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"],Fx=["pre","script","style","textarea"],jx={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,a,i,l,s;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(l){return 33===l?(e.consume(l),u):47===l?(e.consume(l),a=!0,f):63===l?(e.consume(l),o=3,r.interrupt?t:O):Vw(l)?(e.consume(l),i=String.fromCharCode(l),p):n(l)}function u(a){return 45===a?(e.consume(a),o=2,A):91===a?(e.consume(a),o=5,l=0,d):Vw(a)?(e.consume(a),o=4,r.interrupt?t:O):n(a)}function A(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const a="CDATA[";return o===a.charCodeAt(l++)?(e.consume(o),6===l?r.interrupt?t:C:d):n(o)}function f(t){return Vw(t)?(e.consume(t),i=String.fromCharCode(t),p):n(t)}function p(l){if(null===l||47===l||62===l||Zw(l)){const s=47===l,c=i.toLowerCase();return s||a||!Fx.includes(c)?Nx.includes(i.toLowerCase())?(o=6,s?(e.consume(l),h):r.interrupt?t(l):C(l)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(l):a?g(l):m(l)):(o=1,r.interrupt?t(l):C(l))}return 45===l||Ww(l)?(e.consume(l),i+=String.fromCharCode(l),p):n(l)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:C):n(o)}function g(t){return ex(t)?(e.consume(t),g):E(t)}function m(t){return 47===t?(e.consume(t),E):58===t||95===t||Vw(t)?(e.consume(t),v):ex(t)?(e.consume(t),m):E(t)}function v(t){return 45===t||46===t||58===t||95===t||Ww(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),y):ex(t)?(e.consume(t),b):m(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,w):ex(t)?(e.consume(t),y):x(t)}function w(t){return t===s?(e.consume(t),s=null,k):null===t||$w(t)?n(t):(e.consume(t),w)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||Zw(t)?b(t):(e.consume(t),x)}function k(e){return 47===e||62===e||ex(e)?m(e):n(e)}function E(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||$w(t)?C(t):ex(t)?(e.consume(t),S):n(t)}function C(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),I):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!$w(t)||6!==o&&7!==o?null===t||$w(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),C):(e.exit("htmlFlowData"),e.check(zx,R,P)(t))}function P(t){return e.check(_x,B,R)(t)}function B(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),D}function D(t){return null===t||$w(t)?P(t):(e.enter("htmlFlowData"),C(t))}function T(t){return 45===t?(e.consume(t),O):C(t)}function I(t){return 47===t?(e.consume(t),i="",Q):C(t)}function Q(t){if(62===t){const n=i.toLowerCase();return Fx.includes(n)?(e.consume(t),L):C(t)}return Vw(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):C(t)}function M(t){return 93===t?(e.consume(t),O):C(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):C(t)}function L(t){return null===t||$w(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),L)}function R(n){return e.exit("htmlFlow"),t(n)}}},zx={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(px,t,n)}}},_x={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return $w(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 Hx={name:"htmlText",tokenize:function(e,t,n){const r=this;let o,a,i;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),l};function l(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),y):63===t?(e.consume(t),v):Vw(t)?(e.consume(t),k):n(t)}function s(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),a=0,f):Vw(t)?(e.consume(t),m):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),A):$w(t)?(i=u,Q(t)):(e.consume(t),u)}function A(t){return 45===t?(e.consume(t),d):u(t)}function d(e){return 62===e?I(e):45===e?A(e):u(e)}function f(t){const r="CDATA[";return t===r.charCodeAt(a++)?(e.consume(t),6===a?p:f):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),h):$w(t)?(i=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?I(t):93===t?(e.consume(t),g):p(t)}function m(t){return null===t||62===t?I(t):$w(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):$w(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?I(e):v(e)}function y(t){return Vw(t)?(e.consume(t),w):n(t)}function w(t){return 45===t||Ww(t)?(e.consume(t),w):x(t)}function x(t){return $w(t)?(i=x,Q(t)):ex(t)?(e.consume(t),x):I(t)}function k(t){return 45===t||Ww(t)?(e.consume(t),k):47===t||62===t||Zw(t)?E(t):n(t)}function E(t){return 47===t?(e.consume(t),I):58===t||95===t||Vw(t)?(e.consume(t),S):$w(t)?(i=E,Q(t)):ex(t)?(e.consume(t),E):I(t)}function S(t){return 45===t||46===t||58===t||95===t||Ww(t)?(e.consume(t),S):C(t)}function C(t){return 61===t?(e.consume(t),P):$w(t)?(i=C,Q(t)):ex(t)?(e.consume(t),C):E(t)}function P(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,B):$w(t)?(i=P,Q(t)):ex(t)?(e.consume(t),P):(e.consume(t),D)}function B(t){return t===o?(e.consume(t),o=void 0,T):null===t?n(t):$w(t)?(i=B,Q(t)):(e.consume(t),B)}function D(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||Zw(t)?E(t):(e.consume(t),D)}function T(e){return 47===e||62===e||Zw(e)?E(e):n(e)}function I(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 ex(t)?ax(e,O,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):O(t)}function O(t){return e.enter("htmlTextData"),i(t)}}};const Ux={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&&Nw(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,a,i=e.length,l=0;for(;i--;)if(n=e[i][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[i][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(o){if("enter"===e[i][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=i,"labelLink"!==n.type)){l=2;break}}else"labelEnd"===n.type&&(o=i);const s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[r+l+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",s,t],["enter",c,t]],a=Fw(a,e.slice(r+1,r+l+3)),a=Fw(a,[["enter",u,t]]),a=Fw(a,ux(t.parser.constructs.insideSpan.null,e.slice(r+l+4,o-3),t)),a=Fw(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Fw(a,e.slice(o+1)),a=Fw(a,[["exit",s,t]]),Nw(e,r,e.length,a),e},tokenize:function(e,t,n){const r=this;let o,a,i=r.events.length;for(;i--;)if(("labelImage"===r.events[i][1].type||"labelLink"===r.events[i][1].type)&&!r.events[i][1]._balanced){o=r.events[i][1];break}return function(t){return o?o._inactive?u(t):(a=r.parser.defined.includes(qw(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),l):n(t)};function l(t){return 40===t?e.attempt(qx,c,a?c:u)(t):91===t?e.attempt(Vx,c,a?s:u)(t):a?c(t):u(t)}function s(t){return e.attempt(Wx,c,u)(t)}function c(e){return t(e)}function u(e){return o._balanced=!0,n(e)}}},qx={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 Zw(t)?Qx(e,o)(t):o(t)}function o(t){return 41===t?c(t):Dx(e,a,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return Zw(t)?Qx(e,l)(t):c(t)}function i(e){return n(e)}function l(t){return 34===t||39===t||40===t?Ix(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function s(t){return Zw(t)?Qx(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},Vx={tokenize:function(e,t,n){const r=this;return function(t){return Tx.call(r,e,o,a,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(qw(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},Wx={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 Yx={name:"labelStartImage",resolveAll:Ux.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"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}};const Gx={name:"labelStartLink",resolveAll:Ux.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 Xx={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),ax(e,t,"linePrefix")}}};const Kx={name:"thematicBreak",tokenize:function(e,t,n){let r,o=0;return function(t){return e.enter("thematicBreak"),function(e){return r=e,a(e)}(t)};function a(a){return a===r?(e.enter("thematicBreakSequence"),i(a)):o>=3&&(null===a||$w(a))?(e.exit("thematicBreak"),t(a)):n(a)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),ex(t)?ax(e,a,"whitespace")(t):a(t))}}};const Jx={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(px,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ax(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!ex(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(Zx,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,ax(e,e.attempt(Jx,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 a=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=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:Xw(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(Kx,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(t)}return n(t)};function l(t){return Xw(t)&&++i<10?(e.consume(t),l):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),s(t)):n(t)}function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(px,r.interrupt?n:c,e.attempt($x,A,u))}function c(e){return r.containerState.initialBlankLine=!0,a++,A(e)}function u(t){return ex(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),A):n(t)}function A(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},$x={partial:!0,tokenize:function(e,t,n){const r=this;return ax(e,function(e){const o=r.events[r.events.length-1];return!ex(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},Zx={partial:!0,tokenize:function(e,t,n){const r=this;return ax(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 ek={name:"setextUnderline",resolveTo:function(e,t){let n,r,o,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),!o&&"definition"===e[a][1].type&&(o=a);const i={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",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end={...e[o][1].end}):e[n][1]=i,e.push(["exit",i,t]),e},tokenize:function(e,t,n){const r=this;let o;return function(t){let i,l=r.events.length;for(;l--;)if("lineEnding"!==r.events[l][1].type&&"linePrefix"!==r.events[l][1].type&&"content"!==r.events[l][1].type){i="paragraph"===r.events[l][1].type;break}return r.parser.lazy[r.now().line]||!r.interrupt&&!i?n(t):(e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),a(t)}(t))};function a(t){return t===o?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),ex(t)?ax(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||$w(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const tk={tokenize:function(e){const t=this,n=e.attempt(px,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,ax(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Px,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 nk={resolveAll:ik()},rk=ak("string"),ok=ak("text");function ak(e){return{resolveAll:ik("text"===e?lk:void 0),tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,a,i);return a;function a(e){return s(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),l;t.consume(e)}function l(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),l)}function s(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 ik(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 lk(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 a,i=o.length,l=-1,s=0;for(;i--;){const e=o[i];if("string"==typeof e){for(l=e.length;32===e.charCodeAt(l-1);)s++,l--;if(l)break;l=-1}else if(-2===e)a=!0,s++;else if(-1!==e){i++;break}}if(s){const o={type:n===e.length||a||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?l:r.start._bufferIndex+l,_index:r.start._index+i,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},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 sk={42:Jx,43:Jx,45:Jx,48:Jx,49:Jx,50:Jx,51:Jx,52:Jx,53:Jx,54:Jx,55:Jx,56:Jx,57:Jx,62:hx},ck={91:Mx},uk={[-2]:yx,[-1]:yx,32:yx},Ak={35:Rx,42:Kx,45:[ek,Kx],60:jx,61:ek,95:Kx,96:bx,126:bx},dk={38:mx,92:gx},fk={[-5]:Xx,[-4]:Xx,[-3]:Xx,33:Yx,38:mx,42:Ax,60:[fx,Hx],91:Gx,92:[Lx,gx],93:Ux,95:Ax,96:xx},pk={null:[Ax,nk]},hk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:ck,disable:{null:[]},document:sk,flow:Ak,flowInitial:uk,insideSpan:pk,string:dk,text:fk},Symbol.toStringTag,{value:"Module"}));function gk(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={},a=[];let i=[],l=[];const s={attempt:h(function(e,t){g(e,t.from)}),check:h(p),consume:function(e){$w(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===i[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),c.events.push(["enter",n,c]),l.push(n),n},exit:function(e){const t=l.pop();return t.end=d(),c.events.push(["exit",t,c]),t},interrupt:h(p,{interrupt:!0})},c={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 a=e[n];let i;if("string"==typeof a)i=a;else switch(a){case-5:i="\r";break;case-4:i="\n";break;case-3:i="\r\n";break;case-2:i=t?" ":"\t";break;case-1:if(!t&&o)continue;i=" ";break;default:i=String.fromCharCode(a)}o=-2===a,r.push(i)}return r.join("")}(A(e),t)},sliceStream:A,write:function(e){return i=Fw(i,e),function(){let e;for(;r._index<i.length;){const t=i[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!==i[i.length-1]?[]:(g(t,0),c.events=ux(a,c.events,c),c.events)}};let u=t.tokenize.call(c,s);return t.resolveAll&&a.push(t),c;function A(e){return function(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let i;if(n===o)i=[e[n].slice(r,a)];else{if(i=e.slice(n,o),r>-1){const e=i[0];"string"==typeof e?i[0]=e.slice(r):i.shift()}a>0&&i.push(e[o].slice(0,a))}return i}(i,e)}function d(){const{_bufferIndex:e,_index:t,line:n,column:o,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:o,offset:a}}function f(e){u=u(e)}function p(e,t){t.restore()}function h(e,t){return function(n,o,a){let i,u,A,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 i=e,u=0,0===e.length?a:h(e[u])}function h(e){return function(n){return f=function(){const e=d(),t=c.previous,n=c.currentConstruct,o=c.events.length,a=Array.from(l);return{from:o,restore:i};function i(){r=e,c.previous=t,c.currentConstruct=n,c.events.length=o,l=a,m()}}(),A=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(c),t):c,s,g,v)(n)}}function g(t){return e(A,f),o}function v(e){return f.restore(),++u<i.length?h(i[u]):a}}}function g(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Nw(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const mk=/[\0\t\n\r]/g;const vk=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bk(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return Uw(n.slice(t?2:1),t?16:10)}return Rw(n)||e}const yk={}.hasOwnProperty;function wk(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:a(te),autolinkProtocol:S,autolinkEmail:S,atxHeading:a(J),blockQuote:a(W),characterEscape:S,characterReference:S,codeFenced:a(Y),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:a(Y,i),codeText:a(G,i),codeTextData:S,data:S,codeFlowValue:S,definition:a(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:a(K),hardBreakEscape:a($),hardBreakTrailing:a($),htmlFlow:a(Z,i),htmlFlowData:S,htmlText:a(Z,i),htmlTextData:S,image:a(ee),label:i,link:a(te),listItem:a(re),listItemValue:d,listOrdered:a(ne,A),listUnordered:a(ne),paragraph:a(oe),reference:j,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:a(J),strong:a(ae),thematicBreak:a(le)},exit:{atxHeading:s(),atxHeadingSequence:w,autolink:s(),autolinkEmail:V,autolinkProtocol:q,blockQuote:s(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:_,characterReferenceMarkerNumeric:_,characterReferenceValue:H,characterReference:U,codeFenced:s(g),codeFencedFence:h,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:C,codeIndented:s(m),codeText:s(I),codeTextData:C,data:C,definition:s(),definitionDestinationString:y,definitionLabelString:v,definitionTitleString:b,emphasis:s(),hardBreakEscape:s(B),hardBreakTrailing:s(B),htmlFlow:s(D),htmlFlowData:C,htmlText:s(T),htmlTextData:C,image:s(M),label:L,labelText:O,lineEnding:P,link:s(Q),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:z,resourceDestinationString:R,resourceTitleString:N,resource:F,setextHeading:s(E),setextHeadingLineSequence:k,setextHeadingText:x,strong:s(),thematicBreak:s()}};kk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const a={stack:[r],tokenStack:[],config:t,enter:l,exit:c,buffer:i,resume:u,data:n},s=[];let A=-1;for(;++A<e.length;)if("listOrdered"===e[A][1].type||"listUnordered"===e[A][1].type)if("enter"===e[A][0])s.push(A);else{A=o(e,s.pop(),A)}for(A=-1;++A<e.length;){const n=t[e[A][0]];yk.call(n,e[A][1].type)&&n[e[A][1].type].call(Object.assign({sliceSerialize:e[A][2].sliceSerialize},a),e[A][1])}if(a.tokenStack.length>0){const e=a.tokenStack[a.tokenStack.length-1];(e[1]||Sk).call(a,void 0,e[0])}for(r.position={start:xk(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:xk(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},A=-1;++A<t.transforms.length;)r=t.transforms[A](r)||r;return r}function o(e,t,n){let r,o,a,i,l=t-1,s=-1,c=!1;for(;++l<=n;){const t=e[l];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,i=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(r&&!i&&!s&&!a&&(a=l),i=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:i=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let i=l;for(o=void 0;i--;){const t=e[i];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;o&&(e[o][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",o=i}else if("linePrefix"!==t[1].type&&"blockQuotePrefix"!==t[1].type&&"blockQuotePrefixWhitespace"!==t[1].type&&"blockQuoteMarker"!==t[1].type&&"listItemIndent"!==t[1].type)break}a&&(!o||a<o)&&(r._spread=!0),r.end=Object.assign({},o?e[o][1].start:t[1].end),e.splice(o||l,0,["exit",r,t[2]]),l++,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(l,0,["enter",o,t[2]]),l++,n++,a=void 0,i=!0}}}return e[t][1]._spread=c,n}function a(e,t){return n;function n(n){l.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(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:xk(t.start),end:void 0}}function s(e){return t;function t(t){e&&e.call(this,t),c.call(this,t)}}function c(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+sw({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Sk).call(this,e,r[0])),n.position.end=xk(e.end)}function u(){return function(e){return Mw(e,"boolean"!=typeof Qw.includeImageAlt||Qw.includeImageAlt,"boolean"!=typeof Qw.includeHtml||Qw.includeHtml)}(this.stack.pop())}function A(){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=qw(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function y(){const e=this.resume();this.stack[this.stack.length-1].url=e}function w(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 S(e){const t=this.stack[this.stack.length-1].children;let n=t[t.length-1];(!n||"text"!==n.type)&&(n=ie(),n.position={start:xk(e.start),end:void 0},t.push(n)),this.stack.push(n)}function C(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=xk(e.end)}function P(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=xk(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(S.call(this,e),C.call(this,e))}function B(){this.data.atHardBreak=!0}function D(){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 I(){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(vk,bk)}(t),n.identifier=qw(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 N(){const e=this.resume();this.stack[this.stack.length-1].title=e}function F(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function z(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=qw(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function _(e){this.data.characterReferenceType=e.type}function H(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=Uw(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Rw(t);this.stack[this.stack.length-1].value+=r}function U(e){this.stack.pop().position.end=xk(e.end)}function q(e){C.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function V(e){C.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function W(){return{type:"blockquote",children:[]}}function Y(){return{type:"code",lang:null,meta:null,value:""}}function G(){return{type:"inlineCode",value:""}}function X(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function K(){return{type:"emphasis",children:[]}}function J(){return{type:"heading",depth:0,children:[]}}function $(){return{type:"break"}}function Z(){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 ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}(n)(function(e){for(;!Sx(e););return e}(function(e){const t={constructs:zw([hk,...(e||{}).extensions||[]]),content:n(ix),defined:[],document:n(lx),flow:n(tk),lazy:{},string:n(rk),text:n(ok)};return t;function n(e){return function(n){return gk(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,a,i){const l=[];let s,c,u,A,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(a||void 0).decode(o)),u=0,n="",r&&(65279===o.charCodeAt(0)&&u++,r=void 0);u<o.length;){if(mk.lastIndex=u,s=mk.exec(o),A=s&&void 0!==s.index?s.index:o.length,d=o.charCodeAt(A),!s){n=o.slice(u);break}if(10===d&&u===A&&e)l.push(-3),e=void 0;else switch(e&&(l.push(-5),e=void 0),u<A&&(l.push(o.slice(u,A)),t+=A-u),d){case 0:l.push(65533),t++;break;case 9:for(c=4*Math.ceil(t/4),l.push(-2);t++<c;)l.push(-1);break;case 10:l.push(-4),t=1;break;default:e=!0,t=1}u=A+1}return i&&(e&&l.push(-5),n&&l.push(n),l.push(null)),l}}()(e,t,!0))))}function xk(e){return{line:e.line,column:e.column,offset:e.offset}}function kk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?kk(e,r):Ek(e,r)}}function Ek(e,t){let n;for(n in t)if(yk.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 Sk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+sw({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+sw({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+sw({start:t.start,end:t.end})+") is still open")}function Ck(e){const t=this;t.parser=function(n){return wk(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Pk(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),a=o[0];a&&"text"===a.type?a.value="["+a.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function Bk(e){return e.spread??e.children.length>1}function Dk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const a=[];for(;r;)a.push(Tk(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(Tk(t.slice(o),o>0,!1)),a.join("")}function Tk(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 Ik={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=ox(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let i,l=e.footnoteCounts.get(r);void 0===l?(l=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=a+1,l+=1,e.footnoteCounts.set(r,l);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,s);const c={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,c),e.applyData(t,c)},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 Pk(e,t);const o={src:ox(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){const n={src:ox(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 Pk(e,t);const o={href:ox(r.url||"")};null!==r.title&&void 0!==r.title&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){const n={href:ox(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=Bk(n[r])}return t}(n):Bk(t),a={},i=[];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:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const e=r[l];(o||0!==l||"element"!==e.type||"p"!==e.tagName)&&i.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||o?i.push(e):i.push(...e.children)}const s=r[r.length-1];s&&(o||"element"!==s.type||"p"!==s.tagName)&&i.push({type:"text",value:"\n"});const c={type:"element",tagName:"li",properties:a,children:i};return e.patch(t,c),e.applyData(t,c)},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 a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},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)},a=iw(t.children[1]),i=aw(t.children[t.children.length-1]);a&&i&&(r.position={start:a,end:i}),o.push(r)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)},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",a=n&&"table"===n.type?n.align:void 0,i=a?a.length:t.children.length;let l=-1;const s=[];for(;++l<i;){const n=t.children[l],r={},i=a?a[l]:void 0;i&&(r.align=i);let c={type:"element",tagName:o,properties:r,children:[]};n&&(c.children=e.all(n),e.patch(n,c),c=e.applyData(n,c)),s.push(c)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,c),e.applyData(t,c)},text:function(e,t){const n={type:"text",value:Dk(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:Qk,yaml:Qk,definition:Qk,footnoteDefinition:Qk};function Qk(){}const Mk="object"==typeof self?self:globalThis,Ok=e=>((e,t)=>{const n=(t,n)=>(e.set(n,t),t),r=o=>{if(e.has(o))return e.get(o);const[a,i]=t[o];switch(a){case 0:case-1:return n(i,o);case 1:{const e=n([],o);for(const t of i)e.push(r(t));return e}case 2:{const e=n({},o);for(const[t,n]of i)e[r(t)]=r(n);return e}case 3:return n(new Date(i),o);case 4:{const{source:e,flags:t}=i;return n(new RegExp(e,t),o)}case 5:{const e=n(new Map,o);for(const[t,n]of i)e.set(r(t),r(n));return e}case 6:{const e=n(new Set,o);for(const t of i)e.add(r(t));return e}case 7:{const{name:e,message:t}=i;return n(new Mk[e](t),o)}case 8:return n(BigInt(i),o);case"BigInt":return n(Object(BigInt(i)),o);case"ArrayBuffer":return n(new Uint8Array(i).buffer,i);case"DataView":{const{buffer:e}=new Uint8Array(i);return n(new DataView(e),i)}}return n(new Mk[a](i),o)};return r})(new Map,e)(0),Lk="",{toString:Rk}={},{keys:Nk}=Object,Fk=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=Rk.call(e).slice(8,-1);switch(n){case"Array":return[1,Lk];case"Object":return[2,Lk];case"Date":return[3,Lk];case"RegExp":return[4,Lk];case"Map":return[5,Lk];case"Set":return[6,Lk];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},jk=([e,t])=>0===e&&("function"===t||"symbol"===t),zk=(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},a=r=>{if(n.has(r))return n.get(r);let[i,l]=Fk(r);switch(i){case 0:{let t=r;switch(l){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(l){let e=r;return"DataView"===l?e=new Uint8Array(r.buffer):"ArrayBuffer"===l&&(e=new Uint8Array(r)),o([l,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(a(t));return t}case 2:{if(l)switch(l){case"BigInt":return o([l,r.toString()],r);case"Boolean":case"Number":case"String":return o([l,r.valueOf()],r)}if(t&&"toJSON"in r)return a(r.toJSON());const n=[],s=o([i,n],r);for(const t of Nk(r))(e||!jk(Fk(r[t])))&&n.push([a(t),a(r[t])]);return s}case 3:return o([i,r.toISOString()],r);case 4:{const{source:e,flags:t}=r;return o([i,{source:e,flags:t}],r)}case 5:{const t=[],n=o([i,t],r);for(const[n,o]of r)(e||!jk(Fk(n))&&!jk(Fk(o)))&&t.push([a(n),a(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!jk(Fk(n)))&&t.push(a(n));return n}}const{message:s}=r;return o([i,{name:l,message:s}],r)};return a})(!(t||n),!!t,new Map,r)(e),r},_k="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?Ok(zk(e,t)):structuredClone(e):(e,t)=>Ok(zk(e,t));function Hk(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 Uk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const qk=function(e){if(null==e)return Wk;if("function"==typeof e)return Vk(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qk(e[n]);return Vk(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 Vk(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 Vk(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function Vk(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 Wk(){return!0}const Yk=[],Gk=!0,Xk=!1;function Kk(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const a=qk(o),i=r?-1:1;!function e(o,l,s){const c=o&&"object"==typeof o?o:{};if("string"==typeof c.type){const e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return u;function u(){let c,u,A,d=Yk;if((!t||a(o,l,s[s.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[Gk,e]:null==e?Yk:[e]}(n(o,s)),d[0]===Xk))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(u=(r?t.children.length:-1)+i,A=s.concat(t);u>-1&&u<t.children.length;){const n=t.children[u];if(c=e(n,u,A)(),c[0]===Xk)return c;u="number"==typeof c[1]?c[1]:u+i}}return d}}(e,void 0,[])()}function Jk(e,t,n,r){let o,a,i;"function"==typeof t?(a=void 0,i=t,o=n):(a=t,i=n,o=r),Kk(e,a,function(e,t){const n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return i(e,r,n)},o)}const $k={}.hasOwnProperty,Zk={};function eE(e,t){const n=t||Zk,r=new Map,o=new Map,a=new Map,i={...Ik,...n.handlers},l={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=l.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=aE(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=aE(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:nE,definitionById:r,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=l.handlers[n];if($k.call(l.handlers,n)&&r)return r(l,e,t);if(l.options.passThrough&&l.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=_k(n);return r.children=l.all(e),r}return _k(e)}return(l.options.unknownHandler||rE)(l,e,t)},options:n,patch:tE,wrap:oE};return Jk(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)}}),l}function tE(e,t){e.position&&(t.position=function(e){const t=iw(e),n=aw(e);if(t&&n)return{start:t,end:n}}(e))}function nE(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,_k(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function rE(e,t){const n=t.data||{},r=!("value"in t)||$k.call(n,"hProperties")||$k.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 oE(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 aE(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function iE(e,t){const n=eE(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||Hk,r=e.options.footnoteBackLabel||Uk,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let s=-1;for(;++s<e.footnoteOrder.length;){const o=e.footnoteById.get(e.footnoteOrder[s]);if(!o)continue;const a=e.all(o),i=String(o.identifier).toUpperCase(),c=ox(i.toLowerCase());let u=0;const A=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++u<=d;){A.length>0&&A.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,u);"string"==typeof e&&(e={type:"text",value:e}),A.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+c+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const f=a[a.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(...A)}else a.push(...A);const p={type:"element",tagName:"li",properties:{id:t+"fn-"+c},children:e.wrap(a,!0)};e.patch(o,p),l.push(p)}if(0!==l.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{..._k(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:"\n"}]}}(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:"\n"},o),a}function lE(e,t){return e&&"run"in e?async function(n,r){const o=iE(n,{file:r,...t});await e.run(o,r)}:function(n,r){return iE(n,{file:r,...e||t})}}function sE(e){if(e)throw e}var cE,uE;var AE=function(){if(uE)return cE;uE=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)},a=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,o=e.call(n,"constructor"),a=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!a)return!1;for(r in n);return typeof r>"u"||e.call(n,r)},i=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},l=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return cE=function e(){var t,n,r,s,c,u,A=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof A&&(p=A,A=arguments[1]||{},d=2),(null==A||"object"!=typeof A&&"function"!=typeof A)&&(A={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(A,n),A!==(s=l(t,n))&&(p&&s&&(a(s)||(c=o(s)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},i(A,{name:n,newValue:e(p,u,s)})):typeof s<"u"&&i(A,{name:n,newValue:s}));return A},cE}();const dE=Jy(AE);function fE(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 pE(){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(a,...i){const l=e[++n];let s=-1;if(a)r(a);else{for(;++s<t.length;)(null===i[s]||void 0===i[s])&&(i[s]=t[s]);t=i,l?function(e,t){let n;return r;function r(...t){const r=e.length>t.length;let i;r&&t.push(o);try{i=e.apply(this,t)}catch(e){if(r&&n)throw e;return o(e)}r||(i&&i.then&&"function"==typeof i.then?i.then(a,o):i instanceof Error?o(i):a(i))}function o(e,...r){n||(n=!0,t(e,...r))}function a(e){o(null,e)}}(l,o)(...i):r(null,...i)}}(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 hE={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');gE(e);let n,r=0,o=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else o<0&&(n=!0,o=a+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,l=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1),l>-1&&(e.codePointAt(a)===t.codePointAt(l--)?l<0&&(o=a):(l=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(gE(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){gE(e);let t,n=e.length,r=-1,o=0,a=-1,i=0;for(;n--;){const l=e.codePointAt(n);if(47!==l)r<0&&(t=!0,r=n+1),46===l?a<0?a=n:1!==i&&(i=1):a>-1&&(i=-1);else if(t){o=n+1;break}}return a<0||r<0||0===i||1===i&&a===r-1&&a===o+1?"":e.slice(a,r)},join:function(...e){let t,n=-1;for(;++n<e.length;)gE(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){gE(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",a=0,i=-1,l=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else{if(47===n)break;n=47}if(47===n){if(i!==s-1&&1!==l)if(i!==s-1&&2===l){if(o.length<2||2!==a||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="",a=0):(o=o.slice(0,r),a=o.length-1-o.lastIndexOf("/")),i=s,l=0;continue}}else if(o.length>0){o="",a=0,i=s,l=0;continue}t&&(o=o.length>0?o+"/..":"..",a=2)}else o.length>0?o+="/"+e.slice(i+1,s):o=e.slice(i+1,s),a=s-i-1;i=s,l=0}else 46===n&&l>-1?l++:l=-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 gE(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mE={cwd:function(){return"/"}};function vE(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function bE(e){if("string"==typeof e)e=new URL(e);else if(!vE(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 yE=["history","path","basename","stem","extname","dirname"];class wE{constructor(e){let t;var n;t=e?vE(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?"":mE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<yE.length;){const e=yE[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)yE.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?hE.basename(this.path):void 0}set basename(e){kE(e,"basename"),xE(e,"basename"),this.path=hE.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?hE.dirname(this.path):void 0}set dirname(e){EE(this.basename,"dirname"),this.path=hE.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?hE.extname(this.path):void 0}set extname(e){if(xE(e,"extname"),EE(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=hE.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){vE(e)&&(e=bE(e)),kE(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?hE.basename(this.path,this.extname):void 0}set stem(e){kE(e,"stem"),xE(e,"stem"),this.path=hE.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 dw(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 xE(e,t){if(e&&e.includes(hE.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+hE.sep+"`")}function kE(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function EE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const SE=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},CE={}.hasOwnProperty;class PE extends SE{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=pE()}copy(){const e=new PE;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(dE(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(IE("data",this.frozen),this.namespace[e]=t,this):CE.call(this.namespace,e)&&this.namespace[e]||void 0:e?(IE("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=OE(e),n=this.parser||this.Parser;return DE("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),DE("process",this.parser||this.Parser),TE("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const a=OE(e),i=n.parse(a);function l(e,n){e||!n?o(e):r?r(n):t(void 0,n)}n.run(i,a,function(e,t,r){if(e||!t||!r)return l(e);const o=t,a=n.stringify(o,r);var i;"string"==typeof(i=a)||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(i)?r.value=a:r.result=a,l(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),DE("processSync",this.parser||this.Parser),TE("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,sE(e),t=r}),ME("processSync","process",n),t}run(e,t,n){QE(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,a){const i=OE(t);r.run(e,i,function(t,r,i){const l=r||e;t?a(t):o?o(l):n(void 0,l,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){sE(e),n=t,r=!0}),ME("runSync","run",r),n}stringify(e,t){this.freeze();const n=OE(t),r=this.compiler||this.Compiler;return TE("stringify",r),QE(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(IE("use",this.frozen),null!=e)if("function"==typeof e)l(e,t);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");Array.isArray(e)?i(e):a(e)}return this;function o(e){if("function"==typeof e)l(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;l(t,n)}else a(e)}}function a(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");i(e.plugins),e.settings&&(r.settings=dE(!0,r.settings,e.settings))}function i(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 l(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,...a]=t;const i=n[o][1];fE(i)&&fE(r)&&(r=dE(!0,i,r)),n[o]=[e,r,...a]}}}}const BE=(new PE).freeze();function DE(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function TE(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function IE(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 QE(e){if(!fE(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function ME(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function OE(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new wE(e)}const LE=[],RE={allowDangerousHtml:!0},NE=/^(https?|ircs?|mailto|xmpp)$/i,FE=[{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 jE(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,a=e.components,i=e.disallowedElements,l=e.rehypePlugins||LE,s=e.remarkPlugins||LE,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...RE}:RE,u=e.skipHtml,A=e.unwrapDisallowed,d=e.urlTransform||zE,f=BE().use(Ck).use(s).use(lE,c).use(l),p=new wE;"string"==typeof r&&(p.value=r);for(const t of FE)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const h=f.parse(p);let g=f.runSync(h,p);return o&&(g={type:"element",tagName:"div",properties:{className:o},children:"root"===g.type?g.children:[g]}),Jk(g,function(e,r,o){if("raw"===e.type&&o&&"number"==typeof r)return u?o.children.splice(r,1):o.children[r]={type:"text",value:e.value},r;if("element"===e.type){let t;for(t in Iw)if(Object.hasOwn(Iw,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Iw[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=d(String(n||""),t,e))}}if("element"===e.type){let a=t?!t.includes(e.tagName):!!i&&i.includes(e.tagName);if(!a&&n&&"number"==typeof r&&(a=!n(e,r,o)),a&&o&&"number"==typeof r)return A&&e.children?o.children.splice(r,1,...e.children):o.children.splice(r,1),r}}),yw(g,{Fragment:aA.Fragment,components:a,ignoreInvalidStyle:!0,jsx:aA.jsx,jsxs:aA.jsxs,passKeys:!0,passNode:!0})}function zE(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||NE.test(e.slice(0,t))?e:""}const _E=({children:e})=>aA.jsx("div",{style:{whiteSpace:"normal"},children:aA.jsx(jE,{components:{p:({...e})=>aA.jsx("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>aA.jsx("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>aA.jsx("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>aA.jsx("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?aA.jsx("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):aA.jsx("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:aA.jsx("code",{children:t})}),blockquote:({...e})=>aA.jsx("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),HE={autoConfig:!0},UE=e=>()=>(e=>{const{getFlow:t}=Pb(),{messages:n,replaceMessages:r}=Bb(),{settings:o}=Tb(),{hasChatHistoryLoaded:a}=Qb(),i={...e,...HE},l=i.markdownComponent?i.markdownComponent:_E;j.useEffect(()=>{var e,t;if(a){const a=[...n];for(let n=0;n<a.length&&n<((null==(e=o.chatHistory)?void 0:e.maxEntries)??30);n++){const e=a[n];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=l)}r(a)}},[a]);const s=async e=>{var n;const r=null==(n=e.data.message)?void 0:n.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,t(),r)&&(e.data.message.contentWrapper=l,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};Db(Sm.PRE_INJECT_MESSAGE,s),Db(Sm.CHUNK_STREAM_MESSAGE,s),Db(Sm.START_STREAM_MESSAGE,s),Db(Sm.START_SIMULATE_STREAM_MESSAGE,s);const c={name:"@rcb-plugins/markdown-renderer"};return null!=i&&i.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(e),qE={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"}},VE=(e,t,n="validateTextInput")=>{var r;if(null==(r=e.detail)||!r.currPath)return;const o=t[e.detail.currPath];if(!o)return;const a=o[n];return"function"==typeof a?a:void 0},WE=e=>{const{showToast:t}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=Fv();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:n}=Pb(),{styles:r,updateStyles:o,replaceStyles:a}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=mb();return{styles:e,replaceStyles:t,updateStyles:n}})(),i=(e=>({...qE,...e,promptBaseColors:{...qE.promptBaseColors},promptHoveredColors:{...qE.promptHoveredColors},textAreaHighlightColors:{...qE.textAreaHighlightColors}}))(e),[l,s]=j.useState(0),c=j.useRef({});Db(Sm.USER_SUBMIT_TEXT,e=>{const a=e,u=VE(a,n(),"validateTextInput");if(!u)return;const A=u(a.data.inputText);if(null!=A&&A.success||e.preventDefault(),!A.promptContent)return;0===l&&(c.current=structuredClone(r));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})(A,i);o(d),t(A.promptContent,A.promptDuration??3e3),s(e=>e+1)}),Db(Sm.USER_UPLOAD_FILE,e=>{var r,o;const a=e,i=null==(o=null==(r=a.data)?void 0:r.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const l=VE(a,n(),"validateFileInput");if(!l)return void console.error("Validator not found for file input.");const s=l(i);if(!s.success)return console.error("Validation failed:",s),s.promptContent&&t(s.promptContent,s.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",s)}),Db(Sm.DISMISS_TOAST,()=>{s(e=>e-1)}),j.useEffect(()=>{0===l&&setTimeout(()=>{a(c.current)})},[l,a]);const u={name:"@rcb-plugins/input-validator"};return i.autoConfig&&(u.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),u},YE=e=>()=>WE(e),GE=j.forwardRef(({embedded:e,currentOpen:t,enabled:n,onSetEnabled:r},o)=>{const a=Bb(),i=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=Qm();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),l=j.useRef(!1),s=j.useRef(!1);return j.useEffect(()=>{!e&&i&&i.toggleChatWindow&&(l.current===t||s.current||(setTimeout(()=>{i&&i.toggleChatWindow&&i.toggleChatWindow(t)},0),l.current=null!=t&&t),s.current=!1)},[t,e,i]),j.useEffect(()=>{const e=()=>{s.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),j.useImperativeHandle(o,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!e&&i&&i.toggleChatWindow&&i.toggleChatWindow(!0)},closeChat:()=>{!e&&i&&i.toggleChatWindow&&i.toggleChatWindow(!1)},toggleChat:()=>{!e&&i&&i.toggleChatWindow&&i.toggleChatWindow()},setBotEnabled:e=>{r&&r(e)}}),[a,i,e,r]),null});GE.displayName="BotController";const XE=j.createContext(null),KE=({trackEvent:e,children:t})=>{const n=j.useRef(e);return n.current=e,z.createElement(XE.Provider,{value:{trackEvent:e=>n.current(e)}},t)},JE=()=>{const e=j.useContext(XE);return e||{trackEvent:()=>{}}},$E=({loginUrl:e,className:t="",style:n,isHeaderButton:r=!1})=>{const{trackEvent:o}=JE(),a=r?{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 z.createElement(z.Fragment,null,r&&z.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 "),z.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:`qa-bot-login-button ${r?"qa-bot-header-login-button":""} ${t}`,style:Object.assign(Object.assign({},a),n),onClick:()=>{o({type:"chatbot_login_clicked",loginUrl:e})}},"Log In"))},ZE=()=>z.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"},z.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"},z.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),z.createElement("circle",{cx:"12",cy:"7",r:"4"}))),eS=[];for(let e=0;e<256;++e)eS.push((e+256).toString(16).slice(1));let tS;const nS=new Uint8Array(16);var rS={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function oS(e,t,n){if(rS.randomUUID&&!e)return rS.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!tS){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tS=crypto.getRandomValues.bind(crypto)}return tS(nS)}();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(eS[e[t+0]]+eS[e[t+1]]+eS[e[t+2]]+eS[e[t+3]]+"-"+eS[e[t+4]]+eS[e[t+5]]+"-"+eS[e[t+6]]+eS[e[t+7]]+"-"+eS[e[t+8]]+eS[e[t+9]]+"-"+eS[e[t+10]]+eS[e[t+11]]+eS[e[t+12]]+eS[e[t+13]]+eS[e[t+14]]+eS[e[t+15]]).toLowerCase()}(r)}function aS(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const iS="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",lS="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",sS="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",cS="background: #f97316; color: white; padding: 2px 6px; border-radius: 3px;",uS="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",AS="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",dS=()=>{aS()&&console.log("%c QA Bot Core %c v0.2.34 ",uS,AS)},fS=(e,...t)=>{aS()&&console.log(`%c[Session]%c ${e}`,iS,"",...t)},pS=(e,...t)=>{aS()&&console.log(`%c[History]%c ${e}`,lS,"",...t)},hS=(e,t)=>{aS()&&console.log(`%c[Message]%c ${e}`,sS,"",t)},gS=(e,...t)=>{aS()&&console.log(`%c[Turnstile]%c ${e}`,cS,"",...t)},mS=(...e)=>{console.warn(...e)},vS=(...e)=>{console.error(...e)},bS="qa_bot_session_messages",yS=()=>`qa_bot_session_${oS()}`,wS=()=>{try{const e=localStorage.getItem(bS);return e?JSON.parse(e):{}}catch(e){return{}}},xS=(e,t,n,r,o)=>{const a=wS();!a[e]&&(a[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},pS("NEW session created",{sessionId:e.slice(-12)}));const i=a[e].messages.some(e=>e.id===t);if(i)return void pS("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()};a[e].messages.push(l),pS("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:a[e].messages.length});const s=a[e].messages,c=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(c){const t=c.content;a[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&&!a[e].preview){const n=t.content;a[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])=>new Date(e.startedAt).getTime()-new Date(t.startedAt).getTime())[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(bS,JSON.stringify(e))})(a),pS("STORAGE state",{ourSessions:Object.keys(a).length,ourTotalMessages:Object.values(a).reduce((e,t)=>e+t.messages.length,0)})},kS=e=>{var t,n;return null!==(n=null===(t=wS()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},ES=e=>{const t=wS()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},SS=j.createContext(void 0),CS=({children:e,getSessionId:t,setSessionId:n,resetSession:r,clearResettingFlag:o})=>z.createElement(SS.Provider,{value:{getSessionId:t,setSessionId:n,resetSession:r,clearResettingFlag:o}},e),PS=()=>{const e=j.useContext(SS);if(!e)throw new Error("useSession must be used within a SessionProvider");return e},BS=()=>{const[e,t]=j.useState(!1),[n,r]=j.useState([]),[o,a]=j.useState(null),[i,l]=j.useState(0),s=j.useRef(null),c=j.useRef(null),{replaceMessages:u}=Bb(),{toggleTextAreaDisabled:A}=Ib(),{setSessionId:d,getSessionId:f}=PS();j.useEffect(()=>{var n,r;const o=e=>{s.current&&!s.current.contains(e.target)&&c.current&&!c.current.contains(e.target)&&t(!1)},a=null!==(r=null===(n=s.current)||void 0===n?void 0:n.getRootNode())&&void 0!==r?r:document;return e&&a.addEventListener("mousedown",o),()=>{a.removeEventListener("mousedown",o)}},[e]);const p=e=>{var n;const r=f();if(pS("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==r?void 0:r.slice(-12)}),e===r)return pS("RESTORE skipped - already on this session"),void t(!1);const o=(e=>{var t;return(null===(t=wS()[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()});pS("Stored messages from our localStorage",{count:o.length,ids:o.map(e=>e.id.slice(-8))});const a=o.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));var i;d(e),pS("Session ID updated",{newSession:e.slice(-12)}),u(a),pS("replaceMessages called",{count:a.length}),i=null===(n=c.current)||void 0===n?void 0:n.getRootNode(),setTimeout(()=>{const e=(i||document).querySelector(".rcb-chat-body-container");e&&e.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("<a href=")&&(n=n.replace(/<a\s+href=["']([^"']+)["'][^&]*>([^&]+)<\/a>/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),(n.includes("<a ")||(null===(t=e.textContent)||void 0===t?void 0:t.includes("<a href=")))&&(e.textContent||"").includes("<a href=")&&(n=n.replace(/<a\s+href="([^"]+)"[^&]*>([^&]+)<\/a>/gi,'<a href="$1" target="_blank" rel="noopener noreferrer">$2</a>'),r=!0),r&&(e.innerHTML=n)})},50),A(!1),pS("Chat input enabled after restore"),t(!1)};return z.createElement("div",{style:{position:"relative"}},z.createElement("button",{ref:c,className:"history-button",onClick:()=>{if(!e&&(r((()=>{const e=wS();return Object.entries(e).map(([e,t])=>Object.assign({sessionId:e},t)).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();a(t.width+3),l(t.right-n.right-18+4)}}t(!e)},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":e,"aria-haspopup":"menu"},z.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"},z.createElement("circle",{cx:"12",cy:"12",r:"10"}),z.createElement("polyline",{points:"12 6 12 12 16 14"}))),e&&z.createElement("div",{ref:s,role:"menu",style:{position:"absolute",right:i?`-${i}px`:"-18px",top:"100%",marginTop:"8px",width:o?`${o}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===n.length?z.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):n.map(e=>z.createElement("button",{key:e.sessionId,role:"menuitem",onClick:()=>p(e.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"}},z.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.preview||"New conversation"),z.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"})})(e.startedAt))))))},DS=({width:t=24,height:n=24,color:r="currentColor",children:o,...a})=>z.createElement("svg",e({xmlns:"http://www.w3.org/2000/svg",width:t,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},a),o),TS=e=>z.createElement(DS,e,z.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"})),IS=()=>{const{restartFlow:e}=Pb(),{setTextAreaValue:t}=Ib(),{messages:n}=Bb(),{getSessionId:r,resetSession:o,clearResettingFlag:a}=PS(),{trackEvent:i}=JE();return z.createElement("button",{onClick:async()=>{const n=r(),l=n?kS(n):0;i({type:"chatbot_new_chat",previousMessageCount:l}),o(),await t(""),await e(),setTimeout(()=>{a()},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)"}},z.createElement(TS,{width:16,height:16}),"New Chat")};function QS(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(QS).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return QS(t.children)}return""}const MS=()=>{const{getSessionId:e}=PS(),t=j.useCallback(t=>{var n;const r=null===(n=t.data)||void 0===n?void 0:n.message;if(!(null==r?void 0:r.id))return;const o=r.sender,a=r.type||"string";let i;if(i="string"==typeof r.content?r.content:QS(r.content),hS("TRACKED",{id:r.id,sender:o,content:i.substring(0,50)+(i.length>50?"...":"")}),i.includes("rcb-options-container"))return;if(!i.trim())return;const l=e();xS(l,r.id,i,o,a)},[e]);return j.useEffect(()=>(window.addEventListener("rcb-pre-inject-message",t),()=>{window.removeEventListener("rcb-pre-inject-message",t)}),[t]),null},OS=()=>(j.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 a=[];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];a=Array.from(e.querySelectorAll(".rcb-options"))}}if(0===a.length)return;const i=a.findIndex(e=>e===document.activeElement);switch(e.key){case"ArrowDown":case"ArrowRight":{let t;e.preventDefault(),t=i<a.length-1?i+1:0,a[t].setAttribute("tabindex","0"),a.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),a[t].classList.add("keyboard-focused"),a[t].focus();break}case"ArrowUp":case"ArrowLeft":{let t;e.preventDefault(),t=i>0?i-1:a.length-1,a[t].setAttribute("tabindex","0"),a.forEach((e,n)=>{n!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),a[t].classList.add("keyboard-focused"),a[t].focus();break}case"Enter":case" ":if(e.preventDefault(),document.activeElement&&a.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",a=e.querySelector(".rcb-checkbox-mark"),i=a&&a.style.backgroundColor?"checked":"unchecked";t(`${o} ${i}`)}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(),a.length>0&&(a[0].setAttribute("tabindex","0"),a.forEach((e,t)=>{0!==t&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))}),a[0].classList.add("keyboard-focused"),a[0].focus());break;case"End":if(e.preventDefault(),a.length>0){const e=a.length-1;a[e].setAttribute("tabindex","0"),a.forEach((t,n)=>{n!==e&&(t.setAttribute("tabindex","-1"),t.classList.remove("keyboard-focused"))}),a[e].classList.add("keyboard-focused"),a[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 a=o[o.length-1],i=Array.from(a.querySelectorAll(".rcb-options-container")).filter(e=>null!==e.offsetParent);let l=[];if(i.length>0){const e=i[i.length-1];l=Array.from(e.querySelectorAll(".rcb-options"))}if(0===l.length){let e=a.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(l.length>0){if(l.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",l.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),l.length>1){const e=i.length>0?i[i.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=i.length>0?i[i.length-1]:null;if(e){e.querySelectorAll(".keyboard-nav-hint").forEach(e=>e.remove())}}setTimeout(()=>{l[0]&&null!==l[0].offsetParent&&!r&&(l[0].focus(),l.length>1&&t(`${l.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 LS=!1,RS=null;function NS(){return LS?Promise.resolve():RS||(RS=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=()=>{LS=!0,gS("Script loaded"),e()},n.onerror=()=>{RS=null,t(new Error("Failed to load Turnstile script"))},document.head.appendChild(n)}),RS)}const FS=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},jS=({siteKey:e,onVerify:t,onError:n})=>{const r=j.useRef(null),o=j.useRef(!1);return j.useEffect(()=>{!o.current&&r.current&&(o.current=!0,NS().then(()=>{const o=window.turnstile;if(!o||!r.current)return vS("Turnstile API not available after script load"),void(null==n||n());o.render(r.current,{sitekey:e,callback:e=>{gS("Visible challenge completed"),t(e)},"error-callback":()=>{vS("Turnstile challenge failed"),null==n||n()},"expired-callback":()=>{vS("Turnstile token expired"),null==n||n()}})}).catch(e=>{vS("Failed to load Turnstile script:",e),null==n||n()}))},[e,t,n]),z.createElement("div",{style:{padding:"8px 16px"}},z.createElement("div",{ref:r,style:{borderRadius:"8px",overflow:"hidden"}}))};function zS(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 _S({getState:e,onResubmit:t,trackEvent:n,loginUrl:r}){const[o,a]=z.useState(!1),i=e();if(!i.siteKey)return null;if(o){const e=r&&"/login"!==r;return z.createElement("div",{style:{padding:"8px 16px",fontSize:"14px",lineHeight:"1.5"}},z.createElement("p",{style:{margin:0}},"I'm having trouble verifying your session. Please try"," ",z.createElement("a",{href:"",onClick:e=>{e.preventDefault(),window.location.reload()},style:{color:"var(--primaryColor, #107180)"}},"refreshing the page"),e&&z.createElement(z.Fragment,null,", or"," ",z.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--primaryColor, #107180)",fontWeight:"bold"}},"log in")),"."))}return z.createElement(jS,{siteKey:i.siteKey,onVerify:e=>{i.token=e,null==n||n({type:"chatbot_turnstile_completed"}),t(e)},onError:()=>{a(!0),null==n||n({type:"chatbot_turnstile_error"})}})}const HS="#1a5b6e",US="#107180",qS="Arial, sans-serif",VS="Q&A Bot",WS="/chat-icon.svg",YS="Type your question here...",GS="Select an option to continue",XS=!1,KS="Ask me a question!",JS="/login",$S={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}},ZS=j.forwardRef((e,t)=>{var n,r,o;const{apiKey:a,qaEndpoint:i,ratingEndpoint:l,capabilitiesEndpoint:s,agentRatingEndpoint:c,welcomeMessage:u,open:A,onOpenChange:d,isLoggedIn:f,allowAnonAccess:p=!1,actingUser:h,primaryColor:g,secondaryColor:m,botName:v,logo:b,placeholder:y,errorMessage:w,embedded:x,footerText:k,footerLink:E,tooltipText:S,loginUrl:C,turnstileSiteKey:P,resourceContext:B,customFlow:D,onAnalyticsEvent:T}=e,I=j.useRef(`bot_${Math.random().toString(36).substr(2,9)}`);j.useEffect(()=>{dS()},[]);const Q=j.useRef(null);null===Q.current&&(Q.current=yS(),fS("CREATED",Q.current));const M=j.useRef(!1),O=j.useRef({getSessionId:()=>Q.current,isResetting:()=>M.current}),L=function(e){const[t,n]=j.useState(null),[r,o]=j.useState("idle"),a=j.useRef(null),i=j.useRef(null),l=j.useRef(!0),s=j.useCallback(()=>{const e=window.turnstile;if(i.current&&(null==e?void 0:e.remove)){try{e.remove(i.current)}catch(e){}i.current=null}a.current&&(a.current.remove(),a.current=null)},[]);return j.useEffect(()=>{if(l.current=!0,!e)return o("idle"),void n(null);o("loading");const t=document.createElement("div");return t.style.position="fixed",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.setAttribute("aria-hidden","true"),document.body.appendChild(t),a.current=t,NS().then(()=>{if(!l.current)return;const t=window.turnstile;if(!t||!a.current)return vS("Turnstile API not available for silent verification"),void o("failed");const r=t.render(a.current,{sitekey:e,execution:"render","refresh-expired":"auto",callback:e=>{l.current&&(gS("Silent verification succeeded"),n(e),o("verified"))},"error-callback":()=>{l.current&&(vS("Turnstile silent verification failed"),o("failed"))},"expired-callback":()=>{l.current&&(gS("Token expired, awaiting refresh"),n(null),o("loading"))}});i.current=r}).catch(e=>{l.current&&(vS("Failed to load Turnstile script for silent verification:",e),o("failed"))}),()=>{l.current=!1,s()}},[e,s]),{token:t,status:r}}(P),R=j.useRef(null);R.current=L.token;const[N,F]=j.useState(f);j.useEffect(()=>{F(f)},[f]);const _=void 0!==x?x:XS,H=j.useCallback(e=>{var t;T&&T(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(t=Q.current)&&void 0!==t?t:void 0,pageUrl:"undefined"!=typeof window?window.location.href:void 0,isEmbedded:_}))},[T,_]),U=j.useMemo(()=>{const e=Object.assign({},$S);e.general=Object.assign(Object.assign({},e.general),{primaryColor:g||HS,secondaryColor:m||US,fontFamily:qS,embedded:_});const t=!1===N?[z.createElement($E,{key:"login-button",loginUrl:C||JS,isHeaderButton:!0})]:[z.createElement(BS,{key:"history-button"}),z.createElement(ZE,{key:"user-icon"})];e.header={title:z.createElement("span",{style:{fontSize:14,fontWeight:500}},v||VS),showAvatar:!0,avatar:b||WS,buttons:[...t,Kg.CLOSE_CHAT_BUTTON]},e.chatInput=Object.assign(Object.assign({},e.chatInput),{disabled:!1,enabledPlaceholderText:y||YS,disabledPlaceholderText:w||GS}),e.tooltip=Object.assign(Object.assign({},e.tooltip),{text:S||KS});const n=k?E?z.createElement("a",{href:E,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},k):z.createElement("span",{key:"footer-text"},k):null;return e.footer={text:n,buttons:[z.createElement(IS,{key:"new-chat-button"})]},e.chatWindow=Object.assign(Object.assign({},e.chatWindow),{defaultOpen:!!_}),e.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},e},[g,m,v,b,y,w,_,S,N,C,k,E]),q=j.useRef(null),V=((e,t={})=>j.useMemo(()=>{const n=(t,n)=>{if(e.current){const n=getComputedStyle(e.current).getPropertyValue(t);if(n&&""!==n.trim())return n.trim();if(e.current.parentElement){const n=getComputedStyle(e.current.parentElement).getPropertyValue(t);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:n("--primaryColor",t.primaryColor),secondaryColor:n("--secondaryColor",t.secondaryColor),fontFamily:n("--fontFamily",t.fontFamily)}},[e,t]))(q,U.general);((e,t)=>{j.useEffect(()=>{t.current&&(e?t.current.classList.add("bot-logged-in"):t.current.classList.remove("bot-logged-in"))},[e,t])})(!1!==N,q),(({settings:e,themeColors:t})=>{j.useEffect(()=>{t&&(Object.entries(t).forEach(([e,t])=>{t&&document.documentElement.style.setProperty(`--${e}`,t)}),t.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",t.primaryColor),t.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",t.secondaryColor))},[t]),j.useEffect(()=>{var t,n;(null===(t=e.header)||void 0===t?void 0:t.title)&&"string"==typeof e.header.title&&(e.header.title=z.createElement("div",{key:"header-title"},z.createElement("h1",{className:"sr-only"},e.header.title),z.createElement("span",{"aria-hidden":"true"},e.header.title))),e.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},e.chatHistory={disabled:!0},e.chatButton=Object.assign(Object.assign({},e.chatButton),{icon:null===(n=e.header)||void 0===n?void 0:n.avatar}),e.event=Object.assign(Object.assign({},e.event),{rcbToggleChatWindow:!0})},[e])})({settings:U,themeColors:V});const W=j.useMemo(()=>{const t=(({endpoint:e,ratingEndpoint:t,agentRatingEndpoint:n,apiKey:r,sessionId:o,isResetting:a=()=>!1,isLoggedIn:i,allowAnonAccess:l=!1,loginUrl:s="/login",actingUser:c,trackEvent:u,getTurnstileToken:A,backendId:d,resourceContext:f})=>{if(!1===i&&!l)return null==u||u({type:"chatbot_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:z.createElement($E,{loginUrl:s}),chatDisabled:!0,path:"qa_loop"}};let p=null,h=null,g=!1;const m={siteKey:null,token:null,pendingQuery:null,needsChallenge:!1};let v=null;if(!e)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async i=>{var l;v=i.injectMessage.bind(i);const{userInput:s}=i;if(a&&a())return null;if(!s||""===s.trim())return null;if("👍 Helpful"===s||"👎 Not helpful"===s){if(p){const e="👍 Helpful"===s,a="agent"===h?n:t;if(a)try{const t={"Content-Type":"application/json"};r&&(t["X-API-KEY"]=r);const n=o();n&&(t["X-Session-ID"]=n,t["X-Query-ID"]=p);const i="agent"===h?{query_id:p,rating:e?"helpful":"not_helpful",session_id:n}:{sessionId:n,queryId:p,rating:e?1:0};await fetch(a,{method:"POST",headers:t,credentials:"include",body:JSON.stringify(i)}),null==u||u({type:"chatbot_rating_sent",queryId:p,rating:e?"helpful":"not_helpful"})}catch(e){vS("Error sending feedback:",e)}}return"Thanks for the feedback!"}try{const t=oS();p=t,null==u||u({type:"chatbot_question_sent",queryId:t,questionLength:s.length});const n={"Content-Type":"application/json"};r&&(n["X-API-KEY"]=r);const a=o();a&&(n["X-Session-ID"]=a,n["X-Query-ID"]=t);const c={query:s,session_id:a,question_id:t};d&&(c._backend=d),f&&(c.resource_context=f);const v=null==A?void 0:A();v&&(c.turnstile_token=v),fS("SENT to API",{session_id:a,question_id:t});const b=Date.now(),y=await fetch(e,{method:"POST",headers:n,credentials:"include",body:JSON.stringify(c)});if(!y.ok)throw new Error(`API returned ${y.status}`);if((y.headers.get("content-type")||"").includes("text/event-stream")){const e=null===(l=y.body)||void 0===l?void 0:l.getReader();if(!e)throw new Error("Response body is not readable");const n=new TextDecoder;let r="",o="",a=!1;try{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="",l="";for(const t of e.split("\n"))t.startsWith("event: ")?n=t.slice(7):t.startsWith("data: ")&&(l=t.slice(6));if(n&&l){try{t=JSON.parse(l)}catch(e){mS("Failed to parse SSE data:",l),s=r.indexOf("\n\n");continue}if("status"===n){const e=t.message||"Processing...";await i.streamMessage(`_${e}_`,"BOT"),a=!0}else if("token"===n){o+=t.content||"";const e=FS(o);await i.streamMessage(e,"BOT")}else if("done"===n){const e=t.metadata||{};if(h=e.rating_target||null,g=!0===e.is_final_response,o)console.log("[SSE DEBUG] done: tokenContent exists, skipping streamMessage, calling endStreamMessage"),await i.endStreamMessage("BOT");else{const e=t.response||"";if(e){const t=FS(e);await i.streamMessage(t,"BOT"),a=!0}a&&await i.endStreamMessage("BOT")}}else if("error"===n){const e=t.message||"An error occurred";vS("SSE error event:",e),a?(await i.streamMessage(e,"BOT"),await i.endStreamMessage("BOT")):await i.injectMessage(e)}s=r.indexOf("\n\n")}else s=r.indexOf("\n\n")}}a&&await i.endStreamMessage("BOT")}catch(e){if(vS("Error reading SSE stream:",e),!a)throw e;await i.streamMessage("I had trouble completing the response. Please try again.","BOT"),await i.endStreamMessage("BOT")}const s=Date.now()-b;return null==u||u({type:"chatbot_answer_received",queryId:t,responseTimeMs:s,success:!0,responseLength:o.length}),null}const w=Date.now()-b,x=await y.json();if(x.requires_turnstile)return null==u||u({type:"chatbot_turnstile_shown",queryId:t}),m.siteKey=x.site_key,m.pendingQuery={query:s,sessionId:a,queryId:t},m.needsChallenge=!0,"One moment — verifying your session…";const k=x.response||x.answer||x.text||x.message;if(!k)throw new Error("Invalid response format from API");const E=x.metadata||{};h=E.rating_target||null,g=!0===E.is_final_response;const S=FS(k),C=aS()?zS(x):"",P=C?`${S}\n\n${C}`:S;return await i.injectMessage(P),null==u||u({type:"chatbot_answer_received",queryId:t,responseTimeMs:w,success:!0,responseLength:k.length,hasMetadata:!!C}),null}catch(e){return vS("Error in Q&A flow:",e),null==u||u({type:"chatbot_answer_error",queryId:null!=p?p: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=>a&&a()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput||m.needsChallenge?[]:g&&h&&("agent"===h?n:t)?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,component:z.createElement(_S,{getState:()=>m,onResubmit:async t=>{var n;if(m.pendingQuery&&v)try{const o={"Content-Type":"application/json"};r&&(o["X-API-KEY"]=r),m.pendingQuery.sessionId&&(o["X-Session-ID"]=m.pendingQuery.sessionId,o["X-Query-ID"]=m.pendingQuery.queryId);const a={query:m.pendingQuery.query,session_id:m.pendingQuery.sessionId,question_id:m.pendingQuery.queryId,turnstile_token:t};d&&(a._backend=d),f&&(a.resource_context=f);const i=await fetch(e,{method:"POST",headers:o,credentials:"include",body:JSON.stringify(a)}),l=m.pendingQuery.queryId;if(!i.ok)throw new Error(`API returned ${i.status} after Turnstile`);if((i.headers.get("content-type")||"").includes("text/event-stream")){const e=null===(n=i.body)||void 0===n?void 0:n.getReader();if(!e)throw new Error("Response body is not readable");const t=new TextDecoder;let r="",o="",a={};for(;;){const{done:n,value:i}=await e.read();if(n)break;r+=t.decode(i,{stream:!0});let l=r.indexOf("\n\n");for(;-1!==l;){const e=r.slice(0,l);r=r.slice(l+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&&(a=e.metadata||{})}catch(e){}l=r.indexOf("\n\n")}}if(m.token=null,m.pendingQuery=null,m.needsChallenge=!1,m.siteKey=null,!o)throw new Error("No content received from stream");h=a.rating_target||null,g=!0===a.is_final_response,p=l;const s=FS(o);return await v(s),void(null==u||u({type:"chatbot_answer_received",queryId:l,success:!0,responseLength:o.length}))}const s=await i.json();if(s.requires_turnstile)return m.siteKey=s.site_key,m.token=null,void await v("Still verifying — please complete the challenge again.");m.token=null,m.pendingQuery=null,m.needsChallenge=!1,m.siteKey=null;const c=s.response||s.answer||s.text||s.message;if(!c)throw new Error("Invalid response format from API");const A=s.metadata||{};h=A.rating_target||null,g=!0===A.is_final_response,p=l;const b=FS(c),y=aS()?zS(s):"",w=y?`${b}\n\n${y}`:b;await v(w),null==u||u({type:"chatbot_answer_received",queryId:l,success:!0,responseLength:c.length})}catch(e){vS("Error resubmitting after Turnstile:",e),m.token=null,m.pendingQuery=null,m.needsChallenge=!1,m.siteKey=null,await(null==v?void 0:v("I had trouble processing your question after verification. Please try again."))}},trackEvent:u,loginUrl:s}),path:"qa_loop"}}})({endpoint:i,ratingEndpoint:l,agentRatingEndpoint:c,apiKey:a,sessionId:O.current.getSessionId,isResetting:O.current.isResetting,isLoggedIn:N,allowAnonAccess:p,loginUrl:C||JS,actingUser:h,trackEvent:H,getTurnstileToken:()=>R.current,backendId:e.backendId,resourceContext:B}),n={message:u,renderMarkdown:["BOT"],transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},t),D||{})},[a,i,l,c,u,N,p,C,D,h,H,B]),Y=j.useMemo(()=>[cy(),UE(),YE()],[]);return j.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)},[]),OS(),j.useEffect(()=>{const e=q.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")||H({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)},[H]),j.useEffect(()=>{if(!_){const e=e=>{const t=e.data.newState;null==d||d(t);const n=Q.current;H(t?{type:"chatbot_open"}:{type:"chatbot_close",messageCount:n?kS(n):0,durationMs:n?ES(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[_,d,H]),z.createElement("div",{className:"qa-bot "+((null===(n=U.general)||void 0===n?void 0:n.embedded)?"embedded-qa-bot":""),ref:q,role:"region","aria-label":`${v||VS}${(null===(r=U.general)||void 0===r?void 0:r.embedded)?" - Embedded":""}`},z.createElement(CS,{getSessionId:()=>Q.current,setSessionId:e=>{const t=Q.current;Q.current=e,fS("RESTORED",`${null==t?void 0:t.slice(-12)} -> ${e.slice(-12)}`)},resetSession:()=>{const e=Q.current;M.current=!0,Q.current=yS(),fS("RESET",`${null==e?void 0:e.slice(-12)} -> ${Q.current.slice(-12)}`)},clearResettingFlag:()=>{M.current=!1}},z.createElement(KE,{trackEvent:H},z.createElement(wb,null,z.createElement("div",null,z.createElement(MS,null),z.createElement(GE,{ref:t,embedded:(null===(o=U.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:A||!1,enabled:!1!==N,onSetEnabled:e=>F(!!e&&void 0)}),z.createElement(Sb,{key:`chatbot-${I.current}-${N}`,settings:U,flow:W,plugins:Y}),z.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}}),z.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."))))))});ZS.displayName="QABot";Xu('.rcb-chat-window{height:800px!important;max-height:80vh!important;max-width:100%;width:550px!important}.rcb-chat-window .rcb-chat-header{align-items:center;display:flex;flex-direction:row;font-weight:700}.rcb-chat-window a{color:#000;font-weight:700;text-decoration:underline}.rcb-chat-window a:hover{color:var(--primaryColor,#107180)}.rcb-chat-window .rcb-bot-message a,.rcb-chat-window .rcb-bot-message a:link,.rcb-chat-window .rcb-bot-message a:visited{color:#fff!important;text-decoration:underline!important}.rcb-chat-window .rcb-bot-message a:hover{opacity:.85;text-decoration:underline!important}.rcb-chat-window .rcb-chat-input-textarea{overflow-y:auto}.rcb-chat-window .rcb-chat-footer-container{font-size:10px}.qa-bot .history-button,.qa-bot .user-login-icon{display:none!important}.qa-bot.bot-logged-in .history-button,.qa-bot.bot-logged-in .user-login-icon{display:flex!important;transform:scale(1.3) translateY(-2px)}.qa-bot.bot-logged-in .history-button:hover{opacity:.8}.qa-bot.bot-logged-in .history-button:focus{outline:2px solid #fff;outline-offset:2px}.embedded-qa-bot .rcb-chat-window{max-width:100%;width:100%!important}.qa-bot.hidden{display:none}.embedded-qa-bot .rcb-bot-message,.embedded-qa-bot .rcb-user-message{max-width:90%!important;word-break:break-word}.embedded-qa-bot .rcb-chat-input-textarea{width:100%!important}.qa-bot-container{max-width:100%;width:100%}.rcb-chat-tooltip{background-color:#1a5b6e;color:#fff}.rcb-chat-tooltip-tail{border-color:#0000 #0000 #0000 #1a5b6e}@keyframes phone-ring{0%{transform:translateX(0) translateY(0) rotate(0deg)}2%{transform:translateX(0) translateY(-8px) rotate(-2deg)}4%{transform:translateX(0) translateY(-6px) rotate(2deg)}6%{transform:translateX(0) translateY(-8px) rotate(-1deg)}8%{transform:translateX(0) translateY(-6px) rotate(1deg)}10%{transform:translateX(0) translateY(-8px) rotate(-2deg)}12%{transform:translateX(0) translateY(-6px) rotate(2deg)}20%{transform:translateX(0) translateY(0) rotate(0deg)}30%{transform:translateX(0) translateY(0) rotate(0deg)}40%{transform:translateX(0) translateY(0) rotate(0deg)}49%{transform:translateX(0) translateY(0) rotate(0deg)}50%{transform:translateX(0) translateY(-8px) rotate(-2deg)}52%{transform:translateX(0) translateY(-6px) rotate(2deg)}54%{transform:translateX(0) translateY(-8px) rotate(-1deg)}56%{transform:translateX(0) translateY(-6px) rotate(1deg)}58%{transform:translateX(0) translateY(-8px) rotate(-2deg)}60%{transform:translateX(0) translateY(-6px) rotate(2deg)}70%{transform:translateX(0) translateY(0) rotate(0deg)}to{transform:translateX(0) translateY(0) rotate(0deg)}}@media (max-width:768px){.rcb-chat-window{max-height:calc(100vh - 100px)!important;max-width:calc(100vw - 40px)!important;width:550px!important}.embedded-chat-container.open{height:400px}.embedded-chat-closed{font-size:14px;height:40px}.embedded-chat-open-btn{font-size:12px;padding:3px 10px}.rcb-bot-message,.rcb-user-message{max-width:85%!important}.rcb-chat-input-textarea{font-size:16px!important;min-height:44px!important}.rcb-chat-header{padding:12px 16px!important}}@media (max-width:480px){.rcb-chat-window{bottom:10px!important;left:10px!important;max-height:calc(100vh - 80px)!important;max-width:calc(100vw - 20px)!important;right:10px!important;width:calc(100vw - 20px)!important}.embedded-chat-container.open{height:350px}.rcb-bot-message,.rcb-user-message{margin-bottom:8px!important;max-width:90%!important}.rcb-chat-header{font-size:14px!important;padding:8px 12px!important}.rcb-chat-button{bottom:20px!important;height:50px!important;right:20px!important;width:50px!important}.rcb-chat-footer-container{font-size:9px!important;padding:8px 12px!important}}@media (max-width:360px){.rcb-chat-window{left:5px!important;max-width:calc(100vw - 10px)!important;right:5px!important;width:calc(100vw - 10px)!important}.rcb-chat-header{font-size:13px!important;padding:6px 8px!important}}.rcb-checkbox-container{display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin-left:16px!important;max-width:100%!important;padding-top:12px!important}.rcb-checkbox-row-container{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--primaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-row-container:hover{background-color:#e8f4f8!important;border-color:var(--primaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-row-container[data-checked=true]{background-color:var(--primaryColor,#107180)!important;border-color:var(--primaryColor,#107180)!important;color:#fff!important}.rcb-checkbox-row{margin-left:0!important}.rcb-checkbox-mark{height:14px!important;margin-right:6px!important;width:14px!important}.rcb-checkbox-label{font-size:13px!important;margin:0!important;white-space:nowrap!important}.rcb-checkbox-next-button{align-items:center!important;background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;display:flex!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;justify-content:center!important;line-height:24px!important;margin:0!important;max-height:auto!important;min-height:auto!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-checkbox-next-button:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.sr-only{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.rcb-chat-input-send-button:focus,.rcb-chat-input-textarea:focus{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-bot-message ol,.rcb-bot-message ul{list-style-position:outside!important;margin:.5em 0!important;padding-left:1.5em!important}.rcb-bot-message li{margin-bottom:.25em!important}.rcb-bot-message li>p{display:inline!important;margin:0!important}.rcb-user-message{word-wrap:break-word!important;overflow:hidden!important;word-break:break-word!important}:focus-visible{outline:2px solid var(--primaryColor,#107180)!important;outline-offset:2px!important}.rcb-options-container{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;gap:8px!important;margin:16px!important;padding:0!important}.rcb-options{background-color:#fff!important;border:1px solid #d0d0d0!important;border-radius:6px!important;box-sizing:border-box!important;color:var(--secondaryColor,#107180)!important;cursor:pointer!important;flex:0 0 auto!important;font-size:14px!important;font-weight:400!important;outline:none!important;padding:8px 12px!important;text-align:center!important;transition:all .2s ease!important;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:auto!important}.rcb-options:hover{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;box-shadow:0 2px 4px #10718033!important;transform:translateY(-1px)!important}.rcb-checkbox-next-button.keyboard-focused,.rcb-checkbox-next-button:focus,.rcb-checkbox-next-button:focus-visible,.rcb-checkbox-row-container.keyboard-focused,.rcb-checkbox-row-container:focus,.rcb-checkbox-row-container:focus-visible,.rcb-options.keyboard-focused,.rcb-options:focus,.rcb-options:focus-visible{background-color:#e8f4f8!important;border-color:var(--secondaryColor,#107180)!important;outline:none!important}.rcb-options:active{background-color:var(--secondaryColor,#107180)!important;border-color:var(--secondaryColor,#107180)!important;color:#fff!important;transform:translateY(0)!important}.keyboard-nav-hint{color:#666!important;font-size:12px!important;font-style:italic!important;margin-bottom:8px!important}@media (prefers-reduced-motion:reduce){.keyboard-nav-hint{display:none!important}}.rcb-options-container [role=button][tabindex="0"],.rcb-options-container button[tabindex="0"]{position:relative!important}.rcb-options-container [role=button][tabindex="0"]:after,.rcb-options-container button[tabindex="0"]:after{color:var(--secondaryColor,#107180)!important;content:"←"!important;font-size:16px!important;opacity:0!important;position:absolute!important;right:12px!important;top:50%!important;transform:translateY(-50%)!important;transition:opacity .2s ease!important}.rcb-options-container [role=button][tabindex="0"]:focus:after,.rcb-options-container button[tabindex="0"]:focus:after{opacity:1!important}.rcb-chat-input-send-button{cursor:pointer!important;opacity:1!important;pointer-events:auto!important;visibility:visible!important}.rcb-chat-input-send-button:not([tabindex]){-webkit-user-select:none;-moz-user-select:none;user-select:none}.rcb-chat-input-container [onclick],.rcb-chat-input-container [role=button],.rcb-chat-input-container div[style*=cursor],.rcb-chat-input-container svg:last-child,.rcb-chat-input-container>div:last-child{tabindex:0!important;cursor:pointer!important}.rcb-chat-footer{margin-top:4px!important;padding-top:0!important}.rcb-chat-footer-container{align-items:center!important;display:flex!important;margin-top:4px!important;padding-top:4px!important}.rcb-chat-footer-container button{order:1!important}.rcb-chat-footer-container a[href*=qa-bot-core]{tab-index:0!important;order:2!important}.rcb-chat-footer-container a[href*=feedback]{tab-index:0!important;order:3!important}@media (prefers-contrast:high){.rcb-chat-window a{background-color:#fff!important;border:1px solid #000!important;color:#000!important}}@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}.rcb-chat-input-textarea{user-select:text!important}.rcb-chat-body-container,.rcb-chat-input-textarea,.rcb-chat-window{touch-action:pan-y!important}.embedded-qa-bot,.rcb-chat-window{-webkit-overflow-scrolling:touch!important}.embedded-qa-bot .rcb-chat-input-textarea{touch-action:pan-y!important;user-select:text!important}.embedded-qa-bot .rcb-chat-body-container,.embedded-qa-bot .rcb-chat-window{touch-action:pan-y!important}.rcb-chat-header-container{background:var(--primaryColor,#1a5b6e)!important;background:linear-gradient(135deg,var(--primaryColor,#1a5b6e) 0,var(--secondaryColor,#107180) 100%)!important}.rcb-toggle-button{align-items:center!important;background:var(--primaryColor,#1a5b6e)!important;display:flex!important;justify-content:center!important}.rcb-toggle-button svg{stroke:#fff!important;color:#fff!important}.rcb-toggle-button *,.rcb-toggle-button img,.rcb-toggle-button svg,.rcb-toggle-button>*{box-sizing:border-box!important;height:50px!important;left:0!important;margin:0 auto!important;max-height:50px!important;max-width:50px!important;min-height:50px!important;min-width:50px!important;padding:2px!important;position:relative!important;top:0!important;width:50px!important}.rcb-send-button{background-color:var(--primaryColor,#1a5b6e)!important}',{insertAt:"top"});const eC=z.forwardRef((n,r)=>{var{defaultOpen:o}=n,a=t(n,["defaultOpen"]);const[i,l]=z.useState(o||!1),s=z.useRef(null);return z.useImperativeHandle(r,()=>({addMessage:e=>{var t;null===(t=s.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=s.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;l(!0),null===(e=s.current)||void 0===e||e.openChat()},closeChat:()=>{var e;l(!1),null===(e=s.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;l(e=>!e),null===(e=s.current)||void 0===e||e.toggleChat()}}),[]),z.createElement(ZS,e({ref:s},a,{open:i,onOpenChange:l}))});return eC.displayName="ProgrammaticQABot",function(n){if(!(n.target&&n.target instanceof HTMLElement))return void vS("QA Bot: A valid target DOM element is required");const{target:r}=n,o=t(n,["target"]),a=_.createRoot(r),i={current:null};return a.render(z.createElement(z.StrictMode,null,z.createElement(eC,e({ref:e=>{i.current=e}},o)))),{addMessage:e=>{var t;return null===(t=i.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=i.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{i.current=null,a.unmount()}}}});
|
|
37
37
|
//# sourceMappingURL=qa-bot-core.standalone.js.map
|