@xcelsior/ui-chat 1.0.8 → 2.0.1

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.
Files changed (96) hide show
  1. package/dist/index.d.mts +69 -69
  2. package/dist/index.d.ts +69 -69
  3. package/dist/index.js +2458 -627
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +2457 -628
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +6 -5
  8. package/src/components/BrandIcons.stories.tsx +95 -0
  9. package/src/components/BrandIcons.tsx +84 -0
  10. package/src/components/Chat.stories.tsx +149 -16
  11. package/src/components/Chat.tsx +116 -96
  12. package/src/components/ChatHeader.tsx +124 -69
  13. package/src/components/ChatInput.tsx +253 -104
  14. package/src/components/ChatWidget.tsx +209 -63
  15. package/src/components/ConversationRating.stories.tsx +33 -0
  16. package/src/components/ConversationRating.tsx +156 -0
  17. package/src/components/MarkdownMessage.tsx +202 -0
  18. package/src/components/MessageItem.stories.tsx +253 -55
  19. package/src/components/MessageItem.tsx +223 -60
  20. package/src/components/MessageList.tsx +164 -35
  21. package/src/components/PreChatForm.tsx +236 -96
  22. package/src/components/ThinkingIndicator.tsx +370 -0
  23. package/src/components/TypingIndicator.tsx +27 -11
  24. package/src/hooks/useDraggablePosition.ts +91 -0
  25. package/src/hooks/useMessages.ts +12 -13
  26. package/src/hooks/useResizableWidget.ts +324 -0
  27. package/src/index.tsx +5 -0
  28. package/src/types.ts +51 -5
  29. package/src/utils/markdown-styles.ts +140 -0
  30. package/storybook-static/assets/BrandIcons-Cjy5INAp.js +4 -0
  31. package/storybook-static/assets/BrandIcons.stories-BeVC6svr.js +64 -0
  32. package/storybook-static/assets/Chat.stories-J_Yp51wU.js +803 -0
  33. package/storybook-static/assets/Color-YHDXOIA2-BMnd3YrF.js +1 -0
  34. package/storybook-static/assets/ConversationRating.stories-B5_QddHN.js +12 -0
  35. package/storybook-static/assets/DocsRenderer-CFRXHY34-i_W8iCu9.js +575 -0
  36. package/storybook-static/assets/MessageItem-DAaKZ9s9.js +14 -0
  37. package/storybook-static/assets/MessageItem.stories-Ckr1_scc.js +255 -0
  38. package/storybook-static/assets/ToastContext-Bty1K7ya.js +1 -0
  39. package/storybook-static/assets/chunk-XP5HYGXS-BpfKkqn7.js +1 -0
  40. package/storybook-static/assets/en-US-BukEqXxE.js +1 -0
  41. package/storybook-static/assets/entry-preview-docs-DHohToDm.js +46 -0
  42. package/storybook-static/assets/entry-preview-oDnntGcx.js +2 -0
  43. package/storybook-static/assets/iframe-CGBtu2Se.js +211 -0
  44. package/storybook-static/assets/index--qcDGAq6.js +1 -0
  45. package/storybook-static/assets/index-BLHw34Di.js +24 -0
  46. package/storybook-static/assets/index-B_4m48Mv.js +1 -0
  47. package/storybook-static/assets/index-DgH-xKnr.js +11 -0
  48. package/storybook-static/assets/index-DrFu-skq.js +6 -0
  49. package/storybook-static/assets/index-DrdPSA1J.js +240 -0
  50. package/storybook-static/assets/index-jvNEZhzf.js +1 -0
  51. package/storybook-static/assets/index-yBjzXJbu.js +9 -0
  52. package/storybook-static/assets/jsx-runtime-Cf8x2fCZ.js +9 -0
  53. package/storybook-static/assets/preview-B8lJiyuQ.js +34 -0
  54. package/storybook-static/assets/preview-BBWR9nbA.js +1 -0
  55. package/storybook-static/assets/preview-BRpahs9B.js +2 -0
  56. package/storybook-static/assets/preview-BWzBA1C2.js +396 -0
  57. package/storybook-static/assets/preview-CvbIS5ZJ.js +1 -0
  58. package/storybook-static/assets/preview-DD_OYowb.js +1 -0
  59. package/storybook-static/assets/preview-DGUiP6tS.js +7 -0
  60. package/storybook-static/assets/preview-DHQbi4pV.js +1 -0
  61. package/storybook-static/assets/preview-DUOvJmsz.js +1 -0
  62. package/storybook-static/assets/preview-DcGwT3kv.css +1 -0
  63. package/storybook-static/assets/preview-DwI0w3cI.js +1 -0
  64. package/storybook-static/assets/react-18-CALspjOX.js +1 -0
  65. package/storybook-static/assets/test-utils-BE0XkMtV.js +9 -0
  66. package/storybook-static/favicon.svg +1 -0
  67. package/storybook-static/iframe.html +666 -0
  68. package/storybook-static/index.html +177 -0
  69. package/storybook-static/index.json +1 -0
  70. package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
  71. package/storybook-static/nunito-sans-bold.woff2 +0 -0
  72. package/storybook-static/nunito-sans-italic.woff2 +0 -0
  73. package/storybook-static/nunito-sans-regular.woff2 +0 -0
  74. package/storybook-static/project.json +1 -0
  75. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +3 -0
  76. package/storybook-static/sb-addons/essentials-backgrounds-5/manager-bundle.js +12 -0
  77. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +405 -0
  78. package/storybook-static/sb-addons/essentials-docs-4/manager-bundle.js +245 -0
  79. package/storybook-static/sb-addons/essentials-measure-8/manager-bundle.js +3 -0
  80. package/storybook-static/sb-addons/essentials-outline-9/manager-bundle.js +3 -0
  81. package/storybook-static/sb-addons/essentials-toolbars-7/manager-bundle.js +3 -0
  82. package/storybook-static/sb-addons/essentials-viewport-6/manager-bundle.js +3 -0
  83. package/storybook-static/sb-addons/interactions-10/manager-bundle.js +222 -0
  84. package/storybook-static/sb-addons/links-1/manager-bundle.js +3 -0
  85. package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  86. package/storybook-static/sb-common-assets/favicon.svg +1 -0
  87. package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  88. package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  89. package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  90. package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  91. package/storybook-static/sb-manager/globals-module-info.js +1052 -0
  92. package/storybook-static/sb-manager/globals-runtime.js +42127 -0
  93. package/storybook-static/sb-manager/globals.js +48 -0
  94. package/storybook-static/sb-manager/runtime.js +12048 -0
  95. package/.turbo/turbo-build.log +0 -22
  96. package/.turbo/turbo-lint.log +0 -5
