@snf/qa-bot-core 0.2.10 → 0.2.11-debug.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/qa-bot-core.js +1 -1
- package/dist/qa-bot-core.js.map +1 -1
- package/dist/qa-bot-core.standalone.js +4 -4
- package/dist/qa-bot-core.standalone.js.map +1 -1
- package/dist/qa-bot-core.umd.cjs +1 -1
- package/dist/qa-bot-core.umd.cjs.map +1 -1
- package/dist/types/utils/logger.d.ts +2 -1
- package/package.json +1 -1
package/dist/qa-bot-core.umd.cjs
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Copyright(c) 2015 Andreas Lubbe
|
|
6
6
|
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
7
7
|
* MIT Licensed
|
|
8
|
-
*/var nn,rn;const on=tn(function(){if(rn)return nn;rn=1;var e=/["'&<>]/;return nn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,A="",i=0,a=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}a!==i&&(A+=n.substring(a,i)),a=i+1,A+=o}return a!==i?A+n.substring(a,i):A}}());function An(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const an=/(url|image|image-set)\(/i;class sn extends en{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(an)&&delete t[e]}),t}}const ln=/^<(!doctype|(html|head|body)(\s|>))/i,cn=/^(aria-|data-|\w+:)/iu,un=/{{{(\w+)\/?}}}/;function dn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let pn=class{constructor(e,t={},n=[],r=[]){var o;if(An(this,"allowed",void 0),An(this,"banned",void 0),An(this,"blocked",void 0),An(this,"container",void 0),An(this,"content",[]),An(this,"props",void 0),An(this,"matchers",void 0),An(this,"filters",void 0),An(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new sn],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:Xt),this.banned=new Set(Vt),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 a=e.asTag().toLowerCase(),s=this.getTagConfig(a);if(r[e.inverseName]||!this.isTagAllowed(a)||!this.canRenderChild(t,s))return;let l="";for(;o&&(i=e.match(o));){const{index:t,length:a,match:s,valid:c,void:u,...d}=i,p=e.propName+String(A);t>0&&(l+=o.slice(0,t)),c?(l+=u?`{{{${p}/}}}`:`{{{${p}}}}${s}{{{/${p}}}}`,this.keyIndex+=1,A+=1,n[p]={children:s,matcher:e,props:{...r,...d,key:this.keyIndex}}):l+=s,e.greedy?(o=l+o.slice(t+a),l=""):o=o.slice(t+(a||s.length))}e.greedy||(o=l+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||dn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(ln)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?on(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:A,value:i}=o,a=A.toLowerCase(),s=Kt[a]||Kt[A];if(!this.isSafe(e)||!a.match(cn)&&(!t&&(!s||2===s)||a.startsWith("on")||i.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let l="style"===a?this.extractStyleAttribute(e):i;4===s?l=!0:3===s?l=Number.parseFloat(String(l)):5!==s&&(l=String(l)),n[Jt[a]||a]=this.applyAttributeFilters(a,l),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 Wt[e]?{...t,...Wt[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:A,transform:i,transformOnlyAllowList:a}=this.props;let s=[],l="";return[...t.childNodes].forEach(t=>{if(1===t.nodeType){const u=t.nodeName.toLowerCase(),d=this.getTagConfig(u);l&&(s.push(l),l="");const p=this.applyNodeFilters(u,t);if(!p)return;let f;if(i&&(!a||this.isTagAllowed(u))){this.keyIndex+=1;const t=this.keyIndex;f=this.parseNode(p,d);const n=i(p,f,d);if(null===n)return;if(typeof n<"u")return void s.push(e.cloneElement(n,{key:t}));this.keyIndex=t-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!A&&!this.canRenderChild(n,d))s=[...s,...this.parseNode(p,d.tagName?d:n)];else{var c;this.keyIndex+=1;const t=this.extractAttributes(p),n={tagName:u};t&&(n.attributes=t),d.void&&(n.selfClose=d.void),s.push(e.createElement($t,{...n,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(p,d)))}}else if(3===t.nodeType){const e=r&&!o?t.textContent:this.applyMatchers(t.textContent||"",n);Array.isArray(e)?s=[...s,...e]:l+=e}}),l&&s.push(l),s}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(un);){const[e,A]=o,i=o.index,a=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[A])throw new Error(`Token "${A}" found but no matching element to replace with.`);i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:s,matcher:l,props:c}=t[A];let u;if(a)u=e.length,n.push(l.createElement(s,c));else{const o=r.match(new RegExp(`{{{/${A}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${A}".`);u=o.index+o[0].length,n.push(l.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function fn(t){var n;const{attributes:r,className:o,containerTagName:A,content:i,emptyContent:a,parsedContent:s,tagName:l,noWrap:c}=t,u=null!==(n=A??l)&&void 0!==n?n:"span",d="fragment"===u||c;let p;if(s)p=s;else{const e=new pn(i??"",t).parse();e.length>0&&(p=e)}return p||(p=a),d?e.createElement(e.Fragment,null,p):e.createElement($t,{attributes:r,className:o,tagName:u},p)}function hn(t){const{attributes:n,className:r,content:o="",disableFilters:A=!1,disableMatchers:i=!1,emptyContent:a=null,filters:s=[],matchers:l=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:p=!1,...f}=t,h=i?[]:l,g=A?[]:s,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const b=m.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new pn(b,f,h,g),y=v.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return e.createElement(fn,{attributes:n,className:r,containerTagName:t.containerTagName,emptyContent:a,noWrap:p,parsedContent:0===y.length?void 0:y,tagName:d})}const gn=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(hn,{content:"string"==typeof e?e:""})}),mn={autoConfig:!0},vn=(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)},bn=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},wn=t=>{const{getFlow:n}=Rt(),{messages:r,replaceMessages:o}=zt(),{settings:A}=Ut(),{hasChatHistoryLoaded:i}=_t(),a={...t,...mn},s=a.htmlComponent?a.htmlComponent:gn;e.useEffect(()=>{var e,t;if(i){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=A.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=s)}o(n)}},[i]);const l=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();"string"==typeof e.data.message.content&&vn(e,n(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=bn),e.data.message.contentWrapper=s,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};Ft(j.PRE_INJECT_MESSAGE,l),Ft(j.CHUNK_STREAM_MESSAGE,l),Ft(j.START_STREAM_MESSAGE,l),Ft(j.START_SIMULATE_STREAM_MESSAGE,l),Ft(j.START_SPEAK_AUDIO,async e=>{vn(e,n(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=a&&a.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const yn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,En={};function Bn(e,t){return(En.jsx?xn:yn).test(e)}const Pn=/[ \t\n\f\r]/g;function kn(e){return""===e.replace(Pn,"")}class Cn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Dn(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 Cn(n,r,t)}function Sn(e){return e.toLowerCase()}Cn.prototype.property={},Cn.prototype.normal={},Cn.prototype.space=null;class In{constructor(e,t){this.property=e,this.attribute=t}}In.prototype.space=null,In.prototype.boolean=!1,In.prototype.booleanish=!1,In.prototype.overloadedBoolean=!1,In.prototype.number=!1,In.prototype.commaSeparated=!1,In.prototype.spaceSeparated=!1,In.prototype.commaOrSpaceSeparated=!1,In.prototype.mustUseProperty=!1,In.prototype.defined=!1;let Tn=0;const Qn=Rn(),Mn=Rn(),On=Rn(),Ln=Rn(),jn=Rn(),Nn=Rn(),Hn=Rn();function Rn(){return 2**++Tn}const zn=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qn,booleanish:Mn,commaOrSpaceSeparated:Hn,commaSeparated:Nn,number:Ln,overloadedBoolean:On,spaceSeparated:jn},Symbol.toStringTag,{value:"Module"})),Fn=Object.keys(zn);class Un extends In{constructor(e,t,n,r){let o=-1;if(super(e,t),qn(this,"space",r),"number"==typeof n)for(;++o<Fn.length;){const e=Fn[o];qn(this,Fn[o],(n&zn[e])===zn[e])}}}function qn(e,t,n){n&&(e[t]=n)}Un.prototype.defined=!0;const _n={}.hasOwnProperty;function Yn(e){const t={},n={};let r;for(r in e.properties)if(_n.call(e.properties,r)){const o=e.properties[r],A=new Un(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(A.mustUseProperty=!0),t[r]=A,n[Sn(r)]=r,n[Sn(A.attribute)]=r}return new Cn(t,n,e.space)}const Gn=Yn({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}}),Wn=Yn({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Vn(e,t){return t in e?e[t]:t}function Xn(e,t){return Vn(e,t.toLowerCase())}const Kn=Yn({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Xn,properties:{xmlns:null,xmlnsXLink:null}}),Jn=Yn({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:Ln,ariaColIndex:Ln,ariaColSpan:Ln,ariaControls:jn,ariaCurrent:null,ariaDescribedBy:jn,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:jn,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:jn,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jn,ariaLevel:Ln,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:jn,ariaPlaceholder:null,ariaPosInSet:Ln,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:jn,ariaRowCount:Ln,ariaRowIndex:Ln,ariaRowSpan:Ln,ariaSelected:Mn,ariaSetSize:Ln,ariaSort:null,ariaValueMax:Ln,ariaValueMin:Ln,ariaValueNow:Ln,ariaValueText:null,role:null}}),Zn=Yn({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Xn,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nn,acceptCharset:jn,accessKey:jn,action:null,allow:null,allowFullScreen:Qn,allowPaymentRequest:Qn,allowUserMedia:Qn,alt:null,as:null,async:Qn,autoCapitalize:null,autoComplete:jn,autoFocus:Qn,autoPlay:Qn,blocking:jn,capture:null,charSet:null,checked:Qn,cite:null,className:jn,cols:Ln,colSpan:null,content:null,contentEditable:Mn,controls:Qn,controlsList:jn,coords:Ln|Nn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qn,defer:Qn,dir:null,dirName:null,disabled:Qn,download:On,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qn,formTarget:null,headers:jn,height:Ln,hidden:Qn,high:Ln,href:null,hrefLang:null,htmlFor:jn,httpEquiv:jn,id:null,imageSizes:null,imageSrcSet:null,inert:Qn,inputMode:null,integrity:null,is:null,isMap:Qn,itemId:null,itemProp:jn,itemRef:jn,itemScope:Qn,itemType:jn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qn,low:Ln,manifest:null,max:null,maxLength:Ln,media:null,method:null,min:null,minLength:Ln,multiple:Qn,muted:Qn,name:null,nonce:null,noModule:Qn,noValidate:Qn,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:Qn,optimum:Ln,pattern:null,ping:jn,placeholder:null,playsInline:Qn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qn,referrerPolicy:null,rel:jn,required:Qn,reversed:Qn,rows:Ln,rowSpan:Ln,sandbox:jn,scope:null,scoped:Qn,seamless:Qn,selected:Qn,shadowRootClonable:Qn,shadowRootDelegatesFocus:Qn,shadowRootMode:null,shape:null,size:Ln,sizes:null,slot:null,span:Ln,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ln,step:null,style:null,tabIndex:Ln,target:null,title:null,translate:null,type:null,typeMustMatch:Qn,useMap:null,value:Mn,width:Ln,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jn,axis:null,background:null,bgColor:null,border:Ln,borderColor:null,bottomMargin:Ln,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qn,declare:Qn,event:null,face:null,frame:null,frameBorder:null,hSpace:Ln,leftMargin:Ln,link:null,longDesc:null,lowSrc:null,marginHeight:Ln,marginWidth:Ln,noResize:Qn,noHref:Qn,noShade:Qn,noWrap:Qn,object:null,profile:null,prompt:null,rev:null,rightMargin:Ln,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:Ln,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ln,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Qn,disableRemotePlayback:Qn,prefix:null,property:null,results:Ln,security:null,unselectable:null}}),$n=Yn({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:Vn,properties:{about:Hn,accentHeight:Ln,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ln,amplitude:Ln,arabicForm:null,ascent:Ln,attributeName:null,attributeType:null,azimuth:Ln,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ln,by:null,calcMode:null,capHeight:Ln,className:jn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ln,diffuseConstant:Ln,direction:null,display:null,dur:null,divisor:Ln,dominantBaseline:null,download:Qn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ln,enableBackground:null,end:null,event:null,exponent:Ln,externalResourcesRequired:null,fill:null,fillOpacity:Ln,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nn,g2:Nn,glyphName:Nn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ln,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ln,horizOriginX:Ln,horizOriginY:Ln,id:null,ideographic:Ln,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ln,k:Ln,k1:Ln,k2:Ln,k3:Ln,k4:Ln,kernelMatrix:Hn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ln,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:Ln,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:Ln,overlineThickness:Ln,paintOrder:null,panose1:null,path:null,pathLength:Ln,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ln,pointsAtY:Ln,pointsAtZ:Ln,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hn,rev:Hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hn,requiredFeatures:Hn,requiredFonts:Hn,requiredFormats:Hn,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:Ln,specularExponent:Ln,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ln,strikethroughThickness:Ln,string:null,stroke:null,strokeDashArray:Hn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ln,strokeOpacity:Ln,strokeWidth:null,style:null,surfaceScale:Ln,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hn,tabIndex:Ln,tableValues:null,target:null,targetX:Ln,targetY:Ln,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ln,underlineThickness:Ln,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ln,values:null,vAlphabetic:Ln,vMathematical:Ln,vectorEffect:null,vHanging:Ln,vIdeographic:Ln,version:null,vertAdvY:Ln,vertOriginX:Ln,vertOriginY:Ln,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ln,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),er=/^data[-\w.:]+$/i,tr=/-[a-z]/g,nr=/[A-Z]/g;function rr(e){return"-"+e.toLowerCase()}function or(e){return e.charAt(1).toUpperCase()}const Ar={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"},ir=Dn([Wn,Gn,Kn,Jn,Zn],"html"),ar=Dn([Wn,Gn,Kn,Jn,$n],"svg");function sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lr,cr,ur,dr={};var pr=function(){if(ur)return dr;ur=1;var e=dr&&dr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0}),dr.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(cr)return lr;cr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,A=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,a=/^\s+|\s+$/g,s="";function l(e){return e?e.replace(a,s):s}return lr=function(a,c){if("string"!=typeof a)throw new TypeError("First argument must be a string");if(!a)return[];c=c||{};var u=1,d=1;function p(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=a,!c.silent)throw t}function m(e){var t=e.exec(a);if(t){var n=t[0];return p(n),a=a.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=f();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var t=2;s!=a.charAt(t)&&("*"!=a.charAt(t)||"/"!=a.charAt(t+1));)++t;if(t+=2,s===a.charAt(t-1))return g("End of comment missing");var n=a.slice(2,t-2);return d+=2,p(n),a=a.slice(t),d+=2,e({type:"comment",comment:n})}}function y(){var t=f(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var a=m(A),c=t({type:"declaration",property:l(n[0].replace(e,s)),value:a?l(a[0].replace(e,s)):s});return m(i),c}}return h.prototype.content=a,v(),function(){var e,t=[];for(b(t);e=y();)!1!==e&&(t.push(e),b(t));return t}()},lr}());return dr}();const fr=sr(pr),hr=fr.default||fr,gr=vr("end"),mr=vr("start");function vr(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 br(e){return e&&"object"==typeof e?"position"in e||"type"in e?yr(e.position):"start"in e||"end"in e?yr(e):"line"in e||"column"in e?wr(e):"":""}function wr(e){return xr(e&&e.line)+":"+xr(e&&e.column)}function yr(e){return wr(e&&e.start)+"-"+wr(e&&e.end)}function xr(e){return e&&"number"==typeof e?e:1}class Er extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},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=br(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}}Er.prototype.file="",Er.prototype.name="",Er.prototype.reason="",Er.prototype.message="",Er.prototype.stack="",Er.prototype.column=void 0,Er.prototype.line=void 0,Er.prototype.ancestors=void 0,Er.prototype.cause=void 0,Er.prototype.fatal=void 0,Er.prototype.place=void 0,Er.prototype.ruleId=void 0,Er.prototype.source=void 0;const Br={}.hasOwnProperty,Pr=new Map,kr=/[A-Z]/g,Cr=/-([a-z])/g,Dr=new Set(["table","tbody","thead","tfoot","tr"]),Sr=new Set(["td","th"]),Ir="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Tr(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),a=mr(n);return t(r,o,A,i,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.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?ar:ir,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},A=Qr(o,e,void 0);return A&&"string"!=typeof A?A:o.create(e,o.Fragment,{children:A||void 0},void 0)}function Qr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const A=Nr(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Br.call(t.properties,o)){const A=jr(e,o,t.properties[o]);if(A){const[o,i]=A;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&Sr.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 a=Lr(e,t);return Dr.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&kn(e.value):kn(e)}(e)})),Mr(e,i,A,t),Or(i,a),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)}Hr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const A=null===t.name?e.Fragment:Nr(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 Hr(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 Hr(e,t.position);else A=null===r.value||r.value;n[o]=A}return n}(e,t),a=Lr(e,t);return Mr(e,i,A,t),Or(i,a),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);Hr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Or(r,Lr(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 Mr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Or(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Lr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Pr;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 a=Qr(e,A,i);void 0!==a&&n.push(a)}return n}function jr(e,t,n){const r=function(e,t){const n=Sn(t);let r=t,o=In;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&er.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(tr,or);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!tr.test(e)){let n=e.replace(nr,rr);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Un}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{hr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Ir+"#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(Cr,zr)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Br.call(e,n)&&(t[Rr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Ar[r.property]||r.property:r.attribute,n]}}function Nr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Bn(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=Bn(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 Br.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Hr(e)}function Hr(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ir+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Rr(e){let t=e.replace(kr,Fr);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function zr(e,t){return t.toUpperCase()}function Fr(e){return"-"+e.toLowerCase()}const Ur={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qr={};function _r(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 Yr(e.children,t,n)}return Array.isArray(e)?Yr(e,t,n):""}function Yr(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=_r(e[o],t,n);return r.join("")}const Gr=document.createElement("i");function Wr(e){const t="&"+e+";";Gr.innerHTML=t;const n=Gr.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function Vr(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 Xr(e,t){return e.length>0?(Vr(e,e.length,0,t),e):t}const Kr={}.hasOwnProperty;function Jr(e){const t={};let n=-1;for(;++n<e.length;)Zr(t,e[n]);return t}function Zr(e,t){let n;for(n in t){const r=(Kr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let A;if(o)for(A in o){Kr.call(r,A)||(r[A]=[]);const e=o[A];$r(r[A],Array.isArray(e)?e:e?[e]:[])}}}function $r(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Vr(e,0,0,r)}function eo(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 to(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const no=ho(/[A-Za-z]/),ro=ho(/[\dA-Za-z]/),oo=ho(/[#-'*+\--9=?A-Z^-~]/);function Ao(e){return null!==e&&(e<32||127===e)}const io=ho(/\d/),ao=ho(/[\dA-Fa-f]/),so=ho(/[!-/:-@[-`{-~]/);function lo(e){return null!==e&&e<-2}function co(e){return null!==e&&(e<0||32===e)}function uo(e){return-2===e||-1===e||32===e}const po=ho(new RegExp("\\p{P}|\\p{S}","u")),fo=ho(/\s/);function ho(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function go(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const A=e.charCodeAt(n);let i="";if(37===A&&ro(e.charCodeAt(n+1))&&ro(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 mo(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let A=0;return function(r){return uo(r)?(e.enter(n),i(r)):t(r)};function i(r){return uo(r)&&A++<o?(e.consume(r),i):(e.exit(n),t(r))}}const vo={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"),mo(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)):lo(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const bo={tokenize:function(e){const t=this,n=[];let r,o,A,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,s,l)(r)}return l(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 a=n;for(;a<t.events.length;)t.events[a][1].end={...o},a++;return Vr(t.events,A+1,0,t.events.slice(n)),t.events.length=a,l(e)}return a(e)}function l(o){if(i===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wo,c,u)(o)}function c(e){return r&&v(),m(i),d(e)}function u(e){return t.parser.lazy[t.now().line]=i!==n.length,A=t.now().offset,f(e)}function d(n){return t.containerState={},e.attempt(wo,p,f)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),d(e)}function f(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)):lo(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),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,a,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){if(o){a=t.events[s][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;Vr(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}}},wo={tokenize:function(e,t,n){return mo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function yo(e){return null===e||co(e)||fo(e)?1:po(e)?2:void 0}function xo(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 Eo={name:"attention",resolveAll:function(e,t){let n,r,o,A,i,a,s,l,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};Bo(u,-a),Bo(d,a),A={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...A.start},end:{...i.end}},e[n][1].end={...A.start},e[c][1].start={...i.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=Xr(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=Xr(s,[["enter",r,t],["enter",A,t],["exit",A,t],["enter",o,t]]),s=Xr(s,xo(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=Xr(s,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(l=2,s=Xr(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):l=0,Vr(e,n-1,c-n+3,s),c=n+s.length-l-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=yo(r);let A;return function(t){return A=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===A)return e.consume(a),i;const s=e.exit("attentionSequence"),l=yo(a),c=!l||2===l&&o||n.includes(a),u=!o||2===o&&l||n.includes(r);return s._open=!!(42===A?c:c&&(o||!u)),s._close=!!(42===A?u:u&&(l||!c)),t(a)}}};function Bo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Po={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return no(t)?(e.consume(t),A):64===t?n(t):s(t)}function A(e){return 43===e||45===e||46===e||ro(e)?(r=1,i(e)):s(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||ro(t))&&r++<32?(e.consume(t),i):(r=0,s(t))}function a(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||Ao(r)?n(r):(e.consume(r),a)}function s(t){return 64===t?(e.consume(t),l):oo(t)?(e.consume(t),s):n(t)}function l(e){return ro(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,l):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||ro(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const ko={partial:!0,tokenize:function(e,t,n){return function(t){return uo(t)?mo(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||lo(e)?t(e):n(e)}}};const Co={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return uo(t)?mo(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(Co,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 uo(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Do={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 so(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const So={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"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,A=ro,l(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,A=ao,l):(e.enter("characterReferenceValue"),o=7,A=io,l(t))}function l(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return A!==ro||Wr(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return A(a)&&i++<o?(e.consume(a),l):n(a)}}};const Io={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)}}},To={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"),uo(t)?mo(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===A?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===A?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),uo(t)?mo(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||lo(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let A,i=0,a=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?(a++,e.consume(t),s):a<3?n(t):(e.exit("codeFencedFenceSequence"),uo(t)?mo(e,l,"whitespace")(t):l(t))}function l(n){return null===n||lo(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(Io,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||lo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(t)):uo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mo(e,u,"whitespace")(t)):96===t&&t===A?n(t):(e.consume(t),c)}function u(t){return null===t||lo(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||lo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(t)):96===t&&t===A?n(t):(e.consume(t),d)}function p(t){return e.attempt(o,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&uo(t)?mo(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||lo(t)?e.check(Io,p,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||lo(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Qo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),mo(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?a(t):lo(t)?e.attempt(Mo,A,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||lo(t)?(e.exit("codeFlowValue"),A(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Mo={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):lo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):mo(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):lo(e)?o(e):n(e)}}};const Oo={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"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,l(t)):lo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),s(t))}function s(t){return null===t||32===t||96===t||lo(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),s)}function l(n){return 96===n?(e.consume(n),r++,l):r===A?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",s(n))}}};class Lo{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&jo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),jo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);jo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);jo(this.left,t.reverse())}}}function jo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function No(e){const t={};let n,r,o,A,i,a,s,l=-1;const c=new Lo(e);for(;++l<c.length;){for(;l in t;)l=t[l];if(n=c.get(l),l&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(l-1)[1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Ho(c,l)),l=t[l],s=!0);else if(n[1]._container){for(o=l,r=void 0;o--;)if(A=c.get(o),"lineEnding"===A[1].type||"lineEndingBlank"===A[1].type)"enter"===A[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),A[1].type="lineEnding",r=o);else if("linePrefix"!==A[1].type)break;r&&(n[1].end={...c.get(r)[1].start},i=c.slice(r,l),i.unshift(n),c.splice(r,l-r+1,i))}}return Vr(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!s}function Ho(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),a=i.events,s=[],l={};let c,u,d=-1,p=n,f=0,h=0;const g=[h];for(;p;){for(;e.get(++o)[1]!==p;);A.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=n;++d<a.length;)"exit"===a[d][0]&&"enter"===a[d-1][0]&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(h=d+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),d=g.length;d--;){const t=a.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;)l[f+s[d][0]]=f+s[d][1],f+=s[d][1]-s[d][0]-1;return l}const Ro={resolve:function(e){return No(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):lo(t)?e.check(zo,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}}},zo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mo(e,o,"linePrefix")};function o(o){if(null===o||lo(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 Fo(e,t,n,r,o,A,i,a,s){const l=s||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(A),e.consume(t),e.exit(A),u):null===t||32===t||41===t||Ao(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(A),e.consume(n),e.exit(A),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(a),u(t)):null===t||60===t||lo(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(o){return c||null!==o&&41!==o&&!co(o)?c<l&&40===o?(e.consume(o),c++,f):41===o?(e.consume(o),c--,f):null===o||32===o||40===o||Ao(o)?n(o):(e.consume(o),92===o?h:f):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function Uo(e,t,n,r,o,A){const i=this;let a,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(A),l};function l(u){return s>999||null===u||91===u||93===u&&!a||94===u&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):93===u?(e.exit(A),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):lo(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||lo(t)||s++>999?(e.exit("chunkString"),l(t)):(e.consume(t),a||(a=!uo(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function qo(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,a):n(t)};function a(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),a(i)):null===t?n(t):lo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mo(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(t))}function l(t){return t===i||null===t||lo(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:l)}function c(t){return t===i||92===t?(e.consume(t),l):l(t)}}function _o(e,t){let n;return function r(o){return lo(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):uo(o)?mo(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Yo={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return Uo.call(r,e,A,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function A(t){return o=to(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 co(t)?_o(e,a)(t):a(t)}function a(t){return Fo(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(Go,l,l)(t)}function l(t){return uo(t)?mo(e,c,"whitespace")(t):c(t)}function c(A){return null===A||lo(A)?(e.exit("definition"),r.parser.defined.push(o),t(A)):n(A)}}},Go={partial:!0,tokenize:function(e,t,n){return function(t){return co(t)?_o(e,r)(t):n(t)};function r(t){return qo(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return uo(t)?mo(e,A,"whitespace")(t):A(t)}function A(e){return null===e||lo(e)?t(e):n(e)}}};const Wo={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return lo(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Vo={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"},Vr(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||co(t)?(e.exit("atxHeadingSequence"),A(t)):n(t)}function A(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||lo(n)?(e.exit("atxHeading"),t(n)):uo(n)?mo(e,A,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),A(t))}function a(t){return null===t||35===t||co(t)?(e.exit("atxHeadingText"),A(t)):(e.consume(t),a)}}};const Xo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ko=["pre","script","style","textarea"],Jo={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,a,s;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),l}(t)};function l(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),A=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:O):no(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function c(A){return 45===A?(e.consume(A),o=2,u):91===A?(e.consume(A),o=5,a=0,d):no(A)?(e.consume(A),o=4,r.interrupt?t:O):n(A)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const A="CDATA[";return o===A.charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:k:d):n(o)}function p(t){return no(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||co(a)){const s=47===a,l=i.toLowerCase();return s||A||!Ko.includes(l)?Xo.includes(i.toLowerCase())?(o=6,s?(e.consume(a),h):r.interrupt?t(a):k(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):A?g(a):m(a)):(o=1,r.interrupt?t(a):k(a))}return 45===a||ro(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:k):n(o)}function g(t){return uo(t)?(e.consume(t),g):B(t)}function m(t){return 47===t?(e.consume(t),B):58===t||95===t||no(t)?(e.consume(t),v):uo(t)?(e.consume(t),m):B(t)}function v(t){return 45===t||46===t||58===t||95===t||ro(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):uo(t)?(e.consume(t),b):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,y):uo(t)?(e.consume(t),w):x(t)}function y(t){return t===s?(e.consume(t),s=null,E):null===t||lo(t)?n(t):(e.consume(t),y)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||co(t)?b(t):(e.consume(t),x)}function E(e){return 47===e||62===e||uo(e)?m(e):n(e)}function B(t){return 62===t?(e.consume(t),P):n(t)}function P(t){return null===t||lo(t)?k(t):uo(t)?(e.consume(t),P):n(t)}function k(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!lo(t)||6!==o&&7!==o?null===t||lo(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),k):(e.exit("htmlFlowData"),e.check(Zo,j,C)(t))}function C(t){return e.check($o,D,j)(t)}function D(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||lo(t)?C(t):(e.enter("htmlFlowData"),k(t))}function I(t){return 45===t?(e.consume(t),O):k(t)}function T(t){return 47===t?(e.consume(t),i="",Q):k(t)}function Q(t){if(62===t){const n=i.toLowerCase();return Ko.includes(n)?(e.consume(t),L):k(t)}return no(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):k(t)}function M(t){return 93===t?(e.consume(t),O):k(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):k(t)}function L(t){return null===t||lo(t)?(e.exit("htmlFlowData"),j(t)):(e.consume(t),L)}function j(n){return e.exit("htmlFlow"),t(n)}}},Zo={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ko,t,n)}}},$o={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return lo(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 eA={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),a};function a(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),w):63===t?(e.consume(t),v):no(t)?(e.consume(t),E):n(t)}function s(t){return 45===t?(e.consume(t),l):91===t?(e.consume(t),A=0,p):no(t)?(e.consume(t),m):n(t)}function l(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):lo(t)?(i=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(A++)?(e.consume(t),6===A?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):lo(t)?(i=f,Q(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):f(t)}function m(t){return null===t||62===t?T(t):lo(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):lo(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?T(e):v(e)}function w(t){return no(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||ro(t)?(e.consume(t),y):x(t)}function x(t){return lo(t)?(i=x,Q(t)):uo(t)?(e.consume(t),x):T(t)}function E(t){return 45===t||ro(t)?(e.consume(t),E):47===t||62===t||co(t)?B(t):n(t)}function B(t){return 47===t?(e.consume(t),T):58===t||95===t||no(t)?(e.consume(t),P):lo(t)?(i=B,Q(t)):uo(t)?(e.consume(t),B):T(t)}function P(t){return 45===t||46===t||58===t||95===t||ro(t)?(e.consume(t),P):k(t)}function k(t){return 61===t?(e.consume(t),C):lo(t)?(i=k,Q(t)):uo(t)?(e.consume(t),k):B(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,D):lo(t)?(i=C,Q(t)):uo(t)?(e.consume(t),C):(e.consume(t),S)}function D(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):lo(t)?(i=D,Q(t)):(e.consume(t),D)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||co(t)?B(t):(e.consume(t),S)}function I(e){return 47===e||62===e||co(e)?B(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return uo(t)?mo(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 tA={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&&Vr(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,A,i=e.length,a=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)){a=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}},l={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[o-2][1].start}};return A=[["enter",s,t],["enter",l,t]],A=Xr(A,e.slice(r+1,r+a+3)),A=Xr(A,[["enter",c,t]]),A=Xr(A,xo(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),A=Xr(A,[["exit",c,t],e[o-2],e[o-1],["exit",l,t]]),A=Xr(A,e.slice(o+1)),A=Xr(A,[["exit",s,t]]),Vr(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?c(t):(A=r.parser.defined.includes(to(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(nA,l,A?l:c)(t):91===t?e.attempt(rA,l,A?s:c)(t):A?l(t):c(t)}function s(t){return e.attempt(oA,l,c)(t)}function l(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},nA={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 co(t)?_o(e,o)(t):o(t)}function o(t){return 41===t?l(t):Fo(e,A,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function A(t){return co(t)?_o(e,a)(t):l(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?qo(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):l(t)}function s(t){return co(t)?_o(e,l)(t):l(t)}function l(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},rA={tokenize:function(e,t,n){const r=this;return function(t){return Uo.call(r,e,o,A,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(to(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function A(e){return n(e)}}},oA={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 AA={name:"labelStartImage",resolveAll:tA.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 iA={name:"labelStartLink",resolveAll:tA.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 aA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),mo(e,t,"linePrefix")}}};const sA={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||lo(A))?(e.exit("thematicBreak"),t(A)):n(A)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),uo(t)?mo(e,A,"whitespace")(t):A(t))}}};const lA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ko,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mo(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!uo(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(uA,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,mo(e,e.attempt(lA,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:io(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(sA,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return io(t)&&++i<10?(e.consume(t),a):(!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(ko,r.interrupt?n:l,e.attempt(cA,u,c))}function l(e){return r.containerState.initialBlankLine=!0,A++,u(e)}function c(t){return uo(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=A+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},cA={partial:!0,tokenize:function(e,t,n){const r=this;return mo(e,function(e){const o=r.events[r.events.length-1];return!uo(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},uA={partial:!0,tokenize:function(e,t,n){const r=this;return mo(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 dA={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,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][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"),uo(t)?mo(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||lo(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const pA={tokenize:function(e){const t=this,n=e.attempt(ko,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,mo(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ro,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 fA={resolveAll:vA()},hA=mA("string"),gA=mA("text");function mA(e){return{resolveAll:vA("text"===e?bA: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),a;t.consume(e)}function a(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),a)}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 vA(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 bA(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,a=-1,s=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)s++,a--;if(a)break;a=-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?a:r.start._bufferIndex+a,_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 wA={42:lA,43:lA,45:lA,48:lA,49:lA,50:lA,51:lA,52:lA,53:lA,54:lA,55:lA,56:lA,57:lA,62:Co},yA={91:Yo},xA={[-2]:Qo,[-1]:Qo,32:Qo},EA={35:Vo,42:sA,45:[dA,sA],60:Jo,61:dA,95:sA,96:To,126:To},BA={38:So,92:Do},PA={[-5]:aA,[-4]:aA,[-3]:aA,33:AA,38:So,42:Eo,60:[Po,eA],91:iA,92:[Wo,Do],93:tA,95:Eo,96:Oo},kA={null:[Eo,fA]},CA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:yA,disable:{null:[]},document:wA,flow:EA,flowInitial:xA,insideSpan:kA,string:BA,text:PA},Symbol.toStringTag,{value:"Module"}));function DA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},A=[];let i=[],a=[];const s={attempt:h(function(e,t){g(e,t.from)}),check:h(f),consume:function(e){lo(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++)),l.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),l.events.push(["enter",n,l]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=d(),l.events.push(["exit",t,l]),t},interrupt:h(f,{interrupt:!0})},l={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("")}(u(e),t)},sliceStream:u,write:function(e){return i=Xr(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;)p(t.charCodeAt(r._bufferIndex));else p(t)}}(),null!==i[i.length-1]?[]:(g(t,0),l.events=xo(A,l.events,l),l.events)}};let c=t.tokenize.call(l,s);return t.resolveAll&&A.push(t),l;function u(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 p(e){c=c(e)}function f(e,t){t.restore()}function h(e,t){return function(n,o,A){let i,c,u,p;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return i=e,c=0,0===e.length?A:h(e[c])}function h(e){return function(n){return p=function(){const e=d(),t=l.previous,n=l.currentConstruct,o=l.events.length,A=Array.from(a);return{from:o,restore:i};function i(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=o,a=A,m()}}(),u=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(l),t):l,s,g,v)(n)}}function g(t){return e(u,p),o}function v(e){return p.restore(),++c<i.length?h(i[c]):A}}}function g(e,t){e.resolveAll&&!A.includes(e)&&A.push(e),e.resolve&&Vr(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const SA=/[\0\t\n\r]/g;const IA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TA(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return eo(n.slice(t?2:1),t?16:10)}return Wr(n)||e}const QA={}.hasOwnProperty;function MA(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:P,autolinkEmail:P,atxHeading:A(J),blockQuote:A(G),characterEscape:P,characterReference:P,codeFenced:A(W),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:A(W,i),codeText:A(V,i),codeTextData:P,data:P,codeFlowValue:P,definition:A(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:A(K),hardBreakEscape:A(Z),hardBreakTrailing:A(Z),htmlFlow:A($,i),htmlFlowData:P,htmlText:A($,i),htmlTextData:P,image:A(ee),label:i,link:A(te),listItem:A(re),listItemValue:d,listOrdered:A(ne,u),listUnordered:A(ne),paragraph:A(oe),reference:R,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:A(J),strong:A(Ae),thematicBreak:A(ae)},exit:{atxHeading:s(),atxHeadingSequence:y,autolink:s(),autolinkEmail:Y,autolinkProtocol:_,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:F,characterReferenceMarkerNumeric:F,characterReferenceValue:U,characterReference:q,codeFenced:s(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:k,codeIndented:s(m),codeText:s(T),codeTextData:k,data:k,definition:s(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:s(),hardBreakEscape:s(D),hardBreakTrailing:s(D),htmlFlow:s(S),htmlFlowData:k,htmlText:s(I),htmlTextData:k,image:s(M),label:L,labelText:O,lineEnding:C,link:s(Q),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:z,resourceDestinationString:j,resourceTitleString:N,resource:H,setextHeading:s(B),setextHeadingLineSequence:E,setextHeadingText:x,strong:s(),thematicBreak:s()}};LA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const A={stack:[r],tokenStack:[],config:t,enter:a,exit:l,buffer:i,resume:c,data:n},s=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])s.push(u);else{u=o(e,s.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];QA.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},A),e[u][1])}if(A.tokenStack.length>0){const e=A.tokenStack[A.tokenStack.length-1];(e[1]||NA).call(A,void 0,e[0])}for(r.position={start:OA(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:OA(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,A,i,a=t-1,s=-1,l=!1;for(;++a<=n;){const t=e[a];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=a),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=a;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",l=!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||a,0,["exit",r,t[2]]),a++,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(a,0,["enter",o,t[2]]),a++,n++,A=void 0,i=!0}}}return e[t][1]._spread=l,n}function A(e,t){return n;function n(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(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:OA(t.start),end:void 0}}function s(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||NA).call(this,e,r[0])),n.position.end=OA(e.end)}function c(){return function(e){return _r(e,"boolean"!=typeof qr.includeImageAlt||qr.includeImageAlt,"boolean"!=typeof qr.includeHtml||qr.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){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=to(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function y(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 E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(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:OA(e.start),end:void 0},t.push(n)),this.stack.push(n)}function k(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=OA(e.end)}function C(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=OA(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(P.call(this,e),k.call(this,e))}function D(){this.data.atHardBreak=!0}function S(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(IA,TA)}(t),n.identifier=to(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 j(){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 H(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function z(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=to(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function F(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=eo(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Wr(t);this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=OA(e.end)}function _(e){k.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function Y(e){k.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function V(){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 Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function Ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}(n)(function(e){for(;!No(e););return e}(function(e){const t={constructs:Jr([CA,...(e||{}).extensions||[]]),content:n(vo),defined:[],document:n(bo),flow:n(pA),lazy:{},string:n(hA),text:n(gA)};return t;function n(e){return function(n){return DA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,A,i){const a=[];let s,l,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(A||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(SA.lastIndex=c,s=SA.exec(o),u=s&&void 0!==s.index?s.index:o.length,d=o.charCodeAt(u),!s){n=o.slice(c);break}if(10===d&&c===u&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),c<u&&(a.push(o.slice(c,u)),t+=u-c),d){case 0:a.push(65533),t++;break;case 9:for(l=4*Math.ceil(t/4),a.push(-2);t++<l;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function OA(e){return{line:e.line,column:e.column,offset:e.offset}}function LA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LA(e,r):jA(e,r)}}function jA(e,t){let n;for(n in t)if(QA.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 NA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+br({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+br({start:t.start,end:t.end})+") is still open")}function HA(e){const t=this;t.parser=function(n){return MA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function RA(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 zA(e){return e.spread??e.children.length>1}function FA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const A=[];for(;r;)A.push(UA(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return A.push(UA(t.slice(o),o>0,!1)),A.join("")}function UA(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 qA={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=go(r.toLowerCase()),A=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);void 0===a?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=A+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,l),e.applyData(t,l)},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 RA(e,t);const o={src:go(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:go(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 RA(e,t);const o={href:go(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:go(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=zA(n[r])}return t}(n):zA(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 a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"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 l={type:"element",tagName:"li",properties:A,children:i};return e.patch(t,l),e.applyData(t,l)},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=mr(t.children[1]),i=gr(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 a=-1;const s=[];for(;++a<i;){const n=t.children[a],r={},i=A?A[a]:void 0;i&&(r.align=i);let l={type:"element",tagName:o,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),s.push(l)}const l={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)},text:function(e,t){const n={type:"text",value:FA(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:_A,yaml:_A,definition:_A,footnoteDefinition:_A};function _A(){}const YA="object"==typeof self?self:globalThis,GA=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 YA[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 YA[A](i),o)};return r})(new Map,e)(0),WA="",{toString:VA}={},{keys:XA}=Object,KA=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=VA.call(e).slice(8,-1);switch(n){case"Array":return[1,WA];case"Object":return[2,WA];case"Date":return[3,WA];case"RegExp":return[4,WA];case"Map":return[5,WA];case"Set":return[6,WA];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},JA=([e,t])=>0===e&&("function"===t||"symbol"===t),ZA=(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,a]=KA(r);switch(i){case 0:{let t=r;switch(a){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),o([a,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(A(t));return t}case 2:{if(a)switch(a){case"BigInt":return o([a,r.toString()],r);case"Boolean":case"Number":case"String":return o([a,r.valueOf()],r)}if(t&&"toJSON"in r)return A(r.toJSON());const n=[],s=o([i,n],r);for(const t of XA(r))(e||!JA(KA(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||!JA(KA(n))&&!JA(KA(o)))&&t.push([A(n),A(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!JA(KA(n)))&&t.push(A(n));return n}}const{message:s}=r;return o([i,{name:a,message:s}],r)};return A})(!(t||n),!!t,new Map,r)(e),r},$A="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?GA(ZA(e,t)):structuredClone(e):(e,t)=>GA(ZA(e,t));function ei(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 ti(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const ni=function(e){if(null==e)return oi;if("function"==typeof e)return ri(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ni(e[n]);return ri(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 ri(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 ri(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function ri(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 oi(){return!0}const Ai=[],ii=!0,ai=!1;function si(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const A=ni(o),i=r?-1:1;!function e(o,a,s){const l=o&&"object"==typeof o?o:{};if("string"==typeof l.type){const e="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let l,c,u,d=Ai;if((!t||A(o,a,s[s.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[ii,e]:null==e?Ai:[e]}(n(o,s)),d[0]===ai))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+i,u=s.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(l=e(n,c,u)(),l[0]===ai)return l;c="number"==typeof l[1]?l[1]:c+i}}return d}}(e,void 0,[])()}function li(e,t,n,r){let o,A,i;"function"==typeof t?(A=void 0,i=t,o=n):(A=t,i=n,o=r),si(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 ci={}.hasOwnProperty,ui={};function di(e,t){const n=t||ui,r=new Map,o=new Map,A=new Map,i={...qA,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=a.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=mi(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=mi(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:fi,definitionById:r,footnoteById:o,footnoteCounts:A,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=a.handlers[n];if(ci.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=$A(n);return r.children=a.all(e),r}return $A(e)}return(a.options.unknownHandler||hi)(a,e,t)},options:n,patch:pi,wrap:gi};return li(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)}}),a}function pi(e,t){e.position&&(t.position=function(e){const t=mr(e),n=gr(e);if(t&&n)return{start:t,end:n}}(e))}function fi(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,$A(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function hi(e,t){const n=t.data||{},r=!("value"in t)||ci.call(n,"hProperties")||ci.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 gi(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 mi(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function vi(e,t){const n=di(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||ei,r=e.options.footnoteBackLabel||ti,o=e.options.footnoteLabel||"Footnotes",A=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];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(),l=go(i.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+l+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=A[A.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else A.push(...u);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+l},children:e.wrap(A,!0)};e.patch(o,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:A,properties:{...$A(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!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 bi(e,t){return e&&"run"in e?async function(n,r){const o=vi(n,{file:r,...t});await e.run(o,r)}:function(n,r){return vi(n,{file:r,...e||t})}}function wi(e){if(e)throw e}var yi,xi;var Ei=function(){if(xi)return yi;xi=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return yi=function e(){var t,n,r,s,l,c,u=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<p;++d)if(null!=(t=arguments[d]))for(n in t)r=a(u,n),u!==(s=a(t,n))&&(f&&s&&(A(s)||(l=o(s)))?(l?(l=!1,c=r&&o(r)?r:[]):c=r&&A(r)?r:{},i(u,{name:n,newValue:e(f,c,s)})):typeof s<"u"&&i(u,{name:n,newValue:s}));return u},yi}();const Bi=sr(Ei);function Pi(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 ki(){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 a=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,a?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)}}(a,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 Ci={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Di(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,a=t.length-1;for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else i<0&&(n=!0,i=A+1),a>-1&&(e.codePointAt(A)===t.codePointAt(a--)?a<0&&(o=A):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Di(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){Di(e);let t,n=e.length,r=-1,o=0,A=-1,i=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?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;)Di(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Di(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",A=0,i=-1,a=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!==a)if(i!==s-1&&2===a){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,a=0;continue}}else if(o.length>0){o="",A=0,i=s,a=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,a=0}else 46===n&&a>-1?a++:a=-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 Di(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Si={cwd:function(){return"/"}};function Ii(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Ti(e){if("string"==typeof e)e=new URL(e);else if(!Ii(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 Qi=["history","path","basename","stem","extname","dirname"];class Mi{constructor(e){let t;var n;t=e?Ii(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?"":Si.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Qi.length;){const e=Qi[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Qi.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?Ci.basename(this.path):void 0}set basename(e){Li(e,"basename"),Oi(e,"basename"),this.path=Ci.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Ci.dirname(this.path):void 0}set dirname(e){ji(this.basename,"dirname"),this.path=Ci.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Ci.extname(this.path):void 0}set extname(e){if(Oi(e,"extname"),ji(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=Ci.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ii(e)&&(e=Ti(e)),Li(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Ci.basename(this.path,this.extname):void 0}set stem(e){Li(e,"stem"),Oi(e,"stem"),this.path=Ci.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Er(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Oi(e,t){if(e&&e.includes(Ci.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ci.sep+"`")}function Li(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ji(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Ni=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Hi={}.hasOwnProperty;class Ri extends Ni{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=ki()}copy(){const e=new Ri;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Bi(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(qi("data",this.frozen),this.namespace[e]=t,this):Hi.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qi("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=Gi(e),n=this.parser||this.Parser;return Fi("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Fi("process",this.parser||this.Parser),Ui("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const A=Gi(e),i=n.parse(A);function a(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 a(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,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Fi("processSync",this.parser||this.Parser),Ui("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,wi(e),t=r}),Yi("processSync","process",n),t}run(e,t,n){_i(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=Gi(t);r.run(e,i,function(t,r,i){const a=r||e;t?A(t):o?o(a):n(void 0,a,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){wi(e),n=t,r=!0}),Yi("runSync","run",r),n}stringify(e,t){this.freeze();const n=Gi(t),r=this.compiler||this.Compiler;return Ui("stringify",r),_i(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(qi("use",this.frozen),null!=e)if("function"==typeof e)a(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)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(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=Bi(!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 a(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];Pi(i)&&Pi(r)&&(r=Bi(!0,i,r)),n[o]=[e,r,...A]}}}}const zi=(new Ri).freeze();function Fi(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Ui(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function qi(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 _i(e){if(!Pi(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Yi(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Mi(e)}const Wi=[],Vi={allowDangerousHtml:!0},Xi=/^(https?|ircs?|mailto|xmpp)$/i,Ki=[{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 Ji(e){const t=e.allowedElements,r=e.allowElement,o=e.children||"",A=e.className,i=e.components,a=e.disallowedElements,s=e.rehypePlugins||Wi,l=e.remarkPlugins||Wi,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vi}:Vi,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||Zi,f=zi().use(HA).use(l).use(bi,c).use(s),h=new Mi;"string"==typeof o&&(h.value=o);for(const t of Ki)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const g=f.parse(h);let m=f.runSync(g,h);return A&&(m={type:"element",tagName:"div",properties:{className:A},children:"root"===m.type?m.children:[m]}),li(m,function(e,n,o){if("raw"===e.type&&o&&"number"==typeof n)return u?o.children.splice(n,1):o.children[n]={type:"text",value:e.value},n;if("element"===e.type){let t;for(t in Ur)if(Object.hasOwn(Ur,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Ur[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=p(String(n||""),t,e))}}if("element"===e.type){let A=t?!t.includes(e.tagName):!!a&&a.includes(e.tagName);if(!A&&r&&"number"==typeof n&&(A=!r(e,n,o)),A&&o&&"number"==typeof n)return d&&e.children?o.children.splice(n,1,...e.children):o.children.splice(n,1),n}}),Tr(m,{Fragment:n.Fragment,components:i,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0})}function Zi(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||Xi.test(e.slice(0,t))?e:""}const $i=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(Ji,{components:{p:({...e})=>n.jsx("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>n.jsx("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>n.jsx("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>n.jsx("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?n.jsx("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):n.jsx("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:n.jsx("code",{children:t})}),blockquote:({...e})=>n.jsx("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),ea={autoConfig:!0},ta=t=>()=>(t=>{const{getFlow:n}=Rt(),{messages:r,replaceMessages:o}=zt(),{settings:A}=Ut(),{hasChatHistoryLoaded:i}=_t(),a={...t,...ea},s=a.markdownComponent?a.markdownComponent:$i;e.useEffect(()=>{var e,t;if(i){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=A.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=s)}o(n)}},[i]);const l=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,n(),r)&&(e.data.message.contentWrapper=s,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};Ft(j.PRE_INJECT_MESSAGE,l),Ft(j.CHUNK_STREAM_MESSAGE,l),Ft(j.START_STREAM_MESSAGE,l),Ft(j.START_SIMULATE_STREAM_MESSAGE,l);const c={name:"@rcb-plugins/markdown-renderer"};return null!=a&&a.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(t),na={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"}},ra=(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},oa=t=>{const{showToast:n}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=Ke();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:r}=Rt(),{styles:o,updateStyles:A,replaceStyles:i}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=St();return{styles:e,replaceStyles:t,updateStyles:n}})(),a=(e=>({...na,...e,promptBaseColors:{...na.promptBaseColors},promptHoveredColors:{...na.promptHoveredColors},textAreaHighlightColors:{...na.textAreaHighlightColors}}))(t),[s,l]=e.useState(0),c=e.useRef({});Ft(j.USER_SUBMIT_TEXT,e=>{const t=e,i=ra(t,r(),"validateTextInput");if(!i)return;const u=i(t.data.inputText);if(null!=u&&u.success||e.preventDefault(),!u.promptContent)return;0===s&&(c.current=structuredClone(o));const d=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(u,a);A(d),n(u.promptContent,u.promptDuration??3e3),l(e=>e+1)}),Ft(j.USER_UPLOAD_FILE,e=>{var t,o;const A=e,i=null==(o=null==(t=A.data)?void 0:t.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const a=ra(A,r(),"validateFileInput");if(!a)return void console.error("Validator not found for file input.");const s=a(i);if(!s.success)return console.error("Validation failed:",s),s.promptContent&&n(s.promptContent,s.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",s)}),Ft(j.DISMISS_TOAST,()=>{l(e=>e-1)}),e.useEffect(()=>{0===s&&setTimeout(()=>{i(c.current)})},[s,i]);const u={name:"@rcb-plugins/input-validator"};return a.autoConfig&&(u.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),u},Aa=e.forwardRef((t,n)=>{let{embedded:r,currentOpen:o,enabled:A,onSetEnabled:i}=t;const a=zt(),s=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=q();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),l=e.useRef(null),c=e.useRef(!1);return e.useEffect(()=>{!r&&s&&s.toggleChatWindow&&(l.current===o||c.current||(setTimeout(()=>{s&&s.toggleChatWindow&&s.toggleChatWindow(o)},0),l.current=o),c.current=!1)},[o,r,s]),e.useEffect(()=>{const e=()=>{c.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),e.useImperativeHandle(n,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!r&&s&&s.toggleChatWindow&&s.toggleChatWindow(!0)},closeChat:()=>{!r&&s&&s.toggleChatWindow&&s.toggleChatWindow(!1)},toggleChat:()=>{!r&&s&&s.toggleChatWindow&&s.toggleChatWindow()},setBotEnabled:e=>{i&&i(e)}}),[a,s,r,i]),null});Aa.displayName="BotController";const ia=t=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:A=!1}=t;const i=A?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return e.createElement(e.Fragment,null,A&&e.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),e.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"qa-bot-login-button ".concat(A?"qa-bot-header-login-button":""," ").concat(r),style:Object.assign(Object.assign({},i),o)},"Log In"))},aa=()=>e.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},e.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElement("circle",{cx:"12",cy:"7",r:"4"}))),sa=[];for(let e=0;e<256;++e)sa.push((e+256).toString(16).slice(1));let la;const ca=new Uint8Array(16);var ua={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function da(e,t,n){if(ua.randomUUID&&!e)return ua.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!la){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");la=crypto.getRandomValues.bind(crypto)}return la(ca)}();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(sa[e[t+0]]+sa[e[t+1]]+sa[e[t+2]]+sa[e[t+3]]+"-"+sa[e[t+4]]+sa[e[t+5]]+"-"+sa[e[t+6]]+sa[e[t+7]]+"-"+sa[e[t+8]]+sa[e[t+9]]+"-"+sa[e[t+10]]+sa[e[t+11]]+sa[e[t+12]]+sa[e[t+13]]+sa[e[t+14]]+sa[e[t+15]]).toLowerCase()}(r)}function pa(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const fa="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",ha="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",ga="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",ma="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",va="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",ba=()=>{pa()&&console.log("%c QA Bot Core %c v".concat("0.2.10"," "),ma,va)},wa=function(e){if(pa()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[Session]%c ".concat(e),fa,"",...n)}},ya=function(e){if(pa()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[History]%c ".concat(e),ha,"",...n)}},xa=(e,t)=>{pa()&&console.log("%c[Message]%c ".concat(e),ga,"",t)},Ea=function(){console.warn(...arguments)},Ba=function(){console.error(...arguments)},Pa="qa_bot_session_messages",ka=()=>"qa_bot_session_".concat(da()),Ca=()=>{try{const e=localStorage.getItem(Pa);return e?JSON.parse(e):{}}catch(e){return{}}},Da=(e,t,n,r,o)=>{const A=Ca();!A[e]&&(A[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},ya("NEW session created",{sessionId:e.slice(-12)}));if(A[e].messages.some(e=>e.id===t))return void ya("DUPLICATE message skipped",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r});const i={id:t,content:n,sender:r,type:o,timestamp:Date.now()};A[e].messages.push(i),ya("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:A[e].messages.length});const a=A[e].messages,s=a.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(s){const t=s.content;A[e].preview=t.slice(0,50)+(t.length>50?"...":"")}else{const t=a.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)=>{let[,n]=e,[,r]=t;return new Date(n.startedAt).getTime()-new Date(r.startedAt).getTime()})[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(Pa,JSON.stringify(e))})(A),ya("STORAGE state",{ourSessions:Object.keys(A).length,ourTotalMessages:Object.values(A).reduce((e,t)=>e+t.messages.length,0)})},Sa=e=>{var t,n;return null!==(n=null===(t=Ca()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},Ia=e=>{const t=Ca()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},Ta=e.createContext(void 0),Qa=t=>{let{children:n,getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}=t;return e.createElement(Ta.Provider,{value:{getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}},n)},Ma=()=>{const t=e.useContext(Ta);if(!t)throw new Error("useSession must be used within a SessionProvider");return t},Oa=()=>{const[t,n]=e.useState(!1),[r,o]=e.useState([]),A=e.useRef(null),i=e.useRef(null),{replaceMessages:a}=zt(),{toggleTextAreaDisabled:s}=qt(),{setSessionId:l,getSessionId:c}=Ma();e.useEffect(()=>{const e=e=>{A.current&&!A.current.contains(e.target)&&i.current&&!i.current.contains(e.target)&&n(!1)};return t&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t]);const u=e=>{const t=c();if(ya("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==t?void 0:t.slice(-12)}),e===t)return ya("RESTORE skipped - already on this session"),void n(!1);const r=(e=>{var t;return(null===(t=Ca()[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()});ya("Stored messages from our localStorage",{count:r.length,ids:r.map(e=>e.id.slice(-8))});const o=r.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));a(o),ya("replaceMessages called",{count:o.length}),setTimeout(()=>{const e=document.querySelector(".rcb-chat-body-container");e&&e.querySelectorAll(".rcb-bot-message").forEach(e=>{e.innerHTML.includes("](")&&(e.innerHTML=e.innerHTML.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'))})},50),l(e),ya("Session ID updated",{newSession:e.slice(-12)}),s(!1),ya("Chat input enabled after restore"),n(!1)};return e.createElement("div",{style:{position:"relative"}},e.createElement("button",{ref:i,className:"history-button",onClick:()=>{t||o((()=>{const e=Ca();return Object.entries(e).map(e=>{let[t,n]=e;return Object.assign({sessionId:t},n)}).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime())})()),n(!t)},style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"18px",display:"flex",border:"none",cursor:"pointer",padding:0},"aria-label":"View chat history",title:"View chat history","aria-expanded":t,"aria-haspopup":"menu"},e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("circle",{cx:"12",cy:"12",r:"10"}),e.createElement("polyline",{points:"12 6 12 12 16 14"}))),t&&e.createElement("div",{ref:A,role:"menu",style:{position:"fixed",left:0,right:0,top:"auto",marginTop:"8px",backgroundColor:"white",borderRadius:0,borderBottom:"3px solid var(--primaryColor, #1a5b6e)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",maxHeight:"250px",overflowY:"auto",zIndex:1e3}},0===r.length?e.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):r.map(t=>e.createElement("button",{key:t.sessionId,role:"menuitem",onClick:()=>u(t.sessionId),style:{width:"100%",padding:"10px 14px",border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left",display:"flex",flexDirection:"column",gap:"2px",borderBottom:"1px solid #eee"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},e.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.preview||"New conversation"),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},(e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/864e5);return 0===r?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):1===r?"Yesterday":r<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})})(t.startedAt))))))};function La(){return La=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},La.apply(null,arguments)}const ja=({width:t=24,height:n=24,color:r="currentColor",children:o,...A})=>e.createElement("svg",La({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),Na=t=>e.createElement(ja,t,e.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),Ha=e.createContext(null),Ra=t=>{let{onAnalyticsEvent:n,getSessionId:r,children:o}=t;const A=e.useRef(n);A.current=n;const i=e.useCallback(e=>{var t,n;A.current&&A.current(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:r())&&void 0!==n?n:void 0}))},[r]);return e.createElement(Ha.Provider,{value:{trackEvent:i}},o)},za=()=>{const{restartFlow:t}=Rt(),{setTextAreaValue:n}=qt(),{messages:r}=zt(),{getSessionId:o,resetSession:A,clearResettingFlag:i}=Ma(),{trackEvent:a}=e.useContext(Ha)||{trackEvent:()=>{}};return e.createElement("button",{onClick:async()=>{const e=o(),r=e?Sa(e):0;a({type:"qa_new_chat_started",previousMessageCount:r}),A(),await n(""),await t(),setTimeout(()=>{i()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},e.createElement(Na,{width:16,height:16}),"New Chat")};function Fa(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(Fa).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return Fa(t.children)}return""}const Ua=()=>{const{getSessionId:t}=Ma(),n=e.useCallback(e=>{var n;const r=null===(n=e.data)||void 0===n?void 0:n.message;if(xa("PRE_INJECT",{sender:null==r?void 0:r.sender,type:null==r?void 0:r.type,content:null==r?void 0:r.content}),!(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:Fa(r.content),i.includes("rcb-options-container"))return;if(!i.trim())return;const a=t();Da(a,r.id,i,o,A)},[t]);return e.useEffect(()=>(window.addEventListener("rcb-pre-inject-message",n),()=>{window.removeEventListener("rcb-pre-inject-message",n)}),[n]),null},qa=()=>(e.useEffect(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let 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 a=[];if(i.length>0){const e=i[i.length-1];a=Array.from(e.querySelectorAll(".rcb-options"))}if(0===a.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(a.length>0){if(a.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",a.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),a.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(()=>{a[0]&&null!==a[0].offsetParent&&!r&&(a[0].focus(),a.length>1&&t(`${a.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);const _a="#1a5b6e",Ya="#107180",Ga="Arial, sans-serif",Wa="Q&A Bot",Va="/chat-icon.svg",Xa="Type your question here...",Ka="Select an option to continue",Ja=!1,Za="Ask me a question!",$a="/login",es={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:1e3,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}},ts=e.forwardRef((t,n)=>{var r,o;const{apiKey:A,qaEndpoint:i,ratingEndpoint:s,welcomeMessage:l,open:c,onOpenChange:u,isLoggedIn:d,allowAnonAccess:p=!1,actingUser:f,primaryColor:h,secondaryColor:g,botName:m,logo:v,placeholder:b,errorMessage:w,embedded:y,footerText:x,footerLink:E,tooltipText:B,loginUrl:P,customFlow:k,onAnalyticsEvent:C}=t,D=e.useRef("bot_".concat(Math.random().toString(36).substr(2,9)));e.useEffect(()=>{ba()},[]);const S=e.useRef(null);null===S.current&&(S.current=ka(),wa("CREATED",S.current));const I=e.useRef(!1),T=e.useRef({getSessionId:()=>S.current,isResetting:()=>I.current}),[Q,M]=e.useState(d);e.useEffect(()=>{M(d)},[d]);const O=e.useMemo(()=>{const t=Object.assign({},es);t.general=Object.assign(Object.assign({},t.general),{primaryColor:h||_a,secondaryColor:g||Ya,fontFamily:Ga,embedded:void 0!==y?y:Ja});const n=!1===Q?[e.createElement(ia,{key:"login-button",loginUrl:P||$a,isHeaderButton:!0})]:[e.createElement(Oa,{key:"history-button"}),e.createElement(aa,{key:"user-icon"})];t.header={title:e.createElement("span",{style:{fontSize:14,fontWeight:500}},m||Wa),showAvatar:!0,avatar:v||Va,buttons:[...n,a.CLOSE_CHAT_BUTTON]},t.chatInput=Object.assign(Object.assign({},t.chatInput),{disabled:!1,enabledPlaceholderText:b||Xa,disabledPlaceholderText:w||Ka}),t.tooltip=Object.assign(Object.assign({},t.tooltip),{text:B||Za});const r=x?E?e.createElement("a",{href:E,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},x):e.createElement("span",{key:"footer-text"},x):null;return t.footer={text:r,buttons:[e.createElement(za,{key:"new-chat-button"})]},t.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},t},[h,g,m,v,b,w,y,B,Q,P,x,E]),L=e.useRef(null),j=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.useMemo(()=>{const e=(e,n)=>{if(t.current){const n=getComputedStyle(t.current).getPropertyValue(e);if(n&&""!==n.trim())return n.trim();if(t.current.parentElement){const n=getComputedStyle(t.current.parentElement).getPropertyValue(e);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:e("--primaryColor",n.primaryColor),secondaryColor:e("--secondaryColor",n.secondaryColor),fontFamily:e("--fontFamily",n.fontFamily)}},[t,n])}(L,O.general);((t,n)=>{e.useEffect(()=>{n.current&&(t?n.current.classList.add("bot-logged-in"):n.current.classList.remove("bot-logged-in"))},[t,n])})(!1!==Q,L),(t=>{let{settings:n,themeColors:r}=t;e.useEffect(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty("--".concat(t),n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),e.useEffect(()=>{var t,r,o;(null===(t=n.header)||void 0===t?void 0:t.title)&&"string"==typeof n.header.title&&(n.header.title=e.createElement("div",{key:"header-title"},e.createElement("h1",{className:"sr-only"},n.header.title),e.createElement("span",{"aria-hidden":"true"},n.header.title))),(null===(r=n.general)||void 0===r?void 0:r.embedded)&&n.chatWindow&&(n.chatWindow.defaultOpen=!0),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!1},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(o=n.header)||void 0===o?void 0:o.avatar}),n.event={rcbToggleChatWindow:!0}},[n])})({settings:O,themeColors:j});const N=e.useMemo(()=>{const t=(t=>{let{endpoint:n,ratingEndpoint:r,apiKey:o,sessionId:A,isResetting:i=()=>!1,isLoggedIn:a,allowAnonAccess:s=!1,loginUrl:l="/login",actingUser:c,onAnalyticsEvent:u}=t;const d=e=>{var t,n;u&&u(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:A())&&void 0!==n?n:void 0}))};if(!1===a&&!s)return d({type:"qa_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:e.createElement(ia,{loginUrl:l}),chatDisabled:!0,path:"qa_loop"}};let p=null,f=!1;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{const{userInput:t}=e;if(i&&i())return null;if(!t||""===t.trim())return null;if("👍 Helpful"===t||"👎 Not helpful"===t){if(r&&p)try{const e="👍 Helpful"===t,n={"Content-Type":"application/json"};o&&(n["X-API-KEY"]=o);const i=A();i&&(n["X-Session-ID"]=i,n["X-Query-ID"]=p),await fetch(r,{method:"POST",headers:n,body:JSON.stringify({sessionId:i,queryId:p,rating:e?1:0})}),d({type:"qa_response_rated",queryId:p,rating:e?"helpful":"not_helpful"})}catch(e){Ba("Error sending feedback:",e)}return"Thanks for the feedback! Feel free to ask another question."}try{const r=da();p=r,d({type:"qa_question_asked",queryId:r,questionLength:t.length});const i={"Content-Type":"application/json"};o&&(i["X-API-KEY"]=o);const a=A();a&&(i["X-Session-ID"]=a,i["X-Query-ID"]=r),c&&(i["X-Acting-User"]=c);const s={query:t,session_id:a,question_id:r};c&&(s.acting_user=c),wa("SENT to API",{session_id:a,question_id:r,acting_user:c||"(not set)"});const l=Date.now(),u=await fetch(n,{method:"POST",headers:i,body:JSON.stringify(s)}),h=Date.now()-l;if(!u.ok)throw new Error("API returned ".concat(u.status));const g=await u.json(),m=g.response||g.answer||g.text||g.message;if(!m)throw new Error("Invalid response format from API");const v=(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)),"[".concat(t,"](").concat(t,")").concat(n)}),t})(m),b=function(e){const{confidence:t,tools_used:n,metadata:r}=e;if(!(t||n&&0!==n.length))return"";const o=[];return t&&o.push("• Confidence: ".concat(t)),n&&n.length>0&&o.push("• Tools used: ".concat(n.join(", "))),(null==r?void 0:r.agent)&&o.push("• Agent: ".concat(r.agent)),"---\n".concat(o.join("\n"))}(g),w=b?"".concat(v,"\n\n").concat(b):v;return await e.injectMessage(w),d({type:"qa_response_received",queryId:r,responseTimeMs:h,success:!0,responseLength:m.length,hasMetadata:!!b}),f=!0,setTimeout(async()=>{await e.injectMessage("Feel free to ask another question.")},100),null}catch(e){return Ba("Error in Q&A flow:",e),d({type:"qa_response_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=>i&&i()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput?[]:r&&f?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,path:"qa_loop"}}})({endpoint:i,ratingEndpoint:s,apiKey:A,sessionId:T.current.getSessionId,isResetting:T.current.isResetting,isLoggedIn:Q,allowAnonAccess:p,loginUrl:P||$a,actingUser:f,onAnalyticsEvent:C}),n={message:l,transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},t),k||{})},[A,i,s,l,Q,p,P,k,f,C]),H=e.useMemo(()=>{return[()=>wn(t),ta(),()=>oa(e)];var e,t},[]);return e.useEffect(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),qa(),e.useEffect(()=>{if(!y){const e=e=>{const t=e.data.newState;null==u||u(t);const n=S.current;t?null==C||C({type:"qa_bot_opened",timestamp:Date.now(),sessionId:null!=n?n:void 0}):null==C||C({type:"qa_bot_closed",timestamp:Date.now(),sessionId:null!=n?n:void 0,messageCount:n?Sa(n):0,durationMs:n?Ia(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[y,u,C]),e.createElement("div",{className:"qa-bot ".concat((null===(r=O.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:L,role:"region","aria-label":m||Wa},e.createElement(Qa,{getSessionId:()=>S.current,setSessionId:e=>{const t=S.current;S.current=e,wa("RESTORED","".concat(null==t?void 0:t.slice(-12)," -> ").concat(e.slice(-12)))},resetSession:()=>{const e=S.current;I.current=!0,S.current=ka(),wa("RESET","".concat(null==e?void 0:e.slice(-12)," -> ").concat(S.current.slice(-12)))},clearResettingFlag:()=>{I.current=!1}},e.createElement(Ra,{onAnalyticsEvent:C,getSessionId:()=>S.current},e.createElement(Mt,null,e.createElement("div",null,e.createElement(Ua,null),e.createElement(Aa,{ref:n,embedded:(null===(o=O.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:c||!1,enabled:!1!==Q,onSetEnabled:e=>M(!!e&&void 0)}),e.createElement(Nt,{key:"chatbot-".concat(D.current,"-").concat(Q),settings:O,flow:N,plugins:H}),e.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region"}),e.createElement("div",{id:"chat-input-help",className:"sr-only"},"Type your message and press Enter to send. Use arrow keys to navigate through response options."))))))});ts.displayName="QABot";i('.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{color:#fff;text-decoration:none}.rcb-chat-window .rcb-bot-message a:hover{text-decoration:underline}.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%}@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-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 ns=()=>{const[t,n]=e.useState(!1),r=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!r())throw new Error("Screen capture is not available in this environment");try{n(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),t=document.createElement("video");t.srcObject=e,await new Promise(e=>{t.onloadedmetadata=()=>{t.play(),e()}});const r=document.createElement("canvas");r.width=t.videoWidth,r.height=t.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(t,0,0,r.width,r.height);const A=await new Promise(e=>r.toBlob(e,"image/png"));if(!A)throw new Error("Could not create image blob");const i=(new Date).toISOString().replace(/[:.]/g,"-"),a=new File([A],"screenshot-".concat(i,".png"),{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),n(!1),a}catch(e){throw Ba("Error capturing screenshot:",e),n(!1),e}},isCapturing:t,isScreenCaptureAvailable:r()}},rs=t=>e.createElement(ja,t,e.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElement("polyline",{points:"17 8 12 3 7 8"}),e.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),os=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error("Failed to read file ".concat(e.name)));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error("Failed to read file ".concat(e.name))),r.readAsDataURL(e)}),As=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB");const is=e.forwardRef((t,n)=>{const[r,o]=e.useState(t.defaultOpen||!1),A=e.useRef(null);return e.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;o(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;o(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;o(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),e.createElement(ts,{ref:A,apiKey:t.apiKey,qaEndpoint:t.qaEndpoint,ratingEndpoint:t.ratingEndpoint,welcomeMessage:t.welcomeMessage,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,botName:t.botName,logo:t.logo,placeholder:t.placeholder,errorMessage:t.errorMessage,embedded:t.embedded,isLoggedIn:t.isLoggedIn,allowAnonAccess:t.allowAnonAccess,open:r,onOpenChange:o,footerText:t.footerText,footerLink:t.footerLink,tooltipText:t.tooltipText,onAnalyticsEvent:t.onAnalyticsEvent})});function as(n){if(!(n.target&&n.target instanceof HTMLElement))return void Ba("QA Bot: A valid target DOM element is required");const r=t.createRoot(n.target),o={current:null};return r.render(e.createElement(e.StrictMode,null,e.createElement(is,{ref:e=>{o.current=e},apiKey:n.apiKey,qaEndpoint:n.qaEndpoint,ratingEndpoint:n.ratingEndpoint,defaultOpen:n.defaultOpen,embedded:n.embedded,isLoggedIn:n.isLoggedIn,allowAnonAccess:n.allowAnonAccess,welcomeMessage:n.welcomeMessage,primaryColor:n.primaryColor,secondaryColor:n.secondaryColor,botName:n.botName,logo:n.logo,placeholder:n.placeholder,errorMessage:n.errorMessage,footerText:n.footerText,footerLink:n.footerLink,tooltipText:n.tooltipText,onAnalyticsEvent:n.onAnalyticsEvent}))),{addMessage:e=>{var t;return null===(t=o.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=o.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{o.current=null,r.unmount()}}}is.displayName="ProgrammaticQABot",exports.FileUploadComponent=t=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:A=!1,className:i}=t;const[a,s]=e.useState(!1),[l,c]=e.useState([]),[u,d]=e.useState(null),p=e.useRef(null),{captureScreenshot:f,isCapturing:h,isScreenCaptureAvailable:g}=ns(),m=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},v=e=>{if(!e||0===e.length)return void Ea("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return Ba("FileUploadComponent: Error converting files to array:",e),void m("Error processing selected files. Please try again.")}const r=[...l,...t];c(r);const o=t.length,A=t.map(e=>e.name).join(", ");m("".concat(o," file").concat(o>1?"s":""," selected: ").concat(A)),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},b=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?s(!0):"dragleave"===e.type&&s(!1)},w=()=>{try{p.current&&p.current.click()}catch(e){Ba("FileUploadComponent: Error in handleButtonClick:",e),m("Error opening file selection dialog. Please try again.")}},y=()=>{d(null)},x=A&&g;return e.createElement("div",{className:"file-upload-container ".concat(i||""),style:{padding:"16px",margin:"8px 0"}},x&&e.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},e.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await f();v([e]),m("Screenshot captured successfully")}catch(e){m("Error capturing screenshot. Please try again.")}})()},disabled:h,"aria-describedby":"screenshot-help","aria-label":h?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:h?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),e.createElement("circle",{cx:"12",cy:"13",r:"4"})),h?"Taking screenshot...":"Take screenshot..."),e.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),e.createElement("div",{className:"file-upload-dropzone ".concat(a?"active":""),onDragEnter:b,onDragLeave:b,onDragOver:b,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),s(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&v(e.dataTransfer.files)}catch(e){Ba("FileUploadComponent: Error in handleDrop:",e),m("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:a?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},e.createElement("input",{ref:p,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&v(e.target.files)}catch(e){Ba("FileUploadComponent: Error in handleFileSelect:",e),m("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),e.createElement("div",{className:"upload-content",onClick:w,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},e.createElement(rs,null),e.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),e.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),l.length>0&&e.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},e.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),l.map((t,r)=>e.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:e=>{e.stopPropagation(),(e=>{d(e)})(t)}},e.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=l.filter((t,n)=>n!==e);c(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":"Remove ".concat(t.name)},"×"),t.name," (",As(t.size),")"))))),(()=>{if(!u)return null;const t=u.type.startsWith("image/"),n=u.type.startsWith("text/"),r="application/pdf"===u.type;return e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:y},e.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{onClick:y,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),e.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},u.name),t&&e.createElement("img",{src:URL.createObjectURL(u),alt:u.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&e.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(u)),r&&e.createElement("iframe",{src:URL.createObjectURL(u),style:{width:"100%",height:"70vh",border:"none"},title:u.name}),!t&&!n&&!r&&e.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())},exports.QABot=ts,exports.applyFlowSettings=function(e,t){if(!t||0===Object.keys(t).length)return e;const n={};for(const[r,o]of Object.entries(e)){let e=Object.assign({},o);if(t.disableOnOptions&&void 0===e.chatDisabled){const t=!(!e.options&&!e.checkboxes);e.chatDisabled=t}n[r]=e}return n},exports.default=as,exports.fileToBase64=os,exports.filesToBase64=e=>Promise.all(e.map(os)),exports.formatFileSize=As,exports.qaBot=as,exports.useScreenshotCapture=ns,exports.validateFileSize=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t};
|
|
8
|
+
*/var nn,rn;const on=tn(function(){if(rn)return nn;rn=1;var e=/["'&<>]/;return nn=function(t){var n=""+t,r=e.exec(n);if(!r)return n;var o,A="",i=0,a=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}a!==i&&(A+=n.substring(a,i)),a=i+1,A+=o}return a!==i?A+n.substring(a,i):A}}());function An(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const an=/(url|image|image-set)\(/i;class sn extends en{attribute(e,t){return"style"===e&&Object.keys(t).forEach(e=>{String(t[e]).match(an)&&delete t[e]}),t}}const ln=/^<(!doctype|(html|head|body)(\s|>))/i,cn=/^(aria-|data-|\w+:)/iu,un=/{{{(\w+)\/?}}}/;function dn(){if(!(typeof window>"u"||typeof document>"u"))return document.implementation.createHTMLDocument("Interweave")}let pn=class{constructor(e,t={},n=[],r=[]){var o;if(An(this,"allowed",void 0),An(this,"banned",void 0),An(this,"blocked",void 0),An(this,"container",void 0),An(this,"content",[]),An(this,"props",void 0),An(this,"matchers",void 0),An(this,"filters",void 0),An(this,"keyIndex",void 0),"production"!==process.env.NODE_ENV&&e&&"string"!=typeof e)throw new TypeError("Interweave parser requires a valid string.");this.props=t,this.matchers=n,this.filters=[...r,new sn],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:Xt),this.banned=new Set(Vt),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 a=e.asTag().toLowerCase(),s=this.getTagConfig(a);if(r[e.inverseName]||!this.isTagAllowed(a)||!this.canRenderChild(t,s))return;let l="";for(;o&&(i=e.match(o));){const{index:t,length:a,match:s,valid:c,void:u,...d}=i,p=e.propName+String(A);t>0&&(l+=o.slice(0,t)),c?(l+=u?`{{{${p}/}}}`:`{{{${p}}}}${s}{{{/${p}}}}`,this.keyIndex+=1,A+=1,n[p]={children:s,matcher:e,props:{...r,...d,key:this.keyIndex}}):l+=s,e.greedy?(o=l+o.slice(t+a),l=""):o=o.slice(t+(a||s.length))}e.greedy||(o=l+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||dn)();if(!n)return;const r=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",o="body"===r||"fragment"===r?n.body:n.createElement(r);if(e.match(ln)){if("production"!==process.env.NODE_ENV)throw new Error("HTML documents as Interweave content are not supported.")}else o.innerHTML=this.convertLineBreaks(this.props.escapeHtml?on(e):e);return o}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let r=0;return 1===e.nodeType&&e.attributes&&([...e.attributes].forEach(o=>{const{name:A,value:i}=o,a=A.toLowerCase(),s=Kt[a]||Kt[A];if(!this.isSafe(e)||!a.match(cn)&&(!t&&(!s||2===s)||a.startsWith("on")||i.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let l="style"===a?this.extractStyleAttribute(e):i;4===s?l=!0:3===s?l=Number.parseFloat(String(l)):5!==s&&(l=String(l)),n[Jt[a]||a]=this.applyAttributeFilters(a,l),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 Wt[e]?{...t,...Wt[e],tagName:e}:t}isSafe(e){if(typeof HTMLAnchorElement<"u"&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){const{noHtml:r,noHtmlExceptMatchers:o,allowElements:A,transform:i,transformOnlyAllowList:a}=this.props;let s=[],l="";return[...t.childNodes].forEach(t=>{if(1===t.nodeType){const u=t.nodeName.toLowerCase(),d=this.getTagConfig(u);l&&(s.push(l),l="");const p=this.applyNodeFilters(u,t);if(!p)return;let f;if(i&&(!a||this.isTagAllowed(u))){this.keyIndex+=1;const t=this.keyIndex;f=this.parseNode(p,d);const n=i(p,f,d);if(null===n)return;if(typeof n<"u")return void s.push(e.cloneElement(n,{key:t}));this.keyIndex=t-1}if(this.banned.has(u))return;if(r||o&&"br"!==u||!this.isTagAllowed(u)||!A&&!this.canRenderChild(n,d))s=[...s,...this.parseNode(p,d.tagName?d:n)];else{var c;this.keyIndex+=1;const t=this.extractAttributes(p),n={tagName:u};t&&(n.attributes=t),d.void&&(n.selfClose=d.void),s.push(e.createElement($t,{...n,key:this.keyIndex},null!==(c=f)&&void 0!==c?c:this.parseNode(p,d)))}}else if(3===t.nodeType){const e=r&&!o?t.textContent:this.applyMatchers(t.textContent||"",n);Array.isArray(e)?s=[...s,...e]:l+=e}}),l&&s.push(l),s}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let r=e,o=null;for(;o=r.match(un);){const[e,A]=o,i=o.index,a=e.includes("/");if("production"!==process.env.NODE_ENV&&!t[A])throw new Error(`Token "${A}" found but no matching element to replace with.`);i>0&&(n.push(r.slice(0,i)),r=r.slice(i));const{children:s,matcher:l,props:c}=t[A];let u;if(a)u=e.length,n.push(l.createElement(s,c));else{const o=r.match(new RegExp(`{{{/${A}}}}`));if("production"!==process.env.NODE_ENV&&!o)throw new Error(`Closing token missing for interpolated element "${A}".`);u=o.index+o[0].length,n.push(l.createElement(this.replaceTokens(r.slice(e.length,o.index),t),c))}r=r.slice(u)}return r.length>0&&n.push(r),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}};function fn(t){var n;const{attributes:r,className:o,containerTagName:A,content:i,emptyContent:a,parsedContent:s,tagName:l,noWrap:c}=t,u=null!==(n=A??l)&&void 0!==n?n:"span",d="fragment"===u||c;let p;if(s)p=s;else{const e=new pn(i??"",t).parse();e.length>0&&(p=e)}return p||(p=a),d?e.createElement(e.Fragment,null,p):e.createElement($t,{attributes:r,className:o,tagName:u},p)}function hn(t){const{attributes:n,className:r,content:o="",disableFilters:A=!1,disableMatchers:i=!1,emptyContent:a=null,filters:s=[],matchers:l=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:d="span",noWrap:p=!1,...f}=t,h=i?[]:l,g=A?[]:s,m=u?[u]:[],v=c?[c]:[];h.forEach(e=>{e.onBeforeParse&&m.push(e.onBeforeParse.bind(e)),e.onAfterParse&&v.push(e.onAfterParse.bind(e))});const b=m.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&"string"!=typeof r)throw new TypeError("Interweave `onBeforeParse` must return a valid HTML string.");return r},o??""),w=new pn(b,f,h,g),y=v.reduce((e,n)=>{const r=n(e,t);if("production"!==process.env.NODE_ENV&&!Array.isArray(r))throw new TypeError("Interweave `onAfterParse` must return an array of strings and React elements.");return r},w.parse());return e.createElement(fn,{attributes:n,className:r,containerTagName:t.containerTagName,emptyContent:a,noWrap:p,parsedContent:0===y.length?void 0:y,tagName:d})}const gn=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(hn,{content:"string"==typeof e?e:""})}),mn={autoConfig:!0},vn=(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)},bn=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},wn=t=>{const{getFlow:n}=Rt(),{messages:r,replaceMessages:o}=zt(),{settings:A}=Ut(),{hasChatHistoryLoaded:i}=_t(),a={...t,...mn},s=a.htmlComponent?a.htmlComponent:gn;e.useEffect(()=>{var e,t;if(i){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=A.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-html-renderer-plugin:parsed")&&(e.contentWrapper=s)}o(n)}},[i]);const l=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();"string"==typeof e.data.message.content&&vn(e,n(),r)&&("rcb-start-simulate-stream-message"===e.type&&(e.data.simulateStreamChunker=bn),e.data.message.contentWrapper=s,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-html-renderer-plugin:parsed"))};Ft(j.PRE_INJECT_MESSAGE,l),Ft(j.CHUNK_STREAM_MESSAGE,l),Ft(j.START_STREAM_MESSAGE,l),Ft(j.START_SIMULATE_STREAM_MESSAGE,l),Ft(j.START_SPEAK_AUDIO,async e=>{vn(e,n(),"BOT")&&(e.data.textToRead=(e=>typeof window.DOMParser<"u"?(new DOMParser).parseFromString(e,"text/html").body.textContent||"":e.replace(/<\/?[^>]+(>|$)/g,""))(e.data.textToRead))});const c={name:"@rcb-plugins/html-renderer"};return null!=a&&a.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0,rcbStartSpeakAudio:!0}}),c};const yn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,En={};function Bn(e,t){return(En.jsx?xn:yn).test(e)}const Pn=/[ \t\n\f\r]/g;function kn(e){return""===e.replace(Pn,"")}class Cn{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Dn(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 Cn(n,r,t)}function Sn(e){return e.toLowerCase()}Cn.prototype.property={},Cn.prototype.normal={},Cn.prototype.space=null;class In{constructor(e,t){this.property=e,this.attribute=t}}In.prototype.space=null,In.prototype.boolean=!1,In.prototype.booleanish=!1,In.prototype.overloadedBoolean=!1,In.prototype.number=!1,In.prototype.commaSeparated=!1,In.prototype.spaceSeparated=!1,In.prototype.commaOrSpaceSeparated=!1,In.prototype.mustUseProperty=!1,In.prototype.defined=!1;let Tn=0;const Qn=Rn(),Mn=Rn(),On=Rn(),Ln=Rn(),jn=Rn(),Nn=Rn(),Hn=Rn();function Rn(){return 2**++Tn}const zn=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qn,booleanish:Mn,commaOrSpaceSeparated:Hn,commaSeparated:Nn,number:Ln,overloadedBoolean:On,spaceSeparated:jn},Symbol.toStringTag,{value:"Module"})),Fn=Object.keys(zn);class Un extends In{constructor(e,t,n,r){let o=-1;if(super(e,t),qn(this,"space",r),"number"==typeof n)for(;++o<Fn.length;){const e=Fn[o];qn(this,Fn[o],(n&zn[e])===zn[e])}}}function qn(e,t,n){n&&(e[t]=n)}Un.prototype.defined=!0;const _n={}.hasOwnProperty;function Yn(e){const t={},n={};let r;for(r in e.properties)if(_n.call(e.properties,r)){const o=e.properties[r],A=new Un(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(A.mustUseProperty=!0),t[r]=A,n[Sn(r)]=r,n[Sn(A.attribute)]=r}return new Cn(t,n,e.space)}const Gn=Yn({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}}),Wn=Yn({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function Vn(e,t){return t in e?e[t]:t}function Xn(e,t){return Vn(e,t.toLowerCase())}const Kn=Yn({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Xn,properties:{xmlns:null,xmlnsXLink:null}}),Jn=Yn({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Mn,ariaAutoComplete:null,ariaBusy:Mn,ariaChecked:Mn,ariaColCount:Ln,ariaColIndex:Ln,ariaColSpan:Ln,ariaControls:jn,ariaCurrent:null,ariaDescribedBy:jn,ariaDetails:null,ariaDisabled:Mn,ariaDropEffect:jn,ariaErrorMessage:null,ariaExpanded:Mn,ariaFlowTo:jn,ariaGrabbed:Mn,ariaHasPopup:null,ariaHidden:Mn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:jn,ariaLevel:Ln,ariaLive:null,ariaModal:Mn,ariaMultiLine:Mn,ariaMultiSelectable:Mn,ariaOrientation:null,ariaOwns:jn,ariaPlaceholder:null,ariaPosInSet:Ln,ariaPressed:Mn,ariaReadOnly:Mn,ariaRelevant:null,ariaRequired:Mn,ariaRoleDescription:jn,ariaRowCount:Ln,ariaRowIndex:Ln,ariaRowSpan:Ln,ariaSelected:Mn,ariaSetSize:Ln,ariaSort:null,ariaValueMax:Ln,ariaValueMin:Ln,ariaValueNow:Ln,ariaValueText:null,role:null}}),Zn=Yn({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Xn,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Nn,acceptCharset:jn,accessKey:jn,action:null,allow:null,allowFullScreen:Qn,allowPaymentRequest:Qn,allowUserMedia:Qn,alt:null,as:null,async:Qn,autoCapitalize:null,autoComplete:jn,autoFocus:Qn,autoPlay:Qn,blocking:jn,capture:null,charSet:null,checked:Qn,cite:null,className:jn,cols:Ln,colSpan:null,content:null,contentEditable:Mn,controls:Qn,controlsList:jn,coords:Ln|Nn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qn,defer:Qn,dir:null,dirName:null,disabled:Qn,download:On,draggable:Mn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qn,formTarget:null,headers:jn,height:Ln,hidden:Qn,high:Ln,href:null,hrefLang:null,htmlFor:jn,httpEquiv:jn,id:null,imageSizes:null,imageSrcSet:null,inert:Qn,inputMode:null,integrity:null,is:null,isMap:Qn,itemId:null,itemProp:jn,itemRef:jn,itemScope:Qn,itemType:jn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qn,low:Ln,manifest:null,max:null,maxLength:Ln,media:null,method:null,min:null,minLength:Ln,multiple:Qn,muted:Qn,name:null,nonce:null,noModule:Qn,noValidate:Qn,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:Qn,optimum:Ln,pattern:null,ping:jn,placeholder:null,playsInline:Qn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qn,referrerPolicy:null,rel:jn,required:Qn,reversed:Qn,rows:Ln,rowSpan:Ln,sandbox:jn,scope:null,scoped:Qn,seamless:Qn,selected:Qn,shadowRootClonable:Qn,shadowRootDelegatesFocus:Qn,shadowRootMode:null,shape:null,size:Ln,sizes:null,slot:null,span:Ln,spellCheck:Mn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ln,step:null,style:null,tabIndex:Ln,target:null,title:null,translate:null,type:null,typeMustMatch:Qn,useMap:null,value:Mn,width:Ln,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:jn,axis:null,background:null,bgColor:null,border:Ln,borderColor:null,bottomMargin:Ln,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qn,declare:Qn,event:null,face:null,frame:null,frameBorder:null,hSpace:Ln,leftMargin:Ln,link:null,longDesc:null,lowSrc:null,marginHeight:Ln,marginWidth:Ln,noResize:Qn,noHref:Qn,noShade:Qn,noWrap:Qn,object:null,profile:null,prompt:null,rev:null,rightMargin:Ln,rules:null,scheme:null,scrolling:Mn,standby:null,summary:null,text:null,topMargin:Ln,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ln,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Qn,disableRemotePlayback:Qn,prefix:null,property:null,results:Ln,security:null,unselectable:null}}),$n=Yn({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:Vn,properties:{about:Hn,accentHeight:Ln,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ln,amplitude:Ln,arabicForm:null,ascent:Ln,attributeName:null,attributeType:null,azimuth:Ln,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ln,by:null,calcMode:null,capHeight:Ln,className:jn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ln,diffuseConstant:Ln,direction:null,display:null,dur:null,divisor:Ln,dominantBaseline:null,download:Qn,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ln,enableBackground:null,end:null,event:null,exponent:Ln,externalResourcesRequired:null,fill:null,fillOpacity:Ln,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Nn,g2:Nn,glyphName:Nn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ln,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ln,horizOriginX:Ln,horizOriginY:Ln,id:null,ideographic:Ln,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ln,k:Ln,k1:Ln,k2:Ln,k3:Ln,k4:Ln,kernelMatrix:Hn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ln,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:Ln,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:Ln,overlineThickness:Ln,paintOrder:null,panose1:null,path:null,pathLength:Ln,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:jn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ln,pointsAtY:Ln,pointsAtZ:Ln,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Hn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Hn,rev:Hn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Hn,requiredFeatures:Hn,requiredFonts:Hn,requiredFormats:Hn,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:Ln,specularExponent:Ln,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ln,strikethroughThickness:Ln,string:null,stroke:null,strokeDashArray:Hn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ln,strokeOpacity:Ln,strokeWidth:null,style:null,surfaceScale:Ln,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Hn,tabIndex:Ln,tableValues:null,target:null,targetX:Ln,targetY:Ln,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Hn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ln,underlineThickness:Ln,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ln,values:null,vAlphabetic:Ln,vMathematical:Ln,vectorEffect:null,vHanging:Ln,vIdeographic:Ln,version:null,vertAdvY:Ln,vertOriginX:Ln,vertOriginY:Ln,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ln,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),er=/^data[-\w.:]+$/i,tr=/-[a-z]/g,nr=/[A-Z]/g;function rr(e){return"-"+e.toLowerCase()}function or(e){return e.charAt(1).toUpperCase()}const Ar={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"},ir=Dn([Wn,Gn,Kn,Jn,Zn],"html"),ar=Dn([Wn,Gn,Kn,Jn,$n],"svg");function sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lr,cr,ur,dr={};var pr=function(){if(ur)return dr;ur=1;var e=dr&&dr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0}),dr.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(cr)return lr;cr=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,A=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,i=/^[;\s]*/,a=/^\s+|\s+$/g,s="";function l(e){return e?e.replace(a,s):s}return lr=function(a,c){if("string"!=typeof a)throw new TypeError("First argument must be a string");if(!a)return[];c=c||{};var u=1,d=1;function p(e){var n=e.match(t);n&&(u+=n.length);var r=e.lastIndexOf("\n");d=~r?e.length-r:d+e.length}function f(){var e={line:u,column:d};return function(t){return t.position=new h(e),v(),t}}function h(e){this.start=e,this.end={line:u,column:d},this.source=c.source}function g(e){var t=new Error(c.source+":"+u+":"+d+": "+e);if(t.reason=e,t.filename=c.source,t.line=u,t.column=d,t.source=a,!c.silent)throw t}function m(e){var t=e.exec(a);if(t){var n=t[0];return p(n),a=a.slice(n.length),t}}function v(){m(n)}function b(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var e=f();if("/"==a.charAt(0)&&"*"==a.charAt(1)){for(var t=2;s!=a.charAt(t)&&("*"!=a.charAt(t)||"/"!=a.charAt(t+1));)++t;if(t+=2,s===a.charAt(t-1))return g("End of comment missing");var n=a.slice(2,t-2);return d+=2,p(n),a=a.slice(t),d+=2,e({type:"comment",comment:n})}}function y(){var t=f(),n=m(r);if(n){if(w(),!m(o))return g("property missing ':'");var a=m(A),c=t({type:"declaration",property:l(n[0].replace(e,s)),value:a?l(a[0].replace(e,s)):s});return m(i),c}}return h.prototype.content=a,v(),function(){var e,t=[];for(b(t);e=y();)!1!==e&&(t.push(e),b(t));return t}()},lr}());return dr}();const fr=sr(pr),hr=fr.default||fr,gr=vr("end"),mr=vr("start");function vr(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 br(e){return e&&"object"==typeof e?"position"in e||"type"in e?yr(e.position):"start"in e||"end"in e?yr(e):"line"in e||"column"in e?wr(e):"":""}function wr(e){return xr(e&&e.line)+":"+xr(e&&e.column)}function yr(e){return wr(e&&e.start)+"-"+wr(e&&e.end)}function xr(e){return e&&"number"==typeof e?e:1}class Er extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",o={},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=br(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}}Er.prototype.file="",Er.prototype.name="",Er.prototype.reason="",Er.prototype.message="",Er.prototype.stack="",Er.prototype.column=void 0,Er.prototype.line=void 0,Er.prototype.ancestors=void 0,Er.prototype.cause=void 0,Er.prototype.fatal=void 0,Er.prototype.place=void 0,Er.prototype.ruleId=void 0,Er.prototype.source=void 0;const Br={}.hasOwnProperty,Pr=new Map,kr=/[A-Z]/g,Cr=/-([a-z])/g,Dr=new Set(["table","tbody","thead","tfoot","tr"]),Sr=new Set(["td","th"]),Ir="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Tr(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),a=mr(n);return t(r,o,A,i,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.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?ar:ir,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},A=Qr(o,e,void 0);return A&&"string"!=typeof A?A:o.create(e,o.Fragment,{children:A||void 0},void 0)}function Qr(e,t,n){return"element"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.tagName.toLowerCase()&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const A=Nr(e,t.tagName,!1),i=function(e,t){const n={};let r,o;for(o in t.properties)if("children"!==o&&Br.call(t.properties,o)){const A=jr(e,o,t.properties[o]);if(A){const[o,i]=A;e.tableCellAlignToStyle&&"align"===o&&"string"==typeof i&&Sr.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 a=Lr(e,t);return Dr.has(t.tagName)&&(a=a.filter(function(e){return"string"!=typeof e||!function(e){return"object"==typeof e?"text"===e.type&&kn(e.value):kn(e)}(e)})),Mr(e,i,A,t),Or(i,a),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)}Hr(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,n){const r=e.schema;let o=r;"svg"===t.name&&"html"===r.space&&(o=ar,e.schema=o),e.ancestors.push(t);const A=null===t.name?e.Fragment:Nr(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 Hr(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 Hr(e,t.position);else A=null===r.value||r.value;n[o]=A}return n}(e,t),a=Lr(e,t);return Mr(e,i,A,t),Or(i,a),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);Hr(e,t.position)}(e,t):"root"===t.type?function(e,t,n){const r={};return Or(r,Lr(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 Mr(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Or(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Lr(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:Pr;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 a=Qr(e,A,i);void 0!==a&&n.push(a)}return n}function jr(e,t,n){const r=function(e,t){const n=Sn(t);let r=t,o=In;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&er.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(tr,or);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!tr.test(e)){let n=e.replace(nr,rr);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Un}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{hr(t,r)}catch(t){if(!e.ignoreInvalidStyle){const n=t,r=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Ir+"#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(Cr,zr)),n[r]=t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){const t={};let n;for(n in e)Br.call(e,n)&&(t[Rr(n)]=e[n]);return t}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?Ar[r.property]||r.property:r.attribute,n]}}function Nr(e,t,n){let r;if(n)if(t.includes(".")){const e=t.split(".");let n,o=-1;for(;++o<e.length;){const t=Bn(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=Bn(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 Br.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Hr(e)}function Hr(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Ir+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Rr(e){let t=e.replace(kr,Fr);return"ms-"===t.slice(0,3)&&(t="-"+t),t}function zr(e,t){return t.toUpperCase()}function Fr(e){return"-"+e.toLowerCase()}const Ur={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qr={};function _r(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 Yr(e.children,t,n)}return Array.isArray(e)?Yr(e,t,n):""}function Yr(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=_r(e[o],t,n);return r.join("")}const Gr=document.createElement("i");function Wr(e){const t="&"+e+";";Gr.innerHTML=t;const n=Gr.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}function Vr(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 Xr(e,t){return e.length>0?(Vr(e,e.length,0,t),e):t}const Kr={}.hasOwnProperty;function Jr(e){const t={};let n=-1;for(;++n<e.length;)Zr(t,e[n]);return t}function Zr(e,t){let n;for(n in t){const r=(Kr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let A;if(o)for(A in o){Kr.call(r,A)||(r[A]=[]);const e=o[A];$r(r[A],Array.isArray(e)?e:e?[e]:[])}}}function $r(e,t){let n=-1;const r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);Vr(e,0,0,r)}function eo(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 to(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const no=ho(/[A-Za-z]/),ro=ho(/[\dA-Za-z]/),oo=ho(/[#-'*+\--9=?A-Z^-~]/);function Ao(e){return null!==e&&(e<32||127===e)}const io=ho(/\d/),ao=ho(/[\dA-Fa-f]/),so=ho(/[!-/:-@[-`{-~]/);function lo(e){return null!==e&&e<-2}function co(e){return null!==e&&(e<0||32===e)}function uo(e){return-2===e||-1===e||32===e}const po=ho(new RegExp("\\p{P}|\\p{S}","u")),fo=ho(/\s/);function ho(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function go(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const A=e.charCodeAt(n);let i="";if(37===A&&ro(e.charCodeAt(n+1))&&ro(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 mo(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let A=0;return function(r){return uo(r)?(e.enter(n),i(r)):t(r)};function i(r){return uo(r)&&A++<o?(e.consume(r),i):(e.exit(n),t(r))}}const vo={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"),mo(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)):lo(t)?(e.consume(t),e.exit("chunkText"),r):(e.consume(t),o)}}};const bo={tokenize:function(e){const t=this,n=[];let r,o,A,i=0;return a;function a(r){if(i<n.length){const o=n[i];return t.containerState=o[1],e.attempt(o[0].continuation,s,l)(r)}return l(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 a=n;for(;a<t.events.length;)t.events[a][1].end={...o},a++;return Vr(t.events,A+1,0,t.events.slice(n)),t.events.length=a,l(e)}return a(e)}function l(o){if(i===n.length){if(!r)return d(o);if(r.currentConstruct&&r.currentConstruct.concrete)return f(o);t.interrupt=!(!r.currentConstruct||r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wo,c,u)(o)}function c(e){return r&&v(),m(i),d(e)}function u(e){return t.parser.lazy[t.now().line]=i!==n.length,A=t.now().offset,f(e)}function d(n){return t.containerState={},e.attempt(wo,p,f)(n)}function p(e){return i++,n.push([t.currentConstruct,t.containerState]),d(e)}function f(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)):lo(n)?(e.consume(n),g(e.exit("chunkFlow")),i=0,t.interrupt=void 0,a):(e.consume(n),h)}function g(e,n){const a=t.sliceStream(e);if(n&&a.push(null),e.previous=o,o&&(o.next=e),o=e,r.defineSkip(e.start),r.write(a),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,a,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){if(o){a=t.events[s][1].end;break}o=!0}for(m(i),e=n;e<t.events.length;)t.events[e][1].end={...a},e++;Vr(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}}},wo={tokenize:function(e,t,n){return mo(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};function yo(e){return null===e||co(e)||fo(e)?1:po(e)?2:void 0}function xo(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 Eo={name:"attention",resolveAll:function(e,t){let n,r,o,A,i,a,s,l,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close)for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;const u={...e[n][1].end},d={...e[c][1].start};Bo(u,-a),Bo(d,a),A={type:a>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},i={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:d},o={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...A.start},end:{...i.end}},e[n][1].end={...A.start},e[c][1].start={...i.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=Xr(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=Xr(s,[["enter",r,t],["enter",A,t],["exit",A,t],["enter",o,t]]),s=Xr(s,xo(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=Xr(s,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(l=2,s=Xr(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):l=0,Vr(e,n-1,c-n+3,s),c=n+s.length-l-2;break}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=yo(r);let A;return function(t){return A=t,e.enter("attentionSequence"),i(t)};function i(a){if(a===A)return e.consume(a),i;const s=e.exit("attentionSequence"),l=yo(a),c=!l||2===l&&o||n.includes(a),u=!o||2===o&&l||n.includes(r);return s._open=!!(42===A?c:c&&(o||!u)),s._close=!!(42===A?u:u&&(l||!c)),t(a)}}};function Bo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Po={name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o};function o(t){return no(t)?(e.consume(t),A):64===t?n(t):s(t)}function A(e){return 43===e||45===e||46===e||ro(e)?(r=1,i(e)):s(e)}function i(t){return 58===t?(e.consume(t),r=0,a):(43===t||45===t||46===t||ro(t))&&r++<32?(e.consume(t),i):(r=0,s(t))}function a(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||Ao(r)?n(r):(e.consume(r),a)}function s(t){return 64===t?(e.consume(t),l):oo(t)?(e.consume(t),s):n(t)}function l(e){return ro(e)?c(e):n(e)}function c(n){return 46===n?(e.consume(n),r=0,l):62===n?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):u(n)}function u(t){if((45===t||ro(t))&&r++<63){const n=45===t?u:c;return e.consume(t),n}return n(t)}}};const ko={partial:!0,tokenize:function(e,t,n){return function(t){return uo(t)?mo(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||lo(e)?t(e):n(e)}}};const Co={continuation:{tokenize:function(e,t,n){const r=this;return function(t){return uo(t)?mo(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):o(t)};function o(r){return e.attempt(Co,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 uo(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}};const Do={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 so(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}};const So={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"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,A=ro,l(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,A=ao,l):(e.enter("characterReferenceValue"),o=7,A=io,l(t))}function l(a){if(59===a&&i){const o=e.exit("characterReferenceValue");return A!==ro||Wr(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return A(a)&&i++<o?(e.consume(a),l):n(a)}}};const Io={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)}}},To={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"),uo(t)?mo(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===A?(e.enter("codeFencedFenceSequence"),c(t)):n(t)}function c(t){return t===A?(o++,e.consume(t),c):o>=a?(e.exit("codeFencedFenceSequence"),uo(t)?mo(e,u,"whitespace")(t):u(t)):n(t)}function u(r){return null===r||lo(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}};let A,i=0,a=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?(a++,e.consume(t),s):a<3?n(t):(e.exit("codeFencedFenceSequence"),uo(t)?mo(e,l,"whitespace")(t):l(t))}function l(n){return null===n||lo(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(Io,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),c(n))}function c(t){return null===t||lo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(t)):uo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mo(e,u,"whitespace")(t)):96===t&&t===A?n(t):(e.consume(t),c)}function u(t){return null===t||lo(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return null===t||lo(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(t)):96===t&&t===A?n(t):(e.consume(t),d)}function p(t){return e.attempt(o,v,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&uo(t)?mo(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||lo(t)?e.check(Io,p,v)(t):(e.enter("codeFlowValue"),m(t))}function m(t){return null===t||lo(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),m)}function v(n){return e.exit("codeFenced"),t(n)}}};const Qo={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),mo(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?a(t):lo(t)?e.attempt(Mo,A,a)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||lo(t)?(e.exit("codeFlowValue"),A(t)):(e.consume(t),i)}function a(n){return e.exit("codeIndented"),t(n)}}},Mo={partial:!0,tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):lo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):mo(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):lo(e)?o(e):n(e)}}};const Oo={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"),a(t))}function a(t){return null===t?n(t):32===t?(e.enter("space"),e.consume(t),e.exit("space"),a):96===t?(o=e.enter("codeTextSequence"),r=0,l(t)):lo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(e.enter("codeTextData"),s(t))}function s(t){return null===t||32===t||96===t||lo(t)?(e.exit("codeTextData"),a(t)):(e.consume(t),s)}function l(n){return 96===n?(e.consume(n),r++,l):r===A?(e.exit("codeTextSequence"),e.exit("codeText"),t(n)):(o.type="codeTextData",s(n))}}};class Lo{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){const n=t??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){const r=t||0;this.setCursor(Math.trunc(e));const o=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return n&&jo(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),jo(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),jo(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&0===this.right.length||e<0&&0===this.left.length))if(e<this.left.length){const t=this.left.splice(e,Number.POSITIVE_INFINITY);jo(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);jo(this.left,t.reverse())}}}function jo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function No(e){const t={};let n,r,o,A,i,a,s,l=-1;const c=new Lo(e);for(;++l<c.length;){for(;l in t;)l=t[l];if(n=c.get(l),l&&"chunkFlow"===n[1].type&&"listItemPrefix"===c.get(l-1)[1].type&&(a=n[1]._tokenizer.events,o=0,o<a.length&&"lineEndingBlank"===a[o][1].type&&(o+=2),o<a.length&&"content"===a[o][1].type))for(;++o<a.length&&"content"!==a[o][1].type;)"chunkText"===a[o][1].type&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if("enter"===n[0])n[1].contentType&&(Object.assign(t,Ho(c,l)),l=t[l],s=!0);else if(n[1]._container){for(o=l,r=void 0;o--;)if(A=c.get(o),"lineEnding"===A[1].type||"lineEndingBlank"===A[1].type)"enter"===A[0]&&(r&&(c.get(r)[1].type="lineEndingBlank"),A[1].type="lineEnding",r=o);else if("linePrefix"!==A[1].type)break;r&&(n[1].end={...c.get(r)[1].start},i=c.slice(r,l),i.unshift(n),c.splice(r,l-r+1,i))}}return Vr(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!s}function Ho(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),a=i.events,s=[],l={};let c,u,d=-1,p=n,f=0,h=0;const g=[h];for(;p;){for(;e.get(++o)[1]!==p;);A.push(o),p._tokenizer||(c=r.sliceStream(p),p.next||c.push(null),u&&i.defineSkip(p.start),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),p._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),u=p,p=p.next}for(p=n;++d<a.length;)"exit"===a[d][0]&&"enter"===a[d-1][0]&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(h=d+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(i.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),d=g.length;d--;){const t=a.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;)l[f+s[d][0]]=f+s[d][1],f+=s[d][1]-s[d][0]-1;return l}const Ro={resolve:function(e){return No(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?o(t):lo(t)?e.check(zo,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}}},zo={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mo(e,o,"linePrefix")};function o(o){if(null===o||lo(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 Fo(e,t,n,r,o,A,i,a,s){const l=s||Number.POSITIVE_INFINITY;let c=0;return function(t){return 60===t?(e.enter(r),e.enter(o),e.enter(A),e.consume(t),e.exit(A),u):null===t||32===t||41===t||Ao(t)?n(t):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(A),e.consume(n),e.exit(A),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(a),u(t)):null===t||60===t||lo(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(o){return c||null!==o&&41!==o&&!co(o)?c<l&&40===o?(e.consume(o),c++,f):41===o?(e.consume(o),c--,f):null===o||32===o||40===o||Ao(o)?n(o):(e.consume(o),92===o?h:f):(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),t(o))}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function Uo(e,t,n,r,o,A){const i=this;let a,s=0;return function(t){return e.enter(r),e.enter(o),e.consume(t),e.exit(o),e.enter(A),l};function l(u){return s>999||null===u||91===u||93===u&&!a||94===u&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(u):93===u?(e.exit(A),e.enter(o),e.consume(u),e.exit(o),e.exit(r),t):lo(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||lo(t)||s++>999?(e.exit("chunkString"),l(t)):(e.consume(t),a||(a=!uo(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function qo(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,a):n(t)};function a(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),a(i)):null===t?n(t):lo(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mo(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),l(t))}function l(t){return t===i||null===t||lo(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:l)}function c(t){return t===i||92===t?(e.consume(t),l):l(t)}}function _o(e,t){let n;return function r(o){return lo(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):uo(o)?mo(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const Yo={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return Uo.call(r,e,A,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function A(t){return o=to(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 co(t)?_o(e,a)(t):a(t)}function a(t){return Fo(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(Go,l,l)(t)}function l(t){return uo(t)?mo(e,c,"whitespace")(t):c(t)}function c(A){return null===A||lo(A)?(e.exit("definition"),r.parser.defined.push(o),t(A)):n(A)}}},Go={partial:!0,tokenize:function(e,t,n){return function(t){return co(t)?_o(e,r)(t):n(t)};function r(t){return qo(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return uo(t)?mo(e,A,"whitespace")(t):A(t)}function A(e){return null===e||lo(e)?t(e):n(e)}}};const Wo={name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return lo(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}};const Vo={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"},Vr(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||co(t)?(e.exit("atxHeadingSequence"),A(t)):n(t)}function A(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||lo(n)?(e.exit("atxHeading"),t(n)):uo(n)?mo(e,A,"whitespace")(n):(e.enter("atxHeadingText"),a(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),A(t))}function a(t){return null===t||35===t||co(t)?(e.exit("atxHeadingText"),A(t)):(e.consume(t),a)}}};const Xo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ko=["pre","script","style","textarea"],Jo={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,a,s;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),l}(t)};function l(a){return 33===a?(e.consume(a),c):47===a?(e.consume(a),A=!0,p):63===a?(e.consume(a),o=3,r.interrupt?t:O):no(a)?(e.consume(a),i=String.fromCharCode(a),f):n(a)}function c(A){return 45===A?(e.consume(A),o=2,u):91===A?(e.consume(A),o=5,a=0,d):no(A)?(e.consume(A),o=4,r.interrupt?t:O):n(A)}function u(o){return 45===o?(e.consume(o),r.interrupt?t:O):n(o)}function d(o){const A="CDATA[";return o===A.charCodeAt(a++)?(e.consume(o),6===a?r.interrupt?t:k:d):n(o)}function p(t){return no(t)?(e.consume(t),i=String.fromCharCode(t),f):n(t)}function f(a){if(null===a||47===a||62===a||co(a)){const s=47===a,l=i.toLowerCase();return s||A||!Ko.includes(l)?Xo.includes(i.toLowerCase())?(o=6,s?(e.consume(a),h):r.interrupt?t(a):k(a)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(a):A?g(a):m(a)):(o=1,r.interrupt?t(a):k(a))}return 45===a||ro(a)?(e.consume(a),i+=String.fromCharCode(a),f):n(a)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:k):n(o)}function g(t){return uo(t)?(e.consume(t),g):B(t)}function m(t){return 47===t?(e.consume(t),B):58===t||95===t||no(t)?(e.consume(t),v):uo(t)?(e.consume(t),m):B(t)}function v(t){return 45===t||46===t||58===t||95===t||ro(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):uo(t)?(e.consume(t),b):m(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,y):uo(t)?(e.consume(t),w):x(t)}function y(t){return t===s?(e.consume(t),s=null,E):null===t||lo(t)?n(t):(e.consume(t),y)}function x(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||co(t)?b(t):(e.consume(t),x)}function E(e){return 47===e||62===e||uo(e)?m(e):n(e)}function B(t){return 62===t?(e.consume(t),P):n(t)}function P(t){return null===t||lo(t)?k(t):uo(t)?(e.consume(t),P):n(t)}function k(t){return 45===t&&2===o?(e.consume(t),I):60===t&&1===o?(e.consume(t),T):62===t&&4===o?(e.consume(t),L):63===t&&3===o?(e.consume(t),O):93===t&&5===o?(e.consume(t),M):!lo(t)||6!==o&&7!==o?null===t||lo(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),k):(e.exit("htmlFlowData"),e.check(Zo,j,C)(t))}function C(t){return e.check($o,D,j)(t)}function D(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),S}function S(t){return null===t||lo(t)?C(t):(e.enter("htmlFlowData"),k(t))}function I(t){return 45===t?(e.consume(t),O):k(t)}function T(t){return 47===t?(e.consume(t),i="",Q):k(t)}function Q(t){if(62===t){const n=i.toLowerCase();return Ko.includes(n)?(e.consume(t),L):k(t)}return no(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),Q):k(t)}function M(t){return 93===t?(e.consume(t),O):k(t)}function O(t){return 62===t?(e.consume(t),L):45===t&&2===o?(e.consume(t),O):k(t)}function L(t){return null===t||lo(t)?(e.exit("htmlFlowData"),j(t)):(e.consume(t),L)}function j(n){return e.exit("htmlFlow"),t(n)}}},Zo={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(ko,t,n)}}},$o={partial:!0,tokenize:function(e,t,n){const r=this;return function(t){return lo(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 eA={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),a};function a(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),w):63===t?(e.consume(t),v):no(t)?(e.consume(t),E):n(t)}function s(t){return 45===t?(e.consume(t),l):91===t?(e.consume(t),A=0,p):no(t)?(e.consume(t),m):n(t)}function l(t){return 45===t?(e.consume(t),d):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):lo(t)?(i=c,Q(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),d):c(t)}function d(e){return 62===e?T(e):45===e?u(e):c(e)}function p(t){const r="CDATA[";return t===r.charCodeAt(A++)?(e.consume(t),6===A?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):lo(t)?(i=f,Q(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):f(t)}function m(t){return null===t||62===t?T(t):lo(t)?(i=m,Q(t)):(e.consume(t),m)}function v(t){return null===t?n(t):63===t?(e.consume(t),b):lo(t)?(i=v,Q(t)):(e.consume(t),v)}function b(e){return 62===e?T(e):v(e)}function w(t){return no(t)?(e.consume(t),y):n(t)}function y(t){return 45===t||ro(t)?(e.consume(t),y):x(t)}function x(t){return lo(t)?(i=x,Q(t)):uo(t)?(e.consume(t),x):T(t)}function E(t){return 45===t||ro(t)?(e.consume(t),E):47===t||62===t||co(t)?B(t):n(t)}function B(t){return 47===t?(e.consume(t),T):58===t||95===t||no(t)?(e.consume(t),P):lo(t)?(i=B,Q(t)):uo(t)?(e.consume(t),B):T(t)}function P(t){return 45===t||46===t||58===t||95===t||ro(t)?(e.consume(t),P):k(t)}function k(t){return 61===t?(e.consume(t),C):lo(t)?(i=k,Q(t)):uo(t)?(e.consume(t),k):B(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,D):lo(t)?(i=C,Q(t)):uo(t)?(e.consume(t),C):(e.consume(t),S)}function D(t){return t===o?(e.consume(t),o=void 0,I):null===t?n(t):lo(t)?(i=D,Q(t)):(e.consume(t),D)}function S(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||co(t)?B(t):(e.consume(t),S)}function I(e){return 47===e||62===e||co(e)?B(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function Q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),M}function M(t){return uo(t)?mo(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 tA={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&&Vr(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,o,A,i=e.length,a=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)){a=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}},l={type:"label",start:{...e[r][1].start},end:{...e[o][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[o-2][1].start}};return A=[["enter",s,t],["enter",l,t]],A=Xr(A,e.slice(r+1,r+a+3)),A=Xr(A,[["enter",c,t]]),A=Xr(A,xo(t.parser.constructs.insideSpan.null,e.slice(r+a+4,o-3),t)),A=Xr(A,[["exit",c,t],e[o-2],e[o-1],["exit",l,t]]),A=Xr(A,e.slice(o+1)),A=Xr(A,[["exit",s,t]]),Vr(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?c(t):(A=r.parser.defined.includes(to(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(nA,l,A?l:c)(t):91===t?e.attempt(rA,l,A?s:c)(t):A?l(t):c(t)}function s(t){return e.attempt(oA,l,c)(t)}function l(e){return t(e)}function c(e){return o._balanced=!0,n(e)}}},nA={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 co(t)?_o(e,o)(t):o(t)}function o(t){return 41===t?l(t):Fo(e,A,i,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function A(t){return co(t)?_o(e,a)(t):l(t)}function i(e){return n(e)}function a(t){return 34===t||39===t||40===t?qo(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):l(t)}function s(t){return co(t)?_o(e,l)(t):l(t)}function l(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},rA={tokenize:function(e,t,n){const r=this;return function(t){return Uo.call(r,e,o,A,"reference","referenceMarker","referenceString")(t)};function o(e){return r.parser.defined.includes(to(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function A(e){return n(e)}}},oA={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 AA={name:"labelStartImage",resolveAll:tA.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 iA={name:"labelStartLink",resolveAll:tA.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 aA={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),mo(e,t,"linePrefix")}}};const sA={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||lo(A))?(e.exit("thematicBreak"),t(A)):n(A)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),uo(t)?mo(e,A,"whitespace")(t):A(t))}}};const lA={continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ko,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mo(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!uo(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(uA,t,o)(n))});function o(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,mo(e,e.attempt(lA,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:io(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(sA,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(t)}return n(t)};function a(t){return io(t)&&++i<10?(e.consume(t),a):(!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(ko,r.interrupt?n:l,e.attempt(cA,u,c))}function l(e){return r.containerState.initialBlankLine=!0,A++,u(e)}function c(t){return uo(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=A+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},cA={partial:!0,tokenize:function(e,t,n){const r=this;return mo(e,function(e){const o=r.events[r.events.length-1];return!uo(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},uA={partial:!0,tokenize:function(e,t,n){const r=this;return mo(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 dA={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,a=r.events.length;for(;a--;)if("lineEnding"!==r.events[a][1].type&&"linePrefix"!==r.events[a][1].type&&"content"!==r.events[a][1].type){i="paragraph"===r.events[a][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"),uo(t)?mo(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||lo(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};const pA={tokenize:function(e){const t=this,n=e.attempt(ko,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,mo(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Ro,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 fA={resolveAll:vA()},hA=mA("string"),gA=mA("text");function mA(e){return{resolveAll:vA("text"===e?bA: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),a;t.consume(e)}function a(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),a)}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 vA(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 bA(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,a=-1,s=0;for(;i--;){const e=o[i];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)s++,a--;if(a)break;a=-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?a:r.start._bufferIndex+a,_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 wA={42:lA,43:lA,45:lA,48:lA,49:lA,50:lA,51:lA,52:lA,53:lA,54:lA,55:lA,56:lA,57:lA,62:Co},yA={91:Yo},xA={[-2]:Qo,[-1]:Qo,32:Qo},EA={35:Vo,42:sA,45:[dA,sA],60:Jo,61:dA,95:sA,96:To,126:To},BA={38:So,92:Do},PA={[-5]:aA,[-4]:aA,[-3]:aA,33:AA,38:So,42:Eo,60:[Po,eA],91:iA,92:[Wo,Do],93:tA,95:Eo,96:Oo},kA={null:[Eo,fA]},CA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:yA,disable:{null:[]},document:wA,flow:EA,flowInitial:xA,insideSpan:kA,string:BA,text:PA},Symbol.toStringTag,{value:"Module"}));function DA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},A=[];let i=[],a=[];const s={attempt:h(function(e,t){g(e,t.from)}),check:h(f),consume:function(e){lo(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++)),l.previous=e},enter:function(e,t){const n=t||{};return n.type=e,n.start=d(),l.events.push(["enter",n,l]),a.push(n),n},exit:function(e){const t=a.pop();return t.end=d(),l.events.push(["exit",t,l]),t},interrupt:h(f,{interrupt:!0})},l={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("")}(u(e),t)},sliceStream:u,write:function(e){return i=Xr(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;)p(t.charCodeAt(r._bufferIndex));else p(t)}}(),null!==i[i.length-1]?[]:(g(t,0),l.events=xo(A,l.events,l),l.events)}};let c=t.tokenize.call(l,s);return t.resolveAll&&A.push(t),l;function u(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 p(e){c=c(e)}function f(e,t){t.restore()}function h(e,t){return function(n,o,A){let i,c,u,p;return Array.isArray(n)?f(n):"tokenize"in n?f([n]):function(e){return t;function t(t){const n=null!==t&&e[t],r=null!==t&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}(n);function f(e){return i=e,c=0,0===e.length?A:h(e[c])}function h(e){return function(n){return p=function(){const e=d(),t=l.previous,n=l.currentConstruct,o=l.events.length,A=Array.from(a);return{from:o,restore:i};function i(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=o,a=A,m()}}(),u=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?v():e.tokenize.call(t?Object.assign(Object.create(l),t):l,s,g,v)(n)}}function g(t){return e(u,p),o}function v(e){return p.restore(),++c<i.length?h(i[c]):A}}}function g(e,t){e.resolveAll&&!A.includes(e)&&A.push(e),e.resolve&&Vr(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function m(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}const SA=/[\0\t\n\r]/g;const IA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function TA(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return eo(n.slice(t?2:1),t?16:10)}return Wr(n)||e}const QA={}.hasOwnProperty;function MA(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:P,autolinkEmail:P,atxHeading:A(J),blockQuote:A(G),characterEscape:P,characterReference:P,codeFenced:A(W),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:A(W,i),codeText:A(V,i),codeTextData:P,data:P,codeFlowValue:P,definition:A(X),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:A(K),hardBreakEscape:A(Z),hardBreakTrailing:A(Z),htmlFlow:A($,i),htmlFlowData:P,htmlText:A($,i),htmlTextData:P,image:A(ee),label:i,link:A(te),listItem:A(re),listItemValue:d,listOrdered:A(ne,u),listUnordered:A(ne),paragraph:A(oe),reference:R,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:A(J),strong:A(Ae),thematicBreak:A(ae)},exit:{atxHeading:s(),atxHeadingSequence:y,autolink:s(),autolinkEmail:Y,autolinkProtocol:_,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:F,characterReferenceMarkerNumeric:F,characterReferenceValue:U,characterReference:q,codeFenced:s(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:k,codeIndented:s(m),codeText:s(T),codeTextData:k,data:k,definition:s(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:b,emphasis:s(),hardBreakEscape:s(D),hardBreakTrailing:s(D),htmlFlow:s(S),htmlFlowData:k,htmlText:s(I),htmlTextData:k,image:s(M),label:L,labelText:O,lineEnding:C,link:s(Q),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:z,resourceDestinationString:j,resourceTitleString:N,resource:H,setextHeading:s(B),setextHeadingLineSequence:E,setextHeadingText:x,strong:s(),thematicBreak:s()}};LA(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let r={type:"root",children:[]};const A={stack:[r],tokenStack:[],config:t,enter:a,exit:l,buffer:i,resume:c,data:n},s=[];let u=-1;for(;++u<e.length;)if("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)if("enter"===e[u][0])s.push(u);else{u=o(e,s.pop(),u)}for(u=-1;++u<e.length;){const n=t[e[u][0]];QA.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},A),e[u][1])}if(A.tokenStack.length>0){const e=A.tokenStack[A.tokenStack.length-1];(e[1]||NA).call(A,void 0,e[0])}for(r.position={start:OA(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:OA(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r}function o(e,t,n){let r,o,A,i,a=t-1,s=-1,l=!1;for(;++a<=n;){const t=e[a];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=a),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=a;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",l=!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||a,0,["exit",r,t[2]]),a++,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(a,0,["enter",o,t[2]]),a++,n++,A=void 0,i=!0}}}return e[t][1]._spread=l,n}function A(e,t){return n;function n(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(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:OA(t.start),end:void 0}}function s(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){const n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw new Error("Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+"): it’s not open");r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||NA).call(this,e,r[0])),n.position.end=OA(e.end)}function c(){return function(e){return _r(e,"boolean"!=typeof qr.includeImageAlt||qr.includeImageAlt,"boolean"!=typeof qr.includeHtml||qr.includeHtml)}(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function d(e){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){const e=this.resume();this.stack[this.stack.length-1].lang=e}function f(){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=to(this.sliceSerialize(e)).toLowerCase()}function b(){const e=this.resume();this.stack[this.stack.length-1].title=e}function w(){const e=this.resume();this.stack[this.stack.length-1].url=e}function y(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 E(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(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:OA(e.start),end:void 0},t.push(n)),this.stack.push(n)}function k(e){const t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=OA(e.end)}function C(e){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=OA(e.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(P.call(this,e),k.call(this,e))}function D(){this.data.atHardBreak=!0}function S(){const e=this.resume();this.stack[this.stack.length-1].value=e}function I(){const e=this.resume();this.stack[this.stack.length-1].value=e}function T(){const e=this.resume();this.stack[this.stack.length-1].value=e}function Q(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){const e=this.stack[this.stack.length-1];if(this.data.inReference){const t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(e){const t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=function(e){return e.replace(IA,TA)}(t),n.identifier=to(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 j(){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 H(){this.data.inReference=void 0}function R(){this.data.referenceType="collapsed"}function z(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=to(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"}function F(e){this.data.characterReferenceType=e.type}function U(e){const t=this.sliceSerialize(e),n=this.data.characterReferenceType;let r;n?(r=eo(t,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):r=Wr(t);this.stack[this.stack.length-1].value+=r}function q(e){this.stack.pop().position.end=OA(e.end)}function _(e){k.call(this,e);this.stack[this.stack.length-1].url=this.sliceSerialize(e)}function Y(e){k.call(this,e);this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)}function G(){return{type:"blockquote",children:[]}}function W(){return{type:"code",lang:null,meta:null,value:""}}function V(){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 Z(){return{type:"break"}}function $(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function te(){return{type:"link",title:null,url:"",children:[]}}function ne(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}function re(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}function oe(){return{type:"paragraph",children:[]}}function Ae(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}(n)(function(e){for(;!No(e););return e}(function(e){const t={constructs:Jr([CA,...(e||{}).extensions||[]]),content:n(vo),defined:[],document:n(bo),flow:n(pA),lazy:{},string:n(hA),text:n(gA)};return t;function n(e){return function(n){return DA(t,e,n)}}}(n).document().write(function(){let e,t=1,n="",r=!0;return function(o,A,i){const a=[];let s,l,c,u,d;for(o=n+("string"==typeof o?o.toString():new TextDecoder(A||void 0).decode(o)),c=0,n="",r&&(65279===o.charCodeAt(0)&&c++,r=void 0);c<o.length;){if(SA.lastIndex=c,s=SA.exec(o),u=s&&void 0!==s.index?s.index:o.length,d=o.charCodeAt(u),!s){n=o.slice(c);break}if(10===d&&c===u&&e)a.push(-3),e=void 0;else switch(e&&(a.push(-5),e=void 0),c<u&&(a.push(o.slice(c,u)),t+=u-c),d){case 0:a.push(65533),t++;break;case 9:for(l=4*Math.ceil(t/4),a.push(-2);t++<l;)a.push(-1);break;case 10:a.push(-4),t=1;break;default:e=!0,t=1}c=u+1}return i&&(e&&a.push(-5),n&&a.push(n),a.push(null)),a}}()(e,t,!0))))}function OA(e){return{line:e.line,column:e.column,offset:e.offset}}function LA(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LA(e,r):jA(e,r)}}function jA(e,t){let n;for(n in t)if(QA.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 NA(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+br({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+br({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+br({start:t.start,end:t.end})+") is still open")}function HA(e){const t=this;t.parser=function(n){return MA(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function RA(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 zA(e){return e.spread??e.children.length>1}function FA(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const A=[];for(;r;)A.push(UA(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return A.push(UA(t.slice(o),o>0,!1)),A.join("")}function UA(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 qA={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=go(r.toLowerCase()),A=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);void 0===a?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=A+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,s);const l={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,l),e.applyData(t,l)},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 RA(e,t);const o={src:go(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:go(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 RA(e,t);const o={href:go(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:go(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=zA(n[r])}return t}(n):zA(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 a=-1;for(;++a<r.length;){const e=r[a];(o||0!==a||"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 l={type:"element",tagName:"li",properties:A,children:i};return e.patch(t,l),e.applyData(t,l)},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=mr(t.children[1]),i=gr(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 a=-1;const s=[];for(;++a<i;){const n=t.children[a],r={},i=A?A[a]:void 0;i&&(r.align=i);let l={type:"element",tagName:o,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),s.push(l)}const l={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)},text:function(e,t){const n={type:"text",value:FA(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:_A,yaml:_A,definition:_A,footnoteDefinition:_A};function _A(){}const YA="object"==typeof self?self:globalThis,GA=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 YA[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 YA[A](i),o)};return r})(new Map,e)(0),WA="",{toString:VA}={},{keys:XA}=Object,KA=e=>{const t=typeof e;if("object"!==t||!e)return[0,t];const n=VA.call(e).slice(8,-1);switch(n){case"Array":return[1,WA];case"Object":return[2,WA];case"Date":return[3,WA];case"RegExp":return[4,WA];case"Map":return[5,WA];case"Set":return[6,WA];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},JA=([e,t])=>0===e&&("function"===t||"symbol"===t),ZA=(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,a]=KA(r);switch(i){case 0:{let t=r;switch(a){case"bigint":i=8,t=r.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);t=null;break;case"undefined":return o([-1],r)}return o([i,t],r)}case 1:{if(a){let e=r;return"DataView"===a?e=new Uint8Array(r.buffer):"ArrayBuffer"===a&&(e=new Uint8Array(r)),o([a,[...e]],r)}const e=[],t=o([i,e],r);for(const t of r)e.push(A(t));return t}case 2:{if(a)switch(a){case"BigInt":return o([a,r.toString()],r);case"Boolean":case"Number":case"String":return o([a,r.valueOf()],r)}if(t&&"toJSON"in r)return A(r.toJSON());const n=[],s=o([i,n],r);for(const t of XA(r))(e||!JA(KA(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||!JA(KA(n))&&!JA(KA(o)))&&t.push([A(n),A(o)]);return n}case 6:{const t=[],n=o([i,t],r);for(const n of r)(e||!JA(KA(n)))&&t.push(A(n));return n}}const{message:s}=r;return o([i,{name:a,message:s}],r)};return A})(!(t||n),!!t,new Map,r)(e),r},$A="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?GA(ZA(e,t)):structuredClone(e):(e,t)=>GA(ZA(e,t));function ei(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 ti(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}const ni=function(e){if(null==e)return oi;if("function"==typeof e)return ri(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ni(e[n]);return ri(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 ri(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 ri(t);function t(t){return t&&t.type===e}}(e);throw new Error("Expected function, string, or object as test")};function ri(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 oi(){return!0}const Ai=[],ii=!0,ai=!1;function si(e,t,n,r){let o;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):o=t;const A=ni(o),i=r?-1:1;!function e(o,a,s){const l=o&&"object"==typeof o?o:{};if("string"==typeof l.type){const e="string"==typeof l.tagName?l.tagName:"string"==typeof l.name?l.name:void 0;Object.defineProperty(c,"name",{value:"node ("+o.type+(e?"<"+e+">":"")+")"})}return c;function c(){let l,c,u,d=Ai;if((!t||A(o,a,s[s.length-1]||void 0))&&(d=function(e){return Array.isArray(e)?e:"number"==typeof e?[ii,e]:null==e?Ai:[e]}(n(o,s)),d[0]===ai))return d;if("children"in o&&o.children){const t=o;if(t.children&&"skip"!==d[0])for(c=(r?t.children.length:-1)+i,u=s.concat(t);c>-1&&c<t.children.length;){const n=t.children[c];if(l=e(n,c,u)(),l[0]===ai)return l;c="number"==typeof l[1]?l[1]:c+i}}return d}}(e,void 0,[])()}function li(e,t,n,r){let o,A,i;"function"==typeof t?(A=void 0,i=t,o=n):(A=t,i=n,o=r),si(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 ci={}.hasOwnProperty,ui={};function di(e,t){const n=t||ui,r=new Map,o=new Map,A=new Map,i={...qA,...n.handlers},a={all:function(e){const t=[];if("children"in e){const n=e.children;let r=-1;for(;++r<n.length;){const o=a.one(n[r],e);if(o){if(r&&"break"===n[r-1].type&&(!Array.isArray(o)&&"text"===o.type&&(o.value=mi(o.value)),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=mi(e.value))}Array.isArray(o)?t.push(...o):t.push(o)}}}return t},applyData:fi,definitionById:r,footnoteById:o,footnoteCounts:A,footnoteOrder:[],handlers:i,one:function(e,t){const n=e.type,r=a.handlers[n];if(ci.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){const{children:t,...n}=e,r=$A(n);return r.children=a.all(e),r}return $A(e)}return(a.options.unknownHandler||hi)(a,e,t)},options:n,patch:pi,wrap:gi};return li(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)}}),a}function pi(e,t){e.position&&(t.position=function(e){const t=mr(e),n=gr(e);if(t&&n)return{start:t,end:n}}(e))}function fi(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,$A(o)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function hi(e,t){const n=t.data||{},r=!("value"in t)||ci.call(n,"hProperties")||ci.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 gi(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 mi(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function vi(e,t){const n=di(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||ei,r=e.options.footnoteBackLabel||ti,o=e.options.footnoteLabel||"Footnotes",A=e.options.footnoteLabelTagName||"h2",i=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];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(),l=go(i.toLowerCase());let c=0;const u=[],d=e.footnoteCounts.get(i);for(;void 0!==d&&++c<=d;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+l+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}const p=A[A.length-1];if(p&&"element"===p.type&&"p"===p.tagName){const e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else A.push(...u);const f={type:"element",tagName:"li",properties:{id:t+"fn-"+l},children:e.wrap(A,!0)};e.patch(o,f),a.push(f)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:A,properties:{...$A(i),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!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 bi(e,t){return e&&"run"in e?async function(n,r){const o=vi(n,{file:r,...t});await e.run(o,r)}:function(n,r){return vi(n,{file:r,...e||t})}}function wi(e){if(e)throw e}var yi,xi;var Ei=function(){if(xi)return yi;xi=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},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return yi=function e(){var t,n,r,s,l,c,u=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},d=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});d<p;++d)if(null!=(t=arguments[d]))for(n in t)r=a(u,n),u!==(s=a(t,n))&&(f&&s&&(A(s)||(l=o(s)))?(l?(l=!1,c=r&&o(r)?r:[]):c=r&&A(r)?r:{},i(u,{name:n,newValue:e(f,c,s)})):typeof s<"u"&&i(u,{name:n,newValue:s}));return u},yi}();const Bi=sr(Ei);function Pi(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 ki(){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 a=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,a?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)}}(a,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 Ci={basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');Di(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,a=t.length-1;for(;A--;)if(47===e.codePointAt(A)){if(n){r=A+1;break}}else i<0&&(n=!0,i=A+1),a>-1&&(e.codePointAt(A)===t.codePointAt(a--)?a<0&&(o=A):(a=-1,o=i));return r===o?o=i:o<0&&(o=e.length),e.slice(r,o)},dirname:function(e){if(Di(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){Di(e);let t,n=e.length,r=-1,o=0,A=-1,i=0;for(;n--;){const a=e.codePointAt(n);if(47!==a)r<0&&(t=!0,r=n+1),46===a?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;)Di(e[n]),e[n]&&(t=void 0===t?e[n]:t+"/"+e[n]);return void 0===t?".":function(e){Di(e);const t=47===e.codePointAt(0);let n=function(e,t){let n,r,o="",A=0,i=-1,a=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!==a)if(i!==s-1&&2===a){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,a=0;continue}}else if(o.length>0){o="",A=0,i=s,a=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,a=0}else 46===n&&a>-1?a++:a=-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 Di(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Si={cwd:function(){return"/"}};function Ii(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}function Ti(e){if("string"==typeof e)e=new URL(e);else if(!Ii(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 Qi=["history","path","basename","stem","extname","dirname"];class Mi{constructor(e){let t;var n;t=e?Ii(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?"":Si.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r,o=-1;for(;++o<Qi.length;){const e=Qi[o];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)Qi.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?Ci.basename(this.path):void 0}set basename(e){Li(e,"basename"),Oi(e,"basename"),this.path=Ci.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?Ci.dirname(this.path):void 0}set dirname(e){ji(this.basename,"dirname"),this.path=Ci.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?Ci.extname(this.path):void 0}set extname(e){if(Oi(e,"extname"),ji(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=Ci.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Ii(e)&&(e=Ti(e)),Li(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?Ci.basename(this.path,this.extname):void 0}set stem(e){Li(e,"stem"),Oi(e,"stem"),this.path=Ci.join(this.dirname||"",e+(this.extname||""))}fail(e,t,n){const r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){const r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){const r=new Er(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Oi(e,t){if(e&&e.includes(Ci.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ci.sep+"`")}function Li(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ji(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}const Ni=function(e){const t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},Hi={}.hasOwnProperty;class Ri extends Ni{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=ki()}copy(){const e=new Ri;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data(Bi(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2===arguments.length?(qi("data",this.frozen),this.namespace[e]=t,this):Hi.call(this.namespace,e)&&this.namespace[e]||void 0:e?(qi("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=Gi(e),n=this.parser||this.Parser;return Fi("parse",n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),Fi("process",this.parser||this.Parser),Ui("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,o){const A=Gi(e),i=n.parse(A);function a(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 a(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,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),Fi("processSync",this.parser||this.Parser),Ui("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,wi(e),t=r}),Yi("processSync","process",n),t}run(e,t,n){_i(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=Gi(t);r.run(e,i,function(t,r,i){const a=r||e;t?A(t):o?o(a):n(void 0,a,i)})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){wi(e),n=t,r=!0}),Yi("runSync","run",r),n}stringify(e,t){this.freeze();const n=Gi(t),r=this.compiler||this.Compiler;return Ui("stringify",r),_i(e),r(e,n)}use(e,...t){const n=this.attachers,r=this.namespace;if(qi("use",this.frozen),null!=e)if("function"==typeof e)a(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)a(e,[]);else{if("object"!=typeof e)throw new TypeError("Expected usable value, not `"+e+"`");if(Array.isArray(e)){const[t,...n]=e;a(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=Bi(!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 a(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];Pi(i)&&Pi(r)&&(r=Bi(!0,i,r)),n[o]=[e,r,...A]}}}}const zi=(new Ri).freeze();function Fi(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `parser`")}function Ui(e,t){if("function"!=typeof t)throw new TypeError("Cannot `"+e+"` without `compiler`")}function qi(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 _i(e){if(!Pi(e)||"string"!=typeof e.type)throw new TypeError("Expected node, got `"+e+"`")}function Yi(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return function(e){return!!(e&&"object"==typeof e&&"message"in e&&"messages"in e)}(e)?e:new Mi(e)}const Wi=[],Vi={allowDangerousHtml:!0},Xi=/^(https?|ircs?|mailto|xmpp)$/i,Ki=[{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 Ji(e){const t=e.allowedElements,r=e.allowElement,o=e.children||"",A=e.className,i=e.components,a=e.disallowedElements,s=e.rehypePlugins||Wi,l=e.remarkPlugins||Wi,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Vi}:Vi,u=e.skipHtml,d=e.unwrapDisallowed,p=e.urlTransform||Zi,f=zi().use(HA).use(l).use(bi,c).use(s),h=new Mi;"string"==typeof o&&(h.value=o);for(const t of Ki)Object.hasOwn(e,t.from)&&(t.from,t.to&&t.to,t.id);const g=f.parse(h);let m=f.runSync(g,h);return A&&(m={type:"element",tagName:"div",properties:{className:A},children:"root"===m.type?m.children:[m]}),li(m,function(e,n,o){if("raw"===e.type&&o&&"number"==typeof n)return u?o.children.splice(n,1):o.children[n]={type:"text",value:e.value},n;if("element"===e.type){let t;for(t in Ur)if(Object.hasOwn(Ur,t)&&Object.hasOwn(e.properties,t)){const n=e.properties[t],r=Ur[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=p(String(n||""),t,e))}}if("element"===e.type){let A=t?!t.includes(e.tagName):!!a&&a.includes(e.tagName);if(!A&&r&&"number"==typeof n&&(A=!r(e,n,o)),A&&o&&"number"==typeof n)return d&&e.children?o.children.splice(n,1,...e.children):o.children.splice(n,1),n}}),Tr(m,{Fragment:n.Fragment,components:i,ignoreInvalidStyle:!0,jsx:n.jsx,jsxs:n.jsxs,passKeys:!0,passNode:!0})}function Zi(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||Xi.test(e.slice(0,t))?e:""}const $i=({children:e})=>n.jsx("div",{style:{whiteSpace:"normal"},children:n.jsx(Ji,{components:{p:({...e})=>n.jsx("p",{style:{margin:0,marginBottom:"0.5em",lineHeight:1.4,textAlign:"left"},children:e.children}),ul:({...e})=>n.jsx("ul",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),ol:({...e})=>n.jsx("ol",{style:{paddingLeft:"clamp(8px, 3.5vw, 16px)",margin:0,listStylePosition:"inside"},children:e.children}),li:({...e})=>n.jsx("li",{style:{marginBottom:"1px",lineHeight:1.4},children:e.children}),code:({inline:e,children:t})=>e?n.jsx("code",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"2px 4px",borderRadius:"4px",fontFamily:"inherit",fontSize:"0.95em"},children:t}):n.jsx("pre",{style:{backgroundColor:"rgba(0, 0, 0, 0.3)",padding:"8px",borderRadius:"4px",overflowX:"auto",margin:"0.5em 0",whiteSpace:"pre-wrap"},children:n.jsx("code",{children:t})}),blockquote:({...e})=>n.jsx("blockquote",{style:{margin:0,paddingLeft:"10px",borderLeft:"2px solid #ccc",color:"#666",fontStyle:"italic"},children:e.children})},children:"string"==typeof e?e:""})}),ea={autoConfig:!0},ta=t=>()=>(t=>{const{getFlow:n}=Rt(),{messages:r,replaceMessages:o}=zt(),{settings:A}=Ut(),{hasChatHistoryLoaded:i}=_t(),a={...t,...ea},s=a.markdownComponent?a.markdownComponent:$i;e.useEffect(()=>{var e,t;if(i){const n=[...r];for(let r=0;r<n.length&&r<((null==(e=A.chatHistory)?void 0:e.maxEntries)??30);r++){const e=n[r];null!=(t=e.tags)&&t.includes("rcb-markdown-renderer-plugin:parsed")&&(e.contentWrapper=s)}o(n)}},[i]);const l=async e=>{var t;const r=null==(t=e.data.message)?void 0:t.sender.toUpperCase();((e,t,n)=>{var r;if("string"!=typeof e.data.message.content||!e.detail.currPath)return!1;const o=t[e.detail.currPath];return!!o&&((null==(r=o.renderMarkdown)?void 0:r.map(e=>e.toUpperCase()).includes(n))??!1)})(e,n(),r)&&(e.data.message.contentWrapper=s,e.data.message.tags||(e.data.message.tags=[]),e.data.message.tags.push("rcb-markdown-renderer-plugin:parsed"))};Ft(j.PRE_INJECT_MESSAGE,l),Ft(j.CHUNK_STREAM_MESSAGE,l),Ft(j.START_STREAM_MESSAGE,l),Ft(j.START_SIMULATE_STREAM_MESSAGE,l);const c={name:"@rcb-plugins/markdown-renderer"};return null!=a&&a.autoConfig&&(c.settings={event:{rcbPreInjectMessage:!0,rcbChunkStreamMessage:!0,rcbStartSimulateStreamMessage:!0,rcbStartStreamMessage:!0}}),c})(t),na={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"}},ra=(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},oa=t=>{const{showToast:n}=(()=>{const{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}=Ke();return{showToast:e,dismissToast:t,toasts:n,replaceToasts:r}})(),{getFlow:r}=Rt(),{styles:o,updateStyles:A,replaceStyles:i}=(()=>{const{styles:e,replaceStyles:t,updateStyles:n}=St();return{styles:e,replaceStyles:t,updateStyles:n}})(),a=(e=>({...na,...e,promptBaseColors:{...na.promptBaseColors},promptHoveredColors:{...na.promptHoveredColors},textAreaHighlightColors:{...na.textAreaHighlightColors}}))(t),[s,l]=e.useState(0),c=e.useRef({});Ft(j.USER_SUBMIT_TEXT,e=>{const t=e,i=ra(t,r(),"validateTextInput");if(!i)return;const u=i(t.data.inputText);if(null!=u&&u.success||e.preventDefault(),!u.promptContent)return;0===s&&(c.current=structuredClone(o));const d=((e,t)=>{const n=e.promptType??"info";let r={};return t.advancedStyles&&(r=t.advancedStyles[n]),t.promptBaseColors&&(r.toastPromptStyle={color:t.promptBaseColors[n],borderColor:t.promptBaseColors[n]}),t.promptHoveredColors&&(r.toastPromptHoveredStyle={color:t.promptHoveredColors[n],borderColor:t.promptHoveredColors[n]}),t.textAreaHighlightColors&&(e.highlightTextArea??!0)&&(r.chatInputAreaStyle={boxShadow:`${t.textAreaHighlightColors[n]} 0px 0px 5px`}),r})(u,a);A(d),n(u.promptContent,u.promptDuration??3e3),l(e=>e+1)}),Ft(j.USER_UPLOAD_FILE,e=>{var t,o;const A=e,i=null==(o=null==(t=A.data)?void 0:t.files)?void 0:o[0];if(!i)return console.error("No file uploaded."),void e.preventDefault();const a=ra(A,r(),"validateFileInput");if(!a)return void console.error("Validator not found for file input.");const s=a(i);if(!s.success)return console.error("Validation failed:",s),s.promptContent&&n(s.promptContent,s.promptDuration??3e3),void e.preventDefault();console.log("Validation successful:",s)}),Ft(j.DISMISS_TOAST,()=>{l(e=>e-1)}),e.useEffect(()=>{0===s&&setTimeout(()=>{i(c.current)})},[s,i]);const u={name:"@rcb-plugins/input-validator"};return a.autoConfig&&(u.settings={event:{rcbUserSubmitText:!0,rcbUserUploadFile:!0,rcbDismissToast:!0}}),u},Aa=e.forwardRef((t,n)=>{let{embedded:r,currentOpen:o,enabled:A,onSetEnabled:i}=t;const a=zt(),s=(()=>{const{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}=q();return{isChatWindowOpen:e,toggleChatWindow:t,toggleIsBotTyping:n,scrollToBottom:r,getIsChatBotVisible:o}})(),l=e.useRef(null),c=e.useRef(!1);return e.useEffect(()=>{!r&&s&&s.toggleChatWindow&&(l.current===o||c.current||(setTimeout(()=>{s&&s.toggleChatWindow&&s.toggleChatWindow(o)},0),l.current=o),c.current=!1)},[o,r,s]),e.useEffect(()=>{const e=()=>{c.current=!0};return window.addEventListener("rcb-toggle-chat-window",e),()=>window.removeEventListener("rcb-toggle-chat-window",e)}),e.useImperativeHandle(n,()=>({addMessage:e=>{a&&a.injectMessage&&a.injectMessage(e)},openChat:()=>{!r&&s&&s.toggleChatWindow&&s.toggleChatWindow(!0)},closeChat:()=>{!r&&s&&s.toggleChatWindow&&s.toggleChatWindow(!1)},toggleChat:()=>{!r&&s&&s.toggleChatWindow&&s.toggleChatWindow()},setBotEnabled:e=>{i&&i(e)}}),[a,s,r,i]),null});Aa.displayName="BotController";const ia=t=>{let{loginUrl:n,className:r="",style:o,isHeaderButton:A=!1}=t;const i=A?{display:"inline-block",padding:"6px 12px",backgroundColor:"transparent",border:"1px solid #ccc",color:"white",textDecoration:"none",borderRadius:"4px",fontWeight:"normal",textAlign:"center",margin:"8px",fontSize:"12px",opacity:.8,transition:"all 0.2s ease"}:{display:"inline-block",padding:"10px 20px",backgroundColor:"white",border:"1px solid var(--primaryColor, #107180)",color:"var(--primaryColor, #107180)",textDecoration:"none",borderRadius:"4px",fontWeight:"bold",textAlign:"center",margin:"18px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)"};return e.createElement(e.Fragment,null,A&&e.createElement("style",null,"\n .rcb-chat-header-container .qa-bot-header-login-button:hover {\n background-color: #0000001a !important;\n opacity: 1 !important;\n }\n "),e.createElement("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"qa-bot-login-button ".concat(A?"qa-bot-header-login-button":""," ").concat(r),style:Object.assign(Object.assign({},i),o)},"Log In"))},aa=()=>e.createElement("div",{className:"user-login-icon",style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"5px",display:"flex"},role:"img","aria-label":"User logged in",title:"User logged in"},e.createElement("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElement("circle",{cx:"12",cy:"7",r:"4"}))),sa=[];for(let e=0;e<256;++e)sa.push((e+256).toString(16).slice(1));let la;const ca=new Uint8Array(16);var ua={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function da(e,t,n){if(ua.randomUUID&&!e)return ua.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!la){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");la=crypto.getRandomValues.bind(crypto)}return la(ca)}();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(sa[e[t+0]]+sa[e[t+1]]+sa[e[t+2]]+sa[e[t+3]]+"-"+sa[e[t+4]]+sa[e[t+5]]+"-"+sa[e[t+6]]+sa[e[t+7]]+"-"+sa[e[t+8]]+sa[e[t+9]]+"-"+sa[e[t+10]]+sa[e[t+11]]+sa[e[t+12]]+sa[e[t+13]]+sa[e[t+14]]+sa[e[t+15]]).toLowerCase()}(r)}function pa(){return"undefined"!=typeof localStorage&&"true"===localStorage.getItem("QA_BOT_DEBUG")}const fa="background: #1a5b6e; color: white; padding: 2px 6px; border-radius: 3px;",ha="background: #7c3aed; color: white; padding: 2px 6px; border-radius: 3px;",ga="background: #059669; color: white; padding: 2px 6px; border-radius: 3px;",ma="background: #dc2626; color: white; padding: 2px 6px; border-radius: 3px;",va="background: #f59e0b; color: #000; padding: 2px 6px; border-radius: 3px 0 0 3px; font-weight: bold;",ba="background: #fbbf24; color: #000; padding: 2px 6px; border-radius: 0 3px 3px 0;",wa=()=>{pa()&&console.log("%c QA Bot Core %c v".concat("0.2.11-debug.0"," "),va,ba)},ya=function(e){if(pa()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[Session]%c ".concat(e),fa,"",...n)}},xa=function(e){if(pa()){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];console.log("%c[History]%c ".concat(e),ha,"",...n)}},Ea=(e,t)=>{pa()&&console.log("%c[Message]%c ".concat(e),ga,"",t)},Ba=(e,t)=>{pa()&&console.log("%c[Block]%c ".concat(e),ma,"",t)},Pa=function(){console.warn(...arguments)},ka=function(){console.error(...arguments)},Ca="qa_bot_session_messages",Da=()=>"qa_bot_session_".concat(da()),Sa=()=>{try{const e=localStorage.getItem(Ca);return e?JSON.parse(e):{}}catch(e){return{}}},Ia=(e,t,n,r,o)=>{const A=Sa();!A[e]&&(A[e]={messages:[],startedAt:(new Date).toISOString(),preview:""},xa("NEW session created",{sessionId:e.slice(-12)}));if(A[e].messages.some(e=>e.id===t))return void xa("DUPLICATE message skipped",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r});const i={id:t,content:n,sender:r,type:o,timestamp:Date.now()};A[e].messages.push(i),xa("MESSAGE added",{sessionId:e.slice(-12),messageId:t.slice(-8),sender:r,totalInSession:A[e].messages.length});const a=A[e].messages,s=a.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(s){const t=s.content;A[e].preview=t.slice(0,50)+(t.length>50?"...":"")}else{const t=a.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)=>{let[,n]=e,[,r]=t;return new Date(n.startedAt).getTime()-new Date(r.startedAt).getTime()})[0])||void 0===t?void 0:t[0];if(!n)break;delete e[n]}localStorage.setItem(Ca,JSON.stringify(e))})(A),xa("STORAGE state",{ourSessions:Object.keys(A).length,ourTotalMessages:Object.values(A).reduce((e,t)=>e+t.messages.length,0)})},Ta=e=>{var t,n;return null!==(n=null===(t=Sa()[e])||void 0===t?void 0:t.messages.length)&&void 0!==n?n:0},Qa=e=>{const t=Sa()[e];return(null==t?void 0:t.startedAt)?Date.now()-new Date(t.startedAt).getTime():0},Ma=e.createContext(void 0),Oa=t=>{let{children:n,getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}=t;return e.createElement(Ma.Provider,{value:{getSessionId:r,setSessionId:o,resetSession:A,clearResettingFlag:i}},n)},La=()=>{const t=e.useContext(Ma);if(!t)throw new Error("useSession must be used within a SessionProvider");return t},ja=()=>{const[t,n]=e.useState(!1),[r,o]=e.useState([]),A=e.useRef(null),i=e.useRef(null),{replaceMessages:a}=zt(),{toggleTextAreaDisabled:s}=qt(),{setSessionId:l,getSessionId:c}=La();e.useEffect(()=>{const e=e=>{A.current&&!A.current.contains(e.target)&&i.current&&!i.current.contains(e.target)&&n(!1)};return t&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[t]);const u=e=>{const t=c();if(xa("RESTORE requested",{targetSession:e.slice(-12),currentSession:null==t?void 0:t.slice(-12)}),e===t)return xa("RESTORE skipped - already on this session"),void n(!1);const r=(e=>{var t;return(null===(t=Sa()[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()});xa("Stored messages from our localStorage",{count:r.length,ids:r.map(e=>e.id.slice(-8))});const o=r.map(e=>({id:e.id,content:e.content,sender:e.sender.toUpperCase(),type:e.type||"string",timestamp:new Date(e.timestamp).toISOString()}));a(o),xa("replaceMessages called",{count:o.length}),setTimeout(()=>{const e=document.querySelector(".rcb-chat-body-container");e&&e.querySelectorAll(".rcb-bot-message").forEach(e=>{e.innerHTML.includes("](")&&(e.innerHTML=e.innerHTML.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'))})},50),l(e),xa("Session ID updated",{newSession:e.slice(-12)}),s(!1),xa("Chat input enabled after restore"),n(!1)};return e.createElement("div",{style:{position:"relative"}},e.createElement("button",{ref:i,className:"history-button",onClick:()=>{t||o((()=>{const e=Sa();return Object.entries(e).map(e=>{let[t,n]=e;return Object.assign({sessionId:t},n)}).sort((e,t)=>new Date(t.startedAt).getTime()-new Date(e.startedAt).getTime())})()),n(!t)},style:{alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"50%",backgroundColor:"var(--primaryColor, #1a5b6e)",marginRight:"18px",display:"flex",border:"none",cursor:"pointer",padding:0},"aria-label":"View chat history",title:"View chat history","aria-expanded":t,"aria-haspopup":"menu"},e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"},e.createElement("circle",{cx:"12",cy:"12",r:"10"}),e.createElement("polyline",{points:"12 6 12 12 16 14"}))),t&&e.createElement("div",{ref:A,role:"menu",style:{position:"fixed",left:0,right:0,top:"auto",marginTop:"8px",backgroundColor:"white",borderRadius:0,borderBottom:"3px solid var(--primaryColor, #1a5b6e)",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",maxHeight:"250px",overflowY:"auto",zIndex:1e3}},0===r.length?e.createElement("div",{style:{padding:"12px 16px",color:"#666",fontSize:"14px",textAlign:"center"}},"No chat history"):r.map(t=>e.createElement("button",{key:t.sessionId,role:"menuitem",onClick:()=>u(t.sessionId),style:{width:"100%",padding:"10px 14px",border:"none",backgroundColor:"transparent",cursor:"pointer",textAlign:"left",display:"flex",flexDirection:"column",gap:"2px",borderBottom:"1px solid #eee"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#f5f5f5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},e.createElement("span",{style:{fontSize:"14px",color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.preview||"New conversation"),e.createElement("span",{style:{fontSize:"12px",color:"#888"}},(e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),r=Math.floor(n/864e5);return 0===r?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):1===r?"Yesterday":r<7?t.toLocaleDateString([],{weekday:"short"}):t.toLocaleDateString([],{month:"short",day:"numeric"})})(t.startedAt))))))};function Na(){return Na=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Na.apply(null,arguments)}const Ha=({width:t=24,height:n=24,color:r="currentColor",children:o,...A})=>e.createElement("svg",Na({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),Ra=t=>e.createElement(Ha,t,e.createElement("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})),za=e.createContext(null),Fa=t=>{let{onAnalyticsEvent:n,getSessionId:r,children:o}=t;const A=e.useRef(n);A.current=n;const i=e.useCallback(e=>{var t,n;A.current&&A.current(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:r())&&void 0!==n?n:void 0}))},[r]);return e.createElement(za.Provider,{value:{trackEvent:i}},o)},Ua=()=>{const{restartFlow:t}=Rt(),{setTextAreaValue:n}=qt(),{messages:r}=zt(),{getSessionId:o,resetSession:A,clearResettingFlag:i}=La(),{trackEvent:a}=e.useContext(za)||{trackEvent:()=>{}};return e.createElement("button",{onClick:async()=>{const e=o(),r=e?Ta(e):0;a({type:"qa_new_chat_started",previousMessageCount:r}),A(),await n(""),await t(),setTimeout(()=>{i()},100)},tabIndex:0,"aria-label":"New chat conversation",style:{backgroundColor:"var(--primaryColor, #107180)",border:"none",color:"#ffffff",fontSize:"14px",cursor:"pointer",padding:"8px 12px",borderRadius:"4px",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"6px",fontWeight:"500"},onMouseEnter:e=>{e.target.style.backgroundColor="var(--secondaryColor, #0d5f6b)"},onMouseLeave:e=>{e.target.style.backgroundColor="var(--primaryColor, #107180)"}},e.createElement(Ra,{width:16,height:16}),"New Chat")};function qa(e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if(!e)return"";if(Array.isArray(e))return e.map(qa).join("");if("object"==typeof e&&null!==e&&"props"in e){const t=e.props;if(t&&"children"in t)return qa(t.children)}return""}const _a=()=>{const{getSessionId:t}=La(),n=e.useCallback(e=>{var n;const r=null===(n=e.data)||void 0===n?void 0:n.message;if(Ea("PRE_INJECT",{sender:null==r?void 0:r.sender,type:null==r?void 0:r.type,content:null==r?void 0:r.content}),!(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:qa(r.content),i.includes("rcb-options-container"))return;if(!i.trim())return;const a=t();Ia(a,r.id,i,o,A)},[t]),r=e.useCallback(e=>{var t;const n=null===(t=e.detail)||void 0===t?void 0:t.block;Ba("PRE_PROCESS",{hasMessage:!!(null==n?void 0:n.message),messageType:typeof(null==n?void 0:n.message),hasOptions:!!(null==n?void 0:n.options),hasComponent:!!(null==n?void 0:n.component),block:n})},[]);return e.useEffect(()=>{const e=e=>{Ea(e.type.replace("rcb-","").toUpperCase(),{data:e.data})},t=["rcb-pre-inject-message","rcb-post-inject-message","rcb-change-path","rcb-user-submit-text"];return t.forEach(t=>{window.addEventListener(t,e)}),window.addEventListener("rcb-pre-process-block",r),window.addEventListener("rcb-post-process-block",r),window.addEventListener("rcb-pre-inject-message",n),()=>{t.forEach(t=>{window.removeEventListener(t,e)}),window.removeEventListener("rcb-pre-process-block",r),window.removeEventListener("rcb-post-process-block",r),window.removeEventListener("rcb-pre-inject-message",n)}},[n,r]),null},Ya=()=>(e.useEffect(()=>{const e=e=>{if(!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(e.key))return;const n=document.activeElement;if(n&&("INPUT"===n.tagName||"TEXTAREA"===n.tagName||"true"===n.contentEditable||n.classList.contains("rcb-chat-input-textarea")))return;const r=document.querySelector(".rcb-chat-window");if(!r)return;const o=Array.from(r.querySelectorAll(".rcb-message-container, .rcb-bot-message-container, .rcb-user-message-container")).filter(e=>null!==e.offsetParent);if(o.length>0){const t=o[o.length-1].querySelector(".rcb-checkbox-container");if(t&&null!==t.offsetParent){const n=Array.from(t.querySelectorAll(".rcb-checkbox-row-container")),r=t.querySelector(".rcb-checkbox-next-button");if(n.length>0){const t=[...n];return r&&t.push(r),void((e,t)=>{e.preventDefault();let n=-1;for(let e=0;e<t.length;e++)if(t[e]===document.activeElement||t[e].contains(document.activeElement)){n=e;break}-1===n&&(n=0);let r=n;switch(e.key){case"ArrowDown":case"ArrowRight":r=n<t.length-1?n+1:0;break;case"ArrowUp":case"ArrowLeft":r=n>0?n-1:t.length-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;case"Enter":case" ":{const e=t[n],r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});return void e.dispatchEvent(r)}default:return}t[r].focus(),t[r].setAttribute("tabindex","0"),t[r].classList.add("keyboard-focused"),t.forEach((e,t)=>{t!==r&&(e.setAttribute("tabindex","-1"),e.classList.remove("keyboard-focused"))})})(e,t)}}}let 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 a=[];if(i.length>0){const e=i[i.length-1];a=Array.from(e.querySelectorAll(".rcb-options"))}if(0===a.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(a.length>0){if(a.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",a.length),0===t?e.classList.add("keyboard-focused"):e.classList.remove("keyboard-focused")}),a.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(()=>{a[0]&&null!==a[0].offsetParent&&!r&&(a[0].focus(),a.length>1&&t(`${a.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);const Ga="#1a5b6e",Wa="#107180",Va="Arial, sans-serif",Xa="Q&A Bot",Ka="/chat-icon.svg",Ja="Type your question here...",Za="Select an option to continue",$a=!1,es="Ask me a question!",ts="/login",ns={general:{showHeader:!0,showFooter:!0},tooltip:{mode:"CLOSE"},chatInput:{disabled:!1,characterLimit:1e3,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}},rs=e.forwardRef((t,n)=>{var r,o;const{apiKey:A,qaEndpoint:i,ratingEndpoint:s,welcomeMessage:l,open:c,onOpenChange:u,isLoggedIn:d,allowAnonAccess:p=!1,actingUser:f,primaryColor:h,secondaryColor:g,botName:m,logo:v,placeholder:b,errorMessage:w,embedded:y,footerText:x,footerLink:E,tooltipText:B,loginUrl:P,customFlow:k,onAnalyticsEvent:C}=t,D=e.useRef("bot_".concat(Math.random().toString(36).substr(2,9)));e.useEffect(()=>{wa()},[]);const S=e.useRef(null);null===S.current&&(S.current=Da(),ya("CREATED",S.current));const I=e.useRef(!1),T=e.useRef({getSessionId:()=>S.current,isResetting:()=>I.current}),[Q,M]=e.useState(d);e.useEffect(()=>{M(d)},[d]);const O=e.useMemo(()=>{const t=Object.assign({},ns);t.general=Object.assign(Object.assign({},t.general),{primaryColor:h||Ga,secondaryColor:g||Wa,fontFamily:Va,embedded:void 0!==y?y:$a});const n=!1===Q?[e.createElement(ia,{key:"login-button",loginUrl:P||ts,isHeaderButton:!0})]:[e.createElement(ja,{key:"history-button"}),e.createElement(aa,{key:"user-icon"})];t.header={title:e.createElement("span",{style:{fontSize:14,fontWeight:500}},m||Xa),showAvatar:!0,avatar:v||Ka,buttons:[...n,a.CLOSE_CHAT_BUTTON]},t.chatInput=Object.assign(Object.assign({},t.chatInput),{disabled:!1,enabledPlaceholderText:b||Ja,disabledPlaceholderText:w||Za}),t.tooltip=Object.assign(Object.assign({},t.tooltip),{text:B||es});const r=x?E?e.createElement("a",{href:E,target:"_blank",rel:"noopener noreferrer",key:"footer-link"},x):e.createElement("span",{key:"footer-text"},x):null;return t.footer={text:r,buttons:[e.createElement(Ua,{key:"new-chat-button"})]},t.event={rcbPreInjectMessage:!0,rcbPostInjectMessage:!0,rcbUserSubmitText:!0,rcbChangePath:!0,rcbToggleChatWindow:!0},t},[h,g,m,v,b,w,y,B,Q,P,x,E]),L=e.useRef(null),j=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.useMemo(()=>{const e=(e,n)=>{if(t.current){const n=getComputedStyle(t.current).getPropertyValue(e);if(n&&""!==n.trim())return n.trim();if(t.current.parentElement){const n=getComputedStyle(t.current.parentElement).getPropertyValue(e);if(n&&""!==n.trim())return n.trim()}}return n};return{primaryColor:e("--primaryColor",n.primaryColor),secondaryColor:e("--secondaryColor",n.secondaryColor),fontFamily:e("--fontFamily",n.fontFamily)}},[t,n])}(L,O.general);((t,n)=>{e.useEffect(()=>{n.current&&(t?n.current.classList.add("bot-logged-in"):n.current.classList.remove("bot-logged-in"))},[t,n])})(!1!==Q,L),(t=>{let{settings:n,themeColors:r}=t;e.useEffect(()=>{r&&(Object.entries(r).forEach(e=>{let[t,n]=e;n&&document.documentElement.style.setProperty("--".concat(t),n)}),r.primaryColor&&document.documentElement.style.setProperty("--rcb-header-background",r.primaryColor),r.secondaryColor&&document.documentElement.style.setProperty("--rcb-header-background-hover",r.secondaryColor))},[r]),e.useEffect(()=>{var t,r,o;(null===(t=n.header)||void 0===t?void 0:t.title)&&"string"==typeof n.header.title&&(n.header.title=e.createElement("div",{key:"header-title"},e.createElement("h1",{className:"sr-only"},n.header.title),e.createElement("span",{"aria-hidden":"true"},n.header.title))),(null===(r=n.general)||void 0===r?void 0:r.embedded)&&n.chatWindow&&(n.chatWindow.defaultOpen=!0),n.device={desktopEnabled:!0,mobileEnabled:!0,applyMobileOptimizations:!1},n.chatHistory={disabled:!1},n.chatButton=Object.assign(Object.assign({},n.chatButton),{icon:null===(o=n.header)||void 0===o?void 0:o.avatar}),n.event={rcbToggleChatWindow:!0}},[n])})({settings:O,themeColors:j});const N=e.useMemo(()=>{const t=(t=>{let{endpoint:n,ratingEndpoint:r,apiKey:o,sessionId:A,isResetting:i=()=>!1,isLoggedIn:a,allowAnonAccess:s=!1,loginUrl:l="/login",actingUser:c,onAnalyticsEvent:u}=t;const d=e=>{var t,n;u&&u(Object.assign(Object.assign({},e),{timestamp:Date.now(),sessionId:null!==(n=null!==(t=e.sessionId)&&void 0!==t?t:A())&&void 0!==n?n:void 0}))};if(!1===a&&!s)return d({type:"qa_login_prompt_shown"}),{qa_loop:{message:"To ask questions, please log in first.",component:e.createElement(ia,{loginUrl:l}),chatDisabled:!0,path:"qa_loop"}};let p=null,f=!1;if(!n)throw new Error("Q&A endpoint is required");return{qa_loop:{message:async e=>{const{userInput:t}=e;if(i&&i())return null;if(!t||""===t.trim())return null;if("👍 Helpful"===t||"👎 Not helpful"===t){if(r&&p)try{const e="👍 Helpful"===t,n={"Content-Type":"application/json"};o&&(n["X-API-KEY"]=o);const i=A();i&&(n["X-Session-ID"]=i,n["X-Query-ID"]=p),await fetch(r,{method:"POST",headers:n,body:JSON.stringify({sessionId:i,queryId:p,rating:e?1:0})}),d({type:"qa_response_rated",queryId:p,rating:e?"helpful":"not_helpful"})}catch(e){ka("Error sending feedback:",e)}return"Thanks for the feedback! Feel free to ask another question."}try{const r=da();p=r,d({type:"qa_question_asked",queryId:r,questionLength:t.length});const i={"Content-Type":"application/json"};o&&(i["X-API-KEY"]=o);const a=A();a&&(i["X-Session-ID"]=a,i["X-Query-ID"]=r),c&&(i["X-Acting-User"]=c);const s={query:t,session_id:a,question_id:r};c&&(s.acting_user=c),ya("SENT to API",{session_id:a,question_id:r,acting_user:c||"(not set)"});const l=Date.now(),u=await fetch(n,{method:"POST",headers:i,body:JSON.stringify(s)}),h=Date.now()-l;if(!u.ok)throw new Error("API returned ".concat(u.status));const g=await u.json(),m=g.response||g.answer||g.text||g.message;if(!m)throw new Error("Invalid response format from API");const v=(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)),"[".concat(t,"](").concat(t,")").concat(n)}),t})(m),b=function(e){const{confidence:t,tools_used:n,metadata:r}=e;if(!(t||n&&0!==n.length))return"";const o=[];return t&&o.push("• Confidence: ".concat(t)),n&&n.length>0&&o.push("• Tools used: ".concat(n.join(", "))),(null==r?void 0:r.agent)&&o.push("• Agent: ".concat(r.agent)),"---\n".concat(o.join("\n"))}(g),w=b?"".concat(v,"\n\n").concat(b):v;return await e.injectMessage(w),d({type:"qa_response_received",queryId:r,responseTimeMs:h,success:!0,responseLength:m.length,hasMetadata:!!b}),f=!0,setTimeout(async()=>{await e.injectMessage("Feel free to ask another question.")},100),null}catch(e){return ka("Error in Q&A flow:",e),d({type:"qa_response_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=>i&&i()||"👍 Helpful"===e.userInput||"👎 Not helpful"===e.userInput?[]:r&&f?["👍 Helpful","👎 Not helpful"]:[],renderMarkdown:["BOT"],chatDisabled:!1,path:"qa_loop"}}})({endpoint:i,ratingEndpoint:s,apiKey:A,sessionId:T.current.getSessionId,isResetting:T.current.isResetting,isLoggedIn:Q,allowAnonAccess:p,loginUrl:P||ts,actingUser:f,onAnalyticsEvent:C}),n={message:l,transition:{duration:0},path:"qa_loop"};return Object.assign(Object.assign({start:n},t),k||{})},[A,i,s,l,Q,p,P,k,f,C]),H=e.useMemo(()=>{return[()=>wn(t),ta(),()=>oa(e)];var e,t},[]);return e.useEffect(()=>{const e=()=>{const e=document.querySelector(".rcb-chat-window");if(!e)return;const t=e.querySelector(".rcb-send-button");t&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","0"),t.hasAttribute("data-keyboard-enabled")||(t.setAttribute("data-keyboard-enabled","true"),t.addEventListener("keydown",e=>{if("Enter"===e.key||" "===e.key){e.preventDefault();const n=t&&Object.keys(t).find(e=>e.startsWith("__reactProps"));if(n){const r=t[n],o=null==r?void 0:r.onMouseDown;if(o&&"function"==typeof o)return void o(e)}const r=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(r)}})))},t=setInterval(e,1e3);return e(),()=>clearInterval(t)},[]),Ya(),e.useEffect(()=>{if(!y){const e=e=>{const t=e.data.newState;null==u||u(t);const n=S.current;t?null==C||C({type:"qa_bot_opened",timestamp:Date.now(),sessionId:null!=n?n:void 0}):null==C||C({type:"qa_bot_closed",timestamp:Date.now(),sessionId:null!=n?n:void 0,messageCount:n?Ta(n):0,durationMs:n?Qa(n):0})};return window.addEventListener("rcb-toggle-chat-window",e),()=>{window.removeEventListener("rcb-toggle-chat-window",e)}}},[y,u,C]),e.createElement("div",{className:"qa-bot ".concat((null===(r=O.general)||void 0===r?void 0:r.embedded)?"embedded-qa-bot":""),ref:L,role:"region","aria-label":m||Xa},e.createElement(Oa,{getSessionId:()=>S.current,setSessionId:e=>{const t=S.current;S.current=e,ya("RESTORED","".concat(null==t?void 0:t.slice(-12)," -> ").concat(e.slice(-12)))},resetSession:()=>{const e=S.current;I.current=!0,S.current=Da(),ya("RESET","".concat(null==e?void 0:e.slice(-12)," -> ").concat(S.current.slice(-12)))},clearResettingFlag:()=>{I.current=!1}},e.createElement(Fa,{onAnalyticsEvent:C,getSessionId:()=>S.current},e.createElement(Mt,null,e.createElement("div",null,e.createElement(_a,null),e.createElement(Aa,{ref:n,embedded:(null===(o=O.general)||void 0===o?void 0:o.embedded)||!1,currentOpen:c||!1,enabled:!1!==Q,onSetEnabled:e=>M(!!e&&void 0)}),e.createElement(Nt,{key:"chatbot-".concat(D.current,"-").concat(Q),settings:O,flow:N,plugins:H}),e.createElement("div",{role:"status","aria-live":"polite","aria-label":"Bot response updates",className:"sr-only",id:"bot-live-region"}),e.createElement("div",{id:"chat-input-help",className:"sr-only"},"Type your message and press Enter to send. Use arrow keys to navigate through response options."))))))});rs.displayName="QABot";i('.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{color:#fff;text-decoration:none}.rcb-chat-window .rcb-bot-message a:hover{text-decoration:underline}.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%}@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-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 os=()=>{const[t,n]=e.useState(!1),r=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"function"==typeof navigator.mediaDevices.getDisplayMedia;return{captureScreenshot:async()=>{if(!r())throw new Error("Screen capture is not available in this environment");try{n(!0);const e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser",cursor:"always",width:{ideal:1920},height:{ideal:1080}},audio:!1}),t=document.createElement("video");t.srcObject=e,await new Promise(e=>{t.onloadedmetadata=()=>{t.play(),e()}});const r=document.createElement("canvas");r.width=t.videoWidth,r.height=t.videoHeight;const o=r.getContext("2d");if(!o)throw new Error("Could not get canvas context");o.drawImage(t,0,0,r.width,r.height);const A=await new Promise(e=>r.toBlob(e,"image/png"));if(!A)throw new Error("Could not create image blob");const i=(new Date).toISOString().replace(/[:.]/g,"-"),a=new File([A],"screenshot-".concat(i,".png"),{type:"image/png"});return e.getTracks().forEach(e=>e.stop()),n(!1),a}catch(e){throw ka("Error capturing screenshot:",e),n(!1),e}},isCapturing:t,isScreenCaptureAvailable:r()}},As=t=>e.createElement(Ha,t,e.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElement("polyline",{points:"17 8 12 3 7 8"}),e.createElement("line",{x1:"12",y1:"3",x2:"12",y2:"15"})),is=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if("string"!=typeof r.result)return void n(new Error("Failed to read file ".concat(e.name)));const o=r.result.split(",")[1];t({fileName:e.name,contentType:e.type,size:e.size,fileData:o})},r.onerror=()=>n(new Error("Failed to read file ".concat(e.name))),r.readAsDataURL(e)}),as=e=>e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB");const ss=e.forwardRef((t,n)=>{const[r,o]=e.useState(t.defaultOpen||!1),A=e.useRef(null);return e.useImperativeHandle(n,()=>({addMessage:e=>{var t;null===(t=A.current)||void 0===t||t.addMessage(e)},setBotEnabled:e=>{var t;null===(t=A.current)||void 0===t||t.setBotEnabled(e)},openChat:()=>{var e;o(!0),null===(e=A.current)||void 0===e||e.openChat()},closeChat:()=>{var e;o(!1),null===(e=A.current)||void 0===e||e.closeChat()},toggleChat:()=>{var e;o(e=>!e),null===(e=A.current)||void 0===e||e.toggleChat()}}),[]),e.createElement(rs,{ref:A,apiKey:t.apiKey,qaEndpoint:t.qaEndpoint,ratingEndpoint:t.ratingEndpoint,welcomeMessage:t.welcomeMessage,primaryColor:t.primaryColor,secondaryColor:t.secondaryColor,botName:t.botName,logo:t.logo,placeholder:t.placeholder,errorMessage:t.errorMessage,embedded:t.embedded,isLoggedIn:t.isLoggedIn,allowAnonAccess:t.allowAnonAccess,open:r,onOpenChange:o,footerText:t.footerText,footerLink:t.footerLink,tooltipText:t.tooltipText,onAnalyticsEvent:t.onAnalyticsEvent})});function ls(n){if(!(n.target&&n.target instanceof HTMLElement))return void ka("QA Bot: A valid target DOM element is required");const r=t.createRoot(n.target),o={current:null};return r.render(e.createElement(e.StrictMode,null,e.createElement(ss,{ref:e=>{o.current=e},apiKey:n.apiKey,qaEndpoint:n.qaEndpoint,ratingEndpoint:n.ratingEndpoint,defaultOpen:n.defaultOpen,embedded:n.embedded,isLoggedIn:n.isLoggedIn,allowAnonAccess:n.allowAnonAccess,welcomeMessage:n.welcomeMessage,primaryColor:n.primaryColor,secondaryColor:n.secondaryColor,botName:n.botName,logo:n.logo,placeholder:n.placeholder,errorMessage:n.errorMessage,footerText:n.footerText,footerLink:n.footerLink,tooltipText:n.tooltipText,onAnalyticsEvent:n.onAnalyticsEvent}))),{addMessage:e=>{var t;return null===(t=o.current)||void 0===t?void 0:t.addMessage(e)},setBotEnabled:e=>{var t;return null===(t=o.current)||void 0===t?void 0:t.setBotEnabled(e)},openChat:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.openChat()},closeChat:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.closeChat()},toggleChat:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.toggleChat()},destroy:()=>{o.current=null,r.unmount()}}}ss.displayName="ProgrammaticQABot",exports.FileUploadComponent=t=>{let{onFileUpload:n,maxSizeMB:r=10,acceptedTypes:o="image/*,application/pdf,text/*,.doc,.docx",enableScreenshot:A=!1,className:i}=t;const[a,s]=e.useState(!1),[l,c]=e.useState([]),[u,d]=e.useState(null),p=e.useRef(null),{captureScreenshot:f,isCapturing:h,isScreenCaptureAvailable:g}=os(),m=e=>{const t=document.createElement("div");t.setAttribute("aria-live","assertive"),t.setAttribute("aria-atomic","true"),t.className="sr-only",t.textContent=e,document.body.appendChild(t),setTimeout(()=>document.body.removeChild(t),1e3)},v=e=>{if(!e||0===e.length)return void Pa("FileUploadComponent: No valid files provided to handleFiles");let t;try{t=Array.from(e)}catch(e){return ka("FileUploadComponent: Error converting files to array:",e),void m("Error processing selected files. Please try again.")}const r=[...l,...t];c(r);const o=t.length,A=t.map(e=>e.name).join(", ");m("".concat(o," file").concat(o>1?"s":""," selected: ").concat(A)),setTimeout(()=>{const e=document.querySelector(".rcb-chat-content");e&&(e.scrollTop=e.scrollHeight)},100),n&&n(r)},b=e=>{e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?s(!0):"dragleave"===e.type&&s(!1)},w=()=>{try{p.current&&p.current.click()}catch(e){ka("FileUploadComponent: Error in handleButtonClick:",e),m("Error opening file selection dialog. Please try again.")}},y=()=>{d(null)},x=A&&g;return e.createElement("div",{className:"file-upload-container ".concat(i||""),style:{padding:"16px",margin:"8px 0"}},x&&e.createElement("div",{style:{display:"flex",justifyContent:"center",marginBottom:"10px"}},e.createElement("button",{onClick:e=>{e.preventDefault(),(async()=>{try{const e=await f();v([e]),m("Screenshot captured successfully")}catch(e){m("Error capturing screenshot. Please try again.")}})()},disabled:h,"aria-describedby":"screenshot-help","aria-label":h?"Taking screenshot, please wait":"Take a screenshot to attach",style:{display:"flex",alignItems:"center",gap:"8px",backgroundColor:"#107180",color:"white",border:"none",borderRadius:"5px",padding:"8px 12px",cursor:h?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}},e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},e.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),e.createElement("circle",{cx:"12",cy:"13",r:"4"})),h?"Taking screenshot...":"Take screenshot..."),e.createElement("span",{id:"screenshot-help",className:"sr-only"},"Captures the current screen and adds it as an attachment")),e.createElement("div",{className:"file-upload-dropzone ".concat(a?"active":""),onDragEnter:b,onDragLeave:b,onDragOver:b,onDrop:e=>{var t;e.preventDefault(),e.stopPropagation(),s(!1);try{(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&e.dataTransfer.files.length>0&&v(e.dataTransfer.files)}catch(e){ka("FileUploadComponent: Error in handleDrop:",e),m("Error processing dropped files. Please try again.")}},role:"button",tabIndex:0,"aria-label":"File upload area. Click to select files or drag and drop files here.","aria-describedby":"upload-instructions",onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w())},style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",backgroundColor:a?"#f0f8ff":"#fafafa",transition:"all 0.3s ease"}},e.createElement("input",{ref:p,type:"file",className:"file-input",onChange:e=>{var t;try{(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&v(e.target.files)}catch(e){ka("FileUploadComponent: Error in handleFileSelect:",e),m("Error processing selected files. Please try again.")}},multiple:!0,style:{display:"none"},"aria-label":"Select files to upload",accept:o}),e.createElement("div",{className:"upload-content",onClick:w,style:{cursor:"pointer",flexDirection:"column",alignItems:"center",display:"flex",textAlign:"center",padding:"12px"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"}},e.createElement(As,null),e.createElement("p",{style:{margin:0,fontWeight:"bold"}},"Upload Files")),e.createElement("p",{id:"upload-instructions",style:{margin:0,fontSize:"14px",color:"#666"}},"Drag and drop files here or click to select. (Max ",r,"MB each)")),l.length>0&&e.createElement("div",{className:"selected-files",style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"12px",alignItems:"center"}},e.createElement("span",{style:{fontWeight:400,color:"#888",fontSize:"13px",marginRight:"8px",alignSelf:"center"}},"Selected files:"),l.map((t,r)=>e.createElement("span",{key:r,style:{background:"#fff",color:"#107180",borderRadius:"5px",padding:"4px 12px",fontSize:"14px",marginRight:"4px",marginBottom:"4px",border:"1px solid #ccc",display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},onClick:e=>{e.stopPropagation(),(e=>{d(e)})(t)}},e.createElement("span",{onClick:e=>{e.stopPropagation(),(e=>{const t=l.filter((t,n)=>n!==e);c(t),n&&n(t)})(r)},style:{cursor:"pointer",color:"#888",fontWeight:"bold",fontSize:"15px",marginRight:"4px",userSelect:"none",lineHeight:1},title:"Remove file","aria-label":"Remove ".concat(t.name)},"×"),t.name," (",as(t.size),")"))))),(()=>{if(!u)return null;const t=u.type.startsWith("image/"),n=u.type.startsWith("text/"),r="application/pdf"===u.type;return e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:1e3},onClick:y},e.createElement("div",{style:{backgroundColor:"white",padding:"20px",borderRadius:"8px",maxWidth:"90%",maxHeight:"90%",overflow:"auto",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{onClick:y,style:{position:"absolute",top:"10px",right:"10px",background:"none",border:"none",fontSize:"24px",cursor:"pointer",color:"#666"}},"×"),e.createElement("h3",{style:{marginTop:0,marginBottom:"16px"}},u.name),t&&e.createElement("img",{src:URL.createObjectURL(u),alt:u.name,style:{maxWidth:"100%",maxHeight:"70vh"}}),n&&e.createElement("pre",{style:{whiteSpace:"pre-wrap",wordWrap:"break-word",maxHeight:"70vh",overflow:"auto",padding:"16px",backgroundColor:"#f5f5f5",borderRadius:"4px"}},URL.createObjectURL(u)),r&&e.createElement("iframe",{src:URL.createObjectURL(u),style:{width:"100%",height:"70vh",border:"none"},title:u.name}),!t&&!n&&!r&&e.createElement("div",{style:{padding:"20px",textAlign:"center"}},"Preview not available for this file type")))})())},exports.QABot=rs,exports.applyFlowSettings=function(e,t){if(!t||0===Object.keys(t).length)return e;const n={};for(const[r,o]of Object.entries(e)){let e=Object.assign({},o);if(t.disableOnOptions&&void 0===e.chatDisabled){const t=!(!e.options&&!e.checkboxes);e.chatDisabled=t}n[r]=e}return n},exports.default=ls,exports.fileToBase64=is,exports.filesToBase64=e=>Promise.all(e.map(is)),exports.formatFileSize=as,exports.qaBot=ls,exports.useScreenshotCapture=os,exports.validateFileSize=function(e){const t=1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)*1024;return e.size<=t};
|
|
9
9
|
//# sourceMappingURL=qa-bot-core.umd.cjs.map
|