meshy-node 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dashboard/assets/{DashboardPage-SnCGw2xt.js → DashboardPage-bvnSOEOR.js} +5 -5
- package/dashboard/assets/{DashboardShared-BT6S17Jz.js → DashboardShared-GLcSNGlq.js} +27 -27
- package/dashboard/assets/{DiffTab-CvU4K64b.js → DiffTab-COHFrirB.js} +1 -1
- package/dashboard/assets/{FilesTab-BaqQIowl.js → FilesTab-CbAyNkqV.js} +1 -1
- package/dashboard/assets/{PreviewTab-9Mfum0Jt.js → PreviewTab-DfpJt0_L.js} +1 -1
- package/dashboard/assets/{SharedConversationPage-BHE9J9Xr.js → SharedConversationPage-GIVshodB.js} +3 -3
- package/dashboard/assets/{file-BS3FucfJ.js → file-BQIg747t.js} +1 -1
- package/dashboard/assets/{folder-Ogzaq0pA.js → folder-bif_P7Bd.js} +1 -1
- package/dashboard/assets/index-CtsPt3oz.css +1 -0
- package/dashboard/assets/index-DN5st9yl.js +301 -0
- package/dashboard/assets/{play-B3eo_tM3.js → play-DQsrWPv1.js} +1 -1
- package/dashboard/index.html +2 -2
- package/main.cjs +22 -6
- package/package.json +1 -1
- package/runtime-metadata.json +5 -5
- package/dashboard/assets/index-DP2pi2M_.css +0 -1
- package/dashboard/assets/index-JZIFVxcO.js +0 -301
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ye,j as m,H as sl,bb as Lr,T as Dr,k as pn,bc as Fr,r as pe,B as kt,C as it,b as bt,X as ul,bd as cl,s as fl,A as Mr,K as pl}from"./index-
|
|
1
|
+
import{c as ye,j as m,H as sl,bb as Lr,T as Dr,k as pn,bc as Fr,r as pe,B as kt,C as it,b as bt,X as ul,bd as cl,s as fl,A as Mr,K as pl}from"./index-DN5st9yl.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -43,41 +43,41 @@ import{c as ye,j as m,H as sl,bb as Lr,T as Dr,k as pn,bc as Fr,r as pe,B as kt,
|
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const Tl=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],hn=ye("wrench",Tl);function wt(e){return typeof e=="object"&&e!==null}function Nl(e){if(!wt(e))return null;if(e.type==="text"&&typeof e.text=="string"){const t=e.text.trim();return t?{type:"text",text:t}:null}if(e.type==="image"&&typeof e.mediaType=="string"&&typeof e.data=="string"){const t=e.mediaType.trim(),n=e.data;return!t||!n?null:{type:"image",mediaType:t,data:n,...typeof e.filename=="string"&&e.filename.trim()?{filename:e.filename.trim()}:{}}}if(e.type==="tool_result"&&typeof e.toolUseId=="string"&&typeof e.content=="string"){const t=e.toolUseId.trim(),n=e.content.trim();return!t||!n?null:{type:"tool_result",toolUseId:t,content:n,...typeof e.isError=="boolean"?{isError:e.isError}:{}}}return null}function _l(e){if(!wt(e))return null;if(e.type==="text"&&typeof e.text=="string"){const r=e.text.trim();return r?{type:"text",text:r}:null}if(e.type!=="image"||!wt(e.source)){if(e.type==="tool_result"&&typeof e.tool_use_id=="string"&&typeof e.content=="string"){const r=e.tool_use_id.trim(),i=e.content.trim();return!r||!i?null:{type:"tool_result",toolUseId:r,content:i,...typeof e.is_error=="boolean"?{isError:e.is_error}:{}}}return null}const t=typeof e.source.media_type=="string"?e.source.media_type.trim():"",n=typeof e.source.data=="string"?e.source.data:"";return!t||!n?null:{type:"image",mediaType:t,data:n}}function gt(e){if(typeof e=="string"){const t=e.trim();return t?[{type:"text",text:t}]:[]}return Array.isArray(e)?e.map(t=>Nl(t)??_l(t)).filter(t=>t!==null):[]}function
|
|
47
|
-
`)}function Ll(e){return`data:${e.mediaType};base64,${e.data}`}function
|
|
48
|
-
`);return e.toolUseId?[{type:"tool_result",toolUseId:e.toolUseId,content:r,isError:!1}]:[{type:"text",text:r}]}function et(e){return typeof e=="object"&&e!==null}function ql(e){if(!e)return;const t=["file_path","path","command"].map(n=>e[n]).find(n=>typeof n=="string"&&n.trim().length>0);return t==null?void 0:t.trim()}function Hl(e){const t=e.toLowerCase();return t.includes(" permission to write ")?"Write":t.includes(" permission to edit ")?"Edit":t.includes(" permission to run ")||t.includes(" permission to execute ")?"Bash":"Action"}function Gt(e){const t=e.trim();if(!t.startsWith("Awaiting your permission to "))return null;const n=t.match(/`([^`]+)`/);return{requests:[{toolName:Hl(t),target:n==null?void 0:n[1],summary:t}]}}function Vl(e){if(!Array.isArray(e.permission_denials))return null;const t=[];for(const n of e.permission_denials){if(!et(n)||typeof n.tool_name!="string")continue;const r=et(n.tool_input)?n.tool_input:void 0,i=ql(r),o=typeof e.result=="string"&&e.result.trim().length>0?e.result.trim():`Awaiting your permission to use ${n.tool_name}${i?` on \`${i}\``:""}.`;t.push({toolName:n.tool_name,...typeof n.tool_use_id=="string"?{toolUseId:n.tool_use_id}:{},...i?{target:i}:{},summary:o})}return t.length>0?{requests:t}:null}function Bn(e){if(!Array.isArray(e))return null;for(const t of e){if(!et(t)||t.type!=="text"||typeof t.text!="string")continue;const n=Gt(t.text);if(n)return n}return null}function mn(e){if(!et(e))return null;const t=Vl(e);if(t)return t;if(typeof e.result=="string"){const r=Gt(e.result);if(r)return r}if(typeof e.message=="string"){const r=Gt(e.message);if(r)return r}if(et(e.message)){const r=mn(e.message);if(r)return r;const i=Bn(e.message.content);if(i)return i}const n=Bn(e.content);return n||null}function Wl(e){return JSON.stringify(e.requests.map(t=>({toolName:t.toolName,target:t.target??null,summary:t.summary})))}function Jl(e,t){return e.requests.map(n=>{const r=n.target?` for \`${n.target}\``:"",i=t==="approve"?`Approved. Proceed with the requested ${n.toolName} action${r}.`:`Denied. Do not proceed with the requested ${n.toolName} action${r}. Ask for another approach if needed.`;return n.toolUseId?{type:"tool_result",toolUseId:n.toolUseId,content:i,isError:t==="deny"}:t==="approve"?{type:"text",text:i}:{type:"text",text:i}})}function Yl(e){return Oe(e)!==null}function Kt(e){return typeof e=="object"&&e!==null}function $n(e){if(e.type==="user"){const t=Oe(e),n=typeof e.timestamp=="string"?e.timestamp:"";if(t)return`user:${n}:${Ce(t)}`}return JSON.stringify(e)}function Xe(e){return Array.isArray(e)?e.map(t=>Xe(t)):Kt(e)?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>[t,Xe(n)])):e}function Un(e){const t=Oe(e);if(t)return`user:${Ce(t)}`;if(e.type==="assistant"){if(typeof e.message=="string")return`assistant:${JSON.stringify(e.message)}`;if(Kt(e.message)&&"content"in e.message)return`assistant:${JSON.stringify(Xe(e.message.content))}`;if(Array.isArray(e.content))return`assistant:${JSON.stringify(Xe(e.content))}`;if(Kt(e.message))return`assistant:${JSON.stringify(Xe(e.message))}`}return JSON.stringify(e)}function qn(e){if(typeof e.timestamp!="string")return null;const t=Date.parse(e.timestamp);return Number.isNaN(t)?null:t}function Qt(e){const t=ot(e);return t?`question:${Re(t)}`:null}function Xl(e){const t=mn(e);return t?`permission:${Wl(t)}`:null}function Hn(e){if(!Array.isArray(e))return null;const t=new Set;for(const n of e){const r=Qt(n);if(r){t.add(r);continue}if(typeof n=="object"&&n!==null&&n.type==="text"&&typeof n.text=="string"){const i=at(n.text);i&&t.add(Re(i))}}return t.size===0?null:Array.from(t).sort().join("|")}function Gl(e){const t=Qt(e);if(t)return t;if(typeof e.message=="string"){const n=at(e.message);return n?Re(n):null}if(typeof e.message=="object"&&e.message!==null){const n=Qt(e.message);return n||Hn(e.message.content)}return Hn(e.content)}function Kl(e){return Xl(e)}function Kp(e,t,n){const r=typeof t.timestamp=="string"?t.timestamp:"";return`${e}-${r}-${n}`}function Qp(e,t){const n=new Map;for(const i of t){const o=Un(i);n.set(o,(n.get(o)??0)+1)}const r=[];for(let i=e.length-1;i>=0;i-=1){const o=e[i];if(!o)continue;const l=Un(o),a=n.get(l)??0;if(a>0){n.set(l,a-1);continue}r.push({...o})}return[...r.reverse(),...t.map(i=>({...i}))].map((i,o)=>({event:i,order:o})).sort((i,o)=>{const l=qn(i.event),a=qn(o.event);return l!==null&&a!==null&&l!==a?l-a:i.order-o.order}).map(i=>i.event)}function Zp(e,t){const n=$n(t);return e.some(r=>$n(r)===n)?e:[...e,{...t}]}function eh(e,t){const n=new Map;for(const r of t){const i=Oe(r);if(!i)continue;const o=Ce(i);n.set(o,(n.get(o)??0)+1)}return e.filter(r=>{const i=Ce(r.content),o=n.get(i)??0;return o<=0?!0:(n.set(i,o-1),!1)})}function th(e,t){const n=Ce(t),r=e.findIndex(i=>Ce(i.content)===n);return r===-1?e:e.filter((i,o)=>o!==r)}function nh(e,t){const n=Ce(t);return e.some(r=>{const i=Oe(r);return i!==null&&Ce(i)===n})}function rh(e){const t=[];let n=null;for(const r of e){if(Yl(r)){n=null,t.push(r);continue}const i=Kl(r)??Gl(r);i&&i===n||(t.push(r),i&&(n=i))}return t}const Ql=["codex","claudecode","copilot"];function Or({agent:e,className:t="h-3.5 w-3.5 shrink-0"}){const n=t;return e==="claudecode"?m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"butt",strokeLinejoin:"miter",className:n,"data-agent-icon":"claudecode","data-agent-shape":"pixel-bot","aria-hidden":"true",children:[m.jsx("path",{d:"M5 9V6h14v3h2v6h-3v3H6v-3H3V9z"}),m.jsx("path",{d:"M8 7v4"}),m.jsx("path",{d:"M16 7v4"}),m.jsx("path",{d:"M7 18v3"}),m.jsx("path",{d:"M11 18v3"}),m.jsx("path",{d:"M15 18v3"})]}):e==="codex"?m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",className:n,"data-agent-icon":"codex","data-agent-shape":"command-cloud","aria-hidden":"true",children:[m.jsx("path",{d:"M6.85 18.05h9.65a4.35 4.35 0 0 0 .65-8.65 5.45 5.45 0 0 0-10.2-1.65 5.1 5.1 0 0 0-.1 10.3z"}),m.jsx("path",{d:"M9.25 8.9 12 12l-2.75 3.1"}),m.jsx("path",{d:"M14.15 15.1h3.25"})]}):e==="copilot"?m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:n,"data-agent-icon":"copilot","data-agent-shape":"pixel-face","aria-hidden":"true",children:[m.jsx("path",{d:"M5.2 4.1h4.65a1.55 1.55 0 0 1 1.55 1.55v4.65a1.55 1.55 0 0 1-1.55 1.55H5.2a1.55 1.55 0 0 1-1.55-1.55V5.65A1.55 1.55 0 0 1 5.2 4.1z"}),m.jsx("path",{d:"M14.15 4.1h4.65a1.55 1.55 0 0 1 1.55 1.55v4.65a1.55 1.55 0 0 1-1.55 1.55h-4.65a1.55 1.55 0 0 1-1.55-1.55V5.65a1.55 1.55 0 0 1 1.55-1.55z"}),m.jsx("path",{d:"M4.5 14.7v3.85h15v-3.85"}),m.jsx("path",{d:"M8.4 14.7v1.9"}),m.jsx("path",{d:"M12 14.7v1.9"}),m.jsx("path",{d:"M15.6 14.7v1.9"}),m.jsx("path",{d:"M7.65 20.25h8.7"})]}):m.jsx(sl,{className:n,"data-agent-icon":"generic","aria-hidden":"true"})}function Rr({value:e,label:t,description:n}){return m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx(Or,{agent:e}),m.jsx("span",{children:t}),n&&m.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:n})]})}function ih(){return Lr.map(e=>m.jsx(pn,{value:e.value,disabled:e.disabled,children:m.jsx(Rr,{value:e.value,label:e.label,description:e.description})},e.value))}function lh(){return Ql.map(e=>m.jsx(pn,{value:e,children:m.jsx(Rr,{value:e,label:Br(e)})},e))}function oh(){return Dr.map(e=>m.jsx(pn,{value:e.value,children:m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("span",{children:e.label}),e.description&&m.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:e.description})]})},e.value))}function Br(e){var t;return((t=Lr.find(n=>n.value===e))==null?void 0:t.label)??e}function ah(e){var t;return((t=Dr.find(n=>n.value===e))==null?void 0:t.label)??e}function Zl(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eo=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,to=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,no={};function Vn(e,t){return(no.jsx?to:eo).test(e)}const ro=/[ \t\n\f\r]/g;function io(e){return typeof e=="object"?e.type==="text"?Wn(e.value):!1:Wn(e)}function Wn(e){return e.replace(ro,"")===""}class st{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}st.prototype.normal={};st.prototype.property={};st.prototype.space=void 0;function $r(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new st(n,r,t)}function Zt(e){return e.toLowerCase()}class te{constructor(t,n){this.attribute=n,this.property=t}}te.prototype.attribute="";te.prototype.booleanish=!1;te.prototype.boolean=!1;te.prototype.commaOrSpaceSeparated=!1;te.prototype.commaSeparated=!1;te.prototype.defined=!1;te.prototype.mustUseProperty=!1;te.prototype.number=!1;te.prototype.overloadedBoolean=!1;te.prototype.property="";te.prototype.spaceSeparated=!1;te.prototype.space=void 0;let lo=0;const F=Te(),Y=Te(),en=Te(),v=Te(),J=Te(),Fe=Te(),re=Te();function Te(){return 2**++lo}const tn=Object.freeze(Object.defineProperty({__proto__:null,boolean:F,booleanish:Y,commaOrSpaceSeparated:re,commaSeparated:Fe,number:v,overloadedBoolean:en,spaceSeparated:J},Symbol.toStringTag,{value:"Module"})),_t=Object.keys(tn);class dn extends te{constructor(t,n,r,i){let o=-1;if(super(t,n),Jn(this,"space",i),typeof r=="number")for(;++o<_t.length;){const l=_t[o];Jn(this,_t[o],(r&tn[l])===tn[l])}}}dn.prototype.defined=!0;function Jn(e,t,n){n&&(e[t]=n)}function Be(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new dn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Zt(r)]=r,n[Zt(o.attribute)]=r}return new st(t,n,e.space)}const Ur=Be({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:v,ariaColIndex:v,ariaColSpan:v,ariaControls:J,ariaCurrent:null,ariaDescribedBy:J,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:J,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:J,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:J,ariaLevel:v,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:J,ariaPlaceholder:null,ariaPosInSet:v,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:J,ariaRowCount:v,ariaRowIndex:v,ariaRowSpan:v,ariaSelected:Y,ariaSetSize:v,ariaSort:null,ariaValueMax:v,ariaValueMin:v,ariaValueNow:v,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function qr(e,t){return t in e?e[t]:t}function Hr(e,t){return qr(e,t.toLowerCase())}const oo=Be({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fe,acceptCharset:J,accessKey:J,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:J,autoFocus:F,autoPlay:F,blocking:J,capture:null,charSet:null,checked:F,cite:null,className:J,cols:v,colSpan:null,content:null,contentEditable:Y,controls:F,controlsList:J,coords:v|Fe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:en,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:J,height:v,hidden:en,high:v,href:null,hrefLang:null,htmlFor:J,httpEquiv:J,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:J,itemRef:J,itemScope:F,itemType:J,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:v,manifest:null,max:null,maxLength:v,media:null,method:null,min:null,minLength:v,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,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:F,optimum:v,pattern:null,ping:J,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:J,required:F,reversed:F,rows:v,rowSpan:v,sandbox:J,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shape:null,size:v,sizes:null,slot:null,span:v,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:v,step:null,style:null,tabIndex:v,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:Y,width:v,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:J,axis:null,background:null,bgColor:null,border:v,borderColor:null,bottomMargin:v,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:v,leftMargin:v,link:null,longDesc:null,lowSrc:null,marginHeight:v,marginWidth:v,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:v,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:v,valueType:null,version:null,vAlign:null,vLink:null,vSpace:v,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:F,disableRemotePlayback:F,prefix:null,property:null,results:v,security:null,unselectable:null},space:"html",transform:Hr}),ao=Be({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:re,accentHeight:v,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:v,amplitude:v,arabicForm:null,ascent:v,attributeName:null,attributeType:null,azimuth:v,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:v,by:null,calcMode:null,capHeight:v,className:J,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:v,diffuseConstant:v,direction:null,display:null,dur:null,divisor:v,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:v,enableBackground:null,end:null,event:null,exponent:v,externalResourcesRequired:null,fill:null,fillOpacity:v,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:Fe,g2:Fe,glyphName:Fe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:v,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:v,horizOriginX:v,horizOriginY:v,id:null,ideographic:v,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:v,k:v,k1:v,k2:v,k3:v,k4:v,kernelMatrix:re,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:v,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:v,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:v,overlineThickness:v,paintOrder:null,panose1:null,path:null,pathLength:v,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:J,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:v,pointsAtY:v,pointsAtZ:v,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:re,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:re,rev:re,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:re,requiredFeatures:re,requiredFonts:re,requiredFormats:re,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:v,specularExponent:v,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:v,strikethroughThickness:v,string:null,stroke:null,strokeDashArray:re,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:v,strokeOpacity:v,strokeWidth:null,style:null,surfaceScale:v,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:re,tabIndex:v,tableValues:null,target:null,targetX:v,targetY:v,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:re,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:v,underlineThickness:v,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:v,values:null,vAlphabetic:v,vMathematical:v,vectorEffect:null,vHanging:v,vIdeographic:v,version:null,vertAdvY:v,vertOriginX:v,vertOriginY:v,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:v,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qr}),Vr=Be({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wr=Be({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hr}),Jr=Be({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),so={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"},uo=/[A-Z]/g,Yn=/-[a-z]/g,co=/^data[-\w.:]+$/i;function fo(e,t){const n=Zt(t);let r=t,i=te;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&co.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Yn,ho);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Yn.test(o)){let l=o.replace(uo,po);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=dn}return new i(r,t)}function po(e){return"-"+e.toLowerCase()}function ho(e){return e.charAt(1).toUpperCase()}const mo=$r([Ur,oo,Vr,Wr,Jr],"html"),gn=$r([Ur,ao,Vr,Wr,Jr],"svg");function go(e){return e.join(" ").trim()}var ze={},Pt,Xn;function xo(){if(Xn)return Pt;Xn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
49
|
-
`,s="/",f="*",c="",h="comment",p="declaration";function x(E,y){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];y=y||{};var S=1,A=1;function z(P){var j=P.match(t);j&&(S+=j.length);var H=P.lastIndexOf(u);A=~H?P.length-H:A+P.length}function L(){var P={line:S,column:A};return function(j){return j.position=new C(P),$(),j}}function C(P){this.start=P,this.end={line:S,column:A},this.source=y.source}C.prototype.content=E;function O(P){var j=new Error(y.source+":"+S+":"+A+": "+P);if(j.reason=P,j.filename=y.source,j.line=S,j.column=A,j.source=E,!y.silent)throw j}function U(P){var j=P.exec(E);if(j){var H=j[0];return z(H),E=E.slice(H.length),j}}function $(){U(n)}function k(P){var j;for(P=P||[];j=T();)j!==!1&&P.push(j);return P}function T(){var P=L();if(!(s!=E.charAt(0)||f!=E.charAt(1))){for(var j=2;c!=E.charAt(j)&&(f!=E.charAt(j)||s!=E.charAt(j+1));)++j;if(j+=2,c===E.charAt(j-1))return O("End of comment missing");var H=E.slice(2,j-2);return A+=2,z(H),E=E.slice(j),A+=2,P({type:h,comment:H})}}function N(){var P=L(),j=U(r);if(j){if(T(),!U(i))return O("property missing ':'");var H=U(o),X=P({type:p,property:b(j[0].replace(e,c)),value:H?b(H[0].replace(e,c)):c});return U(l),X}}function q(){var P=[];k(P);for(var j;j=N();)j!==!1&&(P.push(j),k(P));return P}return $(),q()}function b(E){return E?E.replace(a,c):c}return Pt=x,Pt}var Gn;function yo(){if(Gn)return ze;Gn=1;var e=ze&&ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ze,"__esModule",{value:!0}),ze.default=n;const t=e(xo());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:f}=u;a?i(s,f,u):f&&(o=o||{},o[s]=f)}),o}return ze}var Ve={},Kn;function ko(){if(Kn)return Ve;Kn=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||n.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},u=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(t,l))};return Ve.camelCase=u,Ve}var We,Qn;function bo(){if(Qn)return We;Qn=1;var e=We&&We.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(yo()),n=ko();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(l[(0,n.camelCase)(a,o)]=u)}),l}return r.default=r,We=r,We}var wo=bo();const So=Fr(wo),Yr=Xr("end"),xn=Xr("start");function Xr(e){return t;function t(n){const r=n&&n.position&&n.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 Co(e){const t=xn(e),n=Yr(e);if(t&&n)return{start:t,end:n}}function Ge(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zn(e.position):"start"in e||"end"in e?Zn(e):"line"in e||"column"in e?nn(e):""}function nn(e){return er(e&&e.line)+":"+er(e&&e.column)}function Zn(e){return nn(e&&e.start)+"-"+nn(e&&e.end)}function er(e){return e&&typeof e=="number"?e:1}class Q extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ge(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Q.prototype.file="";Q.prototype.name="";Q.prototype.reason="";Q.prototype.message="";Q.prototype.stack="";Q.prototype.column=void 0;Q.prototype.line=void 0;Q.prototype.ancestors=void 0;Q.prototype.cause=void 0;Q.prototype.fatal=void 0;Q.prototype.place=void 0;Q.prototype.ruleId=void 0;Q.prototype.source=void 0;const yn={}.hasOwnProperty,Eo=new Map,Ao=/[A-Z]/g,vo=new Set(["table","tbody","thead","tfoot","tr"]),Io=new Set(["td","th"]),Gr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jo(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Fo(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Do(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gn:mo,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Kr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Kr(e,t,n){if(t.type==="element")return To(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return No(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Po(e,t,n);if(t.type==="mdxjsEsm")return _o(e,t);if(t.type==="root")return zo(e,t,n);if(t.type==="text")return Lo(e,t)}function To(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=gn,e.schema=i),e.ancestors.push(t);const o=Zr(e,t.tagName,!1),l=Mo(e,t);let a=bn(e,t);return vo.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!io(u):!0})),Qr(e,l,o,t),kn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function No(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tt(e,t.position)}function _o(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tt(e,t.position)}function Po(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=gn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Zr(e,t.name,!0),l=Oo(e,t),a=bn(e,t);return Qr(e,l,o,t),kn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function zo(e,t,n){const r={};return kn(r,bn(e,t)),e.create(t,e.Fragment,r,n)}function Lo(e,t){return t.value}function Qr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Do(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Fo(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=xn(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Mo(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&yn.call(t.properties,i)){const o=Ro(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Io.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Oo(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else tt(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else tt(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function bn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Eo;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=Kr(e,o,l);a!==void 0&&n.push(a)}return n}function Ro(e,t,n){const r=fo(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Zl(n):go(n)),r.property==="style"){let i=typeof n=="object"?n:Bo(e,String(n));return e.stylePropertyNameCase==="css"&&(i=$o(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?so[r.property]||r.property:r.attribute,n]}}function Bo(e,t){try{return So(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Q("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=Gr+"#cannot-parse-style-attribute",i}}function Zr(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=Vn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Vn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return yn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tt(e)}function tt(e,t){const n=new Q("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Gr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $o(e){const t={};let n;for(n in e)yn.call(e,n)&&(t[Uo(n)]=e[n]);return t}function Uo(e){let t=e.replace(Ao,qo);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function qo(e){return"-"+e.toLowerCase()}const zt={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"]},Ho={};function wn(e,t){const n=Ho,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ei(e,r,i)}function ei(e,t,n){if(Vo(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return tr(e.children,t,n)}return Array.isArray(e)?tr(e,t,n):""}function tr(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ei(e[i],t,n);return r.join("")}function Vo(e){return!!(e&&typeof e=="object")}const nr=document.createElement("i");function Sn(e){const t="&"+e+";";nr.innerHTML=t;const n=nr.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ie(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function le(e,t){return e.length>0?(ie(e,e.length,0,t),e):t}const rr={}.hasOwnProperty;function ti(e){const t={};let n=-1;for(;++n<e.length;)Wo(t,e[n]);return t}function Wo(e,t){let n;for(n in t){const i=(rr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){rr.call(i,l)||(i[l]=[]);const a=o[l];Jo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Jo(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ie(e,0,0,r)}function ni(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Z=Ee(/[A-Za-z]/),K=Ee(/[\dA-Za-z]/),Yo=Ee(/[#-'*+\--9=?A-Z^-~]/);function St(e){return e!==null&&(e<32||e===127)}const rn=Ee(/\d/),Xo=Ee(/[\dA-Fa-f]/),Go=Ee(/[!-/:-@[-`{-~]/);function _(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function M(e){return e===-2||e===-1||e===32}const vt=Ee(new RegExp("\\p{P}|\\p{S}","u")),je=Ee(/\s/);function Ee(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $e(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&K(e.charCodeAt(n+1))&&K(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return M(u)?(e.enter(n),a(u)):t(u)}function a(u){return M(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const Ko={tokenize:Qo};function Qo(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),B(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return _(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const Zo={tokenize:ea},ir={tokenize:ta};function ea(e){const t=this,n=[];let r=0,i,o,l;return a;function a(A){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,u,s)(A)}return s(A)}function u(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const z=t.events.length;let L=z,C;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){C=t.events[L][1].end;break}y(r);let O=z;for(;O<t.events.length;)t.events[O][1].end={...C},O++;return ie(t.events,L+1,0,t.events.slice(z)),t.events.length=O,s(A)}return a(A)}function s(A){if(r===n.length){if(!i)return h(A);if(i.currentConstruct&&i.currentConstruct.concrete)return x(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ir,f,c)(A)}function f(A){return i&&S(),y(r),h(A)}function c(A){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(A)}function h(A){return t.containerState={},e.attempt(ir,p,x)(A)}function p(A){return r++,n.push([t.currentConstruct,t.containerState]),h(A)}function x(A){if(A===null){i&&S(),y(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(A)}function b(A){if(A===null){E(e.exit("chunkFlow"),!0),y(0),e.consume(A);return}return _(A)?(e.consume(A),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(A),b)}function E(A,z){const L=t.sliceStream(A);if(z&&L.push(null),A.previous=o,o&&(o.next=A),o=A,i.defineSkip(A.start),i.write(L),t.parser.lazy[A.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<l&&(!i.events[C][1].end||i.events[C][1].end.offset>l))return;const O=t.events.length;let U=O,$,k;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if($){k=t.events[U][1].end;break}$=!0}for(y(r),C=O;C<t.events.length;)t.events[C][1].end={...k},C++;ie(t.events,U+1,0,t.events.slice(O)),t.events.length=C}}function y(A){let z=n.length;for(;z-- >A;){const L=n[z];t.containerState=L[1],L[0].exit.call(t,e)}n.length=A}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ta(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Me(e){if(e===null||W(e)||je(e))return 1;if(vt(e))return 2}function It(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ln={name:"attention",resolveAll:na,tokenize:ra};function na(e,t){let n=-1,r,i,o,l,a,u,s,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};lr(c,-u),lr(h,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=le(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=le(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=le(s,It(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=le(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=le(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,ie(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ra(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Me(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Me(u),c=!f||f===2&&i||n.includes(u),h=!i||i===2&&f||n.includes(r);return s._open=!!(o===42?c:c&&(i||!h)),s._close=!!(o===42?h:h&&(f||!c)),t(u)}}function lr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ia={name:"autolink",tokenize:la};function la(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Z(p)?(e.consume(p),l):p===64?n(p):s(p)}function l(p){return p===43||p===45||p===46||K(p)?(r=1,a(p)):s(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||K(p))&&r++<32?(e.consume(p),a):(r=0,s(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||St(p)?n(p):(e.consume(p),u)}function s(p){return p===64?(e.consume(p),f):Yo(p)?(e.consume(p),s):n(p)}function f(p){return K(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||K(p))&&r++<63){const x=p===45?h:c;return e.consume(p),x}return n(p)}}const ut={partial:!0,tokenize:oa};function oa(e,t,n){return r;function r(o){return M(o)?B(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||_(o)?t(o):n(o)}}const ri={continuation:{tokenize:sa},exit:ua,name:"blockQuote",tokenize:aa};function aa(e,t,n){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return M(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function sa(e,t,n){const r=this;return i;function i(l){return M(l)?B(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(ri,t,n)(l)}}function ua(e){e.exit("blockQuote")}const ii={name:"characterEscape",tokenize:ca};function ca(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Go(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const li={name:"characterReference",tokenize:fa};function fa(e,t,n){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=K,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Xo,f):(e.enter("characterReferenceValue"),o=7,l=rn,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return l===K&&!Sn(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const or={partial:!0,tokenize:ha},ar={concrete:!0,name:"codeFenced",tokenize:pa};function pa(e,t,n){const r=this,i={partial:!0,tokenize:L};let o=0,l=0,a;return u;function u(C){return s(C)}function s(C){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===a?(l++,e.consume(C),f):l<3?n(C):(e.exit("codeFencedFenceSequence"),M(C)?B(e,c,"whitespace")(C):c(C))}function c(C){return C===null||_(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(or,b,z)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||_(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):M(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),B(e,p,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function p(C){return C===null||_(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===null||_(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===a?n(C):(e.consume(C),x)}function b(C){return e.attempt(i,z,E)(C)}function E(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&M(C)?B(e,S,"linePrefix",o+1)(C):S(C)}function S(C){return C===null||_(C)?e.check(or,b,z)(C):(e.enter("codeFlowValue"),A(C))}function A(C){return C===null||_(C)?(e.exit("codeFlowValue"),S(C)):(e.consume(C),A)}function z(C){return e.exit("codeFenced"),t(C)}function L(C,O,U){let $=0;return k;function k(j){return C.enter("lineEnding"),C.consume(j),C.exit("lineEnding"),T}function T(j){return C.enter("codeFencedFence"),M(j)?B(C,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):N(j)}function N(j){return j===a?(C.enter("codeFencedFenceSequence"),q(j)):U(j)}function q(j){return j===a?($++,C.consume(j),q):$>=l?(C.exit("codeFencedFenceSequence"),M(j)?B(C,P,"whitespace")(j):P(j)):U(j)}function P(j){return j===null||_(j)?(C.exit("codeFencedFence"),O(j)):U(j)}}}function ha(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Lt={name:"codeIndented",tokenize:da},ma={partial:!0,tokenize:ga};function da(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):_(s)?e.attempt(ma,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||_(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function ga(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):_(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):_(l)?i(l):n(l)}}const xa={name:"codeText",previous:ka,resolve:ya,tokenize:ba};function ya(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||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),t-=r-i-2,r=i+2),i=void 0);return e}function ka(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ba(e,t,n){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):_(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||_(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",s(c))}}class wa{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Je(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Je(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Je(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Je(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Je(this.left,n.reverse())}}}function Je(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function oi(e){const t={};let n=-1,r,i,o,l,a,u,s;const f=new wa(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Sa(f,n)),n=t[n],s=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return ie(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function Sa(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,h=-1,p=n,x=0,b=0;const E=[b];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),c&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++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&&(b=h+1,E.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):E.pop(),h=E.length;h--;){const y=a.slice(E[h],E[h+1]),S=o.pop();u.push([S,S+y.length-1]),e.splice(S,2,y)}for(u.reverse(),h=-1;++h<u.length;)s[x+u[h][0]]=x+u[h][1],x+=u[h][1]-u[h][0]-1;return s}const Ca={resolve:Aa,tokenize:va},Ea={partial:!0,tokenize:Ia};function Aa(e){return oi(e),e}function va(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):_(a)?e.check(Ea,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ia(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),B(e,o,"linePrefix")}function o(l){if(l===null||_(l))return n(l);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?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function ai(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||St(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||_(y)?n(y):(e.consume(y),y===92?x:p)}function x(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!f&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f<s&&y===40?(e.consume(y),f++,b):y===41?(e.consume(y),f--,b):y===null||y===32||y===40||St(y)?n(y):(e.consume(y),y===92?E:b)}function E(y){return y===40||y===41||y===92?(e.consume(y),b):b(y)}}function si(e,t,n,r,i,o){const l=this;let a=0,u;return s;function s(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),f}function f(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):_(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||_(p)||a++>999?(e.exit("chunkString"),f(p)):(e.consume(p),u||(u=!M(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function ui(e,t,n,r,i,o){let l;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),l=h===40?41:h,u):n(h)}function u(h){return h===l?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),s(h))}function s(h){return h===l?(e.exit(o),u(l)):h===null?n(h):_(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),B(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===l||h===null||_(h)?(e.exit("chunkString"),s(h)):(e.consume(h),h===92?c:f)}function c(h){return h===l||h===92?(e.consume(h),f):f(h)}}function Ke(e,t){let n;return r;function r(i){return _(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):M(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ja={name:"definition",tokenize:Na},Ta={partial:!0,tokenize:_a};function Na(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return si.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return W(p)?Ke(e,s)(p):s(p)}function s(p){return ai(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Ta,c,c)(p)}function c(p){return M(p)?B(e,h,"whitespace")(p):h(p)}function h(p){return p===null||_(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function _a(e,t,n){return r;function r(a){return W(a)?Ke(e,i)(a):n(a)}function i(a){return ui(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return M(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||_(a)?t(a):n(a)}}const Pa={name:"hardBreakEscape",tokenize:za};function za(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return _(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const La={name:"headingAtx",resolve:Da,tokenize:Fa};function Da(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Fa(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||W(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||_(f)?(e.exit("atxHeading"),t(f)):M(f)?B(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||W(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Ma=["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"],sr=["pre","script","style","textarea"],Oa={concrete:!0,name:"htmlFlow",resolveTo:$a,tokenize:Ua},Ra={partial:!0,tokenize:Ha},Ba={partial:!0,tokenize:qa};function $a(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ua(e,t,n){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),h):g===47?(e.consume(g),o=!0,b):g===63?(e.consume(g),i=3,r.interrupt?t:d):Z(g)?(e.consume(g),l=String.fromCharCode(g),E):n(g)}function h(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,x):Z(g)?(e.consume(g),i=4,r.interrupt?t:d):n(g)}function p(g){return g===45?(e.consume(g),r.interrupt?t:d):n(g)}function x(g){const se="CDATA[";return g===se.charCodeAt(a++)?(e.consume(g),a===se.length?r.interrupt?t:N:x):n(g)}function b(g){return Z(g)?(e.consume(g),l=String.fromCharCode(g),E):n(g)}function E(g){if(g===null||g===47||g===62||W(g)){const se=g===47,Ae=l.toLowerCase();return!se&&!o&&sr.includes(Ae)?(i=1,r.interrupt?t(g):N(g)):Ma.includes(l.toLowerCase())?(i=6,se?(e.consume(g),y):r.interrupt?t(g):N(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?S(g):A(g))}return g===45||K(g)?(e.consume(g),l+=String.fromCharCode(g),E):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:N):n(g)}function S(g){return M(g)?(e.consume(g),S):k(g)}function A(g){return g===47?(e.consume(g),k):g===58||g===95||Z(g)?(e.consume(g),z):M(g)?(e.consume(g),A):k(g)}function z(g){return g===45||g===46||g===58||g===95||K(g)?(e.consume(g),z):L(g)}function L(g){return g===61?(e.consume(g),C):M(g)?(e.consume(g),L):A(g)}function C(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,O):M(g)?(e.consume(g),C):U(g)}function O(g){return g===u?(e.consume(g),u=null,$):g===null||_(g)?n(g):(e.consume(g),O)}function U(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||W(g)?L(g):(e.consume(g),U)}function $(g){return g===47||g===62||M(g)?A(g):n(g)}function k(g){return g===62?(e.consume(g),T):n(g)}function T(g){return g===null||_(g)?N(g):M(g)?(e.consume(g),T):n(g)}function N(g){return g===45&&i===2?(e.consume(g),H):g===60&&i===1?(e.consume(g),X):g===62&&i===4?(e.consume(g),ae):g===63&&i===3?(e.consume(g),d):g===93&&i===5?(e.consume(g),me):_(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Ra,de,q)(g)):g===null||_(g)?(e.exit("htmlFlowData"),q(g)):(e.consume(g),N)}function q(g){return e.check(Ba,P,de)(g)}function P(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),j}function j(g){return g===null||_(g)?q(g):(e.enter("htmlFlowData"),N(g))}function H(g){return g===45?(e.consume(g),d):N(g)}function X(g){return g===47?(e.consume(g),l="",oe):N(g)}function oe(g){if(g===62){const se=l.toLowerCase();return sr.includes(se)?(e.consume(g),ae):N(g)}return Z(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),oe):N(g)}function me(g){return g===93?(e.consume(g),d):N(g)}function d(g){return g===62?(e.consume(g),ae):g===45&&i===2?(e.consume(g),d):N(g)}function ae(g){return g===null||_(g)?(e.exit("htmlFlowData"),de(g)):(e.consume(g),ae)}function de(g){return e.exit("htmlFlow"),t(g)}}function qa(e,t,n){const r=this;return i;function i(l){return _(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Ha(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ut,t,n)}}const Va={name:"htmlText",tokenize:Wa};function Wa(e,t,n){const r=this;let i,o,l;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),u}function u(d){return d===33?(e.consume(d),s):d===47?(e.consume(d),L):d===63?(e.consume(d),A):Z(d)?(e.consume(d),U):n(d)}function s(d){return d===45?(e.consume(d),f):d===91?(e.consume(d),o=0,x):Z(d)?(e.consume(d),S):n(d)}function f(d){return d===45?(e.consume(d),p):n(d)}function c(d){return d===null?n(d):d===45?(e.consume(d),h):_(d)?(l=c,X(d)):(e.consume(d),c)}function h(d){return d===45?(e.consume(d),p):c(d)}function p(d){return d===62?H(d):d===45?h(d):c(d)}function x(d){const ae="CDATA[";return d===ae.charCodeAt(o++)?(e.consume(d),o===ae.length?b:x):n(d)}function b(d){return d===null?n(d):d===93?(e.consume(d),E):_(d)?(l=b,X(d)):(e.consume(d),b)}function E(d){return d===93?(e.consume(d),y):b(d)}function y(d){return d===62?H(d):d===93?(e.consume(d),y):b(d)}function S(d){return d===null||d===62?H(d):_(d)?(l=S,X(d)):(e.consume(d),S)}function A(d){return d===null?n(d):d===63?(e.consume(d),z):_(d)?(l=A,X(d)):(e.consume(d),A)}function z(d){return d===62?H(d):A(d)}function L(d){return Z(d)?(e.consume(d),C):n(d)}function C(d){return d===45||K(d)?(e.consume(d),C):O(d)}function O(d){return _(d)?(l=O,X(d)):M(d)?(e.consume(d),O):H(d)}function U(d){return d===45||K(d)?(e.consume(d),U):d===47||d===62||W(d)?$(d):n(d)}function $(d){return d===47?(e.consume(d),H):d===58||d===95||Z(d)?(e.consume(d),k):_(d)?(l=$,X(d)):M(d)?(e.consume(d),$):H(d)}function k(d){return d===45||d===46||d===58||d===95||K(d)?(e.consume(d),k):T(d)}function T(d){return d===61?(e.consume(d),N):_(d)?(l=T,X(d)):M(d)?(e.consume(d),T):$(d)}function N(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),i=d,q):_(d)?(l=N,X(d)):M(d)?(e.consume(d),N):(e.consume(d),P)}function q(d){return d===i?(e.consume(d),i=void 0,j):d===null?n(d):_(d)?(l=q,X(d)):(e.consume(d),q)}function P(d){return d===null||d===34||d===39||d===60||d===61||d===96?n(d):d===47||d===62||W(d)?$(d):(e.consume(d),P)}function j(d){return d===47||d===62||W(d)?$(d):n(d)}function H(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),t):n(d)}function X(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),oe}function oe(d){return M(d)?B(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):me(d)}function me(d){return e.enter("htmlTextData"),l(d)}}const Cn={name:"labelEnd",resolveAll:Ga,resolveTo:Ka,tokenize:Qa},Ja={tokenize:Za},Ya={tokenize:es},Xa={tokenize:ts};function Ga(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ie(e,0,e.length,n),e}function Ka(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,t],["enter",s,t]],a=le(a,e.slice(o+1,o+r+3)),a=le(a,[["enter",f,t]]),a=le(a,It(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=le(a,[["exit",f,t],e[l-2],e[l-1],["exit",s,t]]),a=le(a,e.slice(l+1)),a=le(a,[["exit",u,t]]),ie(e,o,e.length,a),e}function Qa(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(l=r.parser.defined.includes(ce(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),u):n(h)}function u(h){return h===40?e.attempt(Ja,f,l?f:c)(h):h===91?e.attempt(Ya,f,l?s:c)(h):l?f(h):c(h)}function s(h){return e.attempt(Xa,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function Za(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return W(c)?Ke(e,o)(c):o(c)}function o(c){return c===41?f(c):ai(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return W(c)?Ke(e,u)(c):f(c)}function a(c){return n(c)}function u(c){return c===34||c===39||c===40?ui(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return W(c)?Ke(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function es(e,t,n){const r=this;return i;function i(a){return si.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function ts(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const ns={name:"labelStartImage",resolveAll:Cn.resolveAll,tokenize:rs};function rs(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const is={name:"labelStartLink",resolveAll:Cn.resolveAll,tokenize:ls};function ls(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Dt={name:"lineEnding",tokenize:os};function os(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),B(e,t,"linePrefix")}}const xt={name:"thematicBreak",tokenize:as};function as(e,t,n){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||_(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),M(s)?B(e,a,"whitespace")(s):a(s))}}const ee={continuation:{tokenize:fs},exit:hs,name:"list",tokenize:cs},ss={partial:!0,tokenize:ms},us={partial:!0,tokenize:ps};function cs(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:rn(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(xt,n,s)(p):s(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return rn(p)&&++l<10?(e.consume(p),u):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),s(p)):n(p)}function s(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(ut,r.interrupt?n:f,e.attempt(ss,h,c))}function f(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function c(p){return M(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function fs(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ut,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!M(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(us,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(ee,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function ps(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function hs(e){e.exit(this.containerState.type)}function ms(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!M(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ur={name:"setextUnderline",resolveTo:ds,tokenize:gs};function ds(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function gs(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),M(s)?B(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||_(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const xs={tokenize:ys};function ys(e){const t=this,n=e.attempt(ut,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ca,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ks={resolveAll:fi()},bs=ci("string"),ws=ci("text");function ci(e){return{resolveAll:fi(e==="text"?Ss:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const p=c[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function fi(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Ss(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const s={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(n,0,["enter",s,t],["exit",s,t]),n+=2)}n++}return e}const Cs={42:ee,43:ee,45:ee,48:ee,49:ee,50:ee,51:ee,52:ee,53:ee,54:ee,55:ee,56:ee,57:ee,62:ri},Es={91:ja},As={[-2]:Lt,[-1]:Lt,32:Lt},vs={35:La,42:xt,45:[ur,xt],60:Oa,61:ur,95:xt,96:ar,126:ar},Is={38:li,92:ii},js={[-5]:Dt,[-4]:Dt,[-3]:Dt,33:ns,38:li,42:ln,60:[ia,Va],91:is,92:[Pa,ii],93:Cn,95:ln,96:xa},Ts={null:[ln,ks]},Ns={null:[42,95]},_s={null:[]},Ps=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ns,contentInitial:Es,disable:_s,document:Cs,flow:vs,flowInitial:As,insideSpan:Ts,string:Is,text:js},Symbol.toStringTag,{value:"Module"}));function zs(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:O(L),check:O(C),consume:S,enter:A,exit:z,interrupt:O(C,{interrupt:!0})},s={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:c};let f=t.tokenize.call(s,u);return t.resolveAll&&o.push(t),s;function c(T){return l=le(l,T),E(),l[l.length-1]!==null?[]:(U(t,0),s.events=It(o,s.events,s),s.events)}function h(T,N){return Ds(p(T),N)}function p(T){return Ls(l,T)}function x(){const{_bufferIndex:T,_index:N,line:q,column:P,offset:j}=r;return{_bufferIndex:T,_index:N,line:q,column:P,offset:j}}function b(T){i[T.line]=T.column,k()}function E(){let T;for(;r._index<l.length;){const N=l[r._index];if(typeof N=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<N.length;)y(N.charCodeAt(r._bufferIndex));else y(N)}}function y(T){f=f(T)}function S(T){_(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,k()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=T}function A(T,N){const q=N||{};return q.type=T,q.start=x(),s.events.push(["enter",q,s]),a.push(q),q}function z(T){const N=a.pop();return N.end=x(),s.events.push(["exit",N,s]),N}function L(T,N){U(T,N.from)}function C(T,N){N.restore()}function O(T,N){return q;function q(P,j,H){let X,oe,me,d;return Array.isArray(P)?de(P):"tokenize"in P?de([P]):ae(P);function ae(G){return Ue;function Ue(be){const Ne=be!==null&&G[be],_e=be!==null&&G.null,ft=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return de(ft)(be)}}function de(G){return X=G,oe=0,G.length===0?H:g(G[oe])}function g(G){return Ue;function Ue(be){return d=$(),me=G,G.partial||(s.currentConstruct=G),G.name&&s.parser.constructs.disable.null.includes(G.name)?Ae():G.tokenize.call(N?Object.assign(Object.create(s),N):s,u,se,Ae)(be)}}function se(G){return T(me,d),j}function Ae(G){return d.restore(),++oe<X.length?g(X[oe]):H}}}function U(T,N){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&ie(s.events,N,s.events.length-N,T.resolve(s.events.slice(N),s)),T.resolveTo&&(s.events=T.resolveTo(s.events,s))}function $(){const T=x(),N=s.previous,q=s.currentConstruct,P=s.events.length,j=Array.from(a);return{from:P,restore:H};function H(){r=T,s.previous=N,s.currentConstruct=q,s.events.length=P,a=j,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ls(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Ds(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
46
|
+
*/const Tl=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],hn=ye("wrench",Tl);function wt(e){return typeof e=="object"&&e!==null}function Nl(e){if(!wt(e))return null;if(e.type==="text"&&typeof e.text=="string"){const t=e.text.trim();return t?{type:"text",text:t}:null}if(e.type==="image"&&typeof e.mediaType=="string"&&typeof e.data=="string"){const t=e.mediaType.trim(),n=e.data;return!t||!n?null:{type:"image",mediaType:t,data:n,...typeof e.filename=="string"&&e.filename.trim()?{filename:e.filename.trim()}:{}}}if(e.type==="tool_result"&&typeof e.toolUseId=="string"&&typeof e.content=="string"){const t=e.toolUseId.trim(),n=e.content.trim();return!t||!n?null:{type:"tool_result",toolUseId:t,content:n,...typeof e.isError=="boolean"?{isError:e.isError}:{}}}return null}function _l(e){if(!wt(e))return null;if(e.type==="text"&&typeof e.text=="string"){const r=e.text.trim();return r?{type:"text",text:r}:null}if(e.type!=="image"||!wt(e.source)){if(e.type==="tool_result"&&typeof e.tool_use_id=="string"&&typeof e.content=="string"){const r=e.tool_use_id.trim(),i=e.content.trim();return!r||!i?null:{type:"tool_result",toolUseId:r,content:i,...typeof e.is_error=="boolean"?{isError:e.is_error}:{}}}return null}const t=typeof e.source.media_type=="string"?e.source.media_type.trim():"",n=typeof e.source.data=="string"?e.source.data:"";return!t||!n?null:{type:"image",mediaType:t,data:n}}function gt(e){if(typeof e=="string"){const t=e.trim();return t?[{type:"text",text:t}]:[]}return Array.isArray(e)?e.map(t=>Nl(t)??_l(t)).filter(t=>t!==null):[]}function Jp(e,t){const n=e.trim();return[...n?[{type:"text",text:n}]:[],...t]}function Pl(e){return{role:"user",content:e.map(t=>t.type==="text"?{type:"text",text:t.text}:t.type==="tool_result"?{type:"tool_result",tool_use_id:t.toolUseId,content:t.content,...typeof t.isError=="boolean"?{is_error:t.isError}:{}}:{type:"image",source:{type:"base64",media_type:t.mediaType,data:t.data}})}}function Yp(e,t=new Date().toISOString()){return{type:"user",message:Pl(e),timestamp:t}}function Re(e){if(e.type!=="user"||e.isSynthetic===!0)return null;if(typeof e.message=="string"){const t=gt(e.message);return t.length>0?t:null}if(wt(e.message)&&Array.isArray(e.message.content)){const t=gt(e.message.content);return t.length>0?t:null}if(Array.isArray(e.content)){const t=gt(e.content);return t.length>0?t:null}return null}function Xp(e){return gt(e.payload.initialMessage)}function Ce(e){return e.map(t=>{if(t.type==="text")return`t:${t.text}`;if(t.type==="tool_result")return`r:${t.toolUseId}:${t.isError===!0?"1":"0"}:${t.content}`;const n=t.data.slice(0,32),r=t.data.slice(-32);return`i:${t.mediaType}:${t.data.length}:${n}:${r}`}).join("|")}function zl(e){return e.map(t=>t.type==="text"?t.text:t.type==="tool_result"?t.content:"").filter(Boolean).join(`
|
|
47
|
+
`)}function Ll(e){return`data:${e.mediaType};base64,${e.data}`}function Gp(e){var i,o;if(!e)return[];const t=[],n=e.items;if(n)for(const l of Array.from(n)){if((l==null?void 0:l.kind)!=="file"||!((i=l.type)!=null&&i.startsWith("image/")))continue;const a=(o=l.getAsFile)==null?void 0:o.call(l);a&&a.type.startsWith("image/")&&t.push(a)}if(t.length>0)return t;const r=e.files;return r?Array.from(r).filter(l=>l.type.startsWith("image/")):[]}function Dl(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{if(typeof r.result!="string"){n(new Error(`Failed to read ${e.name}`));return}t(r.result)},r.onerror=()=>n(r.error??new Error(`Failed to read ${e.name}`)),r.readAsDataURL(e)})}async function Kp(e){return Promise.all(Array.from(e).map(async t=>{if(!t.type.startsWith("image/"))throw new Error(`${t.name} is not an image`);const n=await Dl(t),r=n.indexOf(",");if(r===-1)throw new Error(`Failed to parse ${t.name}`);return{type:"image",mediaType:t.type||"image/png",data:n.slice(r+1),filename:t.name}}))}function lt(e){return typeof e=="object"&&e!==null}function Fl(e){return lt(e)&&typeof e.name=="string"&&e.name.toLowerCase()==="askuserquestion"}function Ml(e){return!lt(e)||typeof e.label!="string"||!e.label.trim()?null:{label:e.label.trim(),description:typeof e.description=="string"?e.description.trim():""}}function Ol(e){if(!lt(e)||typeof e.question!="string"||!e.question.trim())return null;const t=Array.isArray(e.options)?e.options.map(Ml).filter(n=>n!==null):[];return t.length===0?null:{header:typeof e.header=="string"&&e.header.trim()?e.header.trim():void 0,question:e.question.trim(),multiSelect:e.multiSelect===!0,options:t}}function Xt(e){if(!lt(e)||!Array.isArray(e.questions))return null;const t=e.questions.map(Ol).filter(n=>n!==null);return t.length===0?null:{questions:t}}function Be(e){return JSON.stringify({questions:e.questions})}function ot(e){const t=Xt(e);if(t)return t;if(Fl(e)){const n=lt(e.input)?e.input:void 0,r=Xt(n);return r?{...r,...typeof e.id=="string"&&e.id.trim()?{toolUseId:e.id.trim()}:{}}:null}return null}function Rl(e){var i;const t=e.trim();if(!t)return[];const n=[t],r=t.matchAll(/```(?:json)?\s*([\s\S]*?)```/gi);for(const o of r){const l=(i=o[1])==null?void 0:i.trim();l&&n.push(l)}return n}function at(e){for(const t of Rl(e))try{const n=JSON.parse(t),r=Xt(n);if(r)return r}catch{}return null}function Bl(e){return e.questions.map(t=>t.options.length>0?[0]:[])}function $l(e,t){return e.questions.every((n,r)=>(t[r]??[]).length>0)}function Ul(e,t){const r=e.questions.map((i,o)=>{const l=[...new Set(t[o]??[])].sort((a,s)=>a-s).filter(a=>i.options[a]!==void 0);return{header:i.header??null,question:i.question,multiSelect:i.multiSelect,selectedOptions:l.map(a=>i.options[a]).filter(a=>a!==void 0)}}).map(i=>{const o=i.header??i.question,l=i.selectedOptions.map(a=>a.label).join(i.multiSelect?", ":"");return`${o}: ${l}`}).join(`
|
|
48
|
+
`);return e.toolUseId?[{type:"tool_result",toolUseId:e.toolUseId,content:r,isError:!1}]:[{type:"text",text:r}]}function et(e){return typeof e=="object"&&e!==null}function ql(e){if(!e)return;const t=["file_path","path","command"].map(n=>e[n]).find(n=>typeof n=="string"&&n.trim().length>0);return t==null?void 0:t.trim()}function Hl(e){const t=e.toLowerCase();return t.includes(" permission to write ")?"Write":t.includes(" permission to edit ")?"Edit":t.includes(" permission to run ")||t.includes(" permission to execute ")?"Bash":"Action"}function Gt(e){const t=e.trim();if(!t.startsWith("Awaiting your permission to "))return null;const n=t.match(/`([^`]+)`/);return{requests:[{toolName:Hl(t),target:n==null?void 0:n[1],summary:t}]}}function Vl(e){if(!Array.isArray(e.permission_denials))return null;const t=[];for(const n of e.permission_denials){if(!et(n)||typeof n.tool_name!="string")continue;const r=et(n.tool_input)?n.tool_input:void 0,i=ql(r),o=typeof e.result=="string"&&e.result.trim().length>0?e.result.trim():`Awaiting your permission to use ${n.tool_name}${i?` on \`${i}\``:""}.`;t.push({toolName:n.tool_name,...typeof n.tool_use_id=="string"?{toolUseId:n.tool_use_id}:{},...i?{target:i}:{},summary:o})}return t.length>0?{requests:t}:null}function Bn(e){if(!Array.isArray(e))return null;for(const t of e){if(!et(t)||t.type!=="text"||typeof t.text!="string")continue;const n=Gt(t.text);if(n)return n}return null}function mn(e){if(!et(e))return null;const t=Vl(e);if(t)return t;if(typeof e.result=="string"){const r=Gt(e.result);if(r)return r}if(typeof e.message=="string"){const r=Gt(e.message);if(r)return r}if(et(e.message)){const r=mn(e.message);if(r)return r;const i=Bn(e.message.content);if(i)return i}const n=Bn(e.content);return n||null}function Wl(e){return JSON.stringify(e.requests.map(t=>({toolName:t.toolName,target:t.target??null,summary:t.summary})))}function Jl(e,t){return e.requests.map(n=>{const r=n.target?` for \`${n.target}\``:"",i=t==="approve"?`Approved. Proceed with the requested ${n.toolName} action${r}.`:`Denied. Do not proceed with the requested ${n.toolName} action${r}. Ask for another approach if needed.`;return n.toolUseId?{type:"tool_result",toolUseId:n.toolUseId,content:i,isError:t==="deny"}:t==="approve"?{type:"text",text:i}:{type:"text",text:i}})}function Yl(e){return Re(e)!==null}function Kt(e){return typeof e=="object"&&e!==null}function $n(e){if(e.type==="user"){const t=Re(e),n=typeof e.timestamp=="string"?e.timestamp:"";if(t)return`user:${n}:${Ce(t)}`}return JSON.stringify(e)}function je(e){return Array.isArray(e)?e.map(t=>je(t)):Kt(e)?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>[t,je(n)])):e}function Xl(e,t){return e.length!==t.length?!1:e.every((n,r)=>JSON.stringify(je(n))===JSON.stringify(je(t[r])))}function Un(e){const t=Re(e);if(t)return`user:${Ce(t)}`;if(e.type==="assistant"){if(typeof e.message=="string")return`assistant:${JSON.stringify(e.message)}`;if(Kt(e.message)&&"content"in e.message)return`assistant:${JSON.stringify(je(e.message.content))}`;if(Array.isArray(e.content))return`assistant:${JSON.stringify(je(e.content))}`;if(Kt(e.message))return`assistant:${JSON.stringify(je(e.message))}`}return JSON.stringify(e)}function qn(e){if(typeof e.timestamp!="string")return null;const t=Date.parse(e.timestamp);return Number.isNaN(t)?null:t}function Qt(e){const t=ot(e);return t?`question:${Be(t)}`:null}function Gl(e){const t=mn(e);return t?`permission:${Wl(t)}`:null}function Hn(e){if(!Array.isArray(e))return null;const t=new Set;for(const n of e){const r=Qt(n);if(r){t.add(r);continue}if(typeof n=="object"&&n!==null&&n.type==="text"&&typeof n.text=="string"){const i=at(n.text);i&&t.add(Be(i))}}return t.size===0?null:Array.from(t).sort().join("|")}function Kl(e){const t=Qt(e);if(t)return t;if(typeof e.message=="string"){const n=at(e.message);return n?Be(n):null}if(typeof e.message=="object"&&e.message!==null){const n=Qt(e.message);return n||Hn(e.message.content)}return Hn(e.content)}function Ql(e){return Gl(e)}function Qp(e,t,n){const r=typeof t.timestamp=="string"?t.timestamp:"";return`${e}-${r}-${n}`}function Zp(e,t){const n=new Map;for(const o of t){const l=Un(o);n.set(l,(n.get(l)??0)+1)}const r=[];for(let o=e.length-1;o>=0;o-=1){const l=e[o];if(!l)continue;const a=Un(l),s=n.get(a)??0;if(s>0){n.set(a,s-1);continue}r.push({...l})}const i=[...r.reverse(),...t.map(o=>({...o}))].map((o,l)=>({event:o,order:l})).sort((o,l)=>{const a=qn(o.event),s=qn(l.event);return a!==null&&s!==null&&a!==s?a-s:o.order-l.order}).map(o=>o.event);return Xl(e,i)?e:i}function eh(e,t){const n=$n(t);return e.some(r=>$n(r)===n)?e:[...e,{...t}]}function th(e,t){const n=new Map;for(const r of t){const i=Re(r);if(!i)continue;const o=Ce(i);n.set(o,(n.get(o)??0)+1)}return e.filter(r=>{const i=Ce(r.content),o=n.get(i)??0;return o<=0?!0:(n.set(i,o-1),!1)})}function nh(e,t){const n=Ce(t),r=e.findIndex(i=>Ce(i.content)===n);return r===-1?e:e.filter((i,o)=>o!==r)}function rh(e,t){const n=Ce(t);return e.some(r=>{const i=Re(r);return i!==null&&Ce(i)===n})}function ih(e){const t=[];let n=null;for(const r of e){if(Yl(r)){n=null,t.push(r);continue}const i=Ql(r)??Kl(r);i&&i===n||(t.push(r),i&&(n=i))}return t}const Zl=["codex","claudecode","copilot"];function Or({agent:e,className:t="h-3.5 w-3.5 shrink-0"}){const n=t;return e==="claudecode"?m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"butt",strokeLinejoin:"miter",className:n,"data-agent-icon":"claudecode","data-agent-shape":"pixel-bot","aria-hidden":"true",children:[m.jsx("path",{d:"M5 9V6h14v3h2v6h-3v3H6v-3H3V9z"}),m.jsx("path",{d:"M8 7v4"}),m.jsx("path",{d:"M16 7v4"}),m.jsx("path",{d:"M7 18v3"}),m.jsx("path",{d:"M11 18v3"}),m.jsx("path",{d:"M15 18v3"})]}):e==="codex"?m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",className:n,"data-agent-icon":"codex","data-agent-shape":"command-cloud","aria-hidden":"true",children:[m.jsx("path",{d:"M6.85 18.05h9.65a4.35 4.35 0 0 0 .65-8.65 5.45 5.45 0 0 0-10.2-1.65 5.1 5.1 0 0 0-.1 10.3z"}),m.jsx("path",{d:"M9.25 8.9 12 12l-2.75 3.1"}),m.jsx("path",{d:"M14.15 15.1h3.25"})]}):e==="copilot"?m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:n,"data-agent-icon":"copilot","data-agent-shape":"pixel-face","aria-hidden":"true",children:[m.jsx("path",{d:"M5.2 4.1h4.65a1.55 1.55 0 0 1 1.55 1.55v4.65a1.55 1.55 0 0 1-1.55 1.55H5.2a1.55 1.55 0 0 1-1.55-1.55V5.65A1.55 1.55 0 0 1 5.2 4.1z"}),m.jsx("path",{d:"M14.15 4.1h4.65a1.55 1.55 0 0 1 1.55 1.55v4.65a1.55 1.55 0 0 1-1.55 1.55h-4.65a1.55 1.55 0 0 1-1.55-1.55V5.65a1.55 1.55 0 0 1 1.55-1.55z"}),m.jsx("path",{d:"M4.5 14.7v3.85h15v-3.85"}),m.jsx("path",{d:"M8.4 14.7v1.9"}),m.jsx("path",{d:"M12 14.7v1.9"}),m.jsx("path",{d:"M15.6 14.7v1.9"}),m.jsx("path",{d:"M7.65 20.25h8.7"})]}):m.jsx(sl,{className:n,"data-agent-icon":"generic","aria-hidden":"true"})}function Rr({value:e,label:t,description:n}){return m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx(Or,{agent:e}),m.jsx("span",{children:t}),n&&m.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:n})]})}function lh(){return Lr.map(e=>m.jsx(pn,{value:e.value,disabled:e.disabled,children:m.jsx(Rr,{value:e.value,label:e.label,description:e.description})},e.value))}function oh(){return Zl.map(e=>m.jsx(pn,{value:e,children:m.jsx(Rr,{value:e,label:Br(e)})},e))}function ah(){return Dr.map(e=>m.jsx(pn,{value:e.value,children:m.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[m.jsx("span",{children:e.label}),e.description&&m.jsx("span",{className:"text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:e.description})]})},e.value))}function Br(e){var t;return((t=Lr.find(n=>n.value===e))==null?void 0:t.label)??e}function sh(e){var t;return((t=Dr.find(n=>n.value===e))==null?void 0:t.label)??e}function eo(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const to=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,no=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ro={};function Vn(e,t){return(ro.jsx?no:to).test(e)}const io=/[ \t\n\f\r]/g;function lo(e){return typeof e=="object"?e.type==="text"?Wn(e.value):!1:Wn(e)}function Wn(e){return e.replace(io,"")===""}class st{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}st.prototype.normal={};st.prototype.property={};st.prototype.space=void 0;function $r(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new st(n,r,t)}function Zt(e){return e.toLowerCase()}class te{constructor(t,n){this.attribute=n,this.property=t}}te.prototype.attribute="";te.prototype.booleanish=!1;te.prototype.boolean=!1;te.prototype.commaOrSpaceSeparated=!1;te.prototype.commaSeparated=!1;te.prototype.defined=!1;te.prototype.mustUseProperty=!1;te.prototype.number=!1;te.prototype.overloadedBoolean=!1;te.prototype.property="";te.prototype.spaceSeparated=!1;te.prototype.space=void 0;let oo=0;const F=Ne(),Y=Ne(),en=Ne(),v=Ne(),J=Ne(),Me=Ne(),re=Ne();function Ne(){return 2**++oo}const tn=Object.freeze(Object.defineProperty({__proto__:null,boolean:F,booleanish:Y,commaOrSpaceSeparated:re,commaSeparated:Me,number:v,overloadedBoolean:en,spaceSeparated:J},Symbol.toStringTag,{value:"Module"})),_t=Object.keys(tn);class dn extends te{constructor(t,n,r,i){let o=-1;if(super(t,n),Jn(this,"space",i),typeof r=="number")for(;++o<_t.length;){const l=_t[o];Jn(this,_t[o],(r&tn[l])===tn[l])}}}dn.prototype.defined=!0;function Jn(e,t,n){n&&(e[t]=n)}function $e(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new dn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Zt(r)]=r,n[Zt(o.attribute)]=r}return new st(t,n,e.space)}const Ur=$e({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:v,ariaColIndex:v,ariaColSpan:v,ariaControls:J,ariaCurrent:null,ariaDescribedBy:J,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:J,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:J,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:J,ariaLevel:v,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:J,ariaPlaceholder:null,ariaPosInSet:v,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:J,ariaRowCount:v,ariaRowIndex:v,ariaRowSpan:v,ariaSelected:Y,ariaSetSize:v,ariaSort:null,ariaValueMax:v,ariaValueMin:v,ariaValueNow:v,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function qr(e,t){return t in e?e[t]:t}function Hr(e,t){return qr(e,t.toLowerCase())}const ao=$e({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Me,acceptCharset:J,accessKey:J,action:null,allow:null,allowFullScreen:F,allowPaymentRequest:F,allowUserMedia:F,alt:null,as:null,async:F,autoCapitalize:null,autoComplete:J,autoFocus:F,autoPlay:F,blocking:J,capture:null,charSet:null,checked:F,cite:null,className:J,cols:v,colSpan:null,content:null,contentEditable:Y,controls:F,controlsList:J,coords:v|Me,crossOrigin:null,data:null,dateTime:null,decoding:null,default:F,defer:F,dir:null,dirName:null,disabled:F,download:en,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:F,formTarget:null,headers:J,height:v,hidden:en,high:v,href:null,hrefLang:null,htmlFor:J,httpEquiv:J,id:null,imageSizes:null,imageSrcSet:null,inert:F,inputMode:null,integrity:null,is:null,isMap:F,itemId:null,itemProp:J,itemRef:J,itemScope:F,itemType:J,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:F,low:v,manifest:null,max:null,maxLength:v,media:null,method:null,min:null,minLength:v,multiple:F,muted:F,name:null,nonce:null,noModule:F,noValidate:F,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:F,optimum:v,pattern:null,ping:J,placeholder:null,playsInline:F,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:F,referrerPolicy:null,rel:J,required:F,reversed:F,rows:v,rowSpan:v,sandbox:J,scope:null,scoped:F,seamless:F,selected:F,shadowRootClonable:F,shadowRootDelegatesFocus:F,shadowRootMode:null,shape:null,size:v,sizes:null,slot:null,span:v,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:v,step:null,style:null,tabIndex:v,target:null,title:null,translate:null,type:null,typeMustMatch:F,useMap:null,value:Y,width:v,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:J,axis:null,background:null,bgColor:null,border:v,borderColor:null,bottomMargin:v,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:F,declare:F,event:null,face:null,frame:null,frameBorder:null,hSpace:v,leftMargin:v,link:null,longDesc:null,lowSrc:null,marginHeight:v,marginWidth:v,noResize:F,noHref:F,noShade:F,noWrap:F,object:null,profile:null,prompt:null,rev:null,rightMargin:v,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:v,valueType:null,version:null,vAlign:null,vLink:null,vSpace:v,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:F,disableRemotePlayback:F,prefix:null,property:null,results:v,security:null,unselectable:null},space:"html",transform:Hr}),so=$e({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:re,accentHeight:v,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:v,amplitude:v,arabicForm:null,ascent:v,attributeName:null,attributeType:null,azimuth:v,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:v,by:null,calcMode:null,capHeight:v,className:J,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:v,diffuseConstant:v,direction:null,display:null,dur:null,divisor:v,dominantBaseline:null,download:F,dx:null,dy:null,edgeMode:null,editable:null,elevation:v,enableBackground:null,end:null,event:null,exponent:v,externalResourcesRequired:null,fill:null,fillOpacity:v,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:Me,g2:Me,glyphName:Me,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:v,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:v,horizOriginX:v,horizOriginY:v,id:null,ideographic:v,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:v,k:v,k1:v,k2:v,k3:v,k4:v,kernelMatrix:re,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:v,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:v,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:v,overlineThickness:v,paintOrder:null,panose1:null,path:null,pathLength:v,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:J,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:v,pointsAtY:v,pointsAtZ:v,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:re,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:re,rev:re,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:re,requiredFeatures:re,requiredFonts:re,requiredFormats:re,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:v,specularExponent:v,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:v,strikethroughThickness:v,string:null,stroke:null,strokeDashArray:re,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:v,strokeOpacity:v,strokeWidth:null,style:null,surfaceScale:v,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:re,tabIndex:v,tableValues:null,target:null,targetX:v,targetY:v,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:re,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:v,underlineThickness:v,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:v,values:null,vAlphabetic:v,vMathematical:v,vectorEffect:null,vHanging:v,vIdeographic:v,version:null,vertAdvY:v,vertOriginX:v,vertOriginY:v,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:v,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qr}),Vr=$e({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Wr=$e({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Hr}),Jr=$e({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),uo={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"},co=/[A-Z]/g,Yn=/-[a-z]/g,fo=/^data[-\w.:]+$/i;function po(e,t){const n=Zt(t);let r=t,i=te;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fo.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Yn,mo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Yn.test(o)){let l=o.replace(co,ho);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=dn}return new i(r,t)}function ho(e){return"-"+e.toLowerCase()}function mo(e){return e.charAt(1).toUpperCase()}const go=$r([Ur,ao,Vr,Wr,Jr],"html"),gn=$r([Ur,so,Vr,Wr,Jr],"svg");function xo(e){return e.join(" ").trim()}var Le={},Pt,Xn;function yo(){if(Xn)return Pt;Xn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
|
|
49
|
+
`,u="/",f="*",c="",h="comment",p="declaration";function x(E,y){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];y=y||{};var S=1,A=1;function z(P){var j=P.match(t);j&&(S+=j.length);var H=P.lastIndexOf(s);A=~H?P.length-H:A+P.length}function L(){var P={line:S,column:A};return function(j){return j.position=new C(P),$(),j}}function C(P){this.start=P,this.end={line:S,column:A},this.source=y.source}C.prototype.content=E;function O(P){var j=new Error(y.source+":"+S+":"+A+": "+P);if(j.reason=P,j.filename=y.source,j.line=S,j.column=A,j.source=E,!y.silent)throw j}function U(P){var j=P.exec(E);if(j){var H=j[0];return z(H),E=E.slice(H.length),j}}function $(){U(n)}function k(P){var j;for(P=P||[];j=T();)j!==!1&&P.push(j);return P}function T(){var P=L();if(!(u!=E.charAt(0)||f!=E.charAt(1))){for(var j=2;c!=E.charAt(j)&&(f!=E.charAt(j)||u!=E.charAt(j+1));)++j;if(j+=2,c===E.charAt(j-1))return O("End of comment missing");var H=E.slice(2,j-2);return A+=2,z(H),E=E.slice(j),A+=2,P({type:h,comment:H})}}function N(){var P=L(),j=U(r);if(j){if(T(),!U(i))return O("property missing ':'");var H=U(o),X=P({type:p,property:b(j[0].replace(e,c)),value:H?b(H[0].replace(e,c)):c});return U(l),X}}function q(){var P=[];k(P);for(var j;j=N();)j!==!1&&(P.push(j),k(P));return P}return $(),q()}function b(E){return E?E.replace(a,c):c}return Pt=x,Pt}var Gn;function ko(){if(Gn)return Le;Gn=1;var e=Le&&Le.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Le,"__esModule",{value:!0}),Le.default=n;const t=e(yo());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:f}=s;a?i(u,f,s):f&&(o=o||{},o[u]=f)}),o}return Le}var We={},Kn;function bo(){if(Kn)return We;Kn=1,Object.defineProperty(We,"__esModule",{value:!0}),We.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return We.camelCase=s,We}var Je,Qn;function wo(){if(Qn)return Je;Qn=1;var e=Je&&Je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ko()),n=bo();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,Je=r,Je}var So=wo();const Co=Fr(So),Yr=Xr("end"),xn=Xr("start");function Xr(e){return t;function t(n){const r=n&&n.position&&n.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 Eo(e){const t=xn(e),n=Yr(e);if(t&&n)return{start:t,end:n}}function Ge(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Zn(e.position):"start"in e||"end"in e?Zn(e):"line"in e||"column"in e?nn(e):""}function nn(e){return er(e&&e.line)+":"+er(e&&e.column)}function Zn(e){return nn(e&&e.start)+"-"+nn(e&&e.end)}function er(e){return e&&typeof e=="number"?e:1}class Q extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ge(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Q.prototype.file="";Q.prototype.name="";Q.prototype.reason="";Q.prototype.message="";Q.prototype.stack="";Q.prototype.column=void 0;Q.prototype.line=void 0;Q.prototype.ancestors=void 0;Q.prototype.cause=void 0;Q.prototype.fatal=void 0;Q.prototype.place=void 0;Q.prototype.ruleId=void 0;Q.prototype.source=void 0;const yn={}.hasOwnProperty,Ao=new Map,vo=/[A-Z]/g,Io=new Set(["table","tbody","thead","tfoot","tr"]),jo=new Set(["td","th"]),Gr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function To(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Mo(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Fo(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?gn:go,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Kr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Kr(e,t,n){if(t.type==="element")return No(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return _o(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return zo(e,t,n);if(t.type==="mdxjsEsm")return Po(e,t);if(t.type==="root")return Lo(e,t,n);if(t.type==="text")return Do(e,t)}function No(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=gn,e.schema=i),e.ancestors.push(t);const o=Zr(e,t.tagName,!1),l=Oo(e,t);let a=bn(e,t);return Io.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!lo(s):!0})),Qr(e,l,o,t),kn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function _o(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tt(e,t.position)}function Po(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tt(e,t.position)}function zo(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=gn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Zr(e,t.name,!0),l=Ro(e,t),a=bn(e,t);return Qr(e,l,o,t),kn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Lo(e,t,n){const r={};return kn(r,bn(e,t)),e.create(t,e.Fragment,r,n)}function Do(e,t){return t.value}function Qr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Fo(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Mo(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=xn(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Oo(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&yn.call(t.properties,i)){const o=Bo(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&jo.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ro(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else tt(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else tt(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function bn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Ao;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){const u=i.get(s)||0;l=s+"-"+u,i.set(s,u+1)}}const a=Kr(e,o,l);a!==void 0&&n.push(a)}return n}function Bo(e,t,n){const r=po(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?eo(n):xo(n)),r.property==="style"){let i=typeof n=="object"?n:$o(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Uo(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?uo[r.property]||r.property:r.attribute,n]}}function $o(e,t){try{return Co(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Q("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=Gr+"#cannot-parse-style-attribute",i}}function Zr(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=Vn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Vn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return yn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);tt(e)}function tt(e,t){const n=new Q("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Gr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Uo(e){const t={};let n;for(n in e)yn.call(e,n)&&(t[qo(n)]=e[n]);return t}function qo(e){let t=e.replace(vo,Ho);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Ho(e){return"-"+e.toLowerCase()}const zt={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"]},Vo={};function wn(e,t){const n=Vo,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return ei(e,r,i)}function ei(e,t,n){if(Wo(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return tr(e.children,t,n)}return Array.isArray(e)?tr(e,t,n):""}function tr(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=ei(e[i],t,n);return r.join("")}function Wo(e){return!!(e&&typeof e=="object")}const nr=document.createElement("i");function Sn(e){const t="&"+e+";";nr.innerHTML=t;const n=nr.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ie(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function le(e,t){return e.length>0?(ie(e,e.length,0,t),e):t}const rr={}.hasOwnProperty;function ti(e){const t={};let n=-1;for(;++n<e.length;)Jo(t,e[n]);return t}function Jo(e,t){let n;for(n in t){const i=(rr.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){rr.call(i,l)||(i[l]=[]);const a=o[l];Yo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function Yo(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ie(e,0,0,r)}function ni(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Z=Ee(/[A-Za-z]/),K=Ee(/[\dA-Za-z]/),Xo=Ee(/[#-'*+\--9=?A-Z^-~]/);function St(e){return e!==null&&(e<32||e===127)}const rn=Ee(/\d/),Go=Ee(/[\dA-Fa-f]/),Ko=Ee(/[!-/:-@[-`{-~]/);function _(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function M(e){return e===-2||e===-1||e===32}const vt=Ee(new RegExp("\\p{P}|\\p{S}","u")),Te=Ee(/\s/);function Ee(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ue(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&K(e.charCodeAt(n+1))&&K(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return M(s)?(e.enter(n),a(s)):t(s)}function a(s){return M(s)&&o++<i?(e.consume(s),a):(e.exit(n),t(s))}}const Qo={tokenize:Zo};function Zo(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),B(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const s=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=s),n=s,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return _(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const ea={tokenize:ta},ir={tokenize:na};function ta(e){const t=this,n=[];let r=0,i,o,l;return a;function a(A){if(r<n.length){const z=n[r];return t.containerState=z[1],e.attempt(z[0].continuation,s,u)(A)}return u(A)}function s(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const z=t.events.length;let L=z,C;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){C=t.events[L][1].end;break}y(r);let O=z;for(;O<t.events.length;)t.events[O][1].end={...C},O++;return ie(t.events,L+1,0,t.events.slice(z)),t.events.length=O,u(A)}return a(A)}function u(A){if(r===n.length){if(!i)return h(A);if(i.currentConstruct&&i.currentConstruct.concrete)return x(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ir,f,c)(A)}function f(A){return i&&S(),y(r),h(A)}function c(A){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,x(A)}function h(A){return t.containerState={},e.attempt(ir,p,x)(A)}function p(A){return r++,n.push([t.currentConstruct,t.containerState]),h(A)}function x(A){if(A===null){i&&S(),y(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(A)}function b(A){if(A===null){E(e.exit("chunkFlow"),!0),y(0),e.consume(A);return}return _(A)?(e.consume(A),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(A),b)}function E(A,z){const L=t.sliceStream(A);if(z&&L.push(null),A.previous=o,o&&(o.next=A),o=A,i.defineSkip(A.start),i.write(L),t.parser.lazy[A.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<l&&(!i.events[C][1].end||i.events[C][1].end.offset>l))return;const O=t.events.length;let U=O,$,k;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if($){k=t.events[U][1].end;break}$=!0}for(y(r),C=O;C<t.events.length;)t.events[C][1].end={...k},C++;ie(t.events,U+1,0,t.events.slice(O)),t.events.length=C}}function y(A){let z=n.length;for(;z-- >A;){const L=n[z];t.containerState=L[1],L[0].exit.call(t,e)}n.length=A}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function na(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Oe(e){if(e===null||W(e)||Te(e))return 1;if(vt(e))return 2}function It(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const ln={name:"attention",resolveAll:ra,tokenize:ia};function ra(e,t){let n=-1,r,i,o,l,a,s,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},h={...e[n][1].start};lr(c,-s),lr(h,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,It(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,ie(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function ia(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Oe(r);let o;return l;function l(s){return o=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===o)return e.consume(s),a;const u=e.exit("attentionSequence"),f=Oe(s),c=!f||f===2&&i||n.includes(s),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(s)}}function lr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const la={name:"autolink",tokenize:oa};function oa(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return Z(p)?(e.consume(p),l):p===64?n(p):u(p)}function l(p){return p===43||p===45||p===46||K(p)?(r=1,a(p)):u(p)}function a(p){return p===58?(e.consume(p),r=0,s):(p===43||p===45||p===46||K(p))&&r++<32?(e.consume(p),a):(r=0,u(p))}function s(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||St(p)?n(p):(e.consume(p),s)}function u(p){return p===64?(e.consume(p),f):Xo(p)?(e.consume(p),u):n(p)}function f(p){return K(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):h(p)}function h(p){if((p===45||K(p))&&r++<63){const x=p===45?h:c;return e.consume(p),x}return n(p)}}const ut={partial:!0,tokenize:aa};function aa(e,t,n){return r;function r(o){return M(o)?B(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||_(o)?t(o):n(o)}}const ri={continuation:{tokenize:ua},exit:ca,name:"blockQuote",tokenize:sa};function sa(e,t,n){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return M(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function ua(e,t,n){const r=this;return i;function i(l){return M(l)?B(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(ri,t,n)(l)}}function ca(e){e.exit("blockQuote")}const ii={name:"characterEscape",tokenize:fa};function fa(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Ko(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const li={name:"characterReference",tokenize:pa};function pa(e,t,n){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),s}function s(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=K,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=Go,f):(e.enter("characterReferenceValue"),o=7,l=rn,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return l===K&&!Sn(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const or={partial:!0,tokenize:ma},ar={concrete:!0,name:"codeFenced",tokenize:ha};function ha(e,t,n){const r=this,i={partial:!0,tokenize:L};let o=0,l=0,a;return s;function s(C){return u(C)}function u(C){const O=r.events[r.events.length-1];return o=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(C)}function f(C){return C===a?(l++,e.consume(C),f):l<3?n(C):(e.exit("codeFencedFenceSequence"),M(C)?B(e,c,"whitespace")(C):c(C))}function c(C){return C===null||_(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(or,b,z)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(C))}function h(C){return C===null||_(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(C)):M(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),B(e,p,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),h)}function p(C){return C===null||_(C)?c(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(C))}function x(C){return C===null||_(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(C)):C===96&&C===a?n(C):(e.consume(C),x)}function b(C){return e.attempt(i,z,E)(C)}function E(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),y}function y(C){return o>0&&M(C)?B(e,S,"linePrefix",o+1)(C):S(C)}function S(C){return C===null||_(C)?e.check(or,b,z)(C):(e.enter("codeFlowValue"),A(C))}function A(C){return C===null||_(C)?(e.exit("codeFlowValue"),S(C)):(e.consume(C),A)}function z(C){return e.exit("codeFenced"),t(C)}function L(C,O,U){let $=0;return k;function k(j){return C.enter("lineEnding"),C.consume(j),C.exit("lineEnding"),T}function T(j){return C.enter("codeFencedFence"),M(j)?B(C,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):N(j)}function N(j){return j===a?(C.enter("codeFencedFenceSequence"),q(j)):U(j)}function q(j){return j===a?($++,C.consume(j),q):$>=l?(C.exit("codeFencedFenceSequence"),M(j)?B(C,P,"whitespace")(j):P(j)):U(j)}function P(j){return j===null||_(j)?(C.exit("codeFencedFence"),O(j)):U(j)}}}function ma(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Lt={name:"codeIndented",tokenize:ga},da={partial:!0,tokenize:xa};function ga(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):_(u)?e.attempt(da,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||_(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function xa(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):_(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):_(l)?i(l):n(l)}}const ya={name:"codeText",previous:ba,resolve:ka,tokenize:wa};function ka(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||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),t-=r-i-2,r=i+2),i=void 0);return e}function ba(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wa(e,t,n){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),s(c))}function s(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),s):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):_(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||_(c)?(e.exit("codeTextData"),s(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class Sa{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ye(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ye(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ye(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ye(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ye(this.left,n.reverse())}}}function Ye(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function oi(e){const t={};let n=-1,r,i,o,l,a,s,u;const f=new Sa(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ca(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return ie(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Ca(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,s=[],u={};let f,c,h=-1,p=n,x=0,b=0;const E=[b];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),c&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++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&&(b=h+1,E.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):E.pop(),h=E.length;h--;){const y=a.slice(E[h],E[h+1]),S=o.pop();s.push([S,S+y.length-1]),e.splice(S,2,y)}for(s.reverse(),h=-1;++h<s.length;)u[x+s[h][0]]=x+s[h][1],x+=s[h][1]-s[h][0]-1;return u}const Ea={resolve:va,tokenize:Ia},Aa={partial:!0,tokenize:ja};function va(e){return oi(e),e}function Ia(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):_(a)?e.check(Aa,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function ja(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),B(e,o,"linePrefix")}function o(l){if(l===null||_(l))return n(l);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?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function ai(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),h):y===null||y===32||y===41||St(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(y))}function h(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(a),h(y)):y===null||y===60||_(y)?n(y):(e.consume(y),y===92?x:p)}function x(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!f&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,b):y===41?(e.consume(y),f--,b):y===null||y===32||y===40||St(y)?n(y):(e.consume(y),y===92?E:b)}function E(y){return y===40||y===41||y===92?(e.consume(y),b):b(y)}}function si(e,t,n,r,i,o){const l=this;let a=0,s;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),f}function f(p){return a>999||p===null||p===91||p===93&&!s||p===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):_(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||_(p)||a++>999?(e.exit("chunkString"),f(p)):(e.consume(p),s||(s=!M(p)),p===92?h:c)}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function ui(e,t,n,r,i,o){let l;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),l=h===40?41:h,s):n(h)}function s(h){return h===l?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===l?(e.exit(o),s(l)):h===null?n(h):_(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===l||h===null||_(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===l||h===92?(e.consume(h),f):f(h)}}function Ke(e,t){let n;return r;function r(i){return _(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):M(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Ta={name:"definition",tokenize:_a},Na={partial:!0,tokenize:Pa};function _a(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),l(p)}function l(p){return si.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),s):n(p)}function s(p){return W(p)?Ke(e,u)(p):u(p)}function u(p){return ai(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Na,c,c)(p)}function c(p){return M(p)?B(e,h,"whitespace")(p):h(p)}function h(p){return p===null||_(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function Pa(e,t,n){return r;function r(a){return W(a)?Ke(e,i)(a):n(a)}function i(a){return ui(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return M(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||_(a)?t(a):n(a)}}const za={name:"hardBreakEscape",tokenize:La};function La(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return _(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Da={name:"headingAtx",resolve:Fa,tokenize:Ma};function Fa(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ma(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||W(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||_(f)?(e.exit("atxHeading"),t(f)):M(f)?B(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||W(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const Oa=["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"],sr=["pre","script","style","textarea"],Ra={concrete:!0,name:"htmlFlow",resolveTo:Ua,tokenize:qa},Ba={partial:!0,tokenize:Va},$a={partial:!0,tokenize:Ha};function Ua(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qa(e,t,n){const r=this;let i,o,l,a,s;return u;function u(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),h):g===47?(e.consume(g),o=!0,b):g===63?(e.consume(g),i=3,r.interrupt?t:d):Z(g)?(e.consume(g),l=String.fromCharCode(g),E):n(g)}function h(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,x):Z(g)?(e.consume(g),i=4,r.interrupt?t:d):n(g)}function p(g){return g===45?(e.consume(g),r.interrupt?t:d):n(g)}function x(g){const se="CDATA[";return g===se.charCodeAt(a++)?(e.consume(g),a===se.length?r.interrupt?t:N:x):n(g)}function b(g){return Z(g)?(e.consume(g),l=String.fromCharCode(g),E):n(g)}function E(g){if(g===null||g===47||g===62||W(g)){const se=g===47,Ae=l.toLowerCase();return!se&&!o&&sr.includes(Ae)?(i=1,r.interrupt?t(g):N(g)):Oa.includes(l.toLowerCase())?(i=6,se?(e.consume(g),y):r.interrupt?t(g):N(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?S(g):A(g))}return g===45||K(g)?(e.consume(g),l+=String.fromCharCode(g),E):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:N):n(g)}function S(g){return M(g)?(e.consume(g),S):k(g)}function A(g){return g===47?(e.consume(g),k):g===58||g===95||Z(g)?(e.consume(g),z):M(g)?(e.consume(g),A):k(g)}function z(g){return g===45||g===46||g===58||g===95||K(g)?(e.consume(g),z):L(g)}function L(g){return g===61?(e.consume(g),C):M(g)?(e.consume(g),L):A(g)}function C(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),s=g,O):M(g)?(e.consume(g),C):U(g)}function O(g){return g===s?(e.consume(g),s=null,$):g===null||_(g)?n(g):(e.consume(g),O)}function U(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||W(g)?L(g):(e.consume(g),U)}function $(g){return g===47||g===62||M(g)?A(g):n(g)}function k(g){return g===62?(e.consume(g),T):n(g)}function T(g){return g===null||_(g)?N(g):M(g)?(e.consume(g),T):n(g)}function N(g){return g===45&&i===2?(e.consume(g),H):g===60&&i===1?(e.consume(g),X):g===62&&i===4?(e.consume(g),ae):g===63&&i===3?(e.consume(g),d):g===93&&i===5?(e.consume(g),me):_(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Ba,de,q)(g)):g===null||_(g)?(e.exit("htmlFlowData"),q(g)):(e.consume(g),N)}function q(g){return e.check($a,P,de)(g)}function P(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),j}function j(g){return g===null||_(g)?q(g):(e.enter("htmlFlowData"),N(g))}function H(g){return g===45?(e.consume(g),d):N(g)}function X(g){return g===47?(e.consume(g),l="",oe):N(g)}function oe(g){if(g===62){const se=l.toLowerCase();return sr.includes(se)?(e.consume(g),ae):N(g)}return Z(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),oe):N(g)}function me(g){return g===93?(e.consume(g),d):N(g)}function d(g){return g===62?(e.consume(g),ae):g===45&&i===2?(e.consume(g),d):N(g)}function ae(g){return g===null||_(g)?(e.exit("htmlFlowData"),de(g)):(e.consume(g),ae)}function de(g){return e.exit("htmlFlow"),t(g)}}function Ha(e,t,n){const r=this;return i;function i(l){return _(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function Va(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(ut,t,n)}}const Wa={name:"htmlText",tokenize:Ja};function Ja(e,t,n){const r=this;let i,o,l;return a;function a(d){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(d),s}function s(d){return d===33?(e.consume(d),u):d===47?(e.consume(d),L):d===63?(e.consume(d),A):Z(d)?(e.consume(d),U):n(d)}function u(d){return d===45?(e.consume(d),f):d===91?(e.consume(d),o=0,x):Z(d)?(e.consume(d),S):n(d)}function f(d){return d===45?(e.consume(d),p):n(d)}function c(d){return d===null?n(d):d===45?(e.consume(d),h):_(d)?(l=c,X(d)):(e.consume(d),c)}function h(d){return d===45?(e.consume(d),p):c(d)}function p(d){return d===62?H(d):d===45?h(d):c(d)}function x(d){const ae="CDATA[";return d===ae.charCodeAt(o++)?(e.consume(d),o===ae.length?b:x):n(d)}function b(d){return d===null?n(d):d===93?(e.consume(d),E):_(d)?(l=b,X(d)):(e.consume(d),b)}function E(d){return d===93?(e.consume(d),y):b(d)}function y(d){return d===62?H(d):d===93?(e.consume(d),y):b(d)}function S(d){return d===null||d===62?H(d):_(d)?(l=S,X(d)):(e.consume(d),S)}function A(d){return d===null?n(d):d===63?(e.consume(d),z):_(d)?(l=A,X(d)):(e.consume(d),A)}function z(d){return d===62?H(d):A(d)}function L(d){return Z(d)?(e.consume(d),C):n(d)}function C(d){return d===45||K(d)?(e.consume(d),C):O(d)}function O(d){return _(d)?(l=O,X(d)):M(d)?(e.consume(d),O):H(d)}function U(d){return d===45||K(d)?(e.consume(d),U):d===47||d===62||W(d)?$(d):n(d)}function $(d){return d===47?(e.consume(d),H):d===58||d===95||Z(d)?(e.consume(d),k):_(d)?(l=$,X(d)):M(d)?(e.consume(d),$):H(d)}function k(d){return d===45||d===46||d===58||d===95||K(d)?(e.consume(d),k):T(d)}function T(d){return d===61?(e.consume(d),N):_(d)?(l=T,X(d)):M(d)?(e.consume(d),T):$(d)}function N(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),i=d,q):_(d)?(l=N,X(d)):M(d)?(e.consume(d),N):(e.consume(d),P)}function q(d){return d===i?(e.consume(d),i=void 0,j):d===null?n(d):_(d)?(l=q,X(d)):(e.consume(d),q)}function P(d){return d===null||d===34||d===39||d===60||d===61||d===96?n(d):d===47||d===62||W(d)?$(d):(e.consume(d),P)}function j(d){return d===47||d===62||W(d)?$(d):n(d)}function H(d){return d===62?(e.consume(d),e.exit("htmlTextData"),e.exit("htmlText"),t):n(d)}function X(d){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),oe}function oe(d){return M(d)?B(e,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):me(d)}function me(d){return e.enter("htmlTextData"),l(d)}}const Cn={name:"labelEnd",resolveAll:Ka,resolveTo:Qa,tokenize:Za},Ya={tokenize:es},Xa={tokenize:ts},Ga={tokenize:ns};function Ka(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ie(e,0,e.length,n),e}function Qa(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",s,t],["enter",u,t]],a=le(a,e.slice(o+1,o+r+3)),a=le(a,[["enter",f,t]]),a=le(a,It(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=le(a,[["exit",f,t],e[l-2],e[l-1],["exit",u,t]]),a=le(a,e.slice(l+1)),a=le(a,[["exit",s,t]]),ie(e,o,e.length,a),e}function Za(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(l=r.parser.defined.includes(ce(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),s):n(h)}function s(h){return h===40?e.attempt(Ya,f,l?f:c)(h):h===91?e.attempt(Xa,f,l?u:c)(h):l?f(h):c(h)}function u(h){return e.attempt(Ga,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function es(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return W(c)?Ke(e,o)(c):o(c)}function o(c){return c===41?f(c):ai(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return W(c)?Ke(e,s)(c):f(c)}function a(c){return n(c)}function s(c){return c===34||c===39||c===40?ui(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return W(c)?Ke(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function ts(e,t,n){const r=this;return i;function i(a){return si.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function ns(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const rs={name:"labelStartImage",resolveAll:Cn.resolveAll,tokenize:is};function is(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ls={name:"labelStartLink",resolveAll:Cn.resolveAll,tokenize:os};function os(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Dt={name:"lineEnding",tokenize:as};function as(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),B(e,t,"linePrefix")}}const xt={name:"thematicBreak",tokenize:ss};function ss(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||_(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),M(u)?B(e,a,"whitespace")(u):a(u))}}const ee={continuation:{tokenize:ps},exit:ms,name:"list",tokenize:fs},us={partial:!0,tokenize:ds},cs={partial:!0,tokenize:hs};function fs(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:rn(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(xt,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(p)}return n(p)}function s(p){return rn(p)&&++l<10?(e.consume(p),s):(!r.interrupt||l<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(ut,r.interrupt?n:f,e.attempt(us,h,c))}function f(p){return r.containerState.initialBlankLine=!0,o++,h(p)}function c(p){return M(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),h):n(p)}function h(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function ps(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(ut,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!M(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cs,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(ee,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function hs(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function ms(e){e.exit(this.containerState.type)}function ds(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!M(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ur={name:"setextUnderline",resolveTo:gs,tokenize:xs};function gs(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function xs(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),M(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||_(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const ys={tokenize:ks};function ks(e){const t=this,n=e.attempt(ut,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ea,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const bs={resolveAll:fi()},ws=ci("string"),Ss=ci("text");function ci(e){return{resolveAll:fi(e==="text"?Cs:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),s}function s(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),s)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const p=c[h];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function fi(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Cs(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,a=0,s;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(u===-2)s=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,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(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Es={42:ee,43:ee,45:ee,48:ee,49:ee,50:ee,51:ee,52:ee,53:ee,54:ee,55:ee,56:ee,57:ee,62:ri},As={91:Ta},vs={[-2]:Lt,[-1]:Lt,32:Lt},Is={35:Da,42:xt,45:[ur,xt],60:Ra,61:ur,95:xt,96:ar,126:ar},js={38:li,92:ii},Ts={[-5]:Dt,[-4]:Dt,[-3]:Dt,33:rs,38:li,42:ln,60:[la,Wa],91:ls,92:[za,ii],93:Cn,95:ln,96:ya},Ns={null:[ln,bs]},_s={null:[42,95]},Ps={null:[]},zs=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_s,contentInitial:As,disable:Ps,document:Es,flow:Is,flowInitial:vs,insideSpan:Ns,string:js,text:Ts},Symbol.toStringTag,{value:"Module"}));function Ls(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],a=[];const s={attempt:O(L),check:O(C),consume:S,enter:A,exit:z,interrupt:O(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:h,sliceStream:p,write:c};let f=t.tokenize.call(u,s);return t.resolveAll&&o.push(t),u;function c(T){return l=le(l,T),E(),l[l.length-1]!==null?[]:(U(t,0),u.events=It(o,u.events,u),u.events)}function h(T,N){return Fs(p(T),N)}function p(T){return Ds(l,T)}function x(){const{_bufferIndex:T,_index:N,line:q,column:P,offset:j}=r;return{_bufferIndex:T,_index:N,line:q,column:P,offset:j}}function b(T){i[T.line]=T.column,k()}function E(){let T;for(;r._index<l.length;){const N=l[r._index];if(typeof N=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<N.length;)y(N.charCodeAt(r._bufferIndex));else y(N)}}function y(T){f=f(T)}function S(T){_(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,k()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=T}function A(T,N){const q=N||{};return q.type=T,q.start=x(),u.events.push(["enter",q,u]),a.push(q),q}function z(T){const N=a.pop();return N.end=x(),u.events.push(["exit",N,u]),N}function L(T,N){U(T,N.from)}function C(T,N){N.restore()}function O(T,N){return q;function q(P,j,H){let X,oe,me,d;return Array.isArray(P)?de(P):"tokenize"in P?de([P]):ae(P);function ae(G){return qe;function qe(be){const _e=be!==null&&G[be],Pe=be!==null&&G.null,ft=[...Array.isArray(_e)?_e:_e?[_e]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return de(ft)(be)}}function de(G){return X=G,oe=0,G.length===0?H:g(G[oe])}function g(G){return qe;function qe(be){return d=$(),me=G,G.partial||(u.currentConstruct=G),G.name&&u.parser.constructs.disable.null.includes(G.name)?Ae():G.tokenize.call(N?Object.assign(Object.create(u),N):u,s,se,Ae)(be)}}function se(G){return T(me,d),j}function Ae(G){return d.restore(),++oe<X.length?g(X[oe]):H}}}function U(T,N){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&ie(u.events,N,u.events.length-N,T.resolve(u.events.slice(N),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function $(){const T=x(),N=u.previous,q=u.currentConstruct,P=u.events.length,j=Array.from(a);return{from:P,restore:H};function H(){r=T,u.previous=N,u.currentConstruct=q,u.events.length=P,a=j,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ds(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Fs(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
50
50
|
`;break}case-3:{l=`\r
|
|
51
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Fs(e){const r={constructs:ti([Ps,...(e||{}).extensions||[]]),content:i(Ko),defined:[],document:i(Zo),flow:i(xs),lazy:{},string:i(bs),text:i(ws)};return r;function i(o){return l;function l(a){return zs(r,o,a)}}}function Ms(e){for(;!oi(e););return e}const cr=/[\0\t\n\r]/g;function Os(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,h,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(cr.lastIndex=c,s=cr.exec(o),h=s&&s.index!==void 0?s.index:o.length,p=o.charCodeAt(h),!s){t=o.slice(c);break}if(p===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(o.slice(c,h)),e+=h-c),p){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Rs=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Bs(e){return e.replace(Rs,$s)}function $s(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return ni(n.slice(o?2:1),o?16:10)}return Sn(n)||e}const pi={}.hasOwnProperty;function Us(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),qs(n)(Ms(Fs(n).document().write(Os()(e,t,!0))))}function qs(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(On),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(Dn),blockQuote:o(_e),characterEscape:$,characterReference:$,codeFenced:o(ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(ft,l),codeText:o(Zi,l),codeTextData:$,data:$,codeFlowValue:$,definition:o(el),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(tl),hardBreakEscape:o(Fn),hardBreakTrailing:o(Fn),htmlFlow:o(Mn,l),htmlFlowData:$,htmlText:o(Mn,l),htmlTextData:$,image:o(nl),label:l,link:o(On),listItem:o(rl),listItemValue:h,listOrdered:o(Rn,c),listUnordered:o(Rn),paragraph:o(il),reference:g,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Dn),strong:o(ll),thematicBreak:o(al)},exit:{atxHeading:u(),atxHeadingSequence:L,autolink:u(),autolinkEmail:Ne,autolinkProtocol:be,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:G,characterReference:Ue,codeFenced:u(E),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:k,codeIndented:u(y),codeText:u(j),codeTextData:k,data:k,definition:u(),definitionDestinationString:z,definitionLabelString:S,definitionTitleString:A,emphasis:u(),hardBreakEscape:u(N),hardBreakTrailing:u(N),htmlFlow:u(q),htmlFlowData:k,htmlText:u(P),htmlTextData:k,image:u(X),label:me,labelText:oe,lineEnding:T,link:u(H),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:se,resourceDestinationString:d,resourceTitleString:ae,resource:de,setextHeading:u(U),setextHeadingLineSequence:O,setextHeadingText:C,strong:u(),thematicBreak:u()}};hi(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(w){let I={type:"root",children:[]};const D={stack:[I],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:f,data:n},R=[];let V=-1;for(;++V<w.length;)if(w[V][1].type==="listOrdered"||w[V][1].type==="listUnordered")if(w[V][0]==="enter")R.push(V);else{const ue=R.pop();V=i(w,ue,V)}for(V=-1;++V<w.length;){const ue=t[w[V][0]];pi.call(ue,w[V][1].type)&&ue[w[V][1].type].call(Object.assign({sliceSerialize:w[V][2].sliceSerialize},D),w[V][1])}if(D.tokenStack.length>0){const ue=D.tokenStack[D.tokenStack.length-1];(ue[1]||fr).call(D,void 0,ue[0])}for(I.position={start:we(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:we(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<t.transforms.length;)I=t.transforms[V](I)||I;return I}function i(w,I,D){let R=I-1,V=-1,ue=!1,ve,ge,qe,He;for(;++R<=D;){const ne=w[R];switch(ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ne[0]==="enter"?V++:V--,He=void 0;break}case"lineEndingBlank":{ne[0]==="enter"&&(ve&&!He&&!V&&!qe&&(qe=R),He=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:He=void 0}if(!V&&ne[0]==="enter"&&ne[1].type==="listItemPrefix"||V===-1&&ne[0]==="exit"&&(ne[1].type==="listUnordered"||ne[1].type==="listOrdered")){if(ve){let Pe=R;for(ge=void 0;Pe--;){const xe=w[Pe];if(xe[1].type==="lineEnding"||xe[1].type==="lineEndingBlank"){if(xe[0]==="exit")continue;ge&&(w[ge][1].type="lineEndingBlank",ue=!0),xe[1].type="lineEnding",ge=Pe}else if(!(xe[1].type==="linePrefix"||xe[1].type==="blockQuotePrefix"||xe[1].type==="blockQuotePrefixWhitespace"||xe[1].type==="blockQuoteMarker"||xe[1].type==="listItemIndent"))break}qe&&(!ge||qe<ge)&&(ve._spread=!0),ve.end=Object.assign({},ge?w[ge][1].start:ne[1].end),w.splice(ge||R,0,["exit",ve,ne[2]]),R++,D++}if(ne[1].type==="listItemPrefix"){const Pe={type:"listItem",_spread:!1,start:Object.assign({},ne[1].start),end:void 0};ve=Pe,w.splice(R,0,["enter",Pe,ne[2]]),R++,D++,qe=void 0,He=!0}}}return w[I][1]._spread=ue,D}function o(w,I){return D;function D(R){a.call(this,w(R),R),I&&I.call(this,R)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(w,I,D){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([I,D||void 0]),w.position={start:we(I.start),end:void 0}}function u(w){return I;function I(D){w&&w.call(this,D),s.call(this,D)}}function s(w,I){const D=this.stack.pop(),R=this.tokenStack.pop();if(R)R[0].type!==w.type&&(I?I.call(this,w,R[0]):(R[1]||fr).call(this,w,R[0]));else throw new Error("Cannot close `"+w.type+"` ("+Ge({start:w.start,end:w.end})+"): it’s not open");D.position.end=we(w.end)}function f(){return wn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(w){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function p(){const w=this.resume(),I=this.stack[this.stack.length-1];I.lang=w}function x(){const w=this.resume(),I=this.stack[this.stack.length-1];I.meta=w}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/(\r?\n|\r)$/g,"")}function S(w){const I=this.resume(),D=this.stack[this.stack.length-1];D.label=I,D.identifier=ce(this.sliceSerialize(w)).toLowerCase()}function A(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function z(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function L(w){const I=this.stack[this.stack.length-1];if(!I.depth){const D=this.sliceSerialize(w).length;I.depth=D}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function O(w){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function $(w){const D=this.stack[this.stack.length-1].children;let R=D[D.length-1];(!R||R.type!=="text")&&(R=ol(),R.position={start:we(w.start),end:void 0},D.push(R)),this.stack.push(R)}function k(w){const I=this.stack.pop();I.value+=this.sliceSerialize(w),I.position.end=we(w.end)}function T(w){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=I.children[I.children.length-1];D.position.end=we(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&($.call(this,w),k.call(this,w))}function N(){this.data.atHardBreak=!0}function q(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function P(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function j(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function H(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function X(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function oe(w){const I=this.sliceSerialize(w),D=this.stack[this.stack.length-2];D.label=Bs(I),D.identifier=ce(I).toLowerCase()}function me(){const w=this.stack[this.stack.length-1],I=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const R=w.children;D.children=R}else D.alt=I}function d(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function ae(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function de(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function se(w){const I=this.resume(),D=this.stack[this.stack.length-1];D.label=I,D.identifier=ce(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Ae(w){this.data.characterReferenceType=w.type}function G(w){const I=this.sliceSerialize(w),D=this.data.characterReferenceType;let R;D?(R=ni(I,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):R=Sn(I);const V=this.stack[this.stack.length-1];V.value+=R}function Ue(w){const I=this.stack.pop();I.position.end=we(w.end)}function be(w){k.call(this,w);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(w)}function Ne(w){k.call(this,w);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(w)}function _e(){return{type:"blockquote",children:[]}}function ft(){return{type:"code",lang:null,meta:null,value:""}}function Zi(){return{type:"inlineCode",value:""}}function el(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tl(){return{type:"emphasis",children:[]}}function Dn(){return{type:"heading",depth:0,children:[]}}function Fn(){return{type:"break"}}function Mn(){return{type:"html",value:""}}function nl(){return{type:"image",title:null,url:"",alt:null}}function On(){return{type:"link",title:null,url:"",children:[]}}function Rn(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function rl(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function il(){return{type:"paragraph",children:[]}}function ll(){return{type:"strong",children:[]}}function ol(){return{type:"text",value:""}}function al(){return{type:"thematicBreak"}}}function we(e){return{line:e.line,column:e.column,offset:e.offset}}function hi(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?hi(e,r):Hs(e,r)}}function Hs(e,t){let n;for(n in t)if(pi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function fr(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ge({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ge({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ge({start:t.start,end:t.end})+") is still open")}function Vs(e){const t=this;t.parser=n;function n(r){return Us(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ws(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Js(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
52
|
-
`}]}function
|
|
53
|
-
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function
|
|
54
|
-
`}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const
|
|
55
|
-
`});const
|
|
51
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Ms(e){const r={constructs:ti([zs,...(e||{}).extensions||[]]),content:i(Qo),defined:[],document:i(ea),flow:i(ys),lazy:{},string:i(ws),text:i(Ss)};return r;function i(o){return l;function l(a){return Ls(r,o,a)}}}function Os(e){for(;!oi(e););return e}const cr=/[\0\t\n\r]/g;function Rs(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const s=[];let u,f,c,h,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(cr.lastIndex=c,u=cr.exec(o),h=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(h),!u){t=o.slice(c);break}if(p===10&&c===h&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<h&&(s.push(o.slice(c,h)),e+=h-c),p){case 0:{s.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,s.push(-2);e++<f;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const Bs=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $s(e){return e.replace(Bs,Us)}function Us(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return ni(n.slice(o?2:1),o?16:10)}return Sn(n)||e}const pi={}.hasOwnProperty;function qs(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Hs(n)(Os(Ms(n).document().write(Rs()(e,t,!0))))}function Hs(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(On),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(Dn),blockQuote:o(Pe),characterEscape:$,characterReference:$,codeFenced:o(ft),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(ft,l),codeText:o(Zi,l),codeTextData:$,data:$,codeFlowValue:$,definition:o(el),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(tl),hardBreakEscape:o(Fn),hardBreakTrailing:o(Fn),htmlFlow:o(Mn,l),htmlFlowData:$,htmlText:o(Mn,l),htmlTextData:$,image:o(nl),label:l,link:o(On),listItem:o(rl),listItemValue:h,listOrdered:o(Rn,c),listUnordered:o(Rn),paragraph:o(il),reference:g,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Dn),strong:o(ll),thematicBreak:o(al)},exit:{atxHeading:s(),atxHeadingSequence:L,autolink:s(),autolinkEmail:_e,autolinkProtocol:be,blockQuote:s(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:G,characterReference:qe,codeFenced:s(E),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:k,codeIndented:s(y),codeText:s(j),codeTextData:k,data:k,definition:s(),definitionDestinationString:z,definitionLabelString:S,definitionTitleString:A,emphasis:s(),hardBreakEscape:s(N),hardBreakTrailing:s(N),htmlFlow:s(q),htmlFlowData:k,htmlText:s(P),htmlTextData:k,image:s(X),label:me,labelText:oe,lineEnding:T,link:s(H),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:se,resourceDestinationString:d,resourceTitleString:ae,resource:de,setextHeading:s(U),setextHeadingLineSequence:O,setextHeadingText:C,strong:s(),thematicBreak:s()}};hi(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(w){let I={type:"root",children:[]};const D={stack:[I],tokenStack:[],config:t,enter:a,exit:u,buffer:l,resume:f,data:n},R=[];let V=-1;for(;++V<w.length;)if(w[V][1].type==="listOrdered"||w[V][1].type==="listUnordered")if(w[V][0]==="enter")R.push(V);else{const ue=R.pop();V=i(w,ue,V)}for(V=-1;++V<w.length;){const ue=t[w[V][0]];pi.call(ue,w[V][1].type)&&ue[w[V][1].type].call(Object.assign({sliceSerialize:w[V][2].sliceSerialize},D),w[V][1])}if(D.tokenStack.length>0){const ue=D.tokenStack[D.tokenStack.length-1];(ue[1]||fr).call(D,void 0,ue[0])}for(I.position={start:we(w.length>0?w[0][1].start:{line:1,column:1,offset:0}),end:we(w.length>0?w[w.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<t.transforms.length;)I=t.transforms[V](I)||I;return I}function i(w,I,D){let R=I-1,V=-1,ue=!1,ve,ge,He,Ve;for(;++R<=D;){const ne=w[R];switch(ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ne[0]==="enter"?V++:V--,Ve=void 0;break}case"lineEndingBlank":{ne[0]==="enter"&&(ve&&!Ve&&!V&&!He&&(He=R),Ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ve=void 0}if(!V&&ne[0]==="enter"&&ne[1].type==="listItemPrefix"||V===-1&&ne[0]==="exit"&&(ne[1].type==="listUnordered"||ne[1].type==="listOrdered")){if(ve){let ze=R;for(ge=void 0;ze--;){const xe=w[ze];if(xe[1].type==="lineEnding"||xe[1].type==="lineEndingBlank"){if(xe[0]==="exit")continue;ge&&(w[ge][1].type="lineEndingBlank",ue=!0),xe[1].type="lineEnding",ge=ze}else if(!(xe[1].type==="linePrefix"||xe[1].type==="blockQuotePrefix"||xe[1].type==="blockQuotePrefixWhitespace"||xe[1].type==="blockQuoteMarker"||xe[1].type==="listItemIndent"))break}He&&(!ge||He<ge)&&(ve._spread=!0),ve.end=Object.assign({},ge?w[ge][1].start:ne[1].end),w.splice(ge||R,0,["exit",ve,ne[2]]),R++,D++}if(ne[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},ne[1].start),end:void 0};ve=ze,w.splice(R,0,["enter",ze,ne[2]]),R++,D++,He=void 0,Ve=!0}}}return w[I][1]._spread=ue,D}function o(w,I){return D;function D(R){a.call(this,w(R),R),I&&I.call(this,R)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(w,I,D){this.stack[this.stack.length-1].children.push(w),this.stack.push(w),this.tokenStack.push([I,D||void 0]),w.position={start:we(I.start),end:void 0}}function s(w){return I;function I(D){w&&w.call(this,D),u.call(this,D)}}function u(w,I){const D=this.stack.pop(),R=this.tokenStack.pop();if(R)R[0].type!==w.type&&(I?I.call(this,w,R[0]):(R[1]||fr).call(this,w,R[0]));else throw new Error("Cannot close `"+w.type+"` ("+Ge({start:w.start,end:w.end})+"): it’s not open");D.position.end=we(w.end)}function f(){return wn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(w){if(this.data.expectingFirstListItemValue){const I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(w),10),this.data.expectingFirstListItemValue=void 0}}function p(){const w=this.resume(),I=this.stack[this.stack.length-1];I.lang=w}function x(){const w=this.resume(),I=this.stack[this.stack.length-1];I.meta=w}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w.replace(/(\r?\n|\r)$/g,"")}function S(w){const I=this.resume(),D=this.stack[this.stack.length-1];D.label=I,D.identifier=ce(this.sliceSerialize(w)).toLowerCase()}function A(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function z(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function L(w){const I=this.stack[this.stack.length-1];if(!I.depth){const D=this.sliceSerialize(w).length;I.depth=D}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function O(w){const I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(w).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function $(w){const D=this.stack[this.stack.length-1].children;let R=D[D.length-1];(!R||R.type!=="text")&&(R=ol(),R.position={start:we(w.start),end:void 0},D.push(R)),this.stack.push(R)}function k(w){const I=this.stack.pop();I.value+=this.sliceSerialize(w),I.position.end=we(w.end)}function T(w){const I=this.stack[this.stack.length-1];if(this.data.atHardBreak){const D=I.children[I.children.length-1];D.position.end=we(w.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&($.call(this,w),k.call(this,w))}function N(){this.data.atHardBreak=!0}function q(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function P(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function j(){const w=this.resume(),I=this.stack[this.stack.length-1];I.value=w}function H(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function X(){const w=this.stack[this.stack.length-1];if(this.data.inReference){const I=this.data.referenceType||"shortcut";w.type+="Reference",w.referenceType=I,delete w.url,delete w.title}else delete w.identifier,delete w.label;this.data.referenceType=void 0}function oe(w){const I=this.sliceSerialize(w),D=this.stack[this.stack.length-2];D.label=$s(I),D.identifier=ce(I).toLowerCase()}function me(){const w=this.stack[this.stack.length-1],I=this.resume(),D=this.stack[this.stack.length-1];if(this.data.inReference=!0,D.type==="link"){const R=w.children;D.children=R}else D.alt=I}function d(){const w=this.resume(),I=this.stack[this.stack.length-1];I.url=w}function ae(){const w=this.resume(),I=this.stack[this.stack.length-1];I.title=w}function de(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function se(w){const I=this.resume(),D=this.stack[this.stack.length-1];D.label=I,D.identifier=ce(this.sliceSerialize(w)).toLowerCase(),this.data.referenceType="full"}function Ae(w){this.data.characterReferenceType=w.type}function G(w){const I=this.sliceSerialize(w),D=this.data.characterReferenceType;let R;D?(R=ni(I,D==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):R=Sn(I);const V=this.stack[this.stack.length-1];V.value+=R}function qe(w){const I=this.stack.pop();I.position.end=we(w.end)}function be(w){k.call(this,w);const I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(w)}function _e(w){k.call(this,w);const I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(w)}function Pe(){return{type:"blockquote",children:[]}}function ft(){return{type:"code",lang:null,meta:null,value:""}}function Zi(){return{type:"inlineCode",value:""}}function el(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function tl(){return{type:"emphasis",children:[]}}function Dn(){return{type:"heading",depth:0,children:[]}}function Fn(){return{type:"break"}}function Mn(){return{type:"html",value:""}}function nl(){return{type:"image",title:null,url:"",alt:null}}function On(){return{type:"link",title:null,url:"",children:[]}}function Rn(w){return{type:"list",ordered:w.type==="listOrdered",start:null,spread:w._spread,children:[]}}function rl(w){return{type:"listItem",spread:w._spread,checked:null,children:[]}}function il(){return{type:"paragraph",children:[]}}function ll(){return{type:"strong",children:[]}}function ol(){return{type:"text",value:""}}function al(){return{type:"thematicBreak"}}}function we(e){return{line:e.line,column:e.column,offset:e.offset}}function hi(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?hi(e,r):Vs(e,r)}}function Vs(e,t){let n;for(n in t)if(pi.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function fr(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ge({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ge({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ge({start:t.start,end:t.end})+") is still open")}function Ws(e){const t=this;t.parser=n;function n(r){return qs(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Js(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ys(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
52
|
+
`}]}function Xs(e,t){const n=t.value?t.value+`
|
|
53
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function Gs(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ks(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qs(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ue(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,a+=1,e.footnoteCounts.set(r,a);const s={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)}function Zs(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function eu(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function mi(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function tu(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mi(e,t);const i={src:Ue(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function nu(e,t){const n={src:Ue(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ru(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function iu(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return mi(e,t);const i={href:Ue(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function lu(e,t){const n={href:Ue(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ou(e,t,n){const r=e.all(t),i=n?au(n):di(t),o={},l=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
54
|
+
`}),f.type==="element"&&f.tagName==="p"&&!i?l.push(...f.children):l.push(f)}const s=r[r.length-1];s&&(i||s.type!=="element"||s.tagName!=="p")&&l.push({type:"text",value:`
|
|
55
|
+
`});const u={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,u),e.applyData(t,u)}function au(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=di(n[r])}return t}function di(e){const t=e.spread;return t??e.children.length>1}function su(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function uu(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cu(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function fu(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pu(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=xn(t.children[1]),s=Yr(t.children[t.children.length-1]);a&&s&&(l.position={start:a,end:s}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function hu(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,a=l?l.length:t.children.length;let s=-1;const u=[];for(;++s<a;){const c=t.children[s],h={},p=l?l[s]:void 0;p&&(h.align=p);let x={type:"element",tagName:o,properties:h,children:[]};c&&(x.children=e.all(c),e.patch(c,x),x=e.applyData(c,x)),u.push(x)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function mu(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const pr=9,hr=32;function du(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(mr(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(mr(t.slice(i),i>0,!1)),o.join("")}function mr(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===pr||o===hr;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===pr||o===hr;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function gu(e,t){const n={type:"text",value:du(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xu(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yu={blockquote:Js,break:Ys,code:Xs,delete:Gs,emphasis:Ks,footnoteReference:Qs,heading:Zs,html:eu,imageReference:tu,image:nu,inlineCode:ru,linkReference:iu,link:lu,listItem:ou,list:su,paragraph:uu,root:cu,strong:fu,table:pu,tableCell:mu,tableRow:hu,text:gu,thematicBreak:xu,toml:pt,yaml:pt,definition:pt,footnoteDefinition:pt};function pt(){}const gi=-1,jt=0,Qe=1,Ct=2,En=3,An=4,vn=5,In=6,xi=7,yi=8,dr=typeof self=="object"?self:globalThis,ku=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case jt:case gi:return n(l,i);case Qe:{const a=n([],i);for(const s of l)a.push(r(s));return a}case Ct:{const a=n({},i);for(const[s,u]of l)a[r(s)]=r(u);return a}case En:return n(new Date(l),i);case An:{const{source:a,flags:s}=l;return n(new RegExp(a,s),i)}case vn:{const a=n(new Map,i);for(const[s,u]of l)a.set(r(s),r(u));return a}case In:{const a=n(new Set,i);for(const s of l)a.add(r(s));return a}case xi:{const{name:a,message:s}=l;return n(new dr[a](s),i)}case yi:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:a}=new Uint8Array(l);return n(new DataView(a),l)}}return n(new dr[o](l),i)};return r},gr=e=>ku(new Map,e)(0),De="",{toString:bu}={},{keys:wu}=Object,Xe=e=>{const t=typeof e;if(t!=="object"||!e)return[jt,t];const n=bu.call(e).slice(8,-1);switch(n){case"Array":return[Qe,De];case"Object":return[Ct,De];case"Date":return[En,De];case"RegExp":return[An,De];case"Map":return[vn,De];case"Set":return[In,De];case"DataView":return[Qe,n]}return n.includes("Array")?[Qe,n]:n.includes("Error")?[xi,n]:[Ct,n]},ht=([e,t])=>e===jt&&(t==="function"||t==="symbol"),Su=(e,t,n,r)=>{const i=(l,a)=>{const s=r.push(l)-1;return n.set(a,s),s},o=l=>{if(n.has(l))return n.get(l);let[a,s]=Xe(l);switch(a){case jt:{let f=l;switch(s){case"bigint":a=yi,f=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+s);f=null;break;case"undefined":return i([gi],l)}return i([a,f],l)}case Qe:{if(s){let h=l;return s==="DataView"?h=new Uint8Array(l.buffer):s==="ArrayBuffer"&&(h=new Uint8Array(l)),i([s,[...h]],l)}const f=[],c=i([a,f],l);for(const h of l)f.push(o(h));return c}case Ct:{if(s)switch(s){case"BigInt":return i([s,l.toString()],l);case"Boolean":case"Number":case"String":return i([s,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const f=[],c=i([a,f],l);for(const h of wu(l))(e||!ht(Xe(l[h])))&&f.push([o(h),o(l[h])]);return c}case En:return i([a,l.toISOString()],l);case An:{const{source:f,flags:c}=l;return i([a,{source:f,flags:c}],l)}case vn:{const f=[],c=i([a,f],l);for(const[h,p]of l)(e||!(ht(Xe(h))||ht(Xe(p))))&&f.push([o(h),o(p)]);return c}case In:{const f=[],c=i([a,f],l);for(const h of l)(e||!ht(Xe(h)))&&f.push(o(h));return c}}const{message:u}=l;return i([a,{name:s,message:u}],l)};return o},xr=(e,{json:t,lossy:n}={})=>{const r=[];return Su(!(t||n),!!t,new Map,r)(e),r},Et=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?gr(xr(e,t)):structuredClone(e):(e,t)=>gr(xr(e,t));function Cu(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Eu(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Au(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Cu,r=e.options.footnoteBackLabel||Eu,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let s=-1;for(;++s<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[s]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Ue(c.toLowerCase());let p=0;const x=[],b=e.footnoteCounts.get(c);for(;b!==void 0&&++p<=b;){x.length>0&&x.push({type:"text",value:" "});let S=typeof n=="string"?n:n(s,p);typeof S=="string"&&(S={type:"text",value:S}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(s,p),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const E=f[f.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const S=E.children[E.children.length-1];S&&S.type==="text"?S.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...x)}else f.push(...x);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,y),a.push(y)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Et(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
56
56
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
57
|
-
`}]}}const Tt=(function(e){if(e==null)return
|
|
57
|
+
`}]}}const Tt=(function(e){if(e==null)return Tu;if(typeof e=="function")return Nt(e);if(typeof e=="object")return Array.isArray(e)?vu(e):Iu(e);if(typeof e=="string")return ju(e);throw new Error("Expected function, string, or object as test")});function vu(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Tt(e[n]);return Nt(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Iu(e){const t=e;return Nt(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function ju(e){return Nt(t);function t(n){return n&&n.type===e}}function Nt(e){return t;function t(n,r,i){return!!(Nu(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Tu(){return!0}function Nu(e){return e!==null&&typeof e=="object"&&"type"in e}const ki=[],_u=!0,on=!1,Pu="skip";function bi(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=Tt(i),l=r?-1:1;a(e,void 0,[])();function a(s,u,f){const c=s&&typeof s=="object"?s:{};if(typeof c.type=="string"){const p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(s.type+(p?"<"+p+">":""))+")"})}return h;function h(){let p=ki,x,b,E;if((!t||o(s,u,f[f.length-1]||void 0))&&(p=zu(n(s,f)),p[0]===on))return p;if("children"in s&&s.children){const y=s;if(y.children&&p[0]!==Pu)for(b=(r?y.children.length:-1)+l,E=f.concat(y);b>-1&&b<y.children.length;){const S=y.children[b];if(x=a(S,b,E)(),x[0]===on)return x;b=typeof x[1]=="number"?x[1]:b+l}}return p}}}function zu(e){return Array.isArray(e)?e:typeof e=="number"?[_u,e]:e==null?ki:[e]}function jn(e,t,n,r){let i,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,i=n):(o=t,l=n,i=r),bi(e,o,a,i);function a(s,u){const f=u[u.length-1],c=f?f.children.indexOf(s):void 0;return l(s,c,f)}}const an={}.hasOwnProperty,Lu={};function Du(e,t){const n=t||Lu,r=new Map,i=new Map,o=new Map,l={...yu,...n.handlers},a={all:u,applyData:Mu,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:s,options:n,patch:Fu,wrap:Ru};return jn(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function s(f,c){const h=f.type,p=a.handlers[h];if(an.call(a.handlers,h)&&p)return p(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:b,...E}=f,y=Et(E);return y.children=a.all(f),y}return Et(f)}return(a.options.unknownHandler||Ou)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let p=-1;for(;++p<h.length;){const x=a.one(h[p],f);if(x){if(p&&h[p-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=yr(x.value)),!Array.isArray(x)&&x.type==="element")){const b=x.children[0];b&&b.type==="text"&&(b.value=yr(b.value))}Array.isArray(x)?c.push(...x):c.push(x)}}}return c}}function Fu(e,t){e.position&&(t.position=Eo(e))}function Mu(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,Et(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Ou(e,t){const n=t.data||{},r="value"in t&&!(an.call(n,"hProperties")||an.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Ru(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
58
58
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
59
59
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
60
|
-
`}),n}function yr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kr(e,t){const n=
|
|
61
|
-
`},i),o}function Ru(e,t){return e&&"run"in e?async function(n,r){const i=kr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return kr(n,{file:r,...e||t})}}function br(e){if(e)throw e}var Ft,wr;function Bu(){if(wr)return Ft;wr=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(s){return typeof Array.isArray=="function"?Array.isArray(s):t.call(s)==="[object Array]"},o=function(s){if(!s||t.call(s)!=="[object Object]")return!1;var f=e.call(s,"constructor"),c=s.constructor&&s.constructor.prototype&&e.call(s.constructor.prototype,"isPrototypeOf");if(s.constructor&&!f&&!c)return!1;var h;for(h in s);return typeof h>"u"||e.call(s,h)},l=function(s,f){n&&f.name==="__proto__"?n(s,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):s[f.name]=f.newValue},a=function(s,f){if(f==="__proto__")if(e.call(s,f)){if(r)return r(s,f).value}else return;return s[f]};return Ft=function u(){var s,f,c,h,p,x,b=arguments[0],E=1,y=arguments.length,S=!1;for(typeof b=="boolean"&&(S=b,b=arguments[1]||{},E=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});E<y;++E)if(s=arguments[E],s!=null)for(f in s)c=a(b,f),h=a(s,f),b!==h&&(S&&h&&(o(h)||(p=i(h)))?(p?(p=!1,x=c&&i(c)?c:[]):x=c&&o(c)?c:{},l(b,{name:f,newValue:u(S,x,h)})):typeof h<"u"&&l(b,{name:f,newValue:h}));return b},Ft}var $u=Bu();const Mt=Fr($u);function sn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Uu(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(u,...s){const f=e[++o];let c=-1;if(u){l(u);return}for(;++c<i.length;)(s[c]===null||s[c]===void 0)&&(s[c]=i[c]);i=s,f?qu(f,a)(...s):l(null,...s)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function qu(e,t){let n;return r;function r(...l){const a=e.length>l.length;let u;a&&l.push(i);try{u=e.apply(this,l)}catch(s){const f=s;if(a&&n)throw f;return i(f)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(l,...a){n||(n=!0,t(l,...a))}function o(l){i(null,l)}}const fe={basename:Hu,dirname:Vu,extname:Wu,join:Ju,sep:"/"};function Hu(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ct(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Vu(e){if(ct(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Wu(e){ct(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const a=e.codePointAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Ju(...e){let t=-1,n;for(;++t<e.length;)ct(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Yu(n)}function Yu(e){ct(e);const t=e.codePointAt(0)===47;let n=Xu(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Xu(e,t){let n="",r=0,i=-1,o=0,l=-1,a,u;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return n}function ct(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Gu={cwd:Ku};function Ku(){return"/"}function un(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Qu(e){if(typeof e=="string")e=new URL(e);else if(!un(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Zu(e)}function Zu(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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+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(t)}const Ot=["history","path","basename","stem","extname","dirname"];class wi{constructor(t){let n;t?un(t)?n={path:t}:typeof t=="string"||ec(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Gu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ot.length;){const o=Ot[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Ot.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?fe.basename(this.path):void 0}set basename(t){Bt(t,"basename"),Rt(t,"basename"),this.path=fe.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fe.dirname(this.path):void 0}set dirname(t){Sr(this.basename,"dirname"),this.path=fe.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fe.extname(this.path):void 0}set extname(t){if(Rt(t,"extname"),Sr(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fe.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){un(t)&&(t=Qu(t)),Bt(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fe.basename(this.path,this.extname):void 0}set stem(t){Bt(t,"stem"),Rt(t,"stem"),this.path=fe.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Q(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Rt(e,t){if(e&&e.includes(fe.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fe.sep+"`")}function Bt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Sr(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ec(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tc=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),nc={}.hasOwnProperty;class Tn extends tc{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=Uu()}copy(){const t=new Tn;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Mt(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qt("data",this.frozen),this.namespace[t]=n,this):nc.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qt("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=mt(t),r=this.parser||this.Parser;return $t("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),$t("process",this.parser||this.Parser),Ut("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const a=mt(t),u=r.parse(a);r.run(u,a,function(f,c,h){if(f||!c||!h)return s(f);const p=c,x=r.stringify(p,h);lc(x)?h.value=x:h.result=x,s(f,h)});function s(f,c){f||!c?l(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),$t("processSync",this.parser||this.Parser),Ut("processSync",this.compiler||this.Compiler),this.process(t,i),Er("processSync","process",n),r;function i(o,l){n=!0,br(o),r=l}}run(t,n,r){Cr(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const u=mt(n);i.run(t,u,s);function s(f,c,h){const p=c||t;f?a(f):l?l(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Er("runSync","run",r),i;function o(l,a){br(l),i=a,r=!0}}stringify(t,n){this.freeze();const r=mt(n),i=this.compiler||this.Compiler;return Ut("stringify",i),Cr(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(qt("use",this.frozen),t!=null)if(typeof t=="function")u(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(s){if(typeof s=="function")u(s,[]);else if(typeof s=="object")if(Array.isArray(s)){const[f,...c]=s;u(f,c)}else l(s);else throw new TypeError("Expected usable value, not `"+s+"`")}function l(s){if(!("plugins"in s)&&!("settings"in s))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(s.plugins),s.settings&&(i.settings=Mt(!0,i.settings,s.settings))}function a(s){let f=-1;if(s!=null)if(Array.isArray(s))for(;++f<s.length;){const c=s[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+s+"`")}function u(s,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===s){h=c;break}if(h===-1)r.push([s,...f]);else if(f.length>0){let[p,...x]=f;const b=r[h][1];sn(b)&&sn(p)&&(p=Mt(!0,b,p)),r[h]=[s,p,...x]}}}}const rc=new Tn().freeze();function $t(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ut(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qt(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Cr(e){if(!sn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Er(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mt(e){return ic(e)?e:new wi(e)}function ic(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lc(e){return typeof e=="string"||oc(e)}function oc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ac="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ar=[],vr={allowDangerousHtml:!0},sc=/^(https?|ircs?|mailto|xmpp)$/i,uc=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function cc(e){const t=fc(e),n=pc(e);return hc(t.runSync(t.parse(n),n),e)}function fc(e){const t=e.rehypePlugins||Ar,n=e.remarkPlugins||Ar,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vr}:vr;return rc().use(Vs).use(n).use(Ru,r).use(t)}function pc(e){const t=e.children||"",n=new wi;return typeof t=="string"&&(n.value=t),n}function hc(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,a=t.unwrapDisallowed,u=t.urlTransform||mc;for(const f of uc)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+ac+f.id,void 0);return jn(e,s),jo(e,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function s(f,c,h){if(f.type==="raw"&&h&&typeof c=="number")return l?h.children.splice(c,1):h.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let p;for(p in zt)if(Object.hasOwn(zt,p)&&Object.hasOwn(f.properties,p)){const x=f.properties[p],b=zt[p];(b===null||b.includes(f.tagName))&&(f.properties[p]=u(String(x||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!p&&r&&typeof c=="number"&&(p=!r(f,c,h)),p&&h&&typeof c=="number")return a&&f.children?h.children.splice(c,1,...f.children):h.children.splice(c,1),c}}}function mc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||sc.test(e.slice(0,t))?e:""}function dc(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Si(e,t,n){const i=Tt((n||{}).ignore||[]),o=gc(t);let l=-1;for(;++l<o.length;)bi(e,"text",a);function a(s,f){let c=-1,h;for(;++c<f.length;){const p=f[c],x=h?h.children:void 0;if(i(p,x?x.indexOf(p):void 0,h))return;h=p}if(h)return u(s,f)}function u(s,f){const c=f[f.length-1],h=o[l][0],p=o[l][1];let x=0;const E=c.children.indexOf(s);let y=!1,S=[];h.lastIndex=0;let A=h.exec(s.value);for(;A;){const z=A.index,L={index:A.index,input:A.input,stack:[...f,s]};let C=p(...A,L);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=z+1:(x!==z&&S.push({type:"text",value:s.value.slice(x,z)}),Array.isArray(C)?S.push(...C):C&&S.push(C),x=z+A[0].length,y=!0),!h.global)break;A=h.exec(s.value)}return y?(x<s.value.length&&S.push({type:"text",value:s.value.slice(x)}),c.children.splice(E,1,...S)):S=[s],E+S.length}}function gc(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([xc(i[0]),yc(i[1])])}return t}function xc(e){return typeof e=="string"?new RegExp(dc(e),"g"):e}function yc(e){return typeof e=="function"?e:function(){return e}}function kc(e){Si(e,[/\r?\n|\r/g,bc])}function bc(){return{type:"break"}}function wc(){return function(e){kc(e)}}function Ir(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ht="phrasing",Vt=["autolink","link","image","label"];function Sc(){return{transforms:[Tc],enter:{literalAutolink:Ec,literalAutolinkEmail:Wt,literalAutolinkHttp:Wt,literalAutolinkWww:Wt},exit:{literalAutolink:jc,literalAutolinkEmail:Ic,literalAutolinkHttp:Ac,literalAutolinkWww:vc}}}function Cc(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ht,notInConstruct:Vt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ht,notInConstruct:Vt},{character:":",before:"[ps]",after:"\\/",inConstruct:Ht,notInConstruct:Vt}]}}function Ec(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Wt(e){this.config.enter.autolinkProtocol.call(this,e)}function Ac(e){this.config.exit.autolinkProtocol.call(this,e)}function vc(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Ic(e){this.config.exit.autolinkEmail.call(this,e)}function jc(e){this.exit(e)}function Tc(e){Si(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Nc],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),_c]],{ignore:["link","linkReference"]})}function Nc(e,t,n,r,i){let o="";if(!Ci(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!Pc(n)))return!1;const l=zc(n+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function _c(e,t,n,r){return!Ci(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Pc(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function zc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ir(e,"(");let o=Ir(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Ci(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||je(n)||vt(n))&&(!t||n!==47)}Ei.peek=Uc;function Lc(){this.buffer()}function Dc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fc(){this.buffer()}function Mc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Oc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Rc(e){this.exit(e)}function Bc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $c(e){this.exit(e)}function Uc(){return"["}function Ei(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function qc(){return{enter:{gfmFootnoteCallString:Lc,gfmFootnoteCall:Dc,gfmFootnoteDefinitionLabelString:Fc,gfmFootnoteDefinition:Mc},exit:{gfmFootnoteCallString:Oc,gfmFootnoteCall:Rc,gfmFootnoteDefinitionLabelString:Bc,gfmFootnoteDefinition:$c}}}function Hc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ei},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const a=o.createTracker(l);let u=a.move("[^");const s=o.enter("footnoteDefinition"),f=o.enter("label");return u+=a.move(o.safe(o.associationId(r),{before:u,after:"]"})),f(),u+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),u+=a.move((t?`
|
|
62
|
-
`:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Ai:
|
|
63
|
-
`)}function
|
|
64
|
-
`&&
|
|
65
|
-
`}function
|
|
60
|
+
`}),n}function yr(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function kr(e,t){const n=Du(e,t),r=n.one(e,void 0),i=Au(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
|
|
61
|
+
`},i),o}function Bu(e,t){return e&&"run"in e?async function(n,r){const i=kr(n,{file:r,...t});await e.run(i,r)}:function(n,r){return kr(n,{file:r,...e||t})}}function br(e){if(e)throw e}var Ft,wr;function $u(){if(wr)return Ft;wr=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},o=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),c=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!c)return!1;var h;for(h in u);return typeof h>"u"||e.call(u,h)},l=function(u,f){n&&f.name==="__proto__"?n(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},a=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return Ft=function s(){var u,f,c,h,p,x,b=arguments[0],E=1,y=arguments.length,S=!1;for(typeof b=="boolean"&&(S=b,b=arguments[1]||{},E=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});E<y;++E)if(u=arguments[E],u!=null)for(f in u)c=a(b,f),h=a(u,f),b!==h&&(S&&h&&(o(h)||(p=i(h)))?(p?(p=!1,x=c&&i(c)?c:[]):x=c&&o(c)?c:{},l(b,{name:f,newValue:s(S,x,h)})):typeof h<"u"&&l(b,{name:f,newValue:h}));return b},Ft}var Uu=$u();const Mt=Fr(Uu);function sn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qu(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);a(null,...i);function a(s,...u){const f=e[++o];let c=-1;if(s){l(s);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?Hu(f,a)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Hu(e,t){let n;return r;function r(...l){const a=e.length>l.length;let s;a&&l.push(i);try{s=e.apply(this,l)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(s&&s.then&&typeof s.then=="function"?s.then(o,i):s instanceof Error?i(s):o(s))}function i(l,...a){n||(n=!0,t(l,...a))}function o(l){i(null,l)}}const fe={basename:Vu,dirname:Wu,extname:Ju,join:Yu,sep:"/"};function Vu(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ct(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Wu(e){if(ct(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Ju(e){ct(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const a=e.codePointAt(t);if(a===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Yu(...e){let t=-1,n;for(;++t<e.length;)ct(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Xu(n)}function Xu(e){ct(e);const t=e.codePointAt(0)===47;let n=Gu(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Gu(e,t){let n="",r=0,i=-1,o=0,l=-1,a,s;for(;++l<=e.length;){if(l<e.length)a=e.codePointAt(l);else{if(a===47)break;a=47}if(a===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(s=n.lastIndexOf("/"),s!==n.length-1){s<0?(n="",r=0):(n=n.slice(0,s),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else a===46&&o>-1?o++:o=-1}return n}function ct(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Ku={cwd:Qu};function Qu(){return"/"}function un(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Zu(e){if(typeof e=="string")e=new URL(e);else if(!un(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return ec(e)}function ec(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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+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(t)}const Ot=["history","path","basename","stem","extname","dirname"];class wi{constructor(t){let n;t?un(t)?n={path:t}:typeof t=="string"||tc(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Ku.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ot.length;){const o=Ot[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)Ot.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?fe.basename(this.path):void 0}set basename(t){Bt(t,"basename"),Rt(t,"basename"),this.path=fe.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fe.dirname(this.path):void 0}set dirname(t){Sr(this.basename,"dirname"),this.path=fe.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fe.extname(this.path):void 0}set extname(t){if(Rt(t,"extname"),Sr(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fe.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){un(t)&&(t=Zu(t)),Bt(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fe.basename(this.path,this.extname):void 0}set stem(t){Bt(t,"stem"),Rt(t,"stem"),this.path=fe.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Q(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Rt(e,t){if(e&&e.includes(fe.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fe.sep+"`")}function Bt(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Sr(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function tc(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nc=(function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),rc={}.hasOwnProperty;class Tn extends nc{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=qu()}copy(){const t=new Tn;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Mt(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qt("data",this.frozen),this.namespace[t]=n,this):rc.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qt("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=mt(t),r=this.parser||this.Parser;return $t("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),$t("process",this.parser||this.Parser),Ut("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const a=mt(t),s=r.parse(a);r.run(s,a,function(f,c,h){if(f||!c||!h)return u(f);const p=c,x=r.stringify(p,h);oc(x)?h.value=x:h.result=x,u(f,h)});function u(f,c){f||!c?l(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),$t("processSync",this.parser||this.Parser),Ut("processSync",this.compiler||this.Compiler),this.process(t,i),Er("processSync","process",n),r;function i(o,l){n=!0,br(o),r=l}}run(t,n,r){Cr(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,a){const s=mt(n);i.run(t,s,u);function u(f,c,h){const p=c||t;f?a(f):l?l(p):r(void 0,p,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Er("runSync","run",r),i;function o(l,a){br(l),i=a,r=!0}}stringify(t,n){this.freeze();const r=mt(n),i=this.compiler||this.Compiler;return Ut("stringify",i),Cr(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(qt("use",this.frozen),t!=null)if(typeof t=="function")s(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")s(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;s(f,c)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(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=Mt(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function s(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[p,...x]=f;const b=r[h][1];sn(b)&&sn(p)&&(p=Mt(!0,b,p)),r[h]=[u,p,...x]}}}}const ic=new Tn().freeze();function $t(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ut(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qt(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Cr(e){if(!sn(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Er(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function mt(e){return lc(e)?e:new wi(e)}function lc(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oc(e){return typeof e=="string"||ac(e)}function ac(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sc="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ar=[],vr={allowDangerousHtml:!0},uc=/^(https?|ircs?|mailto|xmpp)$/i,cc=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fc(e){const t=pc(e),n=hc(e);return mc(t.runSync(t.parse(n),n),e)}function pc(e){const t=e.rehypePlugins||Ar,n=e.remarkPlugins||Ar,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...vr}:vr;return ic().use(Ws).use(n).use(Bu,r).use(t)}function hc(e){const t=e.children||"",n=new wi;return typeof t=="string"&&(n.value=t),n}function mc(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,a=t.unwrapDisallowed,s=t.urlTransform||dc;for(const f of cc)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+sc+f.id,void 0);return jn(e,u),To(e,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function u(f,c,h){if(f.type==="raw"&&h&&typeof c=="number")return l?h.children.splice(c,1):h.children[c]={type:"text",value:f.value},c;if(f.type==="element"){let p;for(p in zt)if(Object.hasOwn(zt,p)&&Object.hasOwn(f.properties,p)){const x=f.properties[p],b=zt[p];(b===null||b.includes(f.tagName))&&(f.properties[p]=s(String(x||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):o?o.includes(f.tagName):!1;if(!p&&r&&typeof c=="number"&&(p=!r(f,c,h)),p&&h&&typeof c=="number")return a&&f.children?h.children.splice(c,1,...f.children):h.children.splice(c,1),c}}}function dc(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||uc.test(e.slice(0,t))?e:""}function gc(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Si(e,t,n){const i=Tt((n||{}).ignore||[]),o=xc(t);let l=-1;for(;++l<o.length;)bi(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const p=f[c],x=h?h.children:void 0;if(i(p,x?x.indexOf(p):void 0,h))return;h=p}if(h)return s(u,f)}function s(u,f){const c=f[f.length-1],h=o[l][0],p=o[l][1];let x=0;const E=c.children.indexOf(u);let y=!1,S=[];h.lastIndex=0;let A=h.exec(u.value);for(;A;){const z=A.index,L={index:A.index,input:A.input,stack:[...f,u]};let C=p(...A,L);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?h.lastIndex=z+1:(x!==z&&S.push({type:"text",value:u.value.slice(x,z)}),Array.isArray(C)?S.push(...C):C&&S.push(C),x=z+A[0].length,y=!0),!h.global)break;A=h.exec(u.value)}return y?(x<u.value.length&&S.push({type:"text",value:u.value.slice(x)}),c.children.splice(E,1,...S)):S=[u],E+S.length}}function xc(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([yc(i[0]),kc(i[1])])}return t}function yc(e){return typeof e=="string"?new RegExp(gc(e),"g"):e}function kc(e){return typeof e=="function"?e:function(){return e}}function bc(e){Si(e,[/\r?\n|\r/g,wc])}function wc(){return{type:"break"}}function Sc(){return function(e){bc(e)}}function Ir(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Ht="phrasing",Vt=["autolink","link","image","label"];function Cc(){return{transforms:[Nc],enter:{literalAutolink:Ac,literalAutolinkEmail:Wt,literalAutolinkHttp:Wt,literalAutolinkWww:Wt},exit:{literalAutolink:Tc,literalAutolinkEmail:jc,literalAutolinkHttp:vc,literalAutolinkWww:Ic}}}function Ec(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ht,notInConstruct:Vt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ht,notInConstruct:Vt},{character:":",before:"[ps]",after:"\\/",inConstruct:Ht,notInConstruct:Vt}]}}function Ac(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Wt(e){this.config.enter.autolinkProtocol.call(this,e)}function vc(e){this.config.exit.autolinkProtocol.call(this,e)}function Ic(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function jc(e){this.config.exit.autolinkEmail.call(this,e)}function Tc(e){this.exit(e)}function Nc(e){Si(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_c],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Pc]],{ignore:["link","linkReference"]})}function _c(e,t,n,r,i){let o="";if(!Ci(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!zc(n)))return!1;const l=Lc(n+r);if(!l[0])return!1;const a={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[a,{type:"text",value:l[1]}]:a}function Pc(e,t,n,r){return!Ci(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zc(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Lc(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Ir(e,"(");let o=Ir(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Ci(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Te(n)||vt(n))&&(!t||n!==47)}Ei.peek=qc;function Dc(){this.buffer()}function Fc(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Mc(){this.buffer()}function Oc(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Rc(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Bc(e){this.exit(e)}function $c(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ce(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Uc(e){this.exit(e)}function qc(){return"["}function Ei(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),l(),o+=i.move("]"),o}function Hc(){return{enter:{gfmFootnoteCallString:Dc,gfmFootnoteCall:Fc,gfmFootnoteDefinitionLabelString:Mc,gfmFootnoteDefinition:Oc},exit:{gfmFootnoteCallString:Rc,gfmFootnoteCall:Bc,gfmFootnoteDefinitionLabelString:$c,gfmFootnoteDefinition:Uc}}}function Vc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ei},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const a=o.createTracker(l);let s=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return s+=a.move(o.safe(o.associationId(r),{before:s,after:"]"})),f(),s+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),s+=a.move((t?`
|
|
62
|
+
`:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Ai:Wc))),u(),s}}function Wc(e,t,n){return t===0?e:Ai(e,t,n)}function Ai(e,t,n){return(n?"":" ")+e}const Jc=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];vi.peek=Qc;function Yc(){return{canContainEols:["delete"],enter:{strikethrough:Gc},exit:{strikethrough:Kc}}}function Xc(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Jc}],handlers:{delete:vi}}}function Gc(e){this.enter({type:"delete",children:[]},e)}function Kc(e){this.exit(e)}function vi(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function Qc(){return"~"}function Zc(e){return e.length}function ef(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Zc,o=[],l=[],a=[],s=[];let u=0,f=-1;for(;++f<e.length;){const b=[],E=[];let y=-1;for(e[f].length>u&&(u=e[f].length);++y<e[f].length;){const S=tf(e[f][y]);if(n.alignDelimiters!==!1){const A=i(S);E[y]=A,(s[y]===void 0||A>s[y])&&(s[y]=A)}b.push(S)}l[f]=b,a[f]=E}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=jr(r[c]);else{const b=jr(r);for(;++c<u;)o[c]=b}c=-1;const h=[],p=[];for(;++c<u;){const b=o[c];let E="",y="";b===99?(E=":",y=":"):b===108?E=":":b===114&&(y=":");let S=n.alignDelimiters===!1?1:Math.max(1,s[c]-E.length-y.length);const A=E+"-".repeat(S)+y;n.alignDelimiters!==!1&&(S=E.length+S+y.length,S>s[c]&&(s[c]=S),p[c]=S),h[c]=A}l.splice(1,0,h),a.splice(1,0,p),f=-1;const x=[];for(;++f<l.length;){const b=l[f],E=a[f];c=-1;const y=[];for(;++c<u;){const S=b[c]||"";let A="",z="";if(n.alignDelimiters!==!1){const L=s[c]-(E[c]||0),C=o[c];C===114?A=" ".repeat(L):C===99?L%2?(A=" ".repeat(L/2+.5),z=" ".repeat(L/2-.5)):(A=" ".repeat(L/2),z=A):z=" ".repeat(L)}n.delimiterStart!==!1&&!c&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&S==="")&&(n.delimiterStart!==!1||c)&&y.push(" "),n.alignDelimiters!==!1&&y.push(A),y.push(S),n.alignDelimiters!==!1&&y.push(z),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&y.push("|")}x.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return x.join(`
|
|
63
|
+
`)}function tf(e){return e==null?"":String(e)}function jr(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function nf(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),rf);return i(),l}function rf(e,t,n){return">"+(n?"":" ")+e}function lf(e,t){return Tr(e,t.inConstruct,!0)&&!Tr(e,t.notInConstruct,!1)}function Tr(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Nr(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
64
|
+
`&&lf(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
65
|
+
`}function of(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function af(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function sf(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uf(e,t,n,r){const i=sf(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(af(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,cf);return c(),h}const a=n.createTracker(r),s=i.repeat(Math.max(of(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(s);if(e.lang){const c=n.enter(`codeFencedLang${l}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${l}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
|
|
66
66
|
`,encode:["`"],...a.current()})),c()}return f+=a.move(`
|
|
67
67
|
`),o&&(f+=a.move(o+`
|
|
68
|
-
`)),f+=a.move(
|
|
69
|
-
`,...
|
|
68
|
+
`)),f+=a.move(s),u(),f}function cf(e,t,n){return(n?"":" ")+e}function Nn(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ff(e,t,n,r){const i=Nn(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("[");return u+=s.move(n.safe(n.associationId(e),{before:u,after:"]",...s.current()})),u+=s.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":`
|
|
69
|
+
`,...s.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),l(),u}function pf(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nt(e){return"&#x"+e.toString(16).toUpperCase()+";"}function At(e,t,n){const r=Oe(e),i=Oe(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ii.peek=hf;function Ii(e,t,n,r){const i=pf(n),o=n.enter("emphasis"),l=n.createTracker(r),a=l.move(i);let s=l.move(n.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=At(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=nt(u)+s.slice(1));const c=s.charCodeAt(s.length-1),h=At(r.after.charCodeAt(0),c,i);h.inside&&(s=s.slice(0,-1)+nt(c));const p=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+s+p}function hf(e,t,n){return n.options.emphasis||"*"}function mf(e,t){let n=!1;return jn(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,on}),!!((!e.depth||e.depth<3)&&wn(e)&&(t.options.setext||n))}function df(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(mf(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
|
|
70
70
|
`,after:`
|
|
71
71
|
`});return c(),f(),h+`
|
|
72
72
|
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
73
|
-
`))+1))}const l="#".repeat(i),a=n.enter("headingAtx"),
|
|
74
|
-
`,...o.current()});return/^[\t ]/.test(
|
|
75
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:l,tableCell:
|
|
76
|
-
`))}function u(p,x,b,E){const y=b.enter("tableCell"),S=b.enter("phrasing"),A=b.containerPhrasing(p,{...E,before:o,after:o});return S(),y(),A}function s(p,x){return Zc(p,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(p,x,b){const E=p.children;let y=-1;const S=[],A=x.enter("table");for(;++y<E.length;)S[y]=c(E[y],x,b);return A(),S}function c(p,x,b){const E=p.children;let y=-1;const S=[],A=x.enter("tableRow");for(;++y<E.length;)S[y]=u(E[y],p,x,b);return A(),S}function h(p,x,b){let E=Mi.inlineCode(p,x,b);return b.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function $f(){return{exit:{taskListCheckValueChecked:Pr,taskListCheckValueUnchecked:Pr,paragraph:qf}}}function Uf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Hf}}}function Pr(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function qf(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Hf(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(l);let u=Mi.listItem(e,t,n,{...r,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,s)),u;function s(f){return f+l}}function Vf(){return[Sc(),qc(),Jc(),Lf(),$f()]}function Wf(e){return{extensions:[Cc(),Hc(e),Yc(),Bf(e),Uf()]}}const Jf={tokenize:Zf,partial:!0},Oi={tokenize:ep,partial:!0},Ri={tokenize:tp,partial:!0},Bi={tokenize:np,partial:!0},Yf={tokenize:rp,partial:!0},$i={name:"wwwAutolink",tokenize:Kf,previous:qi},Ui={name:"protocolAutolink",tokenize:Qf,previous:Hi},ke={name:"emailAutolink",tokenize:Gf,previous:Vi},he={};function Xf(){return{text:he}}let Ie=48;for(;Ie<123;)he[Ie]=ke,Ie++,Ie===58?Ie=65:Ie===91&&(Ie=97);he[43]=ke;he[45]=ke;he[46]=ke;he[95]=ke;he[72]=[ke,Ui];he[104]=[ke,Ui];he[87]=[ke,$i];he[119]=[ke,$i];function Gf(e,t,n){const r=this;let i,o;return l;function l(c){return!cn(c)||!Vi.call(r,r.previous)||Pn(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return cn(c)?(e.consume(c),a):c===64?(e.consume(c),u):n(c)}function u(c){return c===46?e.check(Yf,f,s)(c):c===45||c===95||K(c)?(o=!0,e.consume(c),u):f(c)}function s(c){return e.consume(c),i=!0,u}function f(c){return o&&i&&Z(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Kf(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!qi.call(r,r.previous)||Pn(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Jf,e.attempt(Oi,e.attempt(Ri,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Qf(e,t,n){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&Hi.call(r,r.previous)&&!Pn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(Z(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),u}return n(c)}function u(c){return c===47?(e.consume(c),o?s:(o=!0,u)):n(c)}function s(c){return c===null||St(c)||W(c)||je(c)||vt(c)?n(c):e.attempt(Oi,e.attempt(Ri,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Zf(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function ep(e,t,n){let r,i,o;return l;function l(s){return s===46||s===95?e.check(Bi,u,a)(s):s===null||W(s)||je(s)||s!==45&&vt(s)?u(s):(o=!0,e.consume(s),l)}function a(s){return s===95?r=!0:(i=r,r=void 0),e.consume(s),l}function u(s){return i||r||!o?n(s):t(s)}}function tp(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Bi,t,o)(l):l===null||W(l)||je(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function np(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||W(a)||je(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||W(a)||je(a)?t(a):r(a)}function o(a){return Z(a)?l(a):n(a)}function l(a){return a===59?(e.consume(a),r):Z(a)?(e.consume(a),l):n(a)}}function rp(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return K(o)?n(o):t(o)}}function qi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||W(e)}function Hi(e){return!Z(e)}function Vi(e){return!(e===47||cn(e))}function cn(e){return e===43||e===45||e===46||e===95||K(e)}function Pn(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ip={tokenize:pp,partial:!0};function lp(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:up,continuation:{tokenize:cp},exit:fp}},text:{91:{name:"gfmFootnoteCall",tokenize:sp},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:op,resolveTo:ap}}}}function op(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){l=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!l||!l._balanced)return n(u);const s=ce(r.sliceSerialize({start:l.end,end:r.now()}));return s.codePointAt(0)!==94||!o.includes(s.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function ap(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function sp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(c){if(o>999||c===93&&!l||c===null||c===91||W(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(ce(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return W(c)||(l=!0),o++,e.consume(c),c===92?f:s}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,s):s(c)}}function up(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return u;function u(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),s}function s(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(x)}function f(x){if(l>999||x===93&&!a||x===null||x===91||W(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return o=ce(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return W(x)||(a=!0),l++,e.consume(x),x===92?c:f}function c(x){return x===91||x===92||x===93?(e.consume(x),l++,f):f(x)}function h(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(o)||i.push(o),B(e,p,"gfmFootnoteDefinitionWhitespace")):n(x)}function p(x){return t(x)}}function cp(e,t,n){return e.check(ut,t,e.attempt(ip,t,n))}function fp(e){e.exit("gfmFootnoteDefinition")}function pp(e,t,n){const r=this;return B(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function hp(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let u=-1;for(;++u<l.length;)if(l[u][0]==="enter"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._close){let s=u;for(;s--;)if(l[s][0]==="exit"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._open&&l[u][1].end.offset-l[u][1].start.offset===l[s][1].end.offset-l[s][1].start.offset){l[u][1].type="strikethroughSequence",l[s][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[s][1].start),end:Object.assign({},l[u][1].end)},c={type:"strikethroughText",start:Object.assign({},l[s][1].end),end:Object.assign({},l[u][1].start)},h=[["enter",f,a],["enter",l[s][1],a],["exit",l[s][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&ie(h,h.length,0,It(p,l.slice(s+1,u),a)),ie(h,h.length,0,[["exit",c,a],["enter",l[u][1],a],["exit",l[u][1],a],["exit",f,a]]),ie(l,s-1,u-s+3,h),u=s+h.length-2;break}}for(u=-1;++u<l.length;)l[u][1].type==="strikethroughSequenceTemporary"&&(l[u][1].type="data");return l}function o(l,a,u){const s=this.previous,f=this.events;let c=0;return h;function h(x){return s===126&&f[f.length-1][1].type!=="characterEscape"?u(x):(l.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const b=Me(s);if(x===126)return c>1?u(x):(l.consume(x),c++,p);if(c<2&&!n)return u(x);const E=l.exit("strikethroughSequenceTemporary"),y=Me(x);return E._open=!y||y===2&&!!b,E._close=!b||b===2&&!!y,a(x)}}}class mp{constructor(){this.map=[]}add(t,n,r){dp(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function dp(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function gp(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function xp(){return{flow:{null:{name:"table",tokenize:yp,resolveAll:kp}}}}function yp(e,t,n){const r=this;let i=0,o=0,l;return a;function a(k){let T=r.events.length-1;for(;T>-1;){const P=r.events[T][1].type;if(P==="lineEnding"||P==="linePrefix")T--;else break}const N=T>-1?r.events[T][1].type:null,q=N==="tableHead"||N==="tableRow"?C:u;return q===C&&r.parser.lazy[r.now().line]?n(k):q(k)}function u(k){return e.enter("tableHead"),e.enter("tableRow"),s(k)}function s(k){return k===124||(l=!0,o+=1),f(k)}function f(k){return k===null?n(k):_(k)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):n(k):M(k)?B(e,f,"whitespace")(k):(o+=1,l&&(l=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(k)))}function c(k){return k===null||k===124||W(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?h:c)}function h(k){return k===92||k===124?(e.consume(k),c):c(k)}function p(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(k):(e.enter("tableDelimiterRow"),l=!1,M(k)?B(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):x(k))}function x(k){return k===45||k===58?E(k):k===124?(l=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),b):L(k)}function b(k){return M(k)?B(e,E,"whitespace")(k):E(k)}function E(k){return k===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(o+=1,y(k)):k===null||_(k)?z(k):L(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),S(k)):L(k)}function S(k){return k===45?(e.consume(k),S):k===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(k))}function A(k){return M(k)?B(e,z,"whitespace")(k):z(k)}function z(k){return k===124?x(k):k===null||_(k)?!l||i!==o?L(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):L(k)}function L(k){return n(k)}function C(k){return e.enter("tableRow"),O(k)}function O(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),O):k===null||_(k)?(e.exit("tableRow"),t(k)):M(k)?B(e,O,"whitespace")(k):(e.enter("data"),U(k))}function U(k){return k===null||k===124||W(k)?(e.exit("data"),O(k)):(e.consume(k),k===92?$:U)}function $(k){return k===92||k===124?(e.consume(k),U):U(k)}}function kp(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,u=0,s,f,c;const h=new mp;for(;++n<e.length;){const p=e[n],x=p[1];p[0]==="enter"?x.type==="tableHead"?(a=!1,u!==0&&(zr(h,t,u,s,f),f=void 0,u=0),s={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(n,0,[["enter",s,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(n,0,[["enter",f,t]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=dt(h,t,o,i,void 0,c),o=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=dt(h,t,o,i,void 0,c)),o=l,l=[o[1],n,0,0])):x.type==="tableHead"?(a=!0,u=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(u=n,o[1]!==0?(l[0]=l[1],c=dt(h,t,o,i,n,c)):l[1]!==0&&(c=dt(h,t,l,i,n,c)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(u!==0&&zr(h,t,u,s,f),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=gp(t.events,n))}return e}function dt(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},De(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const u=De(t.events,n[1]);if(o={type:l,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const s=De(t.events,n[2]),f=De(t.events,n[3]),c={type:a,start:Object.assign({},s),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,b=n[3]-n[2]-1;e.add(x,b,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},De(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function zr(e,t,n,r,i){const o=[],l=De(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function De(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const bp={name:"tasklistCheck",tokenize:Sp};function wp(){return{text:{91:bp}}}function Sp(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return W(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),l):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),l):n(u)}function l(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return _(u)?t(u):M(u)?e.check({tokenize:Cp},t,n)(u):n(u)}}function Cp(e,t,n){return B(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Ep(e){return ti([Xf(),lp(),hp(e),xp(),wp()])}const Ap={};function vp(e){const t=this,n=e||Ap,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ep(n)),o.push(Vf()),l.push(Wf(n))}function rt({payload:e,disabled:t=!1,bypassEnabled:n=!1,onBypassChange:r,onSubmit:i}){const[o,l]=pe.useState(()=>n?Bl(e):e.questions.map(()=>[])),[a,u]=pe.useState(!1),[s,f]=pe.useState(!1);pe.useEffect(()=>{n&&l(x=>x.map((b,E)=>{var y;return b.length>0?b:(y=e.questions[E])!=null&&y.options.length?[0]:[]}))},[n,e]);const c=$l(e,o)&&!t&&!a&&!s&&!!i,h=(x,b)=>{t||s||a||l(E=>E.map((y,S)=>{if(S!==x)return y;const A=e.questions[S];return A?A.multiSelect?y.includes(b)?y.filter(z=>z!==b):[...y,b].sort((z,L)=>z-L):[b]:y}))},p=async()=>{if(!c||!i)return;u(!0);const x=await i(Ul(e,o));u(!1),x&&f(!0)};return m.jsxs("div",{className:"rounded-xl border border-primary/20 bg-primary/5 p-4 shadow-[0_24px_80px_-60px_hsl(var(--primary)/0.9)]",children:[m.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-sm border border-primary/20 bg-primary/10 text-primary shadow-sm",children:m.jsx(gl,{className:"h-4 w-4"})}),m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-primary/80",children:"Ask User Question"}),m.jsx("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:"Select the answer you want to send back to the agent."})]})]}),m.jsxs(kt,{type:"button",variant:n?"secondary":"outline",size:"sm",onClick:()=>r==null?void 0:r(!n),className:"rounded-sm",children:[m.jsx(vl,{className:"h-4 w-4"}),n?"Bypass on":"Bypass future questions"]})]}),m.jsx("div",{className:"mt-4 space-y-4",children:e.questions.map((x,b)=>{const E=o[b]??[];return m.jsxs("div",{className:"space-y-3 rounded-lg border border-border/60 bg-background/75 p-4",children:[m.jsxs("div",{children:[x.header&&m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.24em] text-muted-foreground",children:x.header}),m.jsx("div",{className:"mt-1 text-sm font-medium leading-6 text-foreground",children:x.question}),m.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:x.multiSelect?"Select one or more options.":"Select one option."})]}),m.jsx("div",{className:"space-y-2",children:x.options.map((y,S)=>{const A=E.includes(S);return m.jsxs("button",{type:"button",onClick:()=>h(b,S),disabled:t||a||s,"aria-pressed":A,className:bt("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors",A?"border-primary/50 bg-primary/10 text-foreground":"border-border/60 bg-background/80 text-foreground hover:border-primary/30 hover:bg-primary/5"),children:[m.jsx("span",{className:bt("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",A?"border-primary bg-primary text-primary-foreground":"border-border/70 bg-background text-transparent"),children:m.jsx(it,{className:"h-3.5 w-3.5"})}),m.jsxs("span",{className:"min-w-0",children:[m.jsx("span",{className:"block text-sm font-medium leading-5",children:y.label}),y.description&&m.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:y.description})]})]},`${y.label}-${S}`)})})]},`${x.header??"question"}-${b}`)})}),m.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[m.jsx("div",{className:"text-xs text-muted-foreground",children:n?"Bypass is enabled. New question cards will default to the first option.":"Enable bypass if you want future question cards to preselect the first option."}),m.jsx(kt,{type:"button",onClick:()=>void p(),disabled:!c,className:"rounded-sm px-5",children:s?"Sent":a?"Sending...":e.questions.length>1?"Send answers":"Send answer"})]})]})}function Ip({payload:e,disabled:t=!1,onSubmit:n}){const[r,i]=pe.useState(null),[o,l]=pe.useState(!1),a=!t&&!o&&!!n,u=async s=>{if(!a||!n)return;i(s);const f=await n(Jl(e,s));i(null),f&&l(!0)};return m.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/5 p-4 shadow-[0_24px_80px_-60px_rgba(245,158,11,0.8)]",children:[m.jsxs("div",{className:"flex items-start gap-3",children:[m.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-sm border border-amber-500/25 bg-amber-500/10 text-amber-600 shadow-sm dark:text-amber-400",children:m.jsx(El,{className:"h-4 w-4"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-amber-700/80 dark:text-amber-300/80",children:"Permission Request"}),m.jsx("div",{className:"mt-1 space-y-3",children:e.requests.map((s,f)=>m.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/75 px-4 py-3",children:[m.jsx("div",{className:"text-sm font-medium leading-6 text-foreground",children:s.summary}),(s.toolName||s.target)&&m.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:[m.jsx("span",{children:s.toolName}),s.target&&m.jsx("span",{className:"font-mono normal-case tracking-normal",children:s.target})]})]},`${s.toolUseId??s.toolName}-${f}`))})]})]}),m.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-end gap-2",children:[m.jsxs(kt,{type:"button",variant:"outline",onClick:()=>void u("deny"),disabled:!a||r!==null,className:"rounded-sm",children:[m.jsx(ul,{className:"h-4 w-4"}),o?"Sent":r==="deny"?"Sending...":"Deny"]}),m.jsxs(kt,{type:"button",onClick:()=>void u("approve"),disabled:!a||r!==null,className:"rounded-sm",children:[m.jsx(it,{className:"h-4 w-4"}),o?"Sent":r==="approve"?"Sending...":"Approve"]})]})]})}function jp(e){return e.replace(/\s+/g," ").trim()}function Se(e,t=132){const n=jp(e);return n?n.length>t?`${n.slice(0,t-3)}...`:n:""}function fn(e,t=84){if(typeof e=="string")return Se(e,t);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){const n=e.slice(0,3).map(r=>fn(r,28)).filter(Boolean).join(", ");return Se(n||JSON.stringify(e),t)}if(typeof e=="object"&&e!==null){const n=Object.entries(e).slice(0,3).map(([r,i])=>`${r}: ${fn(i,32)}`).join(" · ");return Se(n||JSON.stringify(e),t)}return""}function Wi(e){if(!e)return"No input";const t=Object.entries(e).slice(0,4).map(([n,r])=>`${n}: ${fn(r,40)}`).filter(n=>n.trim().length>0).join(" · ");return Se(t||JSON.stringify(e),156)||"No input"}function Ji({expanded:e}){return m.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-sm px-1 py-0.5 text-[8px] font-medium uppercase tracking-[0.16em] text-muted-foreground/70 transition-colors group-hover/activity:text-muted-foreground",children:[e?"Less":"More",e?m.jsx(cl,{className:"h-2.5 w-2.5"}):m.jsx(fl,{className:"h-2.5 w-2.5"})]})}function zn({title:e,preview:t,icon:n,children:r,accentClassName:i,previewClassName:o="font-mono text-[10px] leading-4 text-muted-foreground/82"}){const[l,a]=pe.useState(!1);return m.jsxs("div",{className:`overflow-hidden rounded-sm border border-border/35 shadow-none ${i}`,children:[m.jsxs("button",{type:"button",onClick:()=>a(u=>!u),className:"flex w-full items-start gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-background/24",children:[m.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm border border-border/40 bg-background/50 text-muted-foreground/80",children:n}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:m.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[0.18em] text-muted-foreground/85",children:e})}),m.jsx("div",{className:`mt-0.5 whitespace-pre-wrap break-words text-[10px] leading-4 ${o}`,children:t})]}),m.jsx(Ji,{expanded:l})]}),l&&m.jsx("div",{className:"border-t border-border/35 px-2.5 py-2",children:r})]})}function Yi({text:e}){const t=Se(e,156);return m.jsx(zn,{title:"Thinking",preview:t,icon:m.jsx(ml,{className:"h-3 w-3"}),accentClassName:"bg-muted/22",previewClassName:"text-[10px] leading-4 text-muted-foreground/82",children:m.jsx("div",{className:"whitespace-pre-wrap text-[11px] leading-4 text-muted-foreground/86",children:e})})}function Xi({block:e,renderedQuestionSignatures:t,questionBypassEnabled:n,onQuestionBypassChange:r,onSubmitQuestionResponse:i,questionResponseDisabled:o}){const l=String(e.name??"tool"),a=e.input,u=ot(e);if(u){const f=Re(u);return t!=null&&t.has(f)?null:(t==null||t.add(f),m.jsx(rt,{payload:u,bypassEnabled:n,onBypassChange:r,onSubmit:i,disabled:o}))}const s=Wi(a);if(l==="TodoWrite"){const f=Pp(a==null?void 0:a.todos);if(f.length>0)return m.jsx(zp,{todos:f})}return m.jsx(zn,{title:`Tool: ${l}`,preview:s,icon:m.jsx(hn,{className:"h-3 w-3"}),accentClassName:"bg-muted/18",children:m.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-[10px] leading-4 text-muted-foreground/86",children:JSON.stringify(a??{},null,2)})})}function Ln({block:e,renderedQuestionSignatures:t,questionBypassEnabled:n,onQuestionBypassChange:r,onSubmitQuestionResponse:i,questionResponseDisabled:o}){const l=Gi(e);if(!l)return null;const a=at(l);if(a){const s=Re(a);return t!=null&&t.has(s)?null:(t==null||t.add(s),m.jsx(rt,{payload:a,bypassEnabled:n,onBypassChange:r,onSubmit:i,disabled:o}))}const u=Se(l,156);return m.jsx(zn,{title:"Result",preview:u,icon:m.jsx(hn,{className:"h-3 w-3"}),accentClassName:"bg-background/45",children:m.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-[10px] leading-4 text-muted-foreground/86",children:l})})}function Gi(e){const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.map(n=>String(n.text??"")).join(`
|
|
77
|
-
`):""}function
|
|
73
|
+
`))+1))}const l="#".repeat(i),a=n.enter("headingAtx"),s=n.enter("phrasing");o.move(l+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
|
|
74
|
+
`,...o.current()});return/^[\t ]/.test(u)&&(u=nt(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,n.options.closeAtx&&(u+=" "+l),s(),a(),u}ji.peek=gf;function ji(e){return e.value||""}function gf(){return"<"}Ti.peek=xf;function Ti(e,t,n,r){const i=Nn(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let a=n.enter("label");const s=n.createTracker(r);let u=s.move("![");return u+=s.move(n.safe(e.alt,{before:u,after:"]",...s.current()})),u+=s.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(a=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),a()),u+=s.move(")"),l(),u}function xf(){return"!"}Ni.peek=yf;function Ni(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const a=n.createTracker(r);let s=a.move("![");const u=n.safe(e.alt,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:s,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function yf(){return"!"}_i.peek=kf;function _i(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],a=n.compilePattern(l);let s;if(l.atBreak)for(;s=a.exec(r);){let u=s.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(s.index+1)}}return i+r+i}function kf(){return"`"}function Pi(e,t){const n=wn(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}zi.peek=bf;function zi(e,t,n,r){const i=Nn(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let a,s;if(Pi(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=l.move("<");return c+=l.move(n.containerPhrasing(e,{before:c,after:">",...l.current()})),c+=l.move(">"),a(),n.stack=f,c}a=n.enter("link"),s=n.enter("label");let u=l.move("[");return u+=l.move(n.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(s=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),s()),u+=l.move(")"),a(),u}function bf(e,t,n){return Pi(e,n)?"<":"["}Li.peek=wf;function Li(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const a=n.createTracker(r);let s=a.move("[");const u=n.containerPhrasing(e,{before:s,after:"]",...a.current()});s+=a.move(u+"]["),l();const f=n.stack;n.stack=[],l=n.enter("reference");const c=n.safe(n.associationId(e),{before:s,after:"]",...a.current()});return l(),n.stack=f,o(),i==="full"||!u||u!==c?s+=a.move(c+"]"):i==="shortcut"?s=s.slice(0,-1):s+=a.move("]"),s}function wf(){return"["}function _n(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Sf(e){const t=_n(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Cf(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Di(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ef(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?Cf(n):_n(n);const a=e.ordered?l==="."?")":".":Sf(n);let s=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(s=!0),Di(n)===l&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){s=!0;break}}}}s&&(l=a),n.bulletCurrent=l;const u=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),u}function Af(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function vf(e,t,n,r){const i=Af(n);let o=n.bulletCurrent||_n(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(l-o.length)),a.shift(l);const s=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return s(),u;function f(c,h,p){return h?(p?"":" ".repeat(l))+c:(p?o:o+" ".repeat(l-o.length))+c}}function If(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const jf=Tt(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Tf(e,t,n,r){return(e.children.some(function(l){return jf(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Nf(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Fi.peek=_f;function Fi(e,t,n,r){const i=Nf(n),o=n.enter("strong"),l=n.createTracker(r),a=l.move(i+i);let s=l.move(n.containerPhrasing(e,{after:i,before:a,...l.current()}));const u=s.charCodeAt(0),f=At(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(s=nt(u)+s.slice(1));const c=s.charCodeAt(s.length-1),h=At(r.after.charCodeAt(0),c,i);h.inside&&(s=s.slice(0,-1)+nt(c));const p=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+s+p}function _f(e,t,n){return n.options.strong||"*"}function Pf(e,t,n,r){return n.safe(e.value,r)}function zf(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Lf(e,t,n){const r=(Di(n)+(n.options.ruleSpaces?" ":"")).repeat(zf(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Mi={blockquote:nf,break:Nr,code:uf,definition:ff,emphasis:Ii,hardBreak:Nr,heading:df,html:ji,image:Ti,imageReference:Ni,inlineCode:_i,link:zi,linkReference:Li,list:Ef,listItem:vf,paragraph:If,root:Tf,strong:Fi,text:Pf,thematicBreak:Lf};function Df(){return{enter:{table:Ff,tableData:_r,tableHeader:_r,tableRow:Of},exit:{codeText:Rf,table:Mf,tableData:Jt,tableHeader:Jt,tableRow:Jt}}}function Ff(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function Mf(e){this.exit(e),this.data.inTable=void 0}function Of(e){this.enter({type:"tableRow",children:[]},e)}function Jt(e){this.exit(e)}function _r(e){this.enter({type:"tableCell",children:[]},e)}function Rf(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Bf));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Bf(e,t){return t==="|"?t:e}function $f(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
75
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:l,tableCell:s,tableRow:a}};function l(p,x,b,E){return u(f(p,b,E),p.align)}function a(p,x,b,E){const y=c(p,b,E),S=u([y]);return S.slice(0,S.indexOf(`
|
|
76
|
+
`))}function s(p,x,b,E){const y=b.enter("tableCell"),S=b.enter("phrasing"),A=b.containerPhrasing(p,{...E,before:o,after:o});return S(),y(),A}function u(p,x){return ef(p,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function f(p,x,b){const E=p.children;let y=-1;const S=[],A=x.enter("table");for(;++y<E.length;)S[y]=c(E[y],x,b);return A(),S}function c(p,x,b){const E=p.children;let y=-1;const S=[],A=x.enter("tableRow");for(;++y<E.length;)S[y]=s(E[y],p,x,b);return A(),S}function h(p,x,b){let E=Mi.inlineCode(p,x,b);return b.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function Uf(){return{exit:{taskListCheckValueChecked:Pr,taskListCheckValueUnchecked:Pr,paragraph:Hf}}}function qf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Vf}}}function Pr(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Hf(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){l=a;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Vf(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(l);let s=Mi.listItem(e,t,n,{...r,...a.current()});return o&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),s;function u(f){return f+l}}function Wf(){return[Cc(),Hc(),Yc(),Df(),Uf()]}function Jf(e){return{extensions:[Ec(),Vc(e),Xc(),$f(e),qf()]}}const Yf={tokenize:ep,partial:!0},Oi={tokenize:tp,partial:!0},Ri={tokenize:np,partial:!0},Bi={tokenize:rp,partial:!0},Xf={tokenize:ip,partial:!0},$i={name:"wwwAutolink",tokenize:Qf,previous:qi},Ui={name:"protocolAutolink",tokenize:Zf,previous:Hi},ke={name:"emailAutolink",tokenize:Kf,previous:Vi},he={};function Gf(){return{text:he}}let Ie=48;for(;Ie<123;)he[Ie]=ke,Ie++,Ie===58?Ie=65:Ie===91&&(Ie=97);he[43]=ke;he[45]=ke;he[46]=ke;he[95]=ke;he[72]=[ke,Ui];he[104]=[ke,Ui];he[87]=[ke,$i];he[119]=[ke,$i];function Kf(e,t,n){const r=this;let i,o;return l;function l(c){return!cn(c)||!Vi.call(r,r.previous)||Pn(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return cn(c)?(e.consume(c),a):c===64?(e.consume(c),s):n(c)}function s(c){return c===46?e.check(Xf,f,u)(c):c===45||c===95||K(c)?(o=!0,e.consume(c),s):f(c)}function u(c){return e.consume(c),i=!0,s}function f(c){return o&&i&&Z(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function Qf(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!qi.call(r,r.previous)||Pn(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Yf,e.attempt(Oi,e.attempt(Ri,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function Zf(e,t,n){const r=this;let i="",o=!1;return l;function l(c){return(c===72||c===104)&&Hi.call(r,r.previous)&&!Pn(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(Z(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),s}return n(c)}function s(c){return c===47?(e.consume(c),o?u:(o=!0,s)):n(c)}function u(c){return c===null||St(c)||W(c)||Te(c)||vt(c)?n(c):e.attempt(Oi,e.attempt(Ri,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function ep(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function tp(e,t,n){let r,i,o;return l;function l(u){return u===46||u===95?e.check(Bi,s,a)(u):u===null||W(u)||Te(u)||u!==45&&vt(u)?s(u):(o=!0,e.consume(u),l)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function s(u){return i||r||!o?n(u):t(u)}}function np(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Bi,t,o)(l):l===null||W(l)||Te(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function rp(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||W(a)||Te(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||W(a)||Te(a)?t(a):r(a)}function o(a){return Z(a)?l(a):n(a)}function l(a){return a===59?(e.consume(a),r):Z(a)?(e.consume(a),l):n(a)}}function ip(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return K(o)?n(o):t(o)}}function qi(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||W(e)}function Hi(e){return!Z(e)}function Vi(e){return!(e===47||cn(e))}function cn(e){return e===43||e===45||e===46||e===95||K(e)}function Pn(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const lp={tokenize:hp,partial:!0};function op(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cp,continuation:{tokenize:fp},exit:pp}},text:{91:{name:"gfmFootnoteCall",tokenize:up},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ap,resolveTo:sp}}}}function ap(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const s=r.events[i][1];if(s.type==="labelImage"){l=s;break}if(s.type==="gfmFootnoteCall"||s.type==="labelLink"||s.type==="label"||s.type==="image"||s.type==="link")break}return a;function a(s){if(!l||!l._balanced)return n(s);const u=ce(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(s):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),t(s))}}function sp(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function up(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),s}function s(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!l||c===null||c===91||W(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(ce(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return W(c)||(l=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function cp(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,a;return s;function s(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(x)}function f(x){if(l>999||x===93&&!a||x===null||x===91||W(x))return n(x);if(x===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return o=ce(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return W(x)||(a=!0),l++,e.consume(x),x===92?c:f}function c(x){return x===91||x===92||x===93?(e.consume(x),l++,f):f(x)}function h(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(o)||i.push(o),B(e,p,"gfmFootnoteDefinitionWhitespace")):n(x)}function p(x){return t(x)}}function fp(e,t,n){return e.check(ut,t,e.attempt(lp,t,n))}function pp(e){e.exit("gfmFootnoteDefinition")}function hp(e,t,n){const r=this;return B(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function mp(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,a){let s=-1;for(;++s<l.length;)if(l[s][0]==="enter"&&l[s][1].type==="strikethroughSequenceTemporary"&&l[s][1]._close){let u=s;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[s][1].end.offset-l[s][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[s][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[s][1].end)},c={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[s][1].start)},h=[["enter",f,a],["enter",l[u][1],a],["exit",l[u][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&ie(h,h.length,0,It(p,l.slice(u+1,s),a)),ie(h,h.length,0,[["exit",c,a],["enter",l[s][1],a],["exit",l[s][1],a],["exit",f,a]]),ie(l,u-1,s-u+3,h),s=u+h.length-2;break}}for(s=-1;++s<l.length;)l[s][1].type==="strikethroughSequenceTemporary"&&(l[s][1].type="data");return l}function o(l,a,s){const u=this.previous,f=this.events;let c=0;return h;function h(x){return u===126&&f[f.length-1][1].type!=="characterEscape"?s(x):(l.enter("strikethroughSequenceTemporary"),p(x))}function p(x){const b=Oe(u);if(x===126)return c>1?s(x):(l.consume(x),c++,p);if(c<2&&!n)return s(x);const E=l.exit("strikethroughSequenceTemporary"),y=Oe(x);return E._open=!y||y===2&&!!b,E._close=!b||b===2&&!!y,a(x)}}}class dp{constructor(){this.map=[]}add(t,n,r){gp(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function gp(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function xp(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function yp(){return{flow:{null:{name:"table",tokenize:kp,resolveAll:bp}}}}function kp(e,t,n){const r=this;let i=0,o=0,l;return a;function a(k){let T=r.events.length-1;for(;T>-1;){const P=r.events[T][1].type;if(P==="lineEnding"||P==="linePrefix")T--;else break}const N=T>-1?r.events[T][1].type:null,q=N==="tableHead"||N==="tableRow"?C:s;return q===C&&r.parser.lazy[r.now().line]?n(k):q(k)}function s(k){return e.enter("tableHead"),e.enter("tableRow"),u(k)}function u(k){return k===124||(l=!0,o+=1),f(k)}function f(k){return k===null?n(k):_(k)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),p):n(k):M(k)?B(e,f,"whitespace")(k):(o+=1,l&&(l=!1,i+=1),k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),l=!0,f):(e.enter("data"),c(k)))}function c(k){return k===null||k===124||W(k)?(e.exit("data"),f(k)):(e.consume(k),k===92?h:c)}function h(k){return k===92||k===124?(e.consume(k),c):c(k)}function p(k){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(k):(e.enter("tableDelimiterRow"),l=!1,M(k)?B(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):x(k))}function x(k){return k===45||k===58?E(k):k===124?(l=!0,e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),b):L(k)}function b(k){return M(k)?B(e,E,"whitespace")(k):E(k)}function E(k){return k===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),y):k===45?(o+=1,y(k)):k===null||_(k)?z(k):L(k)}function y(k){return k===45?(e.enter("tableDelimiterFiller"),S(k)):L(k)}function S(k){return k===45?(e.consume(k),S):k===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(k),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(k))}function A(k){return M(k)?B(e,z,"whitespace")(k):z(k)}function z(k){return k===124?x(k):k===null||_(k)?!l||i!==o?L(k):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(k)):L(k)}function L(k){return n(k)}function C(k){return e.enter("tableRow"),O(k)}function O(k){return k===124?(e.enter("tableCellDivider"),e.consume(k),e.exit("tableCellDivider"),O):k===null||_(k)?(e.exit("tableRow"),t(k)):M(k)?B(e,O,"whitespace")(k):(e.enter("data"),U(k))}function U(k){return k===null||k===124||W(k)?(e.exit("data"),O(k)):(e.consume(k),k===92?$:U)}function $(k){return k===92||k===124?(e.consume(k),U):U(k)}}function bp(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],a=!1,s=0,u,f,c;const h=new dp;for(;++n<e.length;){const p=e[n],x=p[1];p[0]==="enter"?x.type==="tableHead"?(a=!1,s!==0&&(zr(h,t,s,u,f),f=void 0,s=0),u={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(n,0,[["enter",u,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],l=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},h.add(n,0,[["enter",f,t]])),i=x.type==="tableDelimiterRow"?2:f?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],c=dt(h,t,o,i,void 0,c),o=[0,0,0,0]),l[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],c=dt(h,t,o,i,void 0,c)),o=l,l=[o[1],n,0,0])):x.type==="tableHead"?(a=!0,s=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(s=n,o[1]!==0?(l[0]=l[1],c=dt(h,t,o,i,n,c)):l[1]!==0&&(c=dt(h,t,l,i,n,c)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(l[3]=n)}for(s!==0&&zr(h,t,s,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=xp(t.events,n))}return e}function dt(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Fe(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const s=Fe(t.events,n[1]);if(o={type:l,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Fe(t.events,n[2]),f=Fe(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],p=t.events[n[3]];if(h[1].end=Object.assign({},p[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,b=n[3]-n[2]-1;e.add(x,b,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Fe(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function zr(e,t,n,r,i){const o=[],l=Fe(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Fe(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const wp={name:"tasklistCheck",tokenize:Cp};function Sp(){return{text:{91:wp}}}function Cp(e,t,n){const r=this;return i;function i(s){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(s):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),o)}function o(s){return W(s)?(e.enter("taskListCheckValueUnchecked"),e.consume(s),e.exit("taskListCheckValueUnchecked"),l):s===88||s===120?(e.enter("taskListCheckValueChecked"),e.consume(s),e.exit("taskListCheckValueChecked"),l):n(s)}function l(s){return s===93?(e.enter("taskListCheckMarker"),e.consume(s),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(s)}function a(s){return _(s)?t(s):M(s)?e.check({tokenize:Ep},t,n)(s):n(s)}}function Ep(e,t,n){return B(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Ap(e){return ti([Gf(),op(),mp(e),yp(),Sp()])}const vp={};function Ip(e){const t=this,n=e||vp,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(Ap(n)),o.push(Wf()),l.push(Jf(n))}function rt({payload:e,disabled:t=!1,bypassEnabled:n=!1,onBypassChange:r,onSubmit:i}){const[o,l]=pe.useState(()=>n?Bl(e):e.questions.map(()=>[])),[a,s]=pe.useState(!1),[u,f]=pe.useState(!1);pe.useEffect(()=>{n&&l(x=>x.map((b,E)=>{var y;return b.length>0?b:(y=e.questions[E])!=null&&y.options.length?[0]:[]}))},[n,e]);const c=$l(e,o)&&!t&&!a&&!u&&!!i,h=(x,b)=>{t||u||a||l(E=>E.map((y,S)=>{if(S!==x)return y;const A=e.questions[S];return A?A.multiSelect?y.includes(b)?y.filter(z=>z!==b):[...y,b].sort((z,L)=>z-L):[b]:y}))},p=async()=>{if(!c||!i)return;s(!0);const x=await i(Ul(e,o));s(!1),x&&f(!0)};return m.jsxs("div",{className:"rounded-xl border border-primary/20 bg-primary/5 p-4 shadow-[0_24px_80px_-60px_hsl(var(--primary)/0.9)]",children:[m.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-sm border border-primary/20 bg-primary/10 text-primary shadow-sm",children:m.jsx(gl,{className:"h-4 w-4"})}),m.jsxs("div",{children:[m.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-primary/80",children:"Ask User Question"}),m.jsx("div",{className:"mt-1 text-sm leading-6 text-muted-foreground",children:"Select the answer you want to send back to the agent."})]})]}),m.jsxs(kt,{type:"button",variant:n?"secondary":"outline",size:"sm",onClick:()=>r==null?void 0:r(!n),className:"rounded-sm",children:[m.jsx(vl,{className:"h-4 w-4"}),n?"Bypass on":"Bypass future questions"]})]}),m.jsx("div",{className:"mt-4 space-y-4",children:e.questions.map((x,b)=>{const E=o[b]??[];return m.jsxs("div",{className:"space-y-3 rounded-lg border border-border/60 bg-background/75 p-4",children:[m.jsxs("div",{children:[x.header&&m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.24em] text-muted-foreground",children:x.header}),m.jsx("div",{className:"mt-1 text-sm font-medium leading-6 text-foreground",children:x.question}),m.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:x.multiSelect?"Select one or more options.":"Select one option."})]}),m.jsx("div",{className:"space-y-2",children:x.options.map((y,S)=>{const A=E.includes(S);return m.jsxs("button",{type:"button",onClick:()=>h(b,S),disabled:t||a||u,"aria-pressed":A,className:bt("flex w-full items-start gap-3 rounded-lg border px-4 py-3 text-left transition-colors",A?"border-primary/50 bg-primary/10 text-foreground":"border-border/60 bg-background/80 text-foreground hover:border-primary/30 hover:bg-primary/5"),children:[m.jsx("span",{className:bt("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border",A?"border-primary bg-primary text-primary-foreground":"border-border/70 bg-background text-transparent"),children:m.jsx(it,{className:"h-3.5 w-3.5"})}),m.jsxs("span",{className:"min-w-0",children:[m.jsx("span",{className:"block text-sm font-medium leading-5",children:y.label}),y.description&&m.jsx("span",{className:"mt-1 block text-xs leading-5 text-muted-foreground",children:y.description})]})]},`${y.label}-${S}`)})})]},`${x.header??"question"}-${b}`)})}),m.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-3",children:[m.jsx("div",{className:"text-xs text-muted-foreground",children:n?"Bypass is enabled. New question cards will default to the first option.":"Enable bypass if you want future question cards to preselect the first option."}),m.jsx(kt,{type:"button",onClick:()=>void p(),disabled:!c,className:"rounded-sm px-5",children:u?"Sent":a?"Sending...":e.questions.length>1?"Send answers":"Send answer"})]})]})}function jp({payload:e,disabled:t=!1,onSubmit:n}){const[r,i]=pe.useState(null),[o,l]=pe.useState(!1),a=!t&&!o&&!!n,s=async u=>{if(!a||!n)return;i(u);const f=await n(Jl(e,u));i(null),f&&l(!0)};return m.jsxs("div",{className:"rounded-xl border border-amber-500/25 bg-amber-500/5 p-4 shadow-[0_24px_80px_-60px_rgba(245,158,11,0.8)]",children:[m.jsxs("div",{className:"flex items-start gap-3",children:[m.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-sm border border-amber-500/25 bg-amber-500/10 text-amber-600 shadow-sm dark:text-amber-400",children:m.jsx(El,{className:"h-4 w-4"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-amber-700/80 dark:text-amber-300/80",children:"Permission Request"}),m.jsx("div",{className:"mt-1 space-y-3",children:e.requests.map((u,f)=>m.jsxs("div",{className:"rounded-lg border border-border/60 bg-background/75 px-4 py-3",children:[m.jsx("div",{className:"text-sm font-medium leading-6 text-foreground",children:u.summary}),(u.toolName||u.target)&&m.jsxs("div",{className:"mt-2 flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:[m.jsx("span",{children:u.toolName}),u.target&&m.jsx("span",{className:"font-mono normal-case tracking-normal",children:u.target})]})]},`${u.toolUseId??u.toolName}-${f}`))})]})]}),m.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-end gap-2",children:[m.jsxs(kt,{type:"button",variant:"outline",onClick:()=>void s("deny"),disabled:!a||r!==null,className:"rounded-sm",children:[m.jsx(ul,{className:"h-4 w-4"}),o?"Sent":r==="deny"?"Sending...":"Deny"]}),m.jsxs(kt,{type:"button",onClick:()=>void s("approve"),disabled:!a||r!==null,className:"rounded-sm",children:[m.jsx(it,{className:"h-4 w-4"}),o?"Sent":r==="approve"?"Sending...":"Approve"]})]})]})}function Tp(e){return e.replace(/\s+/g," ").trim()}function Se(e,t=132){const n=Tp(e);return n?n.length>t?`${n.slice(0,t-3)}...`:n:""}function fn(e,t=84){if(typeof e=="string")return Se(e,t);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){const n=e.slice(0,3).map(r=>fn(r,28)).filter(Boolean).join(", ");return Se(n||JSON.stringify(e),t)}if(typeof e=="object"&&e!==null){const n=Object.entries(e).slice(0,3).map(([r,i])=>`${r}: ${fn(i,32)}`).join(" · ");return Se(n||JSON.stringify(e),t)}return""}function Wi(e){if(!e)return"No input";const t=Object.entries(e).slice(0,4).map(([n,r])=>`${n}: ${fn(r,40)}`).filter(n=>n.trim().length>0).join(" · ");return Se(t||JSON.stringify(e),156)||"No input"}function Ji({expanded:e}){return m.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded-sm px-1 py-0.5 text-[8px] font-medium uppercase tracking-[0.16em] text-muted-foreground/70 transition-colors group-hover/activity:text-muted-foreground",children:[e?"Less":"More",e?m.jsx(cl,{className:"h-2.5 w-2.5"}):m.jsx(fl,{className:"h-2.5 w-2.5"})]})}function zn({title:e,preview:t,icon:n,children:r,accentClassName:i,previewClassName:o="font-mono text-[10px] leading-4 text-muted-foreground/82"}){const[l,a]=pe.useState(!1);return m.jsxs("div",{className:`overflow-hidden rounded-sm border border-border/35 shadow-none ${i}`,children:[m.jsxs("button",{type:"button",onClick:()=>a(s=>!s),className:"flex w-full items-start gap-2 px-2.5 py-1.5 text-left transition-colors hover:bg-background/24",children:[m.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-sm border border-border/40 bg-background/50 text-muted-foreground/80",children:n}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:m.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[0.18em] text-muted-foreground/85",children:e})}),m.jsx("div",{className:`mt-0.5 whitespace-pre-wrap break-words text-[10px] leading-4 ${o}`,children:t})]}),m.jsx(Ji,{expanded:l})]}),l&&m.jsx("div",{className:"border-t border-border/35 px-2.5 py-2",children:r})]})}function Yi({text:e}){const t=Se(e,156);return m.jsx(zn,{title:"Thinking",preview:t,icon:m.jsx(ml,{className:"h-3 w-3"}),accentClassName:"bg-muted/22",previewClassName:"text-[10px] leading-4 text-muted-foreground/82",children:m.jsx("div",{className:"whitespace-pre-wrap text-[11px] leading-4 text-muted-foreground/86",children:e})})}function Xi({block:e,renderedQuestionSignatures:t,questionBypassEnabled:n,onQuestionBypassChange:r,onSubmitQuestionResponse:i,questionResponseDisabled:o}){const l=String(e.name??"tool"),a=e.input,s=ot(e);if(s){const f=Be(s);return t!=null&&t.has(f)?null:(t==null||t.add(f),m.jsx(rt,{payload:s,bypassEnabled:n,onBypassChange:r,onSubmit:i,disabled:o}))}const u=Wi(a);if(l==="TodoWrite"){const f=zp(a==null?void 0:a.todos);if(f.length>0)return m.jsx(Lp,{todos:f})}return m.jsx(zn,{title:`Tool: ${l}`,preview:u,icon:m.jsx(hn,{className:"h-3 w-3"}),accentClassName:"bg-muted/18",children:m.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-[10px] leading-4 text-muted-foreground/86",children:JSON.stringify(a??{},null,2)})})}function Ln({block:e,renderedQuestionSignatures:t,questionBypassEnabled:n,onQuestionBypassChange:r,onSubmitQuestionResponse:i,questionResponseDisabled:o}){const l=Gi(e);if(!l)return null;const a=at(l);if(a){const u=Be(a);return t!=null&&t.has(u)?null:(t==null||t.add(u),m.jsx(rt,{payload:a,bypassEnabled:n,onBypassChange:r,onSubmit:i,disabled:o}))}const s=Se(l,156);return m.jsx(zn,{title:"Result",preview:s,icon:m.jsx(hn,{className:"h-3 w-3"}),accentClassName:"bg-background/45",children:m.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-[10px] leading-4 text-muted-foreground/86",children:l})})}function Gi(e){const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.map(n=>String(n.text??"")).join(`
|
|
77
|
+
`):""}function Np(e){const t=e.message;return typeof t=="object"&&t!==null&&Array.isArray(t.content)?t.content:Array.isArray(e.content)?e.content:[]}function _p(e){return e.flatMap(t=>Np(t).flatMap(n=>{if(n.type==="thinking"){const r=String(n.thinking??"").trim();return r?[{title:"Thinking",preview:Se(r,112),block:n,kind:"thinking"}]:[]}if(n.type==="tool_use")return[{title:`Tool: ${String(n.name??"tool")}`,preview:Wi(n.input),block:n,kind:"tool_use"}];if(n.type==="tool_result"){const r=Se(Gi(n),112);return r?[{title:"Result",preview:r,block:n,kind:"tool_result"}]:[]}return[]}))}function Pp({events:e,...t}){const[n,r]=pe.useState(!1),i=_p(e);return i.length===0?null:m.jsxs("div",{className:"animate-agent-activity group/activity overflow-hidden py-0.5 text-muted-foreground",children:[m.jsxs("button",{type:"button",onClick:()=>r(o=>!o),"aria-expanded":n,className:"flex w-full items-start gap-1.5 rounded-sm px-1 py-1 text-left transition-colors hover:bg-muted/18",children:[m.jsx("div",{className:"mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground/55 transition-colors group-hover/activity:text-muted-foreground/80",children:m.jsx(hn,{className:"h-3 w-3"})}),m.jsxs("div",{className:"min-w-0 flex-1 space-y-0.5",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[m.jsx("span",{className:"text-[9px] font-semibold uppercase tracking-[0.18em] text-muted-foreground/80",children:"Agent activity"}),m.jsxs("span",{className:"font-mono text-[9px] leading-4 text-muted-foreground/55",children:[i.length," ",i.length===1?"item":"items"]})]}),m.jsx("div",{className:"space-y-0.5",children:i.slice(0,4).map((o,l)=>m.jsxs("div",{className:"grid gap-1 text-[10px] leading-4 sm:grid-cols-[5.75rem_minmax(0,1fr)]",children:[m.jsx("span",{className:"truncate font-medium text-muted-foreground/75",children:o.title}),m.jsx("span",{className:"truncate font-mono text-muted-foreground/60",children:o.preview})]},`${o.kind}-${l}`))})]}),m.jsx(Ji,{expanded:n})]}),n&&m.jsx("div",{className:"animate-agent-activity-expand space-y-1 px-3 pb-1 pt-0.5",children:i.map((o,l)=>o.kind==="thinking"?m.jsx(Yi,{text:String(o.block.thinking??"")},l):o.kind==="tool_use"?m.jsx(Xi,{block:o.block,...t},l):m.jsx(Ln,{block:o.block,...t},l))})]})}function zp(e){return Array.isArray(e)?e.map(t=>{if(typeof t!="object"||t===null)return null;const n=t,r=typeof n.content=="string"?n.content:"";if(!r)return null;const i=typeof n.activeForm=="string"?n.activeForm:r,o=typeof n.status=="string"?n.status:"pending";return{content:r,activeForm:i,status:o==="completed"||o==="in_progress"?o:"pending"}}).filter(t=>t!==null):[]}function Lp({todos:e}){const t=e.filter(i=>i.status==="completed").length,n=e.length,r=e.find(i=>i.status==="in_progress");return m.jsxs("div",{className:"overflow-hidden rounded-sm border border-border/35 bg-muted/16 shadow-none",children:[m.jsxs("div",{className:"flex items-center gap-2 border-b border-border/35 px-2.5 py-1.5",children:[m.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-sm border border-border/40 bg-background/50 text-muted-foreground/80",children:m.jsx(bl,{className:"h-3 w-3"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-[0.18em] text-muted-foreground/85",children:"Todos"}),m.jsx("div",{className:"mt-0.5 truncate text-[10px] leading-4 text-muted-foreground/82",children:r?r.activeForm:n===0?"No items":t===n?"All complete":"Up next"})]}),m.jsxs("div",{className:"shrink-0 rounded-sm border border-border/40 bg-background/50 px-1.5 py-0.5 font-mono text-[9px] tracking-wide text-muted-foreground/75",children:[t,"/",n]})]}),m.jsx("ul",{className:"divide-y divide-border/40",children:e.map((i,o)=>m.jsxs("li",{className:"flex items-start gap-2 px-2.5 py-1.5",children:[m.jsx(Dp,{status:i.status}),m.jsx("span",{className:i.status==="completed"?"text-[11px] leading-4 text-muted-foreground line-through decoration-muted-foreground/60":i.status==="in_progress"?"text-[11px] font-medium leading-4 text-foreground":"text-[11px] leading-4 text-foreground/85",children:i.status==="in_progress"?i.activeForm:i.content})]},`${o}-${i.content}`))})]})}function Dp({status:e}){return e==="completed"?m.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-full bg-emerald-500/15 text-emerald-500 dark:text-emerald-400",children:m.jsx(it,{className:"h-2.5 w-2.5"})}):e==="in_progress"?m.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center text-primary",children:m.jsx(Sl,{className:"h-3 w-3 animate-spin"})}):m.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center text-muted-foreground/60",children:m.jsx(yl,{className:"h-2.5 w-2.5"})})}function uh({event:e,agent:t,subItems:n=[],questionBypassEnabled:r=!1,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l=!1}){const a=e.type,s=mn(e),u=ot(e);if(s)return m.jsx(Ze,{agent:t,children:m.jsx(jp,{payload:s,onSubmit:o,disabled:l})});if(u)return m.jsx(Ze,{agent:t,children:m.jsx(rt,{payload:u,bypassEnabled:r,onBypassChange:i,onSubmit:o,disabled:l})});if(a==="user"){if(e.isMeta===!0||e.isSidechain===!0)return null;const f=Fp(e),c=f.filter(p=>p.type==="tool_result");if(c.length>0&&f.every(p=>p.type==="tool_result"))return m.jsx(Ze,{agent:t,children:c.map((p,x)=>m.jsx(Ln,{block:p,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l},x))});const h=Re(e);return h?m.jsx(Bp,{content:h}):null}return a==="assistant"?m.jsx($p,{event:e,agent:t,subItems:n,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l}):null}function Fp(e){const t=e.message,n=t==null?void 0:t.content;if(Array.isArray(n))return n.filter(i=>typeof i=="object"&&i!==null);const r=e.content;return Array.isArray(r)?r.filter(i=>typeof i=="object"&&i!==null):[]}function Yt(e){var n;const t=e.replace(/\r\n/g,`
|
|
78
78
|
`).split(`
|
|
79
79
|
`);for(;t.length>0&&((n=t[0])==null?void 0:n.trim())==="";)t.shift();return t.join(`
|
|
80
|
-
`)}function Ki({text:e,tone:t="default",className:n=""}){const r=t==="inverted",i=r?"underline decoration-current/45 underline-offset-2 hover:decoration-current":"underline decoration-current/35 underline-offset-2 hover:decoration-current",o=r?"rounded-sm bg-black/15 px-1 py-0.5 font-mono text-[11px] text-primary-foreground":"rounded-sm bg-muted/80 px-1 py-0.5 font-mono text-[11px] text-foreground",l=r?"overflow-x-auto rounded-lg border border-primary-foreground/15 bg-black/15 px-3 py-2 font-mono text-[11px] leading-5 text-primary-foreground":"overflow-x-auto rounded-lg border border-border/60 bg-muted/55 px-3 py-2 font-mono text-[11px] leading-5 text-foreground",a=r?"w-full border-collapse text-left text-[11px] text-primary-foreground":"w-full border-collapse text-left text-[11px] text-foreground",
|
|
80
|
+
`)}function Ki({text:e,tone:t="default",className:n=""}){const r=t==="inverted",i=r?"underline decoration-current/45 underline-offset-2 hover:decoration-current":"underline decoration-current/35 underline-offset-2 hover:decoration-current",o=r?"rounded-sm bg-black/15 px-1 py-0.5 font-mono text-[11px] text-primary-foreground":"rounded-sm bg-muted/80 px-1 py-0.5 font-mono text-[11px] text-foreground",l=r?"overflow-x-auto rounded-lg border border-primary-foreground/15 bg-black/15 px-3 py-2 font-mono text-[11px] leading-5 text-primary-foreground":"overflow-x-auto rounded-lg border border-border/60 bg-muted/55 px-3 py-2 font-mono text-[11px] leading-5 text-foreground",a=r?"w-full border-collapse text-left text-[11px] text-primary-foreground":"w-full border-collapse text-left text-[11px] text-foreground",s=r?"border border-primary-foreground/20 px-2 py-1 align-top":"border border-border/60 px-2 py-1 align-top",u=r?"border-l-2 border-primary-foreground/30 pl-3 italic text-primary-foreground/90":"border-l-2 border-border pl-3 italic text-muted-foreground";return m.jsx("div",{className:["max-w-none break-words text-[12px] leading-[18px] [overflow-wrap:anywhere] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&>*+*]:mt-3 [&_li>p]:my-0",n].filter(Boolean).join(" "),children:m.jsx(fc,{remarkPlugins:[Ip,Sc],components:{a:({node:f,...c})=>m.jsx("a",{...c,target:"_blank",rel:"noreferrer noopener",className:i}),blockquote:({node:f,...c})=>m.jsx("blockquote",{...c,className:u}),code:({node:f,className:c,children:h,...p})=>c?m.jsx("code",{...p,className:c,children:h}):m.jsx("code",{...p,className:o,children:h}),h1:({node:f,...c})=>m.jsx("h1",{...c,className:"text-[15px] font-semibold leading-6"}),h2:({node:f,...c})=>m.jsx("h2",{...c,className:"text-[14px] font-semibold leading-6"}),h3:({node:f,...c})=>m.jsx("h3",{...c,className:"text-[13px] font-semibold leading-5"}),h4:({node:f,...c})=>m.jsx("h4",{...c,className:"text-[12px] font-semibold leading-5"}),hr:({node:f,...c})=>m.jsx("hr",{...c,className:r?"border-primary-foreground/20":"border-border"}),img:({node:f,alt:c,src:h})=>h?m.jsx("a",{href:h,target:"_blank",rel:"noreferrer noopener",className:i,children:(c==null?void 0:c.trim())||h}):m.jsx("span",{children:(c==null?void 0:c.trim())||"Image"}),ol:({node:f,...c})=>m.jsx("ol",{...c,className:"list-decimal space-y-1 pl-5"}),p:({node:f,...c})=>m.jsx("p",{...c,className:"my-0"}),pre:({node:f,...c})=>m.jsx("pre",{...c,className:l}),table:({node:f,...c})=>m.jsx("table",{...c,className:a}),td:({node:f,...c})=>m.jsx("td",{...c,className:s}),th:({node:f,...c})=>m.jsx("th",{...c,className:`${s} font-semibold`}),ul:({node:f,...c})=>m.jsx("ul",{...c,className:"list-disc space-y-1 pl-5"})},children:e})})}function Qi({text:e,className:t=""}){const[n,r]=pe.useState(!1);if(!e)return null;const i=async o=>{o.stopPropagation();try{await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),1500)}catch{}};return m.jsx("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy message",className:`flex h-6 w-6 items-center justify-center rounded-sm border border-border/60 bg-background/86 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-all hover:-translate-y-px hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${t}`,children:n?m.jsx(it,{className:"h-3 w-3 text-emerald-500"}):m.jsx(Mr,{className:"h-3 w-3"})})}async function Mp(e){let n=await(await fetch(e)).blob();n.type!=="image/png"&&(n=await Op(n)),await navigator.clipboard.write([new ClipboardItem({[n.type]:n})])}async function Op(e){const t=await createImageBitmap(e),n=document.createElement("canvas");n.width=t.width,n.height=t.height;const r=n.getContext("2d");if(!r)throw new Error("canvas 2d context unavailable");return r.drawImage(t,0,0),await new Promise((i,o)=>{n.toBlob(l=>l?i(l):o(new Error("toBlob failed")),"image/png")})}function Rp({dataUrl:e,className:t=""}){const[n,r]=pe.useState(!1),i=async o=>{o.stopPropagation();try{await Mp(e),r(!0),setTimeout(()=>r(!1),1500)}catch(l){console.error("copy image failed",l)}};return m.jsx("button",{type:"button",onClick:i,"aria-label":n?"Copied":"Copy image",className:`flex h-6 w-6 items-center justify-center rounded-sm border border-border/60 bg-background/86 text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-all hover:-translate-y-px hover:text-foreground group-hover:opacity-100 focus-visible:opacity-100 ${t}`,children:n?m.jsx(it,{className:"h-3 w-3 text-emerald-500"}):m.jsx(Mr,{className:"h-3 w-3"})})}function Bp({content:e}){const t=zl(e),n=e.filter(r=>r.type==="image");return m.jsx("div",{className:"animate-message-rise flex w-full max-w-full min-w-0 justify-end",children:m.jsxs("div",{className:"group relative flex min-w-0 max-w-[88%] items-start gap-3",children:[m.jsx(Qi,{text:t,className:"absolute -left-8 top-7"}),m.jsxs("div",{className:"flex min-w-0 max-w-full flex-col items-end gap-1",children:[m.jsx("div",{className:"pr-1 text-[10px] font-semibold uppercase tracking-[0.28em] text-muted-foreground",children:"You"}),m.jsxs("div",{className:"max-w-full space-y-1 overflow-hidden rounded-xl rounded-br-[9px] border border-primary/20 bg-primary px-3.5 py-2.5 text-[12px] leading-[18px] text-primary-foreground shadow-[0_22px_72px_-44px_hsl(var(--primary)/0.95)]",children:[t&&m.jsx(Ki,{text:t,tone:"inverted"}),n.length>0&&m.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:n.map((r,i)=>{const o=Ll(r);return m.jsxs("div",{className:"relative",children:[m.jsx("img",{src:o,alt:r.filename??`attachment ${i+1}`,className:"max-h-72 w-full rounded-2xl border border-primary-foreground/15 object-cover"}),m.jsx(Rp,{dataUrl:o,className:"absolute right-2 top-2"})]},`${r.filename??"image"}-${i}`)})})]})]}),m.jsx("div",{className:"mt-6 flex h-8 w-8 shrink-0 items-center justify-center rounded-sm border border-primary/20 bg-primary/10 text-primary shadow-sm",children:m.jsx(jl,{className:"h-4 w-4"})})]})})}function Ze({agent:e,children:t}){const n=e?Br(e):"Agent";return m.jsx("div",{className:"animate-message-rise flex w-full max-w-full min-w-0 justify-start",children:m.jsxs("div",{className:"flex min-w-0 max-w-[92%] items-start gap-3",children:[m.jsx("div",{className:"mt-6 flex h-8 w-8 shrink-0 items-center justify-center rounded-sm border border-border/70 bg-muted/70 text-muted-foreground shadow-sm",children:m.jsx(Or,{agent:e??"",className:"h-4 w-4"})}),m.jsxs("div",{className:"min-w-0 max-w-full space-y-2",children:[m.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-[0.28em] text-muted-foreground","data-agent-speaker-label":n,children:n}),t]})]})})}function $p({event:e,agent:t,subItems:n=[],questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l}){const a=e.message;if(!a)return null;const s=ot(a);if(s)return m.jsx(Ze,{agent:t,children:m.jsx(rt,{payload:s,bypassEnabled:r,onBypassChange:i,onSubmit:o,disabled:l})});const u=a.content;if(!u||!Array.isArray(u))return null;const f=new Set,c=u.filter(S=>S.type==="text").map(S=>({...S,text:Yt(String(S.text??"")),questionPayload:at(Yt(String(S.text??"")))})).filter(S=>S.text.length>0||S.questionPayload),h=u.filter(S=>S.type==="thinking").map(S=>Yt(String(S.thinking??""))).filter(Boolean).join(`
|
|
81
81
|
|
|
82
|
-
`),p=
|
|
83
|
-
`):""}function
|
|
82
|
+
`),p=u.filter(S=>S.type==="tool_use"),x=u.filter(S=>S.type==="tool_result"),b=c.length>0,E=b&&(h.length>0||p.length>0||x.length>0)?[{type:"assistant",message:{content:[...h.length>0?[{type:"thinking",thinking:h}]:[],...p,...x]}}]:[];return c.length>0||h.length>0||p.length>0||x.length>0||n.length>0?m.jsxs(Ze,{agent:t,children:[c.map((S,A)=>{if(S.questionPayload){const z=Be(S.questionPayload);return f.has(z)?null:(f.add(z),m.jsx(rt,{payload:S.questionPayload,bypassEnabled:r,onBypassChange:i,onSubmit:o,disabled:l},A))}return m.jsxs("div",{className:"group relative max-w-full overflow-hidden rounded-xl rounded-bl-[9px] border border-border/70 bg-card/86 px-3.5 py-2.5 text-[12px] leading-[18px] text-foreground shadow-[0_20px_70px_-58px_rgba(15,23,42,0.75)] backdrop-blur-sm dark:shadow-[0_20px_70px_-58px_rgba(0,0,0,0.95)]",children:[m.jsx(Qi,{text:S.text,className:"absolute right-2 top-2"}),m.jsx(Ki,{text:S.text})]},A)}),(n.length>0||E.length>0)&&m.jsx(Pp,{events:[...E,...n],questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l}),h.length>0&&!b&&m.jsx(Yi,{text:h}),!b&&p.map((S,A)=>m.jsx(Xi,{block:S,renderedQuestionSignatures:f,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l},A)),!b&&x.map((S,A)=>m.jsx(Ln,{block:S,renderedQuestionSignatures:f,questionBypassEnabled:r,onQuestionBypassChange:i,onSubmitQuestionResponse:o,questionResponseDisabled:l},A))]}):null}function yt(e){return typeof e=="object"&&e!==null}function Up(e){const t=e.message;return yt(t)&&Array.isArray(t.content)?t.content.filter(yt):Array.isArray(e.content)?e.content.filter(yt):[]}function qp(e){const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.filter(yt).map(n=>String(n.text??"")).join(`
|
|
83
|
+
`):""}function Hp(e){return ot(e)?!0:e.type==="tool_result"&&at(qp(e))!==null}function Vp(e){const t=Up(e);return t.length===0||t.some(Hp)?!1:e.type==="assistant"?t.every(n=>n.type==="thinking"||n.type==="tool_use"||n.type==="tool_result"):e.type==="user"?t.every(n=>n.type==="tool_result"):!1}function ch(e){const t=[];let n=[];const r=()=>{var o;if(n.length===0)return;const i=typeof((o=n[0])==null?void 0:o.timestamp)=="string"?n[0].timestamp:void 0;t.push({event:{type:"assistant",message:{role:"assistant",content:[]},...i?{timestamp:i}:{}},subItems:n}),n=[]};for(const i of e){if(Vp(i)){n.push(i);continue}r(),t.push({event:i,subItems:[]})}return r(),t}function fh({label:e,value:t}){return m.jsxs("div",{className:"min-w-[5.5rem] flex-1 rounded-sm border border-border/60 bg-background/52 px-2.5 py-2 shadow-sm",children:[m.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:e}),m.jsx("div",{className:"mt-0.5 text-sm font-semibold tracking-tight text-foreground",children:t})]})}function ph({label:e}){return m.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-muted-foreground",children:e})}function hh({label:e,value:t,mono:n,action:r}){return m.jsxs("div",{className:"grid grid-cols-[4.25rem,minmax(0,1fr)] items-start gap-2",children:[m.jsx("span",{className:"pt-0.5 text-[10px] font-medium uppercase tracking-[0.18em] text-muted-foreground",children:e}),m.jsxs("div",{className:"flex min-w-0 items-start gap-1.5",children:[m.jsx("span",{className:bt("min-w-0 flex-1 break-all text-[12px] text-foreground",n&&"font-mono text-[11px] leading-5"),children:t}),r]})]})}function mh({label:e,value:t,mono:n}){return m.jsxs("div",{className:"rounded-sm border border-border/60 bg-background/62 px-2.5 py-2 shadow-sm",children:[m.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:e}),m.jsx("div",{className:bt("mt-0.5 text-[12px] font-medium text-foreground",n&&"font-mono text-[11px]"),children:t})]})}function dh({capabilities:e,action:t}){return m.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between sm:gap-3",children:[m.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[m.jsx("div",{className:"text-[10px] font-medium uppercase tracking-[0.22em] text-muted-foreground",children:"Capabilities"}),m.jsx("div",{className:"flex flex-wrap items-center gap-1.5 text-[11px]",children:e.length>0?e.map(n=>m.jsx(pl,{variant:"secondary",className:"rounded-sm",children:n},n)):m.jsx("span",{className:"text-[12px] text-muted-foreground",children:"None declared"})})]}),t&&m.jsx("div",{className:"shrink-0 self-start",children:t})]})}export{Or as A,uh as C,fh as D,hh as I,Sl as L,mh as M,ph as T,oh as a,Jp as b,sh as c,lh as d,Gp as e,ah as f,Br as g,ch as h,Qp as i,dh as j,th as k,eh as l,Zp as m,Re as n,nh as o,ih as p,Yp as q,Kp as r,Xp as s,Ll as t,gt as u,rh as v,fc as w};
|