@@ -0,0 +1,14 @@
1
+ import{j as L}from"./jsx-runtime-Cf8x2fCZ.js";import{a as Cr}from"./BrandIcons-Cjy5INAp.js";import{g as Dt}from"./index--qcDGAq6.js";import{t as te,c as Er,d as Ir,f as Tr,a as $n,g as Ar,e as Pr,h as Xn,i as $e}from"./en-US-BukEqXxE.js";function Qe(e,n){const t=te(e),r=te(n),i=t.getTime()-r.getTime();return i<0?-1:i>0?1:i}function vr(e){return Er(e,Date.now())}function zr(e){return n=>{const r=(e?Math[e]:Math.trunc)(n);return r===0?0:r}}function Lr(e,n){return+te(e)-+te(n)}function Dr(e){const n=te(e);return n.setHours(23,59,59,999),n}function Mr(e){const n=te(e);return+Dr(n)==+Ir(n)}function Nr(e,n){const t=te(e),r=te(n),i=Qe(t,r),l=Math.abs(Tr(t,r));let o;if(l<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*l);let a=Qe(t,r)===-i;Mr(te(e))&&l===1&&Qe(e,r)===1&&(a=!1),o=i*(l-Number(a))}return o===0?0:o}function _r(e,n,t){const r=Lr(e,n)/1e3;return zr(t==null?void 0:t.roundingMethod)(r)}function Or(e,n,t){const r=Ar(),i=(t==null?void 0:t.locale)??r.locale??Pr,l=2520,o=Qe(e,n);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let c,u;o>0?(c=te(n),u=te(e)):(c=te(e),u=te(n));const s=_r(u,c),p=($n(u)-$n(c))/1e3,h=Math.round((s-p)/60);let f;if(h<2)return t!=null&&t.includeSeconds?s<5?i.formatDistance("lessThanXSeconds",5,a):s<10?i.formatDistance("lessThanXSeconds",10,a):s<20?i.formatDistance("lessThanXSeconds",20,a):s<40?i.formatDistance("halfAMinute",0,a):s<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):h===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",h,a);if(h<45)return i.formatDistance("xMinutes",h,a);if(h<90)return i.formatDistance("aboutXHours",1,a);if(h<Xn){const b=Math.round(h/60);return i.formatDistance("aboutXHours",b,a)}else{if(h<l)return i.formatDistance("xDays",1,a);if(h<$e){const b=Math.round(h/Xn);return i.formatDistance("xDays",b,a)}else if(h<$e*2)return f=Math.round(h/$e),i.formatDistance("aboutXMonths",f,a)}if(f=Nr(u,c),f<12){const b=Math.round(h/$e);return i.formatDistance("xMonths",b,a)}else{const b=f%12,S=Math.trunc(f/12);return b<3?i.formatDistance("aboutXYears",S,a):b<9?i.formatDistance("overXYears",S,a):i.formatDistance("almostXYears",S+1,a)}}function Rr(e,n){return Or(e,vr(e),n)}function Fr(e,n){const t={};return(e[e.length-1]===""?[...e,""]:e).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const jr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Br=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hr={};function Wn(e,n){return(Hr.jsx?Br:jr).test(e)}const Ur=/[ \t\n\f\r]/g;function Vr(e){return typeof e=="object"?e.type==="text"?Yn(e.value):!1:Yn(e)}function Yn(e){return e.replace(Ur,"")===""}class Ue{constructor(n,t,r){this.normal=t,this.property=n,r&&(this.space=r)}}Ue.prototype.normal={};Ue.prototype.property={};Ue.prototype.space=void 0;function Mt(e,n){const t={},r={};for(const i of e)Object.assign(t,i.property),Object.assign(r,i.normal);return new Ue(t,r,n)}function gn(e){return e.toLowerCase()}class Z{constructor(n,t){this.attribute=t,this.property=n}}Z.prototype.attribute="";Z.prototype.booleanish=!1;Z.prototype.boolean=!1;Z.prototype.commaOrSpaceSeparated=!1;Z.prototype.commaSeparated=!1;Z.prototype.defined=!1;Z.prototype.mustUseProperty=!1;Z.prototype.number=!1;Z.prototype.overloadedBoolean=!1;Z.prototype.property="";Z.prototype.spaceSeparated=!1;Z.prototype.space=void 0;let qr=0;const N=we(),W=we(),yn=we(),k=we(),$=we(),Ae=we(),ne=we();function we(){return 2**++qr}const xn=Object.freeze(Object.defineProperty({__proto__:null,boolean:N,booleanish:W,commaOrSpaceSeparated:ne,commaSeparated:Ae,number:k,overloadedBoolean:yn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),tn=Object.keys(xn);class Tn extends Z{constructor(n,t,r,i){let l=-1;if(super(n,t),Qn(this,"space",i),typeof r=="number")for(;++l<tn.length;){const o=tn[l];Qn(this,tn[l],(r&xn[o])===xn[o])}}}Tn.prototype.defined=!0;function Qn(e,n,t){t&&(e[n]=t)}function ve(e){const n={},t={};for(const[r,i]of Object.entries(e.properties)){const l=new Tn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),n[r]=l,t[gn(r)]=r,t[gn(l.attribute)]=r}return new Ue(n,t,e.space)}const Nt=ve({properties:{ariaActiveDescendant:null,ariaAtomic:W,ariaAutoComplete:null,ariaBusy:W,ariaChecked:W,ariaColCount:k,ariaColIndex:k,ariaColSpan:k,ariaControls:$,ariaCurrent:null,ariaDescribedBy:$,ariaDetails:null,ariaDisabled:W,ariaDropEffect:$,ariaErrorMessage:null,ariaExpanded:W,ariaFlowTo:$,ariaGrabbed:W,ariaHasPopup:null,ariaHidden:W,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$,ariaLevel:k,ariaLive:null,ariaModal:W,ariaMultiLine:W,ariaMultiSelectable:W,ariaOrientation:null,ariaOwns:$,ariaPlaceholder:null,ariaPosInSet:k,ariaPressed:W,ariaReadOnly:W,ariaRelevant:null,ariaRequired:W,ariaRoleDescription:$,ariaRowCount:k,ariaRowIndex:k,ariaRowSpan:k,ariaSelected:W,ariaSetSize:k,ariaSort:null,ariaValueMax:k,ariaValueMin:k,ariaValueNow:k,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function _t(e,n){return n in e?e[n]:n}function Ot(e,n){return _t(e,n.toLowerCase())}const $r=ve({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ae,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:N,allowPaymentRequest:N,allowUserMedia:N,alt:null,as:null,async:N,autoCapitalize:null,autoComplete:$,autoFocus:N,autoPlay:N,blocking:$,capture:null,charSet:null,checked:N,cite:null,className:$,cols:k,colSpan:null,content:null,contentEditable:W,controls:N,controlsList:$,coords:k|Ae,crossOrigin:null,data:null,dateTime:null,decoding:null,default:N,defer:N,dir:null,dirName:null,disabled:N,download:yn,draggable:W,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:N,formTarget:null,headers:$,height:k,hidden:yn,high:k,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:null,inert:N,inputMode:null,integrity:null,is:null,isMap:N,itemId:null,itemProp:$,itemRef:$,itemScope:N,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:N,low:k,manifest:null,max:null,maxLength:k,media:null,method:null,min:null,minLength:k,multiple:N,muted:N,name:null,nonce:null,noModule:N,noValidate:N,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:N,optimum:k,pattern:null,ping:$,placeholder:null,playsInline:N,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:N,referrerPolicy:null,rel:$,required:N,reversed:N,rows:k,rowSpan:k,sandbox:$,scope:null,scoped:N,seamless:N,selected:N,shadowRootClonable:N,shadowRootDelegatesFocus:N,shadowRootMode:null,shape:null,size:k,sizes:null,slot:null,span:k,spellCheck:W,src:null,srcDoc:null,srcLang:null,srcSet:null,start:k,step:null,style:null,tabIndex:k,target:null,title:null,translate:null,type:null,typeMustMatch:N,useMap:null,value:W,width:k,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:k,borderColor:null,bottomMargin:k,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:N,declare:N,event:null,face:null,frame:null,frameBorder:null,hSpace:k,leftMargin:k,link:null,longDesc:null,lowSrc:null,marginHeight:k,marginWidth:k,noResize:N,noHref:N,noShade:N,noWrap:N,object:null,profile:null,prompt:null,rev:null,rightMargin:k,rules:null,scheme:null,scrolling:W,standby:null,summary:null,text:null,topMargin:k,valueType:null,version:null,vAlign:null,vLink:null,vSpace:k,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:N,disableRemotePlayback:N,prefix:null,property:null,results:k,security:null,unselectable:null},space:"html",transform:Ot}),Xr=ve({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ne,accentHeight:k,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:k,amplitude:k,arabicForm:null,ascent:k,attributeName:null,attributeType:null,azimuth:k,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:k,by:null,calcMode:null,capHeight:k,className:$,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:k,diffuseConstant:k,direction:null,display:null,dur:null,divisor:k,dominantBaseline:null,download:N,dx:null,dy:null,edgeMode:null,editable:null,elevation:k,enableBackground:null,end:null,event:null,exponent:k,externalResourcesRequired:null,fill:null,fillOpacity:k,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ae,g2:Ae,glyphName:Ae,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:k,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:k,horizOriginX:k,horizOriginY:k,id:null,ideographic:k,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:k,k,k1:k,k2:k,k3:k,k4:k,kernelMatrix:ne,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:k,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:k,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:k,overlineThickness:k,paintOrder:null,panose1:null,path:null,pathLength:k,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:k,pointsAtY:k,pointsAtZ:k,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ne,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ne,rev:ne,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ne,requiredFeatures:ne,requiredFonts:ne,requiredFormats:ne,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:k,specularExponent:k,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:k,strikethroughThickness:k,string:null,stroke:null,strokeDashArray:ne,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:k,strokeOpacity:k,strokeWidth:null,style:null,surfaceScale:k,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ne,tabIndex:k,tableValues:null,target:null,targetX:k,targetY:k,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ne,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:k,underlineThickness:k,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:k,values:null,vAlphabetic:k,vMathematical:k,vectorEffect:null,vHanging:k,vIdeographic:k,version:null,vertAdvY:k,vertOriginX:k,vertOriginY:k,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:k,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_t}),Rt=ve({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Ft=ve({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Ot}),jt=ve({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),Wr={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"},Yr=/[A-Z]/g,Kn=/-[a-z]/g,Qr=/^data[-\w.:]+$/i;function Kr(e,n){const t=gn(n);let r=n,i=Z;if(t in e.normal)return e.property[e.normal[t]];if(t.length>4&&t.slice(0,4)==="data"&&Qr.test(n)){if(n.charAt(4)==="-"){const l=n.slice(5).replace(Kn,Jr);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=n.slice(4);if(!Kn.test(l)){let o=l.replace(Yr,Gr);o.charAt(0)!=="-"&&(o="-"+o),n="data"+o}}i=Tn}return new i(r,n)}function Gr(e){return"-"+e.toLowerCase()}function Jr(e){return e.charAt(1).toUpperCase()}const Zr=Mt([Nt,$r,Rt,Ft,jt],"html"),An=Mt([Nt,Xr,Rt,Ft,jt],"svg");function ei(e){return e.join(" ").trim()}var Ie={},rn,Gn;function ni(){if(Gn)return rn;Gn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,t=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
2
+ `,u="/",s="*",p="",h="comment",f="declaration";function b(I,x){if(typeof I!="string")throw new TypeError("First argument must be a string");if(!I)return[];x=x||{};var v=1,E=1;function F(P){var C=P.match(n);C&&(v+=C.length);var U=P.lastIndexOf(c);E=~U?P.length-U:E+P.length}function M(){var P={line:v,column:E};return function(C){return C.position=new y(P),j(),C}}function y(P){this.start=P,this.end={line:v,column:E},this.source=x.source}y.prototype.content=I;function _(P){var C=new Error(x.source+":"+v+":"+E+": "+P);if(C.reason=P,C.filename=x.source,C.line=v,C.column=E,C.source=I,!x.silent)throw C}function B(P){var C=P.exec(I);if(C){var U=C[0];return F(U),I=I.slice(U.length),C}}function j(){B(t)}function H(P){var C;for(P=P||[];C=A();)C!==!1&&P.push(C);return P}function A(){var P=M();if(!(u!=I.charAt(0)||s!=I.charAt(1))){for(var C=2;p!=I.charAt(C)&&(s!=I.charAt(C)||u!=I.charAt(C+1));)++C;if(C+=2,p===I.charAt(C-1))return _("End of comment missing");var U=I.slice(2,C-2);return E+=2,F(U),I=I.slice(C),E+=2,P({type:h,comment:U})}}function T(){var P=M(),C=B(r);if(C){if(A(),!B(i))return _("property missing ':'");var U=B(l),Y=P({type:f,property:S(C[0].replace(e,p)),value:U?S(U[0].replace(e,p)):p});return B(o),Y}}function q(){var P=[];H(P);for(var C;C=T();)C!==!1&&(P.push(C),H(P));return P}return j(),q()}function S(I){return I?I.replace(a,p):p}return rn=b,rn}var Jn;function ti(){if(Jn)return Ie;Jn=1;var e=Ie&&Ie.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.default=t;const n=e(ni());function t(r,i){let l=null;if(!r||typeof r!="string")return l;const o=(0,n.default)(r),a=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:s}=c;a?i(u,s,c):s&&(l=l||{},l[u]=s)}),l}return Ie}var Ne={},Zn;function ri(){if(Zn)return Ne;Zn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,t=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,l=function(u){return!u||t.test(u)||e.test(u)},o=function(u,s){return s.toUpperCase()},a=function(u,s){return"".concat(s,"-")},c=function(u,s){return s===void 0&&(s={}),l(u)?u:(u=u.toLowerCase(),s.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(n,o))};return Ne.camelCase=c,Ne}var _e,et;function ii(){if(et)return _e;et=1;var e=_e&&_e.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},n=e(ti()),t=ri();function r(i,l){var o={};return!i||typeof i!="string"||(0,n.default)(i,function(a,c){a&&c&&(o[(0,t.camelCase)(a,l)]=c)}),o}return r.default=r,_e=r,_e}var li=ii();const oi=Dt(li),Bt=Ht("end"),Pn=Ht("start");function Ht(e){return n;function n(t){const r=t&&t.position&&t.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ai(e){const n=Pn(e),t=Bt(e);if(n&&t)return{start:n,end:t}}function Fe(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nt(e.position):"start"in e||"end"in e?nt(e):"line"in e||"column"in e?kn(e):""}function kn(e){return tt(e&&e.line)+":"+tt(e&&e.column)}function nt(e){return kn(e&&e.start)+"-"+kn(e&&e.end)}function tt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(n,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof n=="string"?i=n:!l.cause&&n&&(o=!0,i=n.message,l.cause=n),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Fe(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const vn={}.hasOwnProperty,ui=new Map,si=/[A-Z]/g,ci=new Set(["table","tbody","thead","tfoot","tr"]),fi=new Set(["td","th"]),Ut="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pi(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=bi(t,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=ki(t,n.jsx,n.jsxs)}const i={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?An:Zr,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},l=Vt(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function Vt(e,n,t){if(n.type==="element")return hi(e,n,t);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return di(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return gi(e,n,t);if(n.type==="mdxjsEsm")return mi(e,n);if(n.type==="root")return yi(e,n,t);if(n.type==="text")return xi(e,n)}function hi(e,n,t){const r=e.schema;let i=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(n);const l=$t(e,n.tagName,!1),o=wi(e,n);let a=Ln(e,n);return ci.has(n.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!Vr(c):!0})),qt(e,o,l,n),zn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function di(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}He(e,n.position)}function mi(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);He(e,n.position)}function gi(e,n,t){const r=e.schema;let i=r;n.name==="svg"&&r.space==="html"&&(i=An,e.schema=i),e.ancestors.push(n);const l=n.name===null?e.Fragment:$t(e,n.name,!0),o=Si(e,n),a=Ln(e,n);return qt(e,o,l,n),zn(o,a),e.ancestors.pop(),e.schema=r,e.create(n,l,o,t)}function yi(e,n,t){const r={};return zn(r,Ln(e,n)),e.create(n,e.Fragment,r,t)}function xi(e,n){return n.value}function qt(e,n,t,r){typeof t!="string"&&t!==e.Fragment&&e.passNode&&(n.node=r)}function zn(e,n){if(n.length>0){const t=n.length>1?n:n[0];t&&(e.children=t)}}function ki(e,n,t){return r;function r(i,l,o,a){const u=Array.isArray(o.children)?t:n;return a?u(l,o,a):u(l,o)}}function bi(e,n){return t;function t(r,i,l,o){const a=Array.isArray(l.children),c=Pn(r);return n(i,l,o,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function wi(e,n){const t={};let r,i;for(i in n.properties)if(i!=="children"&&vn.call(n.properties,i)){const l=Ci(e,i,n.properties[i]);if(l){const[o,a]=l;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&fi.has(n.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Si(e,n){const t={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,e.evaluater.evaluateExpression(a.argument))}else He(e,n.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,l=e.evaluater.evaluateExpression(a.expression)}else He(e,n.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function Ln(e,n){const t=[];let r=-1;const i=e.passKeys?new Map:ui;for(;++r<n.children.length;){const l=n.children[r];let o;if(e.passKeys){const c=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(c){const u=i.get(c)||0;o=c+"-"+u,i.set(c,u+1)}}const a=Vt(e,l,o);a!==void 0&&t.push(a)}return t}function Ci(e,n,t){const r=Kr(e.schema,n);if(!(t==null||typeof t=="number"&&Number.isNaN(t))){if(Array.isArray(t)&&(t=r.commaSeparated?Fr(t):ei(t)),r.property==="style"){let i=typeof t=="object"?t:Ei(e,String(t));return e.stylePropertyNameCase==="css"&&(i=Ii(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Wr[r.property]||r.property:r.attribute,t]}}function Ei(e,n){try{return oi(n,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};const r=t,i=new K("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ut+"#cannot-parse-style-attribute",i}}function $t(e,n,t){let r;if(!t)r={type:"Literal",value:n};else if(n.includes(".")){const i=n.split(".");let l=-1,o;for(;++l<i.length;){const a=Wn(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(l&&a.type==="Literal"),optional:!1}:a}r=o}else r=Wn(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const i=r.value;return vn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);He(e)}function He(e,n){const t=new K("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=Ut+"#cannot-handle-mdx-estrees-without-createevaluater",t}function Ii(e){const n={};let t;for(t in e)vn.call(e,t)&&(n[Ti(t)]=e[t]);return n}function Ti(e){let n=e.replace(si,Ai);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function Ai(e){return"-"+e.toLowerCase()}const ln={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Pi={};function vi(e,n){const t=Pi,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,i=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Xt(e,r,i)}function Xt(e,n,t){if(zi(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return rt(e.children,n,t)}return Array.isArray(e)?rt(e,n,t):""}function rt(e,n,t){const r=[];let i=-1;for(;++i<e.length;)r[i]=Xt(e[i],n,t);return r.join("")}function zi(e){return!!(e&&typeof e=="object")}const it=document.createElement("i");function Dn(e){const n="&"+e+";";it.innerHTML=n;const t=it.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function fe(e,n,t,r){const i=e.length;let l=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);l<r.length;)o=r.slice(l,l+1e4),o.unshift(n,0),e.splice(...o),l+=1e4,n+=1e4}function ie(e,n){return e.length>0?(fe(e,e.length,0,n),e):n}const lt={}.hasOwnProperty;function Li(e){const n={};let t=-1;for(;++t<e.length;)Di(n,e[t]);return n}function Di(e,n){let t;for(t in n){const i=(lt.call(e,t)?e[t]:void 0)||(e[t]={}),l=n[t];let o;if(l)for(o in l){lt.call(i,o)||(i[o]=[]);const a=l[o];Mi(i[o],Array.isArray(a)?a:a?[a]:[])}}}function Mi(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);fe(e,0,0,r)}function Wt(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Pe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ce=xe(/[A-Za-z]/),re=xe(/[\dA-Za-z]/),Ni=xe(/[#-'*+\--9=?A-Z^-~]/);function bn(e){return e!==null&&(e<32||e===127)}const wn=xe(/\d/),_i=xe(/[\dA-Fa-f]/),Oi=xe(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}const Ri=xe(new RegExp("\\p{P}|\\p{S}","u")),Fi=xe(/\s/);function xe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ze(e){const n=[];let t=-1,r=0,i=0;for(;++t<e.length;){const l=e.charCodeAt(t);let o="";if(l===37&&re(e.charCodeAt(t+1))&&re(e.charCodeAt(t+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const a=e.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(n.push(e.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return n.join("")+e.slice(r)}function X(e,n,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(c){return R(c)?(e.enter(t),a(c)):n(c)}function a(c){return R(c)&&l++<i?(e.consume(c),a):(e.exit(t),n(c))}}const ji={tokenize:Bi};function Bi(e){const n=e.attempt(this.parser.constructs.contentInitial,r,i);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),X(e,n,"linePrefix")}function i(a){return e.enter("paragraph"),l(a)}function l(a){const c=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=c),t=c,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),l):(e.consume(a),o)}}const Hi={tokenize:Ui},ot={tokenize:Vi};function Ui(e){const n=this,t=[];let r=0,i,l,o;return a;function a(E){if(r<t.length){const F=t[r];return n.containerState=F[1],e.attempt(F[0].continuation,c,u)(E)}return u(E)}function c(E){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,i&&v();const F=n.events.length;let M=F,y;for(;M--;)if(n.events[M][0]==="exit"&&n.events[M][1].type==="chunkFlow"){y=n.events[M][1].end;break}x(r);let _=F;for(;_<n.events.length;)n.events[_][1].end={...y},_++;return fe(n.events,M+1,0,n.events.slice(F)),n.events.length=_,u(E)}return a(E)}function u(E){if(r===t.length){if(!i)return h(E);if(i.currentConstruct&&i.currentConstruct.concrete)return b(E);n.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(ot,s,p)(E)}function s(E){return i&&v(),x(r),h(E)}function p(E){return n.parser.lazy[n.now().line]=r!==t.length,o=n.now().offset,b(E)}function h(E){return n.containerState={},e.attempt(ot,f,b)(E)}function f(E){return r++,t.push([n.currentConstruct,n.containerState]),h(E)}function b(E){if(E===null){i&&v(),x(0),e.consume(E);return}return i=i||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),S(E)}function S(E){if(E===null){I(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return z(E)?(e.consume(E),I(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(E),S)}function I(E,F){const M=n.sliceStream(E);if(F&&M.push(null),E.previous=l,l&&(l.next=E),l=E,i.defineSkip(E.start),i.write(M),n.parser.lazy[E.start.line]){let y=i.events.length;for(;y--;)if(i.events[y][1].start.offset<o&&(!i.events[y][1].end||i.events[y][1].end.offset>o))return;const _=n.events.length;let B=_,j,H;for(;B--;)if(n.events[B][0]==="exit"&&n.events[B][1].type==="chunkFlow"){if(j){H=n.events[B][1].end;break}j=!0}for(x(r),y=_;y<n.events.length;)n.events[y][1].end={...H},y++;fe(n.events,B+1,0,n.events.slice(_)),n.events.length=y}}function x(E){let F=t.length;for(;F-- >E;){const M=t[F];n.containerState=M[1],M[0].exit.call(n,e)}t.length=E}function v(){i.write([null]),l=void 0,i=void 0,n.containerState._closeFlow=void 0}}function Vi(e,n,t){return X(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function at(e){if(e===null||J(e)||Fi(e))return 1;if(Ri(e))return 2}function Mn(e,n,t){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(n=l(n,t),r.push(l))}return n}const Sn={name:"attention",resolveAll:qi,tokenize:$i};function qi(e,n){let t=-1,r,i,l,o,a,c,u,s;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const p={...e[r][1].end},h={...e[t][1].start};ut(p,-c),ut(h,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:h},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[t][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ie(u,[["enter",e[r][1],n],["exit",e[r][1],n]])),u=ie(u,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",l,n]]),u=ie(u,Mn(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),u=ie(u,[["exit",l,n],["enter",a,n],["exit",a,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(s=2,u=ie(u,[["enter",e[t][1],n],["exit",e[t][1],n]])):s=0,fe(e,r-1,t-r+3,u),t=r+u.length-s-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function $i(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=at(r);let l;return o;function o(c){return l=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===l)return e.consume(c),a;const u=e.exit("attentionSequence"),s=at(c),p=!s||s===2&&i||t.includes(c),h=!i||i===2&&s||t.includes(r);return u._open=!!(l===42?p:p&&(i||!h)),u._close=!!(l===42?h:h&&(s||!p)),n(c)}}function ut(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const Xi={name:"autolink",tokenize:Wi};function Wi(e,n,t){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(f){return ce(f)?(e.consume(f),o):f===64?t(f):u(f)}function o(f){return f===43||f===45||f===46||re(f)?(r=1,a(f)):u(f)}function a(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||re(f))&&r++<32?(e.consume(f),a):(r=0,u(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):f===null||f===32||f===60||bn(f)?t(f):(e.consume(f),c)}function u(f){return f===64?(e.consume(f),s):Ni(f)?(e.consume(f),u):t(f)}function s(f){return re(f)?p(f):t(f)}function p(f){return f===46?(e.consume(f),r=0,s):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),n):h(f)}function h(f){if((f===45||re(f))&&r++<63){const b=f===45?h:p;return e.consume(f),b}return t(f)}}const Ze={partial:!0,tokenize:Yi};function Yi(e,n,t){return r;function r(l){return R(l)?X(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||z(l)?n(l):t(l)}}const Yt={continuation:{tokenize:Ki},exit:Gi,name:"blockQuote",tokenize:Qi};function Qi(e,n,t){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return t(o)}function l(o){return R(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(o))}}function Ki(e,n,t){const r=this;return i;function i(o){return R(o)?X(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(Yt,n,t)(o)}}function Gi(e){e.exit("blockQuote")}const Qt={name:"characterEscape",tokenize:Ji};function Ji(e,n,t){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return Oi(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(l)}}const Kt={name:"characterReference",tokenize:Zi};function Zi(e,n,t){const r=this;let i=0,l,o;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),c}function c(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),l=31,o=re,s(p))}function u(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=_i,s):(e.enter("characterReferenceValue"),l=7,o=wn,s(p))}function s(p){if(p===59&&i){const h=e.exit("characterReferenceValue");return o===re&&!Dn(r.sliceSerialize(h))?t(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return o(p)&&i++<l?(e.consume(p),s):t(p)}}const st={partial:!0,tokenize:nl},ct={concrete:!0,name:"codeFenced",tokenize:el};function el(e,n,t){const r=this,i={partial:!0,tokenize:M};let l=0,o=0,a;return c;function c(y){return u(y)}function u(y){const _=r.events[r.events.length-1];return l=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=y,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),s(y)}function s(y){return y===a?(o++,e.consume(y),s):o<3?t(y):(e.exit("codeFencedFenceSequence"),R(y)?X(e,p,"whitespace")(y):p(y))}function p(y){return y===null||z(y)?(e.exit("codeFencedFence"),r.interrupt?n(y):e.check(st,S,F)(y)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||z(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(y)):R(y)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),X(e,f,"whitespace")(y)):y===96&&y===a?t(y):(e.consume(y),h)}function f(y){return y===null||z(y)?p(y):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===null||z(y)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(y)):y===96&&y===a?t(y):(e.consume(y),b)}function S(y){return e.attempt(i,F,I)(y)}function I(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),x}function x(y){return l>0&&R(y)?X(e,v,"linePrefix",l+1)(y):v(y)}function v(y){return y===null||z(y)?e.check(st,S,F)(y):(e.enter("codeFlowValue"),E(y))}function E(y){return y===null||z(y)?(e.exit("codeFlowValue"),v(y)):(e.consume(y),E)}function F(y){return e.exit("codeFenced"),n(y)}function M(y,_,B){let j=0;return H;function H(C){return y.enter("lineEnding"),y.consume(C),y.exit("lineEnding"),A}function A(C){return y.enter("codeFencedFence"),R(C)?X(y,T,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):T(C)}function T(C){return C===a?(y.enter("codeFencedFenceSequence"),q(C)):B(C)}function q(C){return C===a?(j++,y.consume(C),q):j>=o?(y.exit("codeFencedFenceSequence"),R(C)?X(y,P,"whitespace")(C):P(C)):B(C)}function P(C){return C===null||z(C)?(y.exit("codeFencedFence"),_(C)):B(C)}}}function nl(e,n,t){const r=this;return i;function i(o){return o===null?t(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}const on={name:"codeIndented",tokenize:rl},tl={partial:!0,tokenize:il};function rl(e,n,t){const r=this;return i;function i(u){return e.enter("codeIndented"),X(e,l,"linePrefix",5)(u)}function l(u){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?o(u):t(u)}function o(u){return u===null?c(u):z(u)?e.attempt(tl,o,c)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function c(u){return e.exit("codeIndented"),n(u)}}function il(e,n,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):X(e,l,"linePrefix",5)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):z(o)?i(o):t(o)}}const ll={name:"codeText",previous:al,resolve:ol,tokenize:ul};function ol(e){let n=e.length-4,t=3,r,i;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)i===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(i=r):(r===n||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),n-=r-i-2,r=i+2),i=void 0);return e}function al(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ul(e,n,t){let r=0,i,l;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),a(p)}function a(p){return p===96?(e.consume(p),r++,a):(e.exit("codeTextSequence"),c(p))}function c(p){return p===null?t(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),c):p===96?(l=e.enter("codeTextSequence"),i=0,s(p)):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||z(p)?(e.exit("codeTextData"),c(p)):(e.consume(p),u)}function s(p){return p===96?(e.consume(p),i++,s):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(p)):(l.type="codeTextData",u(p))}}class sl{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const i=t||0;this.setCursor(Math.trunc(n));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Oe(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),Oe(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),Oe(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);Oe(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);Oe(this.left,t.reverse())}}}function Oe(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function Gt(e){const n={};let t=-1,r,i,l,o,a,c,u;const s=new sl(e);for(;++t<s.length;){for(;t in n;)t=n[t];if(r=s.get(t),t&&r[1].type==="chunkFlow"&&s.get(t-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,l=0,l<c.length&&c[l][1].type==="lineEndingBlank"&&(l+=2),l<c.length&&c[l][1].type==="content"))for(;++l<c.length&&c[l][1].type!=="content";)c[l][1].type==="chunkText"&&(c[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,cl(s,t)),t=n[t],u=!0);else if(r[1]._container){for(l=t,i=void 0;l--;)if(o=s.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(s.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...s.get(i)[1].start},a=s.slice(i,t),a.unshift(r),s.splice(i,t-i+1,a))}}return fe(e,0,Number.POSITIVE_INFINITY,s.slice(0)),!u}function cl(e,n){const t=e.get(n)[1],r=e.get(n)[2];let i=n-1;const l=[];let o=t._tokenizer;o||(o=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,c=[],u={};let s,p,h=-1,f=t,b=0,S=0;const I=[S];for(;f;){for(;e.get(++i)[1]!==f;);l.push(i),f._tokenizer||(s=r.sliceStream(f),f.next||s.push(null),p&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(s),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=f,f=f.next}for(f=t;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(S=h+1,I.push(S),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):I.pop(),h=I.length;h--;){const x=a.slice(I[h],I[h+1]),v=l.pop();c.push([v,v+x.length-1]),e.splice(v,2,x)}for(c.reverse(),h=-1;++h<c.length;)u[b+c[h][0]]=b+c[h][1],b+=c[h][1]-c[h][0]-1;return u}const fl={resolve:hl,tokenize:dl},pl={partial:!0,tokenize:ml};function hl(e){return Gt(e),e}function dl(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?l(a):z(a)?e.check(pl,o,l)(a):(e.consume(a),i)}function l(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function o(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,i}}function ml(e,n,t){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),X(e,l,"linePrefix")}function l(o){if(o===null||z(o))return t(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(o):e.interrupt(r.parser.constructs.flow,t,n)(o)}}function Jt(e,n,t,r,i,l,o,a,c){const u=c||Number.POSITIVE_INFINITY;let s=0;return p;function p(x){return x===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(x),e.exit(l),h):x===null||x===32||x===41||bn(x)?t(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),S(x))}function h(x){return x===62?(e.enter(l),e.consume(x),e.exit(l),e.exit(i),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(x))}function f(x){return x===62?(e.exit("chunkString"),e.exit(a),h(x)):x===null||x===60||z(x)?t(x):(e.consume(x),x===92?b:f)}function b(x){return x===60||x===62||x===92?(e.consume(x),f):f(x)}function S(x){return!s&&(x===null||x===41||J(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),n(x)):s<u&&x===40?(e.consume(x),s++,S):x===41?(e.consume(x),s--,S):x===null||x===32||x===40||bn(x)?t(x):(e.consume(x),x===92?I:S)}function I(x){return x===40||x===41||x===92?(e.consume(x),S):S(x)}}function Zt(e,n,t,r,i,l){const o=this;let a=0,c;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(l),s}function s(f){return a>999||f===null||f===91||f===93&&!c||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(f):f===93?(e.exit(l),e.enter(i),e.consume(f),e.exit(i),e.exit(r),n):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),s):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),s(f)):(e.consume(f),c||(c=!R(f)),f===92?h:p)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,p):p(f)}}function er(e,n,t,r,i,l){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,c):t(h)}function c(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),n):(e.enter(l),u(h))}function u(h){return h===o?(e.exit(l),c(o)):h===null?t(h):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),X(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),s(h))}function s(h){return h===o||h===null||z(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?p:s)}function p(h){return h===o||h===92?(e.consume(h),s):s(h)}}function je(e,n){let t;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t=!0,r):R(i)?X(e,r,t?"linePrefix":"lineSuffix")(i):n(i)}}const gl={name:"definition",tokenize:xl},yl={partial:!0,tokenize:kl};function xl(e,n,t){const r=this;let i;return l;function l(f){return e.enter("definition"),o(f)}function o(f){return Zt.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):t(f)}function c(f){return J(f)?je(e,u)(f):u(f)}function u(f){return Jt(e,s,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function s(f){return e.attempt(yl,p,p)(f)}function p(f){return R(f)?X(e,h,"whitespace")(f):h(f)}function h(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),n(f)):t(f)}}function kl(e,n,t){return r;function r(a){return J(a)?je(e,i)(a):t(a)}function i(a){return er(e,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return R(a)?X(e,o,"whitespace")(a):o(a)}function o(a){return a===null||z(a)?n(a):t(a)}}const bl={name:"hardBreakEscape",tokenize:wl};function wl(e,n,t){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return z(l)?(e.exit("hardBreakEscape"),n(l)):t(l)}}const Sl={name:"headingAtx",resolve:Cl,tokenize:El};function Cl(e,n){let t=e.length-2,r=3,i,l;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},l={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},fe(e,r,t-r+1,[["enter",i,n],["enter",l,n],["exit",l,n],["exit",i,n]])),e}function El(e,n,t){let r=0;return i;function i(s){return e.enter("atxHeading"),l(s)}function l(s){return e.enter("atxHeadingSequence"),o(s)}function o(s){return s===35&&r++<6?(e.consume(s),o):s===null||J(s)?(e.exit("atxHeadingSequence"),a(s)):t(s)}function a(s){return s===35?(e.enter("atxHeadingSequence"),c(s)):s===null||z(s)?(e.exit("atxHeading"),n(s)):R(s)?X(e,a,"whitespace")(s):(e.enter("atxHeadingText"),u(s))}function c(s){return s===35?(e.consume(s),c):(e.exit("atxHeadingSequence"),a(s))}function u(s){return s===null||s===35||J(s)?(e.exit("atxHeadingText"),a(s)):(e.consume(s),u)}}const Il=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ft=["pre","script","style","textarea"],Tl={concrete:!0,name:"htmlFlow",resolveTo:vl,tokenize:zl},Al={partial:!0,tokenize:Dl},Pl={partial:!0,tokenize:Ll};function vl(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function zl(e,n,t){const r=this;let i,l,o,a,c;return u;function u(m){return s(m)}function s(m){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(m),p}function p(m){return m===33?(e.consume(m),h):m===47?(e.consume(m),l=!0,S):m===63?(e.consume(m),i=3,r.interrupt?n:d):ce(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function h(m){return m===45?(e.consume(m),i=2,f):m===91?(e.consume(m),i=5,a=0,b):ce(m)?(e.consume(m),i=4,r.interrupt?n:d):t(m)}function f(m){return m===45?(e.consume(m),r.interrupt?n:d):t(m)}function b(m){const ae="CDATA[";return m===ae.charCodeAt(a++)?(e.consume(m),a===ae.length?r.interrupt?n:T:b):t(m)}function S(m){return ce(m)?(e.consume(m),o=String.fromCharCode(m),I):t(m)}function I(m){if(m===null||m===47||m===62||J(m)){const ae=m===47,ke=o.toLowerCase();return!ae&&!l&&ft.includes(ke)?(i=1,r.interrupt?n(m):T(m)):Il.includes(o.toLowerCase())?(i=6,ae?(e.consume(m),x):r.interrupt?n(m):T(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?v(m):E(m))}return m===45||re(m)?(e.consume(m),o+=String.fromCharCode(m),I):t(m)}function x(m){return m===62?(e.consume(m),r.interrupt?n:T):t(m)}function v(m){return R(m)?(e.consume(m),v):H(m)}function E(m){return m===47?(e.consume(m),H):m===58||m===95||ce(m)?(e.consume(m),F):R(m)?(e.consume(m),E):H(m)}function F(m){return m===45||m===46||m===58||m===95||re(m)?(e.consume(m),F):M(m)}function M(m){return m===61?(e.consume(m),y):R(m)?(e.consume(m),M):E(m)}function y(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),c=m,_):R(m)?(e.consume(m),y):B(m)}function _(m){return m===c?(e.consume(m),c=null,j):m===null||z(m)?t(m):(e.consume(m),_)}function B(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||J(m)?M(m):(e.consume(m),B)}function j(m){return m===47||m===62||R(m)?E(m):t(m)}function H(m){return m===62?(e.consume(m),A):t(m)}function A(m){return m===null||z(m)?T(m):R(m)?(e.consume(m),A):t(m)}function T(m){return m===45&&i===2?(e.consume(m),U):m===60&&i===1?(e.consume(m),Y):m===62&&i===4?(e.consume(m),oe):m===63&&i===3?(e.consume(m),d):m===93&&i===5?(e.consume(m),pe):z(m)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Al,he,q)(m)):m===null||z(m)?(e.exit("htmlFlowData"),q(m)):(e.consume(m),T)}function q(m){return e.check(Pl,P,he)(m)}function P(m){return e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),C}function C(m){return m===null||z(m)?q(m):(e.enter("htmlFlowData"),T(m))}function U(m){return m===45?(e.consume(m),d):T(m)}function Y(m){return m===47?(e.consume(m),o="",le):T(m)}function le(m){if(m===62){const ae=o.toLowerCase();return ft.includes(ae)?(e.consume(m),oe):T(m)}return ce(m)&&o.length<8?(e.consume(m),o+=String.fromCharCode(m),le):T(m)}function pe(m){return m===93?(e.consume(m),d):T(m)}function d(m){return m===62?(e.consume(m),oe):m===45&&i===2?(e.consume(m),d):T(m)}function oe(m){return m===null||z(m)?(e.exit("htmlFlowData"),he(m)):(e.consume(m),oe)}function he(m){return e.exit("htmlFlow"),n(m)}}function Ll(e,n,t){const r=this;return i;function i(o){return z(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):n(o)}}function Dl(e,n,t){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ze,n,t)}}const Ml={name:"htmlText",tokenize:Nl};function Nl(e,n,t){const r=this;let i,l,o;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),u):d===47?(e.consume(d),M):d===63?(e.consume(d),E):ce(d)?(e.consume(d),B):t(d)}function u(d){return d===45?(e.consume(d),s):d===91?(e.consume(d),l=0,b):ce(d)?(e.consume(d),v):t(d)}function s(d){return d===45?(e.consume(d),f):t(d)}function p(d){return d===null?t(d):d===45?(e.consume(d),h):z(d)?(o=p,Y(d)):(e.consume(d),p)}function h(d){return d===45?(e.consume(d),f):p(d)}function f(d){return d===62?U(d):d===45?h(d):p(d)}function b(d){const oe="CDATA[";return d===oe.charCodeAt(l++)?(e.consume(d),l===oe.length?S:b):t(d)}function S(d){return d===null?t(d):d===93?(e.consume(d),I):z(d)?(o=S,Y(d)):(e.consume(d),S)}function I(d){return d===93?(e.consume(d),x):S(d)}function x(d){return d===62?U(d):d===93?(e.consume(d),x):S(d)}function v(d){return d===null||d===62?U(d):z(d)?(o=v,Y(d)):(e.consume(d),v)}function E(d){return d===null?t(d):d===63?(e.consume(d),F):z(d)?(o=E,Y(d)):(e.consume(d),E)}function F(d){return d===62?U(d):E(d)}function M(d){return ce(d)?(e.consume(d),y):t(d)}function y(d){return d===45||re(d)?(e.consume(d),y):_(d)}function _(d){return z(d)?(o=_,Y(d)):R(d)?(e.consume(d),_):U(d)}function B(d){return d===45||re(d)?(e.consume(d),B):d===47||d===62||J(d)?j(d):t(d)}function j(d){return d===47?(e.consume(d),U):d===58||d===95||ce(d)?(e.consume(d),H):z(d)?(o=j,Y(d)):R(d)?(e.consume(d),j):U(d)}function H(d){return d===45||d===46||d===58||d===95||re(d)?(e.consume(d),H):A(d)}function A(d){return d===61?(e.consume(d),T):z(d)?(o=A,Y(d)):R(d)?(e.consume(d),A):j(d)}function T(d){return d===null||d===60||d===61||d===62||d===96?t(d):d===34||d===39?(e.consume(d),i=d,q):z(d)?(o=T,Y(d)):R(d)?(e.consume(d),T):(e.consume(d),P)}function q(d){return d===i?(e.consume(d),i=void 0,C):d===null?t(d):z(d)?(o=q,Y(d)):(e.consume(d),q)}function P(d){return d===null||d===34||d===39||d===60||d===61||d===96?t(d):d===47||d===62||J(d)?j(d):(e.consume(d),P)}function C(d){return d===47||d===62||J(d)?j(d):t(d)}function U(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),n):t(d)}function Y(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),le}function le(d){return R(d)?X(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):pe(d)}function pe(d){return e.enter("htmlTextData"),o(d)}}const Nn={name:"labelEnd",resolveAll:Fl,resolveTo:jl,tokenize:Bl},_l={tokenize:Hl},Ol={tokenize:Ul},Rl={tokenize:Vl};function Fl(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",n+=i}}return e.length!==t.length&&fe(e,0,e.length,t),e}function jl(e,n){let t=e.length,r=0,i,l,o,a;for(;t--;)if(i=e[t][1],l){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[t][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[t][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(l=t,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=t);const c={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},s={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",c,n],["enter",u,n]],a=ie(a,e.slice(l+1,l+r+3)),a=ie(a,[["enter",s,n]]),a=ie(a,Mn(n.parser.constructs.insideSpan.null,e.slice(l+r+4,o-3),n)),a=ie(a,[["exit",s,n],e[o-2],e[o-1],["exit",u,n]]),a=ie(a,e.slice(o+1)),a=ie(a,[["exit",c,n]]),fe(e,l,e.length,a),e}function Bl(e,n,t){const r=this;let i=r.events.length,l,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){l=r.events[i][1];break}return a;function a(h){return l?l._inactive?p(h):(o=r.parser.defined.includes(Pe(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),c):t(h)}function c(h){return h===40?e.attempt(_l,s,o?s:p)(h):h===91?e.attempt(Ol,s,o?u:p)(h):o?s(h):p(h)}function u(h){return e.attempt(Rl,s,p)(h)}function s(h){return n(h)}function p(h){return l._balanced=!0,t(h)}}function Hl(e,n,t){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return J(p)?je(e,l)(p):l(p)}function l(p){return p===41?s(p):Jt(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return J(p)?je(e,c)(p):s(p)}function a(p){return t(p)}function c(p){return p===34||p===39||p===40?er(e,u,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):s(p)}function u(p){return J(p)?je(e,s)(p):s(p)}function s(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),n):t(p)}}function Ul(e,n,t){const r=this;return i;function i(a){return Zt.call(r,e,l,o,"reference","referenceMarker","referenceString")(a)}function l(a){return r.parser.defined.includes(Pe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function o(a){return t(a)}}function Vl(e,n,t){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),n):t(l)}}const ql={name:"labelStartImage",resolveAll:Nn.resolveAll,tokenize:$l};function $l(e,n,t){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),l}function l(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):t(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const Xl={name:"labelStartLink",resolveAll:Nn.resolveAll,tokenize:Wl};function Wl(e,n,t){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(o):n(o)}}const an={name:"lineEnding",tokenize:Yl};function Yl(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),X(e,n,"linePrefix")}}const Ke={name:"thematicBreak",tokenize:Ql};function Ql(e,n,t){let r=0,i;return l;function l(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||z(u))?(e.exit("thematicBreak"),n(u)):t(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),R(u)?X(e,a,"whitespace")(u):a(u))}}const G={continuation:{tokenize:Zl},exit:no,name:"list",tokenize:Jl},Kl={partial:!0,tokenize:to},Gl={partial:!0,tokenize:eo};function Jl(e,n,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const b=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:wn(f)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Ke,t,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return t(f)}function c(f){return wn(f)&&++o<10?(e.consume(f),c):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):t(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Ze,r.interrupt?t:s,e.attempt(Kl,h,p))}function s(f){return r.containerState.initialBlankLine=!0,l++,h(f)}function p(f){return R(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):t(f)}function h(f){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(f)}}function Zl(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Ze,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,X(e,n,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Gl,n,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,X(e,e.attempt(G,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function eo(e,n,t){const r=this;return X(e,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?n(l):t(l)}}function no(e){e.exit(this.containerState.type)}function to(e,n,t){const r=this;return X(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const o=r.events[r.events.length-1];return!R(l)&&o&&o[1].type==="listItemPrefixWhitespace"?n(l):t(l)}}const pt={name:"setextUnderline",resolveTo:ro,tokenize:io};function ro(e,n){let t=e.length,r,i,l;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(i=t)}else e[t][1].type==="content"&&e.splice(t,1),!l&&e[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",l?(e.splice(i,0,["enter",o,n]),e.splice(l+1,0,["exit",e[r][1],n]),e[r][1].end={...e[l][1].end}):e[r][1]=o,e.push(["exit",o,n]),e}function io(e,n,t){const r=this;let i;return l;function l(u){let s=r.events.length,p;for(;s--;)if(r.events[s][1].type!=="lineEnding"&&r.events[s][1].type!=="linePrefix"&&r.events[s][1].type!=="content"){p=r.events[s][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=u,o(u)):t(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),R(u)?X(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||z(u)?(e.exit("setextHeadingLine"),n(u)):t(u)}}const lo={tokenize:oo};function oo(e){const n=this,t=e.attempt(Ze,r,e.attempt(this.parser.constructs.flowInitial,i,X(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fl,i)),"linePrefix")));return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const ao={resolveAll:tr()},uo=nr("string"),so=nr("text");function nr(e){return{resolveAll:tr(e==="text"?co:void 0),tokenize:n};function n(t){const r=this,i=this.parser.constructs[e],l=t.attempt(i,o,a);return o;function o(s){return u(s)?l(s):a(s)}function a(s){if(s===null){t.consume(s);return}return t.enter("data"),t.consume(s),c}function c(s){return u(s)?(t.exit("data"),l(s)):(t.consume(s),c)}function u(s){if(s===null)return!0;const p=i[s];let h=-1;if(p)for(;++h<p.length;){const f=p[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function tr(e){return n;function n(t,r){let i=-1,l;for(;++i<=t.length;)l===void 0?t[i]&&t[i][1].type==="data"&&(l=i,i++):(!t[i]||t[i][1].type!=="data")&&(i!==l+2&&(t[l][1].end=t[i-1][1].end,t.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(t,r):t}}function co(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],i=n.sliceStream(r);let l=i.length,o=-1,a=0,c;for(;l--;){const u=i[l];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)c=!0,a++;else if(u!==-1){l++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const u={type:t===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:r.start._bufferIndex+o,_index:r.start._index+l,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(t,0,["enter",u,n],["exit",u,n]),t+=2)}t++}return e}const fo={42:G,43:G,45:G,48:G,49:G,50:G,51:G,52:G,53:G,54:G,55:G,56:G,57:G,62:Yt},po={91:gl},ho={[-2]:on,[-1]:on,32:on},mo={35:Sl,42:Ke,45:[pt,Ke],60:Tl,61:pt,95:Ke,96:ct,126:ct},go={38:Kt,92:Qt},yo={[-5]:an,[-4]:an,[-3]:an,33:ql,38:Kt,42:Sn,60:[Xi,Ml],91:Xl,92:[bl,Qt],93:Nn,95:Sn,96:ll},xo={null:[Sn,ao]},ko={null:[42,95]},bo={null:[]},wo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ko,contentInitial:po,disable:bo,document:fo,flow:mo,flowInitial:ho,insideSpan:xo,string:go,text:yo},Symbol.toStringTag,{value:"Module"}));function So(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const i={},l=[];let o=[],a=[];const c={attempt:_(M),check:_(y),consume:v,enter:E,exit:F,interrupt:_(y,{interrupt:!0})},u={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:h,sliceStream:f,write:p};let s=n.tokenize.call(u,c);return n.resolveAll&&l.push(n),u;function p(A){return o=ie(o,A),I(),o[o.length-1]!==null?[]:(B(n,0),u.events=Mn(l,u.events,u),u.events)}function h(A,T){return Eo(f(A),T)}function f(A){return Co(o,A)}function b(){const{_bufferIndex:A,_index:T,line:q,column:P,offset:C}=r;return{_bufferIndex:A,_index:T,line:q,column:P,offset:C}}function S(A){i[A.line]=A.column,H()}function I(){let A;for(;r._index<o.length;){const T=o[r._index];if(typeof T=="string")for(A=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===A&&r._bufferIndex<T.length;)x(T.charCodeAt(r._bufferIndex));else x(T)}}function x(A){s=s(A)}function v(A){z(A)?(r.line++,r.column=1,r.offset+=A===-3?2:1,H()):A!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=A}function E(A,T){const q=T||{};return q.type=A,q.start=b(),u.events.push(["enter",q,u]),a.push(q),q}function F(A){const T=a.pop();return T.end=b(),u.events.push(["exit",T,u]),T}function M(A,T){B(A,T.from)}function y(A,T){T.restore()}function _(A,T){return q;function q(P,C,U){let Y,le,pe,d;return Array.isArray(P)?he(P):"tokenize"in P?he([P]):oe(P);function oe(Q){return Le;function Le(ge){const Se=ge!==null&&Q[ge],Ce=ge!==null&&Q.null,qe=[...Array.isArray(Se)?Se:Se?[Se]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return he(qe)(ge)}}function he(Q){return Y=Q,le=0,Q.length===0?U:m(Q[le])}function m(Q){return Le;function Le(ge){return d=j(),pe=Q,Q.partial||(u.currentConstruct=Q),Q.name&&u.parser.constructs.disable.null.includes(Q.name)?ke():Q.tokenize.call(T?Object.assign(Object.create(u),T):u,c,ae,ke)(ge)}}function ae(Q){return A(pe,d),C}function ke(Q){return d.restore(),++le<Y.length?m(Y[le]):U}}}function B(A,T){A.resolveAll&&!l.includes(A)&&l.push(A),A.resolve&&fe(u.events,T,u.events.length-T,A.resolve(u.events.slice(T),u)),A.resolveTo&&(u.events=A.resolveTo(u.events,u))}function j(){const A=b(),T=u.previous,q=u.currentConstruct,P=u.events.length,C=Array.from(a);return{from:P,restore:U};function U(){r=A,u.previous=T,u.currentConstruct=q,u.events.length=P,a=C,H()}}function H(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Co(e,n){const t=n.start._index,r=n.start._bufferIndex,i=n.end._index,l=n.end._bufferIndex;let o;if(t===i)o=[e[t].slice(r,l)];else{if(o=e.slice(t,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(e[i].slice(0,l))}return o}function Eo(e,n){let t=-1;const r=[];let i;for(;++t<e.length;){const l=e[t];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
3
+ `;break}case-3:{o=`\r
4
+ `;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(l)}i=l===-2,r.push(o)}return r.join("")}function Io(e){const r={constructs:Li([wo,...(e||{}).extensions||[]]),content:i(ji),defined:[],document:i(Hi),flow:i(lo),lazy:{},string:i(uo),text:i(so)};return r;function i(l){return o;function o(a){return So(r,l,a)}}}function To(e){for(;!Gt(e););return e}const ht=/[\0\t\n\r]/g;function Ao(){let e=1,n="",t=!0,r;return i;function i(l,o,a){const c=[];let u,s,p,h,f;for(l=n+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),p=0,n="",t&&(l.charCodeAt(0)===65279&&p++,t=void 0);p<l.length;){if(ht.lastIndex=p,u=ht.exec(l),h=u&&u.index!==void 0?u.index:l.length,f=l.charCodeAt(h),!u){n=l.slice(p);break}if(f===10&&p===h&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),p<h&&(c.push(l.slice(p,h)),e+=h-p),f){case 0:{c.push(65533),e++;break}case 9:{for(s=Math.ceil(e/4)*4,c.push(-2);e++<s;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}p=h+1}return a&&(r&&c.push(-5),n&&c.push(n),c.push(null)),c}}const Po=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function vo(e){return e.replace(Po,zo)}function zo(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const i=t.charCodeAt(1),l=i===120||i===88;return Wt(t.slice(l?2:1),l?16:10)}return Dn(t)||e}const rr={}.hasOwnProperty;function Lo(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Do(t)(To(Io(t).document().write(Ao()(e,n,!0))))}function Do(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Vn),autolinkProtocol:j,autolinkEmail:j,atxHeading:l(Bn),blockQuote:l(Ce),characterEscape:j,characterReference:j,codeFenced:l(qe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(qe,o),codeText:l(dr,o),codeTextData:j,data:j,codeFlowValue:j,definition:l(mr),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(gr),hardBreakEscape:l(Hn),hardBreakTrailing:l(Hn),htmlFlow:l(Un,o),htmlFlowData:j,htmlText:l(Un,o),htmlTextData:j,image:l(yr),label:o,link:l(Vn),listItem:l(xr),listItemValue:h,listOrdered:l(qn,p),listUnordered:l(qn),paragraph:l(kr),reference:m,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Bn),strong:l(br),thematicBreak:l(Sr)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:Se,autolinkProtocol:ge,blockQuote:c(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:Q,characterReference:Le,codeFenced:c(I),codeFencedFence:S,codeFencedFenceInfo:f,codeFencedFenceMeta:b,codeFlowValue:H,codeIndented:c(x),codeText:c(C),codeTextData:H,data:H,definition:c(),definitionDestinationString:F,definitionLabelString:v,definitionTitleString:E,emphasis:c(),hardBreakEscape:c(T),hardBreakTrailing:c(T),htmlFlow:c(q),htmlFlowData:H,htmlText:c(P),htmlTextData:H,image:c(Y),label:pe,labelText:le,lineEnding:A,link:c(U),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ae,resourceDestinationString:d,resourceTitleString:oe,resource:he,setextHeading:c(B),setextHeadingLineSequence:_,setextHeadingText:y,strong:c(),thematicBreak:c()}};ir(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(g){let w={type:"root",children:[]};const D={stack:[w],tokenStack:[],config:n,enter:a,exit:u,buffer:o,resume:s,data:t},O=[];let V=-1;for(;++V<g.length;)if(g[V][1].type==="listOrdered"||g[V][1].type==="listUnordered")if(g[V][0]==="enter")O.push(V);else{const ue=O.pop();V=i(g,ue,V)}for(V=-1;++V<g.length;){const ue=n[g[V][0]];rr.call(ue,g[V][1].type)&&ue[g[V][1].type].call(Object.assign({sliceSerialize:g[V][2].sliceSerialize},D),g[V][1])}if(D.tokenStack.length>0){const ue=D.tokenStack[D.tokenStack.length-1];(ue[1]||dt).call(D,void 0,ue[0])}for(w.position={start:ye(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:ye(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<n.transforms.length;)w=n.transforms[V](w)||w;return w}function i(g,w,D){let O=w-1,V=-1,ue=!1,be,de,De,Me;for(;++O<=D;){const ee=g[O];switch(ee[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ee[0]==="enter"?V++:V--,Me=void 0;break}case"lineEndingBlank":{ee[0]==="enter"&&(be&&!Me&&!V&&!De&&(De=O),Me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Me=void 0}if(!V&&ee[0]==="enter"&&ee[1].type==="listItemPrefix"||V===-1&&ee[0]==="exit"&&(ee[1].type==="listUnordered"||ee[1].type==="listOrdered")){if(be){let Ee=O;for(de=void 0;Ee--;){const me=g[Ee];if(me[1].type==="lineEnding"||me[1].type==="lineEndingBlank"){if(me[0]==="exit")continue;de&&(g[de][1].type="lineEndingBlank",ue=!0),me[1].type="lineEnding",de=Ee}else if(!(me[1].type==="linePrefix"||me[1].type==="blockQuotePrefix"||me[1].type==="blockQuotePrefixWhitespace"||me[1].type==="blockQuoteMarker"||me[1].type==="listItemIndent"))break}De&&(!de||De<de)&&(be._spread=!0),be.end=Object.assign({},de?g[de][1].start:ee[1].end),g.splice(de||O,0,["exit",be,ee[2]]),O++,D++}if(ee[1].type==="listItemPrefix"){const Ee={type:"listItem",_spread:!1,start:Object.assign({},ee[1].start),end:void 0};be=Ee,g.splice(O,0,["enter",Ee,ee[2]]),O++,D++,De=void 0,Me=!0}}}return g[w][1]._spread=ue,D}function l(g,w){return D;function D(O){a.call(this,g(O),O),w&&w.call(this,O)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(g,w,D){this.stack[this.stack.length-1].children.push(g),this.stack.push(g),this.tokenStack.push([w,D||void 0]),g.position={start:ye(w.start),end:void 0}}function c(g){return w;function w(D){g&&g.call(this,D),u.call(this,D)}}function u(g,w){const D=this.stack.pop(),O=this.tokenStack.pop();if(O)O[0].type!==g.type&&(w?w.call(this,g,O[0]):(O[1]||dt).call(this,g,O[0]));else throw new Error("Cannot close `"+g.type+"` ("+Fe({start:g.start,end:g.end})+"): it’s not open");D.position.end=ye(g.end)}function s(){return vi(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function h(g){if(this.data.expectingFirstListItemValue){const w=this.stack[this.stack.length-2];w.start=Number.parseInt(this.sliceSerialize(g),10),this.data.expectingFirstListItemValue=void 0}}function f(){const g=this.resume(),w=this.stack[this.stack.length-1];w.lang=g}function b(){const g=this.resume(),w=this.stack[this.stack.length-1];w.meta=g}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g.replace(/(\r?\n|\r)$/g,"")}function v(g){const w=this.resume(),D=this.stack[this.stack.length-1];D.label=w,D.identifier=Pe(this.sliceSerialize(g)).toLowerCase()}function E(){const g=this.resume(),w=this.stack[this.stack.length-1];w.title=g}function F(){const g=this.resume(),w=this.stack[this.stack.length-1];w.url=g}function M(g){const w=this.stack[this.stack.length-1];if(!w.depth){const D=this.sliceSerialize(g).length;w.depth=D}}function y(){this.data.setextHeadingSlurpLineEnding=!0}function _(g){const w=this.stack[this.stack.length-1];w.depth=this.sliceSerialize(g).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function j(g){const D=this.stack[this.stack.length-1].children;let O=D[D.length-1];(!O||O.type!=="text")&&(O=wr(),O.position={start:ye(g.start),end:void 0},D.push(O)),this.stack.push(O)}function H(g){const w=this.stack.pop();w.value+=this.sliceSerialize(g),w.position.end=ye(g.end)}function A(g){const w=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=w.children[w.children.length-1];D.position.end=ye(g.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(w.type)&&(j.call(this,g),H.call(this,g))}function T(){this.data.atHardBreak=!0}function q(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function P(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function C(){const g=this.resume(),w=this.stack[this.stack.length-1];w.value=g}function U(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const w=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=w,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function Y(){const g=this.stack[this.stack.length-1];if(this.data.inReference){const w=this.data.referenceType||"shortcut";g.type+="Reference",g.referenceType=w,delete g.url,delete g.title}else delete g.identifier,delete g.label;this.data.referenceType=void 0}function le(g){const w=this.sliceSerialize(g),D=this.stack[this.stack.length-2];D.label=vo(w),D.identifier=Pe(w).toLowerCase()}function pe(){const g=this.stack[this.stack.length-1],w=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const O=g.children;D.children=O}else D.alt=w}function d(){const g=this.resume(),w=this.stack[this.stack.length-1];w.url=g}function oe(){const g=this.resume(),w=this.stack[this.stack.length-1];w.title=g}function he(){this.data.inReference=void 0}function m(){this.data.referenceType="collapsed"}function ae(g){const w=this.resume(),D=this.stack[this.stack.length-1];D.label=w,D.identifier=Pe(this.sliceSerialize(g)).toLowerCase(),this.data.referenceType="full"}function ke(g){this.data.characterReferenceType=g.type}function Q(g){const w=this.sliceSerialize(g),D=this.data.characterReferenceType;let O;D?(O=Wt(w,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):O=Dn(w);const V=this.stack[this.stack.length-1];V.value+=O}function Le(g){const w=this.stack.pop();w.position.end=ye(g.end)}function ge(g){H.call(this,g);const w=this.stack[this.stack.length-1];w.url=this.sliceSerialize(g)}function Se(g){H.call(this,g);const w=this.stack[this.stack.length-1];w.url="mailto:"+this.sliceSerialize(g)}function Ce(){return{type:"blockquote",children:[]}}function qe(){return{type:"code",lang:null,meta:null,value:""}}function dr(){return{type:"inlineCode",value:""}}function mr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function gr(){return{type:"emphasis",children:[]}}function Bn(){return{type:"heading",depth:0,children:[]}}function Hn(){return{type:"break"}}function Un(){return{type:"html",value:""}}function yr(){return{type:"image",title:null,url:"",alt:null}}function Vn(){return{type:"link",title:null,url:"",children:[]}}function qn(g){return{type:"list",ordered:g.type==="listOrdered",start:null,spread:g._spread,children:[]}}function xr(g){return{type:"listItem",spread:g._spread,checked:null,children:[]}}function kr(){return{type:"paragraph",children:[]}}function br(){return{type:"strong",children:[]}}function wr(){return{type:"text",value:""}}function Sr(){return{type:"thematicBreak"}}}function ye(e){return{line:e.line,column:e.column,offset:e.offset}}function ir(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?ir(e,r):Mo(e,r)}}function Mo(e,n){let t;for(t in n)if(rr.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function dt(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+Fe({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+Fe({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+Fe({start:n.start,end:n.end})+") is still open")}function No(e){const n=this;n.parser=t;function t(r){return Lo(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function _o(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Oo(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
5
+ `}]}function Ro(e,n){const t=n.value?n.value+`
6
+ `:"",r={},i=n.lang?n.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:t}]};return n.meta&&(l.data={meta:n.meta}),e.patch(n,l),l=e.applyData(n,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(n,l),l}function Fo(e,n){const t={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function jo(e,n){const t={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Bo(e,n){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),i=ze(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=l+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+t+"fn-"+i,id:t+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(n,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(n,u),e.applyData(n,u)}function Ho(e,n){const t={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Uo(e,n){if(e.options.allowDangerousHtml){const t={type:"raw",value:n.value};return e.patch(n,t),e.applyData(n,t)}}function lr(e,n){const t=n.referenceType;let r="]";if(t==="collapsed"?r+="[]":t==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const i=e.all(n),l=i[0];l&&l.type==="text"?l.value="["+l.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Vo(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return lr(e,n);const i={src:ze(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(n,l),e.applyData(n,l)}function qo(e,n){const t={src:ze(n.url)};n.alt!==null&&n.alt!==void 0&&(t.alt=n.alt),n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"img",properties:t,children:[]};return e.patch(n,r),e.applyData(n,r)}function $o(e,n){const t={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,t);const r={type:"element",tagName:"code",properties:{},children:[t]};return e.patch(n,r),e.applyData(n,r)}function Xo(e,n){const t=String(n.identifier).toUpperCase(),r=e.definitionById.get(t);if(!r)return lr(e,n);const i={href:ze(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const l={type:"element",tagName:"a",properties:i,children:e.all(n)};return e.patch(n,l),e.applyData(n,l)}function Wo(e,n){const t={href:ze(n.url)};n.title!==null&&n.title!==void 0&&(t.title=n.title);const r={type:"element",tagName:"a",properties:t,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Yo(e,n,t){const r=e.all(n),i=t?Qo(t):or(n),l={},o=[];if(typeof n.checked=="boolean"){const s=r[0];let p;s&&s.type==="element"&&s.tagName==="p"?p=s:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const s=r[a];(i||a!==0||s.type!=="element"||s.tagName!=="p")&&o.push({type:"text",value:`
7
+ `}),s.type==="element"&&s.tagName==="p"&&!i?o.push(...s.children):o.push(s)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
8
+ `});const u={type:"element",tagName:"li",properties:l,children:o};return e.patch(n,u),e.applyData(n,u)}function Qo(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const t=e.children;let r=-1;for(;!n&&++r<t.length;)n=or(t[r])}return n}function or(e){const n=e.spread;return n??e.children.length>1}function Ko(e,n){const t={},r=e.all(n);let i=-1;for(typeof n.start=="number"&&n.start!==1&&(t.start=n.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){t.className=["contains-task-list"];break}}const l={type:"element",tagName:n.ordered?"ol":"ul",properties:t,children:e.wrap(r,!0)};return e.patch(n,l),e.applyData(n,l)}function Go(e,n){const t={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function Jo(e,n){const t={type:"root",children:e.wrap(e.all(n))};return e.patch(n,t),e.applyData(n,t)}function Zo(e,n){const t={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}function ea(e,n){const t=e.all(n),r=t.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],o),i.push(o)}if(t.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(t,!0)},a=Pn(n.children[1]),c=Bt(n.children[n.children.length-1]);a&&c&&(o.position={start:a,end:c}),i.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(n,l),e.applyData(n,l)}function na(e,n,t){const r=t?t.children:void 0,l=(r?r.indexOf(n):1)===0?"th":"td",o=t&&t.type==="table"?t.align:void 0,a=o?o.length:n.children.length;let c=-1;const u=[];for(;++c<a;){const p=n.children[c],h={},f=o?o[c]:void 0;f&&(h.align=f);let b={type:"element",tagName:l,properties:h,children:[]};p&&(b.children=e.all(p),e.patch(p,b),b=e.applyData(p,b)),u.push(b)}const s={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(n,s),e.applyData(n,s)}function ta(e,n){const t={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,t),e.applyData(n,t)}const mt=9,gt=32;function ra(e){const n=String(e),t=/\r?\n|\r/g;let r=t.exec(n),i=0;const l=[];for(;r;)l.push(yt(n.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=t.exec(n);return l.push(yt(n.slice(i),i>0,!1)),l.join("")}function yt(e,n,t){let r=0,i=e.length;if(n){let l=e.codePointAt(r);for(;l===mt||l===gt;)r++,l=e.codePointAt(r)}if(t){let l=e.codePointAt(i-1);for(;l===mt||l===gt;)i--,l=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function ia(e,n){const t={type:"text",value:ra(String(n.value))};return e.patch(n,t),e.applyData(n,t)}function la(e,n){const t={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,t),e.applyData(n,t)}const oa={blockquote:_o,break:Oo,code:Ro,delete:Fo,emphasis:jo,footnoteReference:Bo,heading:Ho,html:Uo,imageReference:Vo,image:qo,inlineCode:$o,linkReference:Xo,link:Wo,listItem:Yo,list:Ko,paragraph:Go,root:Jo,strong:Zo,table:ea,tableCell:ta,tableRow:na,text:ia,thematicBreak:la,toml:Xe,yaml:Xe,definition:Xe,footnoteDefinition:Xe};function Xe(){}const ar=-1,en=0,Be=1,Ge=2,_n=3,On=4,Rn=5,Fn=6,ur=7,sr=8,xt=typeof self=="object"?self:globalThis,aa=(e,n)=>{const t=(i,l)=>(e.set(l,i),i),r=i=>{if(e.has(i))return e.get(i);const[l,o]=n[i];switch(l){case en:case ar:return t(o,i);case Be:{const a=t([],i);for(const c of o)a.push(r(c));return a}case Ge:{const a=t({},i);for(const[c,u]of o)a[r(c)]=r(u);return a}case _n:return t(new Date(o),i);case On:{const{source:a,flags:c}=o;return t(new RegExp(a,c),i)}case Rn:{const a=t(new Map,i);for(const[c,u]of o)a.set(r(c),r(u));return a}case Fn:{const a=t(new Set,i);for(const c of o)a.add(r(c));return a}case ur:{const{name:a,message:c}=o;return t(new xt[a](c),i)}case sr:return t(BigInt(o),i);case"BigInt":return t(Object(BigInt(o)),i);case"ArrayBuffer":return t(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return t(new DataView(a),o)}}return t(new xt[l](o),i)};return r},kt=e=>aa(new Map,e)(0),Te="",{toString:ua}={},{keys:sa}=Object,Re=e=>{const n=typeof e;if(n!=="object"||!e)return[en,n];const t=ua.call(e).slice(8,-1);switch(t){case"Array":return[Be,Te];case"Object":return[Ge,Te];case"Date":return[_n,Te];case"RegExp":return[On,Te];case"Map":return[Rn,Te];case"Set":return[Fn,Te];case"DataView":return[Be,t]}return t.includes("Array")?[Be,t]:t.includes("Error")?[ur,t]:[Ge,t]},We=([e,n])=>e===en&&(n==="function"||n==="symbol"),ca=(e,n,t,r)=>{const i=(o,a)=>{const c=r.push(o)-1;return t.set(a,c),c},l=o=>{if(t.has(o))return t.get(o);let[a,c]=Re(o);switch(a){case en:{let s=o;switch(c){case"bigint":a=sr,s=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);s=null;break;case"undefined":return i([ar],o)}return i([a,s],o)}case Be:{if(c){let h=o;return c==="DataView"?h=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(h=new Uint8Array(o)),i([c,[...h]],o)}const s=[],p=i([a,s],o);for(const h of o)s.push(l(h));return p}case Ge:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(n&&"toJSON"in o)return l(o.toJSON());const s=[],p=i([a,s],o);for(const h of sa(o))(e||!We(Re(o[h])))&&s.push([l(h),l(o[h])]);return p}case _n:return i([a,o.toISOString()],o);case On:{const{source:s,flags:p}=o;return i([a,{source:s,flags:p}],o)}case Rn:{const s=[],p=i([a,s],o);for(const[h,f]of o)(e||!(We(Re(h))||We(Re(f))))&&s.push([l(h),l(f)]);return p}case Fn:{const s=[],p=i([a,s],o);for(const h of o)(e||!We(Re(h)))&&s.push(l(h));return p}}const{message:u}=o;return i([a,{name:c,message:u}],o)};return l},bt=(e,{json:n,lossy:t}={})=>{const r=[];return ca(!(n||t),!!n,new Map,r)(e),r},Je=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?kt(bt(e,n)):structuredClone(e):(e,n)=>kt(bt(e,n));function fa(e,n){const t=[{type:"text",value:"↩"}];return n>1&&t.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),t}function pa(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function ha(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",t=e.options.footnoteBackContent||fa,r=e.options.footnoteBackLabel||pa,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const s=e.all(u),p=String(u.identifier).toUpperCase(),h=ze(p.toLowerCase());let f=0;const b=[],S=e.footnoteCounts.get(p);for(;S!==void 0&&++f<=S;){b.length>0&&b.push({type:"text",value:" "});let v=typeof t=="string"?t:t(c,f);typeof v=="string"&&(v={type:"text",value:v}),b.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const I=s[s.length-1];if(I&&I.type==="element"&&I.tagName==="p"){const v=I.children[I.children.length-1];v&&v.type==="text"?v.value+=" ":I.children.push({type:"text",value:" "}),I.children.push(...b)}else s.push(...b);const x={type:"element",tagName:"li",properties:{id:n+"fn-"+h},children:e.wrap(s,!0)};e.patch(u,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Je(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
9
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
10
+ `}]}}const cr=(function(e){if(e==null)return ya;if(typeof e=="function")return nn(e);if(typeof e=="object")return Array.isArray(e)?da(e):ma(e);if(typeof e=="string")return ga(e);throw new Error("Expected function, string, or object as test")});function da(e){const n=[];let t=-1;for(;++t<e.length;)n[t]=cr(e[t]);return nn(r);function r(...i){let l=-1;for(;++l<n.length;)if(n[l].apply(this,i))return!0;return!1}}function ma(e){const n=e;return nn(t);function t(r){const i=r;let l;for(l in e)if(i[l]!==n[l])return!1;return!0}}function ga(e){return nn(n);function n(t){return t&&t.type===e}}function nn(e){return n;function n(t,r,i){return!!(xa(t)&&e.call(this,t,typeof r=="number"?r:void 0,i||void 0))}}function ya(){return!0}function xa(e){return e!==null&&typeof e=="object"&&"type"in e}const fr=[],ka=!0,wt=!1,ba="skip";function wa(e,n,t,r){let i;typeof n=="function"&&typeof t!="function"?(r=t,t=n):i=n;const l=cr(i),o=r?-1:1;a(e,void 0,[])();function a(c,u,s){const p=c&&typeof c=="object"?c:{};if(typeof p.type=="string"){const f=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=fr,b,S,I;if((!n||l(c,u,s[s.length-1]||void 0))&&(f=Sa(t(c,s)),f[0]===wt))return f;if("children"in c&&c.children){const x=c;if(x.children&&f[0]!==ba)for(S=(r?x.children.length:-1)+o,I=s.concat(x);S>-1&&S<x.children.length;){const v=x.children[S];if(b=a(v,S,I)(),b[0]===wt)return b;S=typeof b[1]=="number"?b[1]:S+o}}return f}}}function Sa(e){return Array.isArray(e)?e:typeof e=="number"?[ka,e]:e==null?fr:[e]}function pr(e,n,t,r){let i,l,o;typeof n=="function"&&typeof t!="function"?(l=void 0,o=n,i=t):(l=n,o=t,i=r),wa(e,l,a,i);function a(c,u){const s=u[u.length-1],p=s?s.children.indexOf(c):void 0;return o(c,p,s)}}const Cn={}.hasOwnProperty,Ca={};function Ea(e,n){const t=n||Ca,r=new Map,i=new Map,l=new Map,o={...oa,...t.handlers},a={all:u,applyData:Ta,definitionById:r,footnoteById:i,footnoteCounts:l,footnoteOrder:[],handlers:o,one:c,options:t,patch:Ia,wrap:Pa};return pr(e,function(s){if(s.type==="definition"||s.type==="footnoteDefinition"){const p=s.type==="definition"?r:i,h=String(s.identifier).toUpperCase();p.has(h)||p.set(h,s)}}),a;function c(s,p){const h=s.type,f=a.handlers[h];if(Cn.call(a.handlers,h)&&f)return f(a,s,p);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in s){const{children:S,...I}=s,x=Je(I);return x.children=a.all(s),x}return Je(s)}return(a.options.unknownHandler||Aa)(a,s,p)}function u(s){const p=[];if("children"in s){const h=s.children;let f=-1;for(;++f<h.length;){const b=a.one(h[f],s);if(b){if(f&&h[f-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=St(b.value)),!Array.isArray(b)&&b.type==="element")){const S=b.children[0];S&&S.type==="text"&&(S.value=St(S.value))}Array.isArray(b)?p.push(...b):p.push(b)}}}return p}}function Ia(e,n){e.position&&(n.position=ai(e))}function Ta(e,n){let t=n;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(t.type==="element")t.tagName=r;else{const o="children"in t?t.children:[t];t={type:"element",tagName:r,properties:{},children:o}}t.type==="element"&&l&&Object.assign(t.properties,Je(l)),"children"in t&&t.children&&i!==null&&i!==void 0&&(t.children=i)}return t}function Aa(e,n){const t=n.data||{},r="value"in n&&!(Cn.call(t,"hProperties")||Cn.call(t,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Pa(e,n){const t=[];let r=-1;for(n&&t.push({type:"text",value:`
11
+ `});++r<e.length;)r&&t.push({type:"text",value:`
12
+ `}),t.push(e[r]);return n&&e.length>0&&t.push({type:"text",value:`
13
+ `}),t}function St(e){let n=0,t=e.charCodeAt(n);for(;t===9||t===32;)n++,t=e.charCodeAt(n);return e.slice(n)}function Ct(e,n){const t=Ea(e,n),r=t.one(e,void 0),i=ha(t),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&l.children.push({type:"text",value:`
14
+ `},i),l}function va(e,n){return e&&"run"in e?async function(t,r){const i=Ct(t,{file:r,...n});await e.run(i,r)}:function(t,r){return Ct(t,{file:r,...e||n})}}function Et(e){if(e)throw e}var un,It;function za(){if(It)return un;It=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):n.call(u)==="[object Array]"},l=function(u){if(!u||n.call(u)!=="[object Object]")return!1;var s=e.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!s&&!p)return!1;var h;for(h in u);return typeof h>"u"||e.call(u,h)},o=function(u,s){t&&s.name==="__proto__"?t(u,s.name,{enumerable:!0,configurable:!0,value:s.newValue,writable:!0}):u[s.name]=s.newValue},a=function(u,s){if(s==="__proto__")if(e.call(u,s)){if(r)return r(u,s).value}else return;return u[s]};return un=function c(){var u,s,p,h,f,b,S=arguments[0],I=1,x=arguments.length,v=!1;for(typeof S=="boolean"&&(v=S,S=arguments[1]||{},I=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});I<x;++I)if(u=arguments[I],u!=null)for(s in u)p=a(S,s),h=a(u,s),S!==h&&(v&&h&&(l(h)||(f=i(h)))?(f?(f=!1,b=p&&i(p)?p:[]):b=p&&l(p)?p:{},o(S,{name:s,newValue:c(v,b,h)})):typeof h<"u"&&o(S,{name:s,newValue:h}));return S},un}var La=za();const sn=Dt(La);function En(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Da(){const e=[],n={run:t,use:r};return n;function t(...i){let l=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(c,...u){const s=e[++l];let p=-1;if(c){o(c);return}for(;++p<i.length;)(u[p]===null||u[p]===void 0)&&(u[p]=i[p]);i=u,s?Ma(s,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),n}}function Ma(e,n){let t;return r;function r(...o){const a=e.length>o.length;let c;a&&o.push(i);try{c=e.apply(this,o)}catch(u){const s=u;if(a&&t)throw s;return i(s)}a||(c&&c.then&&typeof c.then=="function"?c.then(l,i):c instanceof Error?i(c):l(c))}function i(o,...a){t||(t=!0,n(o,...a))}function l(o){i(null,o)}}const se={basename:Na,dirname:_a,extname:Oa,join:Ra,sep:"/"};function Na(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ve(e);let t=0,r=-1,i=e.length,l;if(n===void 0||n.length===0||n.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else r<0&&(l=!0,r=i+1);return r<0?"":e.slice(t,r)}if(n===e)return"";let o=-1,a=n.length-1;for(;i--;)if(e.codePointAt(i)===47){if(l){t=i+1;break}}else o<0&&(l=!0,o=i+1),a>-1&&(e.codePointAt(i)===n.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return t===r?r=o:r<0&&(r=e.length),e.slice(t,r)}function _a(e){if(Ve(e),e.length===0)return".";let n=-1,t=e.length,r;for(;--t;)if(e.codePointAt(t)===47){if(r){n=t;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Oa(e){Ve(e);let n=e.length,t=-1,r=0,i=-1,l=0,o;for(;n--;){const a=e.codePointAt(n);if(a===47){if(o){r=n+1;break}continue}t<0&&(o=!0,t=n+1),a===46?i<0?i=n:l!==1&&(l=1):i>-1&&(l=-1)}return i<0||t<0||l===0||l===1&&i===t-1&&i===r+1?"":e.slice(i,t)}function Ra(...e){let n=-1,t;for(;++n<e.length;)Ve(e[n]),e[n]&&(t=t===void 0?e[n]:t+"/"+e[n]);return t===void 0?".":Fa(t)}function Fa(e){Ve(e);const n=e.codePointAt(0)===47;let t=ja(e,!n);return t.length===0&&!n&&(t="."),t.length>0&&e.codePointAt(e.length-1)===47&&(t+="/"),n?"/"+t:t}function ja(e,n){let t="",r=0,i=-1,l=0,o=-1,a,c;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||l===1))if(i!==o-1&&l===2){if(t.length<2||r!==2||t.codePointAt(t.length-1)!==46||t.codePointAt(t.length-2)!==46){if(t.length>2){if(c=t.lastIndexOf("/"),c!==t.length-1){c<0?(t="",r=0):(t=t.slice(0,c),r=t.length-1-t.lastIndexOf("/")),i=o,l=0;continue}}else if(t.length>0){t="",r=0,i=o,l=0;continue}}n&&(t=t.length>0?t+"/..":"..",r=2)}else t.length>0?t+="/"+e.slice(i+1,o):t=e.slice(i+1,o),r=o-i-1;i=o,l=0}else a===46&&l>-1?l++:l=-1}return t}function Ve(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ba={cwd:Ha};function Ha(){return"/"}function In(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ua(e){if(typeof e=="string")e=new URL(e);else if(!In(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return Va(e)}function Va(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let t=-1;for(;++t<n.length;)if(n.codePointAt(t)===37&&n.codePointAt(t+1)===50){const r=n.codePointAt(t+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(n)}const cn=["history","path","basename","stem","extname","dirname"];class hr{constructor(n){let t;n?In(n)?t={path:n}:typeof n=="string"||qa(n)?t={value:n}:t=n:t={},this.cwd="cwd"in t?"":Ba.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cn.length;){const l=cn[r];l in t&&t[l]!==void 0&&t[l]!==null&&(this[l]=l==="history"?[...t[l]]:t[l])}let i;for(i in t)cn.includes(i)||(this[i]=t[i])}get basename(){return typeof this.path=="string"?se.basename(this.path):void 0}set basename(n){pn(n,"basename"),fn(n,"basename"),this.path=se.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?se.dirname(this.path):void 0}set dirname(n){Tt(this.basename,"dirname"),this.path=se.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?se.extname(this.path):void 0}set extname(n){if(fn(n,"extname"),Tt(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=se.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){In(n)&&(n=Ua(n)),pn(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?se.basename(this.path,this.extname):void 0}set stem(n){pn(n,"stem"),fn(n,"stem"),this.path=se.join(this.dirname||"",n+(this.extname||""))}fail(n,t,r){const i=this.message(n,t,r);throw i.fatal=!0,i}info(n,t,r){const i=this.message(n,t,r);return i.fatal=void 0,i}message(n,t,r){const i=new K(n,t,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function fn(e,n){if(e&&e.includes(se.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+se.sep+"`")}function pn(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function Tt(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function qa(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $a=(function(e){const r=this.constructor.prototype,i=r[e],l=function(){return i.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),Xa={}.hasOwnProperty;class jn extends $a{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=Da()}copy(){const n=new jn;let t=-1;for(;++t<this.attachers.length;){const r=this.attachers[t];n.use(...r)}return n.data(sn(!0,{},this.namespace)),n}data(n,t){return typeof n=="string"?arguments.length===2?(mn("data",this.frozen),this.namespace[n]=t,this):Xa.call(this.namespace,n)&&this.namespace[n]||void 0:n?(mn("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=t.call(n,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const t=Ye(n),r=this.parser||this.Parser;return hn("parse",r),r(String(t),t)}process(n,t){const r=this;return this.freeze(),hn("process",this.parser||this.Parser),dn("process",this.compiler||this.Compiler),t?i(void 0,t):new Promise(i);function i(l,o){const a=Ye(n),c=r.parse(a);r.run(c,a,function(s,p,h){if(s||!p||!h)return u(s);const f=p,b=r.stringify(f,h);Qa(b)?h.value=b:h.result=b,u(s,h)});function u(s,p){s||!p?o(s):l?l(p):t(void 0,p)}}}processSync(n){let t=!1,r;return this.freeze(),hn("processSync",this.parser||this.Parser),dn("processSync",this.compiler||this.Compiler),this.process(n,i),Pt("processSync","process",t),r;function i(l,o){t=!0,Et(l),r=o}}run(n,t,r){At(n),this.freeze();const i=this.transformers;return!r&&typeof t=="function"&&(r=t,t=void 0),r?l(void 0,r):new Promise(l);function l(o,a){const c=Ye(t);i.run(n,c,u);function u(s,p,h){const f=p||n;s?a(s):o?o(f):r(void 0,f,h)}}}runSync(n,t){let r=!1,i;return this.run(n,t,l),Pt("runSync","run",r),i;function l(o,a){Et(o),i=a,r=!0}}stringify(n,t){this.freeze();const r=Ye(t),i=this.compiler||this.Compiler;return dn("stringify",i),At(n),i(n,r)}use(n,...t){const r=this.attachers,i=this.namespace;if(mn("use",this.frozen),n!=null)if(typeof n=="function")c(n,t);else if(typeof n=="object")Array.isArray(n)?a(n):o(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function l(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[s,...p]=u;c(s,p)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=sn(!0,i.settings,u.settings))}function a(u){let s=-1;if(u!=null)if(Array.isArray(u))for(;++s<u.length;){const p=u[s];l(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,s){let p=-1,h=-1;for(;++p<r.length;)if(r[p][0]===u){h=p;break}if(h===-1)r.push([u,...s]);else if(s.length>0){let[f,...b]=s;const S=r[h][1];En(S)&&En(f)&&(f=sn(!0,S,f)),r[h]=[u,f,...b]}}}}const Wa=new jn().freeze();function hn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function dn(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mn(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function At(e){if(!En(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Pt(e,n,t){if(!t)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function Ye(e){return Ya(e)?e:new hr(e)}function Ya(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Qa(e){return typeof e=="string"||Ka(e)}function Ka(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ga="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vt=[],zt={allowDangerousHtml:!0},Ja=/^(https?|ircs?|mailto|xmpp)$/i,Za=[{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 eu(e){const n=nu(e),t=tu(e);return ru(n.runSync(n.parse(t),t),e)}function nu(e){const n=e.rehypePlugins||vt,t=e.remarkPlugins||vt,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zt}:zt;return Wa().use(No).use(t).use(va,r).use(n)}function tu(e){const n=e.children||"",t=new hr;return typeof n=="string"&&(t.value=n),t}function ru(e,n){const t=n.allowedElements,r=n.allowElement,i=n.components,l=n.disallowedElements,o=n.skipHtml,a=n.unwrapDisallowed,c=n.urlTransform||iu;for(const s of Za)Object.hasOwn(n,s.from)&&(""+s.from+(s.to?"use `"+s.to+"` instead":"remove it")+Ga+s.id,void 0);return n.className&&(e={type:"element",tagName:"div",properties:{className:n.className},children:e.type==="root"?e.children:[e]}),pr(e,u),pi(e,{Fragment:L.Fragment,components:i,ignoreInvalidStyle:!0,jsx:L.jsx,jsxs:L.jsxs,passKeys:!0,passNode:!0});function u(s,p,h){if(s.type==="raw"&&h&&typeof p=="number")return o?h.children.splice(p,1):h.children[p]={type:"text",value:s.value},p;if(s.type==="element"){let f;for(f in ln)if(Object.hasOwn(ln,f)&&Object.hasOwn(s.properties,f)){const b=s.properties[f],S=ln[f];(S===null||S.includes(s.tagName))&&(s.properties[f]=c(String(b||""),f,s))}}if(s.type==="element"){let f=t?!t.includes(s.tagName):l?l.includes(s.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(s,p,h)),f&&h&&typeof p=="number")return a&&s.children?h.children.splice(p,1,...s.children):h.children.splice(p,1),p}}}function iu(e){const n=e.indexOf(":"),t=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return n===-1||i!==-1&&n>i||t!==-1&&n>t||r!==-1&&n>r||Ja.test(e.slice(0,n))?e:""}function Lt({message:e,currentUser:n,showAvatar:t=!0,showTimestamp:r=!0,theme:i}){var E,F;const l=e.senderType===n.type,o=e.senderType==="system",a=((E=e.metadata)==null?void 0:E.isAI)===!0,c=e.senderType==="bot",u=(i==null?void 0:i.background)||"#00001a",s=(()=>{if(!u.startsWith("#"))return!1;const M=u.replace("#",""),y=parseInt(M.substring(0,2),16),_=parseInt(M.substring(2,4),16),B=parseInt(M.substring(4,6),16);return(.299*y+.587*_+.114*B)/255>.5})(),p=(i==null?void 0:i.primary)||"#337eff",h=(i==null?void 0:i.primaryStrong)||"#005eff",f=(i==null?void 0:i.text)||(s?"#1a1a2e":"#f7f7f8"),b=(i==null?void 0:i.textMuted)||(s?"rgba(0,0,0,0.35)":"rgba(247,247,248,0.35)");if(o)return L.jsx("div",{className:"flex justify-center my-3",children:L.jsx("div",{className:"px-4 py-1.5 rounded-full",style:{backgroundColor:s?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.03)",boxShadow:s?"inset 0 0 0 1px rgba(0,0,0,0.06)":"inset 0 0 0 0.5px rgba(255,255,255,0.06)"},children:L.jsx("p",{style:{fontSize:"11px",letterSpacing:"0.019em",color:b},children:e.content})})});const I=l?null:(()=>{var M;return c||a?"AI Assistant":e.senderType==="agent"?((M=e.metadata)==null?void 0:M.agentName)||"Support Agent":null})(),x={background:`linear-gradient(135deg, ${p}, ${h})`,color:"#ffffff",borderRadius:"18px 18px 4px 18px",boxShadow:`0 2px 12px -3px ${p}40`},v=s?{backgroundColor:"rgba(0,0,0,0.04)",color:f,borderRadius:"18px 18px 18px 4px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.06)"}:{backgroundColor:"rgba(255,255,255,0.04)",color:f,borderRadius:"18px 18px 18px 4px",boxShadow:"inset 0 0 0 0.5px rgba(255,255,255,0.06), inset 0 1px 0 0 rgba(255,255,255,0.08)"};return L.jsxs("div",{className:`flex gap-2.5 mb-3 ${l?"flex-row-reverse":"flex-row"}`,children:[t&&!l&&L.jsx("div",{className:"flex-shrink-0 mt-auto mb-5",children:c||a?L.jsx(Cr,{size:28}):L.jsx("div",{className:"h-7 w-7 rounded-full flex items-center justify-center",style:{background:s?`linear-gradient(135deg, ${p}30, rgba(0,0,0,0.04))`:`linear-gradient(135deg, ${p}60, rgba(255,255,255,0.06))`,boxShadow:s?"inset 0 0 0 1px rgba(0,0,0,0.08)":"inset 0 0 0 0.5px rgba(255,255,255,0.1)"},children:L.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:s?p:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[L.jsx("title",{children:"Agent"}),L.jsx("path",{d:"M3 18v-6a9 9 0 0 1 18 0v6"}),L.jsx("path",{d:"M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z"})]})})}),t&&l&&L.jsx("div",{className:"w-7 flex-shrink-0"}),L.jsxs("div",{className:`flex flex-col max-w-[75%] ${l?"items-end":"items-start"}`,children:[I&&L.jsx("span",{className:"mb-1 px-1 font-medium",style:{color:s?"rgba(0,0,0,0.45)":"rgba(247,247,248,0.4)",fontSize:"11px",letterSpacing:"0.019em"},children:I}),L.jsxs("div",{className:"px-4 py-2.5",style:{...l?x:v,fontSize:"14px",lineHeight:"1.5",letterSpacing:"0.006em"},children:[e.messageType==="text"&&L.jsx(eu,{components:{p:({children:M})=>L.jsx("p",{style:{margin:0},children:M}),img:({src:M,alt:y,..._})=>L.jsx("img",{..._,src:M,alt:y,className:"max-w-full h-auto rounded-lg my-2",style:{boxShadow:"0 2px 8px rgba(0,0,0,0.2)"},loading:"lazy"}),a:({href:M,children:y,..._})=>L.jsx("a",{..._,href:M,target:"_blank",rel:"noopener noreferrer",style:{color:l?"rgba(255,255,255,0.85)":p,textDecoration:"underline",textUnderlineOffset:"2px"},children:y}),code:({children:M})=>L.jsx("code",{style:{backgroundColor:l?"rgba(0,0,0,0.2)":s?"rgba(0,0,0,0.06)":"rgba(255,255,255,0.06)",borderRadius:"4px",padding:"2px 5px",fontSize:"12px",fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace'},children:M})},children:e.content}),e.messageType==="image"&&L.jsx("div",{children:L.jsx("img",{src:e.content,alt:"Attachment",className:"max-w-full h-auto rounded-lg",loading:"lazy"})}),e.messageType==="file"&&L.jsxs("div",{className:"flex items-center gap-2",children:[L.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[L.jsx("title",{children:"File"}),L.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})]}),L.jsx("a",{href:e.content,target:"_blank",rel:"noopener noreferrer",style:{color:l?"rgba(255,255,255,0.85)":p,textDecoration:"underline",textUnderlineOffset:"2px"},children:((F=e.metadata)==null?void 0:F.fileName)||"Download file"})]})]}),r&&L.jsxs("div",{className:`flex items-center gap-1.5 mt-1 px-1 ${l?"flex-row-reverse":"flex-row"}`,children:[L.jsx("span",{style:{fontSize:"11px",letterSpacing:"0.019em",color:b},children:Rr(new Date(e.createdAt),{addSuffix:!0})}),l&&e.status&&L.jsxs("span",{style:{color:b},children:[e.status==="sent"&&L.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[L.jsx("title",{children:"Sent"}),L.jsx("polyline",{points:"20 6 9 17 4 12"})]}),e.status==="delivered"&&L.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[L.jsx("title",{children:"Delivered"}),L.jsx("polyline",{points:"18 6 7 17 2 12"}),L.jsx("polyline",{points:"22 6 11 17"})]}),e.status==="read"&&L.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:p,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[L.jsx("title",{children:"Read"}),L.jsx("polyline",{points:"18 6 7 17 2 12"}),L.jsx("polyline",{points:"22 6 11 17"})]})]})]})]})]})}try{Lt.displayName="MessageItem",Lt.__docgenInfo={description:"",displayName:"MessageItem",props:{message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"IMessage"}},currentUser:{defaultValue:null,description:"",name:"currentUser",required:!0,type:{name:"IUser"}},showAvatar:{defaultValue:{value:"true"},description:"",name:"showAvatar",required:!1,type:{name:"boolean | undefined"}},showTimestamp:{defaultValue:{value:"true"},description:"",name:"showTimestamp",required:!1,type:{name:"boolean | undefined"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"IChatTheme | undefined"}}}}}catch{}export{Lt as M};
@@ -0,0 +1,255 @@
1
+ import{j as t}from"./jsx-runtime-Cf8x2fCZ.js";import{M as a}from"./MessageItem-DAaKZ9s9.js";import"./index-yBjzXJbu.js";import"./BrandIcons-Cjy5INAp.js";import"./index--qcDGAq6.js";import"./en-US-BukEqXxE.js";const Oe={title:"Components/MessageItem",component:a,parameters:{layout:"padded"},tags:["autodocs"]},s={name:"John Doe",email:"john@example.com",type:"customer",status:"online"},e={id:"1",conversationId:"conv-1",senderId:"user@example.com",senderType:"customer",content:"Hello, I need help with my account.",messageType:"text",createdAt:new Date().toISOString(),status:"sent"},o={args:{message:{...e,senderId:s.email,content:"Hello, I need help with my account."},currentUser:s,showAvatar:!0,showTimestamp:!0}},n={args:{message:{...e,senderId:"agent@example.com",senderType:"agent",content:"Hi! I'd be happy to help you with your account. What issue are you experiencing?"},currentUser:s,showAvatar:!0,showTimestamp:!0}},m={args:{message:{...e,senderId:"ai-assistant",senderType:"bot",content:`Hello! I'm the Xcelsior assistant. Based on our knowledge base, here are some common solutions:
2
+
3
+ 1. Reset your password
4
+ 2. Verify your email
5
+ 3. Contact support
6
+
7
+ Which would you like help with?`,confidence:.85,metadata:{isAI:!0,kbUsed:!0}},currentUser:s,showAvatar:!0,showTimestamp:!0}},i={args:{message:{...e,senderId:"ai-assistant",senderType:"bot",content:"I'm not entirely sure about this, but let me check with my team. In the meantime, you might want to visit our help center.",confidence:.3,metadata:{isAI:!0,kbUsed:!1}},currentUser:s,showAvatar:!0,showTimestamp:!0}},c={args:{message:{...e,senderId:"ai-assistant",senderType:"bot",content:"You can reset your password by going to Settings > Security > Change Password.",feedback:"good",confidence:.9,metadata:{isAI:!0,kbUsed:!0}},currentUser:s,showAvatar:!0,showTimestamp:!0}},d={args:{message:{...e,senderId:"ai-assistant",senderType:"bot",content:"Your subscription expires on March 15th.",feedback:"wrong",confidence:.6,metadata:{isAI:!0,kbUsed:!0}},currentUser:s,showAvatar:!0,showTimestamp:!0}},p={args:{message:{...e,senderId:"ai-assistant",senderType:"bot",content:`## Getting Started
8
+
9
+ Here's how you can reset your password:
10
+
11
+ 1. Go to the login page
12
+ 2. Click on **"Forgot Password"**
13
+ 3. Enter your email address
14
+ 4. Check your inbox for the reset link
15
+
16
+ *Note: The link expires in 24 hours.*
17
+
18
+ For more help, visit our [support page](https://xcelsior.co/support).`,metadata:{isAI:!0,kbUsed:!0}},currentUser:s,showAvatar:!0,showTimestamp:!0}},u={args:{message:{...e,senderId:"system",senderType:"system",content:"Agent John joined the conversation",messageType:"system"},currentUser:s,showAvatar:!0,showTimestamp:!0}},g={args:{message:{...e,senderId:"system",senderType:"system",content:"Connecting you with a team member who can help further...",messageType:"system"},currentUser:s,showAvatar:!0,showTimestamp:!0}},h={args:{message:{...e,senderId:"system",senderType:"system",content:"Sarah from our team is here to help!",messageType:"system"},currentUser:s,showAvatar:!0,showTimestamp:!0}},l={args:{message:{...e,content:"https://picsum.photos/400/300",messageType:"image"},currentUser:s,showAvatar:!0,showTimestamp:!0}},y={args:{message:{...e,content:"https://example.com/document.pdf",messageType:"file",metadata:{fileName:"Technical Documentation.pdf"}},currentUser:s,showAvatar:!0,showTimestamp:!0}},w={render:r=>t.jsxs("div",{className:"flex flex-col gap-2 max-w-2xl p-4 bg-gray-950 rounded-lg",children:[t.jsx(a,{...r,message:{...e,id:"1",senderId:s.email,senderType:"customer",content:"Hi, I need help with pricing for a custom web app."}}),t.jsx(a,{...r,message:{...e,id:"2",senderId:"ai-assistant",senderType:"bot",content:"Hello! I'd be happy to help with pricing. At Xcelsior, we offer custom quotes based on your project requirements. Could you tell me more about what you're looking for?",confidence:.8,metadata:{isAI:!0,kbUsed:!0},createdAt:new Date(Date.now()-6e4).toISOString()}}),t.jsx(a,{...r,message:{...e,id:"3",senderId:s.email,senderType:"customer",content:"I want to talk to a real person about this. Can you connect me with your sales team?",createdAt:new Date(Date.now()-3e4).toISOString()}}),t.jsx(a,{...r,message:{...e,id:"4",senderId:"system",senderType:"system",content:"Connecting you with a team member who can help further...",messageType:"system",createdAt:new Date(Date.now()-25e3).toISOString()}}),t.jsx(a,{...r,message:{...e,id:"5",senderId:"sarah@xcelsior.co",senderType:"agent",content:"Hi there! I'm Sarah from our sales team. I'd love to discuss your custom web app project. Can you share a bit about the features you need and your timeline?",createdAt:new Date().toISOString()}})]}),args:{currentUser:s,showAvatar:!0,showTimestamp:!0}};var b,I,T,f,A;o.parameters={...o.parameters,docs:{...(b=o.parameters)==null?void 0:b.docs,source:{originalSource:`{
19
+ args: {
20
+ message: {
21
+ ...baseMessage,
22
+ senderId: currentUser.email,
23
+ content: 'Hello, I need help with my account.'
24
+ },
25
+ currentUser,
26
+ showAvatar: true,
27
+ showTimestamp: true
28
+ }
29
+ }`,...(T=(I=o.parameters)==null?void 0:I.docs)==null?void 0:T.source},description:{story:"Customer message (own message)",...(A=(f=o.parameters)==null?void 0:f.docs)==null?void 0:A.description}}};var M,k,S,v,x;n.parameters={...n.parameters,docs:{...(M=n.parameters)==null?void 0:M.docs,source:{originalSource:`{
30
+ args: {
31
+ message: {
32
+ ...baseMessage,
33
+ senderId: 'agent@example.com',
34
+ senderType: 'agent',
35
+ content: "Hi! I'd be happy to help you with your account. What issue are you experiencing?"
36
+ },
37
+ currentUser,
38
+ showAvatar: true,
39
+ showTimestamp: true
40
+ }
41
+ }`,...(S=(k=n.parameters)==null?void 0:k.docs)==null?void 0:S.source},description:{story:"Human agent message",...(x=(v=n.parameters)==null?void 0:v.docs)==null?void 0:x.description}}};var U,C,D,B,F;m.parameters={...m.parameters,docs:{...(U=m.parameters)==null?void 0:U.docs,source:{originalSource:`{
42
+ args: {
43
+ message: {
44
+ ...baseMessage,
45
+ senderId: 'ai-assistant',
46
+ senderType: 'bot',
47
+ content: "Hello! I'm the Xcelsior assistant. Based on our knowledge base, here are some common solutions:\\n\\n1. Reset your password\\n2. Verify your email\\n3. Contact support\\n\\nWhich would you like help with?",
48
+ confidence: 0.85,
49
+ metadata: {
50
+ isAI: true,
51
+ kbUsed: true
52
+ }
53
+ },
54
+ currentUser,
55
+ showAvatar: true,
56
+ showTimestamp: true
57
+ }
58
+ }`,...(D=(C=m.parameters)==null?void 0:C.docs)==null?void 0:D.source},description:{story:"Bot message (AI assistant) — new senderType",...(F=(B=m.parameters)==null?void 0:B.docs)==null?void 0:F.description}}};var H,j,O,N,W;i.parameters={...i.parameters,docs:{...(H=i.parameters)==null?void 0:H.docs,source:{originalSource:`{
59
+ args: {
60
+ message: {
61
+ ...baseMessage,
62
+ senderId: 'ai-assistant',
63
+ senderType: 'bot',
64
+ content: "I'm not entirely sure about this, but let me check with my team. In the meantime, you might want to visit our help center.",
65
+ confidence: 0.3,
66
+ metadata: {
67
+ isAI: true,
68
+ kbUsed: false
69
+ }
70
+ },
71
+ currentUser,
72
+ showAvatar: true,
73
+ showTimestamp: true
74
+ }
75
+ }`,...(O=(j=i.parameters)==null?void 0:j.docs)==null?void 0:O.source},description:{story:"Bot message with low confidence",...(W=(N=i.parameters)==null?void 0:N.docs)==null?void 0:W.description}}};var E,G,q,P,X;c.parameters={...c.parameters,docs:{...(E=c.parameters)==null?void 0:E.docs,source:{originalSource:`{
76
+ args: {
77
+ message: {
78
+ ...baseMessage,
79
+ senderId: 'ai-assistant',
80
+ senderType: 'bot',
81
+ content: "You can reset your password by going to Settings > Security > Change Password.",
82
+ feedback: 'good',
83
+ confidence: 0.9,
84
+ metadata: {
85
+ isAI: true,
86
+ kbUsed: true
87
+ }
88
+ },
89
+ currentUser,
90
+ showAvatar: true,
91
+ showTimestamp: true
92
+ }
93
+ }`,...(q=(G=c.parameters)==null?void 0:G.docs)==null?void 0:q.source},description:{story:"Bot message with feedback (rated good)",...(X=(P=c.parameters)==null?void 0:P.docs)==null?void 0:X.description}}};var Y,J,R,L,V;d.parameters={...d.parameters,docs:{...(Y=d.parameters)==null?void 0:Y.docs,source:{originalSource:`{
94
+ args: {
95
+ message: {
96
+ ...baseMessage,
97
+ senderId: 'ai-assistant',
98
+ senderType: 'bot',
99
+ content: "Your subscription expires on March 15th.",
100
+ feedback: 'wrong',
101
+ confidence: 0.6,
102
+ metadata: {
103
+ isAI: true,
104
+ kbUsed: true
105
+ }
106
+ },
107
+ currentUser,
108
+ showAvatar: true,
109
+ showTimestamp: true
110
+ }
111
+ }`,...(R=(J=d.parameters)==null?void 0:J.docs)==null?void 0:R.source},description:{story:"Bot message with feedback (rated wrong)",...(V=(L=d.parameters)==null?void 0:L.docs)==null?void 0:V.description}}};var _,z,K,Q,Z;p.parameters={...p.parameters,docs:{...(_=p.parameters)==null?void 0:_.docs,source:{originalSource:`{
112
+ args: {
113
+ message: {
114
+ ...baseMessage,
115
+ senderId: 'ai-assistant',
116
+ senderType: 'bot',
117
+ content: \`## Getting Started
118
+
119
+ Here's how you can reset your password:
120
+
121
+ 1. Go to the login page
122
+ 2. Click on **"Forgot Password"**
123
+ 3. Enter your email address
124
+ 4. Check your inbox for the reset link
125
+
126
+ *Note: The link expires in 24 hours.*
127
+
128
+ For more help, visit our [support page](https://xcelsior.co/support).\`,
129
+ metadata: {
130
+ isAI: true,
131
+ kbUsed: true
132
+ }
133
+ },
134
+ currentUser,
135
+ showAvatar: true,
136
+ showTimestamp: true
137
+ }
138
+ }`,...(K=(z=p.parameters)==null?void 0:z.docs)==null?void 0:K.source},description:{story:"AI message with markdown formatting",...(Z=(Q=p.parameters)==null?void 0:Q.docs)==null?void 0:Z.description}}};var $,ee,se,te,ae;u.parameters={...u.parameters,docs:{...($=u.parameters)==null?void 0:$.docs,source:{originalSource:`{
139
+ args: {
140
+ message: {
141
+ ...baseMessage,
142
+ senderId: 'system',
143
+ senderType: 'system',
144
+ content: 'Agent John joined the conversation',
145
+ messageType: 'system'
146
+ },
147
+ currentUser,
148
+ showAvatar: true,
149
+ showTimestamp: true
150
+ }
151
+ }`,...(se=(ee=u.parameters)==null?void 0:ee.docs)==null?void 0:se.source},description:{story:"System message — generic",...(ae=(te=u.parameters)==null?void 0:te.docs)==null?void 0:ae.description}}};var re,oe,ne,me,ie;g.parameters={...g.parameters,docs:{...(re=g.parameters)==null?void 0:re.docs,source:{originalSource:`{
152
+ args: {
153
+ message: {
154
+ ...baseMessage,
155
+ senderId: 'system',
156
+ senderType: 'system',
157
+ content: 'Connecting you with a team member who can help further...',
158
+ messageType: 'system'
159
+ },
160
+ currentUser,
161
+ showAvatar: true,
162
+ showTimestamp: true
163
+ }
164
+ }`,...(ne=(oe=g.parameters)==null?void 0:oe.docs)==null?void 0:ne.source},description:{story:"System message — escalation notice",...(ie=(me=g.parameters)==null?void 0:me.docs)==null?void 0:ie.description}}};var ce,de,pe,ue,ge;h.parameters={...h.parameters,docs:{...(ce=h.parameters)==null?void 0:ce.docs,source:{originalSource:`{
165
+ args: {
166
+ message: {
167
+ ...baseMessage,
168
+ senderId: 'system',
169
+ senderType: 'system',
170
+ content: 'Sarah from our team is here to help!',
171
+ messageType: 'system'
172
+ },
173
+ currentUser,
174
+ showAvatar: true,
175
+ showTimestamp: true
176
+ }
177
+ }`,...(pe=(de=h.parameters)==null?void 0:de.docs)==null?void 0:pe.source},description:{story:"System message — agent took over",...(ge=(ue=h.parameters)==null?void 0:ue.docs)==null?void 0:ge.description}}};var he,le,ye,we,be;l.parameters={...l.parameters,docs:{...(he=l.parameters)==null?void 0:he.docs,source:{originalSource:`{
178
+ args: {
179
+ message: {
180
+ ...baseMessage,
181
+ content: 'https://picsum.photos/400/300',
182
+ messageType: 'image'
183
+ },
184
+ currentUser,
185
+ showAvatar: true,
186
+ showTimestamp: true
187
+ }
188
+ }`,...(ye=(le=l.parameters)==null?void 0:le.docs)==null?void 0:ye.source},description:{story:"Image message",...(be=(we=l.parameters)==null?void 0:we.docs)==null?void 0:be.description}}};var Ie,Te,fe,Ae,Me;y.parameters={...y.parameters,docs:{...(Ie=y.parameters)==null?void 0:Ie.docs,source:{originalSource:`{
189
+ args: {
190
+ message: {
191
+ ...baseMessage,
192
+ content: 'https://example.com/document.pdf',
193
+ messageType: 'file',
194
+ metadata: {
195
+ fileName: 'Technical Documentation.pdf'
196
+ }
197
+ },
198
+ currentUser,
199
+ showAvatar: true,
200
+ showTimestamp: true
201
+ }
202
+ }`,...(fe=(Te=y.parameters)==null?void 0:Te.docs)==null?void 0:fe.source},description:{story:"File message",...(Me=(Ae=y.parameters)==null?void 0:Ae.docs)==null?void 0:Me.description}}};var ke,Se,ve,xe,Ue;w.parameters={...w.parameters,docs:{...(ke=w.parameters)==null?void 0:ke.docs,source:{originalSource:`{
203
+ render: args => <div className="flex flex-col gap-2 max-w-2xl p-4 bg-gray-950 rounded-lg">
204
+ <MessageItem {...args} message={{
205
+ ...baseMessage,
206
+ id: '1',
207
+ senderId: currentUser.email,
208
+ senderType: 'customer',
209
+ content: 'Hi, I need help with pricing for a custom web app.'
210
+ }} />
211
+ <MessageItem {...args} message={{
212
+ ...baseMessage,
213
+ id: '2',
214
+ senderId: 'ai-assistant',
215
+ senderType: 'bot',
216
+ content: "Hello! I'd be happy to help with pricing. At Xcelsior, we offer custom quotes based on your project requirements. Could you tell me more about what you're looking for?",
217
+ confidence: 0.8,
218
+ metadata: {
219
+ isAI: true,
220
+ kbUsed: true
221
+ },
222
+ createdAt: new Date(Date.now() - 60000).toISOString()
223
+ }} />
224
+ <MessageItem {...args} message={{
225
+ ...baseMessage,
226
+ id: '3',
227
+ senderId: currentUser.email,
228
+ senderType: 'customer',
229
+ content: 'I want to talk to a real person about this. Can you connect me with your sales team?',
230
+ createdAt: new Date(Date.now() - 30000).toISOString()
231
+ }} />
232
+ <MessageItem {...args} message={{
233
+ ...baseMessage,
234
+ id: '4',
235
+ senderId: 'system',
236
+ senderType: 'system',
237
+ content: 'Connecting you with a team member who can help further...',
238
+ messageType: 'system',
239
+ createdAt: new Date(Date.now() - 25000).toISOString()
240
+ }} />
241
+ <MessageItem {...args} message={{
242
+ ...baseMessage,
243
+ id: '5',
244
+ senderId: 'sarah@xcelsior.co',
245
+ senderType: 'agent',
246
+ content: "Hi there! I'm Sarah from our sales team. I'd love to discuss your custom web app project. Can you share a bit about the features you need and your timeline?",
247
+ createdAt: new Date().toISOString()
248
+ }} />
249
+ </div>,
250
+ args: {
251
+ currentUser,
252
+ showAvatar: true,
253
+ showTimestamp: true
254
+ }
255
+ }`,...(ve=(Se=w.parameters)==null?void 0:Se.docs)==null?void 0:ve.source},description:{story:"Full conversation flow: customer → bot → escalation → agent",...(Ue=(xe=w.parameters)==null?void 0:xe.docs)==null?void 0:Ue.description}}};const Ne=["CustomerMessage","AgentMessage","BotMessage","BotMessageLowConfidence","BotMessageFeedbackGood","BotMessageFeedbackWrong","BotMessageWithMarkdown","SystemMessage","EscalationNotice","AgentTookOver","ImageMessage","FileMessage","FullConversationFlow"];export{n as AgentMessage,h as AgentTookOver,m as BotMessage,c as BotMessageFeedbackGood,d as BotMessageFeedbackWrong,i as BotMessageLowConfidence,p as BotMessageWithMarkdown,o as CustomerMessage,g as EscalationNotice,y as FileMessage,w as FullConversationFlow,l as ImageMessage,u as SystemMessage,Ne as __namedExportsOrder,Oe as default};