@cline/cli-windows-arm64 3.0.68 → 3.0.69
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/bin/cline.exe +2 -2
- package/cline-hub/webview/assets/Chat-ta9MveJG.js +342 -0
- package/cline-hub/webview/assets/{extensions-view-DH-23v1u.js → extensions-view-Bse6hXDh.js} +1 -1
- package/cline-hub/webview/assets/{highlighted-body-KPVGNVTW-CihZ6cRk.js → highlighted-body-KPVGNVTW-D_zYfwaW.js} +1 -1
- package/cline-hub/webview/assets/{index-CVltFcTl.js → index-zeBm5jOA.js} +2 -2
- package/cline-hub/webview/assets/{label-BOd_bvbx.js → label-CUBxnFlQ.js} +2 -2
- package/cline-hub/webview/assets/mermaid-HWGCJPDP-NlsJ0x2Y.js +1 -0
- package/cline-hub/webview/assets/{settings-view-Btp0pUiK.js → settings-view-DlWCiAz0.js} +1 -1
- package/cline-hub/webview/index.html +1 -1
- package/package.json +1 -1
- package/cline-hub/webview/assets/Chat-B_D5UhNH.js +0 -342
- package/cline-hub/webview/assets/mermaid-HWGCJPDP-DyBSuDs-.js +0 -1
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-CNhdxt2h.js","./rolldown-runtime-B0Z9INg1.js","./mermaid-parser-HclGiUj8.js","./mermaid-markup-D01n6Kcj.js","./chunk-Y2CYZVJY-DsF7k-Jl.js","./src-BY_WSiz7.js","./chunk-I66GZJ75-DXqP3B91.js","./chunk-NSK5VX7P-D5026Kzu.js","./dist-BDCdLWk4.js","./chunk-4I5QYGJK-0RNwvBrV.js","./chunk-WRU74C26-BSENSjFs.js","./chunk-7BUUIJ7U-Bb538aSH.js","./chunk-UBXNYLIW-DzzRI8B_.js","./chunk-W5SLKNZC-jIqX_Eb5.js","./chunk-QR6OTTB3-DgKOIk7B.js","./rough.esm-Dy-Kn_BL.js","./chunk-7Z6QIM7H-C6_Ywz3w.js","./line-BImJQVif.js","./path-fybaL0A-.js","./array-BifhSqXX.js","./highlighted-body-KPVGNVTW-D_zYfwaW.js","./bundle-mjs-CyB9GzWm.js","./bash-B7CDPTg5.js","./shellscript-CLZ0U2zV.js","./html-BY76lXLH.js","./css-BsVw1vtW.js","./javascript-BgS3c2Ky.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-B0Z9INg1.js";import{a,i as o,n as s,r as c,t as l}from"./bundle-mjs-CyB9GzWm.js";import{Bt as u,C as d,F as f,G as p,Ht as m,I as h,L as g,R as _,T as v,Tn as y,Wn as b,X as x,Z as S,_t as C,an as w,ar as T,c as E,j as ee,jn as D,ln as te,n as O,on as ne,or as k,rn as re,sn as ie,t as ae,un as oe,vt as se,w as A,yt as ce,z as j}from"./vscode-CFosRdBr.js";import{B as le,H as ue,N as de,P as fe,U as pe,V as me,W as he,_ as ge,c as _e,g as ve,h as ye,i as be,l as xe,m as Se,n as Ce,o as we,p as Te,r as Ee,t as De,v as Oe,y as ke,z as Ae}from"./label-CUBxnFlQ.js";import{a as je,i as Me,r as Ne,t as Pe}from"./switch-DrjcFF6_.js";import{t as Fe}from"./mermaid-parser-HclGiUj8.js";import{B as Ie,F as Le,H as Re,L as ze,N as Be,V as Ve,j as He,m as Ue}from"./index-zeBm5jOA.js";import{n as We,t as Ge}from"./badge-X4W3Q0cc.js";var Ke=_(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),qe=_(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),Je=_(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ye=_(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Xe=_(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ze=_(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Qe=_(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),$e=_(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),et=_(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),tt=_(`hat-glasses`,[[`path`,{d:`M14 18a2 2 0 0 0-4 0`,key:`1v8fkw`}],[`path`,{d:`m19 11-2.11-6.657a2 2 0 0 0-2.752-1.148l-1.276.61A2 2 0 0 1 12 4H8.5a2 2 0 0 0-1.925 1.456L5 11`,key:`1fkr7p`}],[`path`,{d:`M2 11h20`,key:`3eubbj`}],[`circle`,{cx:`17`,cy:`18`,r:`3`,key:`82mm0e`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),nt=_(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),rt=_(`music-2`,[[`circle`,{cx:`8`,cy:`18`,r:`4`,key:`1fc0mg`}],[`path`,{d:`M12 18V2l7 4`,key:`g04rme`}]]),it=_(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),at=_(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),ot=_(`signal-low`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}]]),st=_(`signal-high`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}],[`path`,{d:`M17 20V8`,key:`1tkaf5`}]]),ct=_(`signal-medium`,[[`path`,{d:`M2 20h.01`,key:`4haj6o`}],[`path`,{d:`M7 20v-4`,key:`j294jx`}],[`path`,{d:`M12 20v-8`,key:`i3yub9`}]]),lt=_(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),ut=_(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),dt=_(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ft=_(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),pt=e(o(),1),M=c(),N=e(a(),1);function mt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function ht(...e){return t=>{let n=!1,r=e.map(e=>{let r=mt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():mt(e[t],null)}}}}function gt(...e){return N.useCallback(ht(...e),e)}var _t=Symbol.for(`react.lazy`),vt=N.use;function yt(e){return typeof e==`object`&&!!e&&`then`in e}function bt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===_t&&`_payload`in e&&yt(e._payload)}function xt(e){let t=St(e),n=N.forwardRef((e,n)=>{let{children:r,...i}=e;bt(r)&&typeof vt==`function`&&(r=vt(r._payload));let a=N.Children.toArray(r),o=a.find(wt);if(o){let e=o.props.children,r=a.map(t=>t===o?N.Children.count(e)>1?N.Children.only(null):N.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:N.isValidElement(e)?N.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function St(e){let t=N.forwardRef((e,t)=>{let{children:n,...r}=e;if(bt(n)&&typeof vt==`function`&&(n=vt(n._payload)),N.isValidElement(n)){let e=Et(n),i=Tt(r,n.props);return n.type!==N.Fragment&&(i.ref=t?ht(t,e):e),N.cloneElement(n,i)}return N.Children.count(n)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ct=Symbol(`radix.slottable`);function wt(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Ct}function Tt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Et(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Dt(e){if(!(e.length>8388608||!Ae(e)))try{let t=atob(e),n=new ArrayBuffer(t.length),r=new Uint8Array(n);for(let e=0;e<t.length;e+=1)r[e]=t.charCodeAt(e);return n}catch{return}}var Ot=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*$/i;function kt(e){let t=e.mediaType.trim().toLowerCase();if(Ot.test(t))switch(e.modality){case`image`:return de.includes(t)?t:void 0;case`audio`:return t.startsWith(`audio/`)?t:void 0;case`video`:return t.startsWith(`video/`)?t:void 0;case`file`:return`application/octet-stream`}}function At(e){let t=e.source.type===`base64`?e.source.data:void 0,[n,r]=(0,N.useState)(),i=kt(e);return(0,N.useEffect)(()=>{if(r(void 0),t===void 0||i===void 0)return;let e=Dt(t);if(!e||typeof URL.createObjectURL!=`function`)return;let n;try{n=URL.createObjectURL(new Blob([e],{type:i}))}catch{return}return r(n),()=>URL.revokeObjectURL?.(n)},[i,t]),n}function jt(e){return e.source.type===`artifact`?`Generated ${e.modality} is stored as an artifact (${e.source.artifactId}).`:e.source.type===`url`?`Generated ${e.modality} requires a trusted remote-media resolver.`:`Generated ${e.modality} could not be rendered.`}function Mt({media:e,className:t,classNames:n}){let r=At(e),i=r?.startsWith(`blob:`)?r:void 0;if(!i)return(0,M.jsx)(`div`,{className:n?.unavailable??t,"data-media-id":e.id,"data-testid":`generated-media-unavailable`,children:jt(e)});let a=n?.[e.modality]??t;switch(e.modality){case`image`:return(0,M.jsx)(`img`,{alt:e.name??`Generated image`,className:a,"data-media-id":e.id,src:i});case`audio`:return(0,M.jsx)(`audio`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`video`:return(0,M.jsx)(`video`,{className:a,controls:!0,"data-media-id":e.id,src:i});case`file`:return(0,M.jsx)(`a`,{className:a,"data-media-id":e.id,download:e.name??!0,href:i,children:e.name??`Generated file (${e.mediaType})`})}return null}var Nt=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Pt=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Nt[n[e]&63];return t};function Ft({className:e,orientation:t=`horizontal`,...n}){return(0,M.jsx)(Ue,{"data-slot":`separator`,orientation:t,className:j(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var It=({className:e,children:t,...n})=>(0,M.jsxs)(`div`,{className:j(`flex items-center gap-0.5 overflow-hidden text-muted-foreground`,e),...n,children:[t,(0,M.jsx)(Ft,{})]}),Lt=({className:e,children:t,...n})=>t??(0,M.jsx)(qe,{className:j(`size-4 shrink-0`,e),...n}),Rt=({children:e,variant:t=`ghost`,size:n=`sm`,tooltip:r,...i})=>r?(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{render:(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i}),children:e}),(0,M.jsx)(Ve,{align:`start`,side:`bottom`,children:r})]}):(0,M.jsx)(A,{size:n,type:`button`,variant:t,...i,children:e}),zt={damping:.7,stiffness:.05,mass:1.25},Bt=70,Vt=1e3/60,Ht=350,Ut=!1;globalThis.document?.addEventListener(`mousedown`,()=>{Ut=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{Ut=!1}),globalThis.document?.addEventListener(`click`,()=>{Ut=!1});var Wt=(e={})=>{let[t,n]=(0,N.useState)(!1),[r,i]=(0,N.useState)(e.initial!==!1),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null);s.current=e;let c=(0,N.useCallback)(()=>{if(!Ut)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,N.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,N.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,N.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Bt}}},[]),f=(0,N.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=qt(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/Vt;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:qt(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,N.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,N.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,N.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=Gt(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=Gt(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=qt(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Ht})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function Gt(e,t){let n=(0,N.useCallback)(t=>(n.current=t,e(t)),t);return n}var Kt=new Map;function qt(...e){let t={...zt},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return Kt.has(r)||Kt.set(r,Object.freeze(t)),n?`instant`:Kt.get(r)}var Jt=(0,N.createContext)(null),Yt=typeof window<`u`?N.useLayoutEffect:N.useEffect;function Xt({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,N.useRef)(null),d=Wt({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:N.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,N.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,N.useImperativeHandle)(c,()=>y,[y]),Yt(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),N.createElement(Jt.Provider,{value:y},N.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=Zt();return N.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},N.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(Xt||={});function Zt(){let e=(0,N.useContext)(Jt);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Qt=({className:e,...t})=>(0,M.jsx)(Xt,{className:j(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),$t=({className:e,...t})=>(0,M.jsx)(Xt.Content,{className:j(`flex flex-col gap-8 p-4`,e),...t}),en=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=Zt(),i=(0,N.useCallback)(()=>{r()},[r]);return!n&&(0,M.jsx)(A,{className:j(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,M.jsx)(Ke,{className:`size-4`})})};v(`flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0`,vertical:`flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0`}},defaultVariants:{orientation:`horizontal`}});var tn=()=>Fe(()=>import(`./mermaid.core-CNhdxt2h.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);function nn(e,t,n){return Math.min(n,Math.max(t,e))}function rn(e){let t=e?.trim();if(!t||t===`none`)return 1;let n=t.endsWith(`%`)?Number.parseFloat(t)/100:Number.parseFloat(t);return Number.isFinite(n)?nn(n,0,1):1}function an(e,t){if(e===`none`)return 0;let n=Number.parseFloat(e);return Number.isFinite(n)?e.endsWith(`%`)?n/100*t:n:null}function on(e){if(e===`none`)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?e.endsWith(`turn`)?t*360:e.endsWith(`grad`)?t*.9:e.endsWith(`rad`)?t*180/Math.PI:t:null}function sn(e){let t=nn(e,0,1);return nn(t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055,0,1)*255}function cn(e,t,n){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[sn(4.0767416621*r-3.3077115913*i+.2309699292*a),sn(-1.2684380046*r+2.6097574011*i-.3413193965*a),sn(-.0041960863*r-.7034186147*i+1.707614701*a)]}function ln(e){let t=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i.exec(e);if(!t)return null;let n=t[1]??``;n.length<=4&&(n=[...n].map(e=>e+e).join(``));let r=e=>Number.parseInt(n.slice(e,e+2),16);return{a:n.length===8?r(6)/255:1,b:r(4),g:r(2),r:r(0)}}function un(e){let[t=``,n]=e.replace(/,/g,` `).split(`/`);return{alpha:n,tokens:t.trim().split(/\s+/).filter(Boolean)}}function dn(e,t){if(e.length<3)return null;let[n,r,i]=e.slice(0,3).map(e=>an(e,255));return n===null||r===null||i===null||n===void 0||r===void 0||i===void 0?null:{a:t,b:nn(i,0,255),g:nn(r,0,255),r:nn(n,0,255)}}function fn(e,t,n){if(t.length<3)return null;let r=an(t[0]??``,1);if(r===null)return null;let i,a;if(e===`oklch`){let e=an(t[1]??``,.4),n=on(t[2]??``);if(e===null||n===null)return null;let r=n*Math.PI/180;i=e*Math.cos(r),a=e*Math.sin(r)}else i=an(t[1]??``,.4),a=an(t[2]??``,.4);if(i===null||a===null)return null;let[o,s,c]=cn(nn(r,0,1),i,a);return{a:n,b:c,g:s,r:o}}function pn(e,t){if((e[0]??``).toLowerCase()!==`srgb`)return null;let[n,r,i]=e.slice(1,4).map(e=>an(e,1));return n==null||r==null||i==null?null:{a:t,b:nn(i,0,1)*255,g:nn(r,0,1)*255,r:nn(n,0,1)*255}}function mn(e){let t=e.trim();if(!t)return null;let n=ln(t);if(n)return n;let r=/^([a-z-]+)\(([^)]*)\)$/i.exec(t);if(!r)return null;let i=(r[1]??``).toLowerCase(),{alpha:a,tokens:o}=un(r[2]??``),s=rn(a);if(i===`rgb`||i===`rgba`){let e=a===void 0?o[3]:void 0;return dn(o,e?rn(e):s)}return i===`oklch`||i===`oklab`?fn(i,o,s):i===`color`?pn(o,s):null}function hn(e){return Math.round(nn(e,0,255)).toString(16).padStart(2,`0`)}function gn(e){return`#${hn(e.r)}${hn(e.g)}${hn(e.b)}`}function _n(e){let t=mn(e);return t?gn(t):null}function vn(e,t,n){let r=mn(e),i=mn(t);if(!r)return e;if(!i)return gn(r);let a=nn(n,0,1);return gn({b:r.b+(i.b-r.b)*a,g:r.g+(i.g-r.g)*a,r:r.r+(i.r-r.r)*a})}var yn={dark:{background:`#18191b`,border:`#2f2f37`,error:`#e54666`,foreground:`#fcfcfd`,muted:`#212225`,mutedForeground:`#b0b4ba`,primary:`#6e56cf`},light:{background:`#f9f9fb`,border:`#e8e8ec`,error:`#e54666`,foreground:`#1c2024`,muted:`#f0f0f3`,mutedForeground:`#60646c`,primary:`#6e56cf`}},bn=`'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,xn=`14px`;function Sn(e){let t=e?.trim().replace(/"/g,`'`)??``;return!t||/\bmonospace\b/i.test(t)?bn:`${t}, ${bn}`}function Cn(e,t,n){let r=n?.(e);return(r?_n(r):null)??_n(e)??t}function wn(e,t,n){let r=yn[t];return{background:Cn(e.background,r.background,n),border:Cn(e.border,r.border,n),error:Cn(e.error,r.error,n),foreground:Cn(e.foreground,r.foreground,n),muted:Cn(e.muted,r.muted,n),mutedForeground:Cn(e.mutedForeground,r.mutedForeground,n),primary:Cn(e.primary,r.primary,n)}}function Tn(e,t,{fontFamily:n=bn,resolveColor:r}={}){let i=wn(e,t,r),a=t===`dark`,o=vn(i.background,i.primary,a?.18:.1),s=vn(i.background,i.primary,a?.6:.5),c=vn(i.background,i.foreground,a?.08:.05),l=vn(i.background,i.foreground,a?.05:.03),u=vn(i.background,i.primary,a?.07:.04),d=vn(i.background,i.error,a?.2:.12);return{activationBkgColor:c,activationBorderColor:i.border,actorBkg:o,actorBorder:s,actorLineColor:i.mutedForeground,actorTextColor:i.foreground,background:i.background,clusterBkg:l,clusterBorder:i.border,darkMode:a,edgeLabelBackground:i.background,errorBkgColor:d,errorTextColor:i.error,fontFamily:n,fontSize:xn,labelBoxBkgColor:c,labelBoxBorderColor:i.border,labelTextColor:i.foreground,lineColor:i.mutedForeground,loopTextColor:i.foreground,mainBkg:o,nodeBorder:s,noteBkgColor:i.muted,noteBorderColor:i.border,noteTextColor:i.foreground,primaryBorderColor:s,primaryColor:o,primaryTextColor:i.foreground,secondaryBorderColor:i.border,secondaryColor:c,secondaryTextColor:i.foreground,sequenceNumberColor:i.background,signalColor:i.mutedForeground,signalTextColor:i.foreground,tertiaryBorderColor:i.border,tertiaryColor:u,tertiaryTextColor:i.foreground,textColor:i.foreground,titleColor:i.foreground}}function En(e,t,n={}){return{fontFamily:n.fontFamily??`'Inter Variable', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif`,htmlLabels:!1,securityLevel:`strict`,startOnLoad:!1,suppressErrorRendering:!0,theme:`base`,themeVariables:Tn(e,t,n)}}function Dn(e=`light`){return En(yn[e],e)}var On=`data-cline-diagram-href`,kn=[`href`,`xlink:href`];function An(e){try{let t=new URL(e.trim());return t.protocol===`http:`||t.protocol===`https:`?t.href:null}catch{return null}}function jn(e){if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return null;try{let t=new DOMParser().parseFromString(e,`image/svg+xml`);if(t.getElementsByTagName(`parsererror`).length>0)return null;for(let e of Array.from(t.getElementsByTagName(`a`))){let t=kn.map(t=>e.getAttribute(t)).find(e=>!!e);for(let t of kn)e.removeAttribute(t);e.removeAttribute(`target`);let n=t?An(t):null;n&&e.setAttribute(On,n)}return new XMLSerializer().serializeToString(t.documentElement)}catch{return null}}var Mn=/<a\b[^>]*>/gi,Nn=/\s(?:xlink:href|href|target)\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;function Pn(e){return e.replace(Mn,e=>{let t=null,n=e.replace(Nn,(e,n,r)=>(/\starget\s*=/i.test(e)||(t??=n??r??null),``)),r=t?An(t):null;return r?n.replace(/\s*\/?>$/,e=>` ${On}="${r.replace(/"/g,`"`)}"${e}`):n})}function Fn(e){return e.includes(`<a`)?jn(e)??Pn(e):e}var In=Promise.resolve();function Ln(e){let t=In.then(e,e);return In=t.catch(()=>void 0),t}var Rn=new WeakMap;function zn(e=tn){let t,n=()=>(t??=e().catch(e=>{throw t=void 0,e}),t);return{async render(e,t,r){let i=(await n()).default;return Ln(async()=>{Rn.get(i)!==r&&(i.initialize(r),Rn.set(i,r));let n=await i.render(e,t);return{...n,svg:Fn(n.svg)}})}}}var Bn={background:`--card`,border:`--border`,error:`--destructive`,foreground:`--foreground`,muted:`--muted`,mutedForeground:`--muted-foreground`,primary:`--primary`},Vn=`--font-sans`;function Hn(e){if(typeof document>`u`)return`light`;let t=document.documentElement;return(e??t).closest(`.dark`)||t.classList.contains(`dark`)||(t.getAttribute(`data-cline-hub-theme`)??t.dataset.theme)===`dark`?`dark`:`light`}var Un;function Wn(e){if(typeof document>`u`)return null;if(Un===void 0){let e=document.createElement(`canvas`);e.width=1,e.height=1,Un=e.getContext(`2d`,{willReadFrequently:!0})}let t=Un;if(!t||(t.fillStyle=`#010203`,t.fillStyle=e,t.fillStyle===`#010203`&&_n(e)===null))return null;t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let[n=0,r=0,i=0,a=255]=t.getImageData(0,0,1,1).data;if(a===0)return null;let o=e=>e.toString(16).padStart(2,`0`);return`#${o(n)}${o(r)}${o(i)}`}function Gn(e,t){let n=e.getPropertyValue(t).trim();return n?_n(n)??Wn(n)??``:``}function Kn(e){if(typeof document>`u`){let e=yn.light,t=Sn(void 0);return{fontFamily:t,key:JSON.stringify([`light`,e,t]),mode:`light`,tokens:e}}let t=e??document.documentElement,n=Hn(t),r=getComputedStyle(t),i=e=>Gn(r,e),a=wn({background:i(Bn.background),border:i(Bn.border),error:i(Bn.error),foreground:i(Bn.foreground),muted:i(Bn.muted),mutedForeground:i(Bn.mutedForeground),primary:i(Bn.primary)},n),o=Sn(r.getPropertyValue(Vn));return{fontFamily:o,key:JSON.stringify([n,a,o]),mode:n,tokens:a}}Dn(`light`);function qn(e=tn){let t=zn(e),n={},r,i={initialize(e){n={...n,...e},r=void 0},render(e,i){let a=Kn();return r?.key!==a.key&&(r={config:{...En(a.tokens,a.mode,{fontFamily:a.fontFamily}),...n,securityLevel:`strict`},key:a.key}),t.render(e,i,r.config)}};return{getMermaid(e){return e&&i.initialize(e),i},language:`mermaid`,name:`mermaid`,type:`diagram`}}var P={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Jn={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Yn={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Xn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Zn=[12288,12288,65281,65376,65504,65510],Qn=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],$n=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],er=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],tr=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},nr=19968,[rr,ir]=ar(er);function ar(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(nr>=i&&nr<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var or=e=>e<161||e>1114109?!1:tr(Xn,e),sr=e=>e<12288||e>65510?!1:tr(Zn,e),cr=e=>e<8361||e>65518?!1:tr(Qn,e),lr=e=>e<32||e>10630?!1:tr($n,e),ur=e=>e>=rr&&e<=ir?!0:e<4352||e>262141?!1:tr(er,e);function dr(e){return or(e)?`ambiguous`:sr(e)?`fullwidth`:cr(e)?`halfwidth`:lr(e)?`narrow`:ur(e)?`wide`:`neutral`}function fr(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function pr(e){return fr(e),dr(e)}function mr(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function hr(e){if(!e||e<4352)return!1;switch(pr(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!mr(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function gr(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function _r(e){return e!==null&&e>=65024&&e<=65038}var vr=br(/\p{P}|\p{S}/u),yr=br(/\s/);function br(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function xr(e){return!!(e&Jn.characterGroupWhitespace)}function Sr(e){return(e&zr.cjkPunctuation)===Jn.characterGroupPunctuation}function Cr(e){return!!(e&zr.cjk)}function wr(e){return e===zr.ivs}function Tr(e){return!!(e&zr.cjkOrIvs)}function Er(e){return e===zr.nonEmojiGeneralUseVS}function Dr(e){return!!(e&zr.spaceOrPunctuation)}var Or=Rr(/[A-Za-z]/),kr=Rr(/[\dA-Za-z]/),Ar=Rr(/[#-'*+\--9=?A-Z^-~]/);function jr(e){return e!==null&&(e<32||e===127)}var Mr=Rr(/\d/),Nr=Rr(/[\dA-Fa-f]/),Pr=Rr(/[!-/:-@[-`{-~]/);function F(e){return e!==null&&e<-2}function Fr(e){return e!==null&&(e<0||e===32)}function I(e){return e===-2||e===-1||e===32}var Ir=Rr(/\p{P}|\p{S}/u),Lr=Rr(/\s/);function Rr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var zr;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(zr||={});function Br(e){if(e===P.eof||Fr(e)||yr(e))return Jn.characterGroupWhitespace;let t=0;if(e>=4352){if(_r(e))return zr.nonEmojiGeneralUseVS;switch(hr(e)){case null:return zr.ivs;case!0:t|=zr.cjk}}return vr(e)&&(t|=Jn.characterGroupPunctuation),t}function Vr(e,t,n){if(!Er(e))return e;let r=t(),i=Br(r);return!r||xr(i)?e:gr(r,n)?zr.cjkPunctuation:Hr(i)}function Hr(e){return e&~zr.ivs}function Ur(e){return!!(e&&e>=55296&&e<=56319)}function Wr(e){return!!(e&&e>=56320&&e<=57343)}function Gr(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function Kr(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var qr=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=Kr(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function Jr(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}function Yr(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Xr(e,t){return e.length>0?(Yr(e,e.length,0,t),e):t}function Zr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Qr={name:`attention`,resolveAll:$r,tokenize:ei};function $r(e,t){let n=-1,r,i,a,o,s,c,l,u;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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};ti(d,-c),ti(f,c),o={type:c>1?Yn.strongSequence:Yn.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Yn.strongSequence:Yn.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Yn.strongText:Yn.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Yn.strong:Yn.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Xr(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Xr(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=Xr(l,Zr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Xr(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Xr(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Yr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ei(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=Wr(a)?Gr(a,r(),i):a,s=Br(o),c=new qr(o,r(),i),l=Vr(s,c.value.bind(c),o),u;return d;function d(t){return t===P.asterisk||P.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=Br(Ur(a)?Jr(a,r(),i):a),d=Sr(l),p=d||xr(l),m=Sr(c),h=m||xr(c),g=Tr(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||Cr(c))||n.includes(o);return s._open=!!(u===P.asterisk?_:_&&(Dr(l)||!v)),s._close=!!(u===P.asterisk?v:v&&(Dr(c)||!_)),t(a)}}function ti(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function ni(){return{text:{[P.asterisk]:Qr,[P.underscore]:Qr},insideSpan:{null:[Qr]}}}function ri(){let e=this.data();(e.micromarkExtensions||=[]).push(ni())}var ii=`;`.codePointAt(0)??P.eof,ai=`&`.codePointAt(0)??P.eof;function oi(){return{handlers:{emphasis:si,strong:ci,text:fi}}}si.peek=li,ci.peek=ui;function si(e,t,n,r){return di(e,t,n,r,li(e,t,n),1)}function ci(e,t,n,r){return di(e,t,n,r,ui(e,t,n),2)}function li(e,t,n){return n.options.emphasis||`*`}function ui(e,t,n){return n.options.strong||`*`}function di(e,t,n,r,i,a){let o=i.repeat(a),s=n.enter(a===1?`emphasis`:`strong`),c=n.createTracker(r),l=c.move(o),u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()})),d=bi(e,t,n,r.before),f=xi(e,t,n,r.after),p=pi(d,Ni(u),i,`open`);p.inside&&u&&(u=Ai(u));let m=pi({current:Pi(u),previous:Mi(u)},f,i,`close`);m.inside&&u&&(u=ji(u));let h=c.move(o);s();let g=m.outside&&Ei(t,n);return n.attentionEncodeSurroundingInfo={after:m.outside&&!g,before:p.outside},Di(n).cjkFriendlyEncodeAfterSupplementaryText=g,l+u+h}function fi(e,t,n,r){let i=Di(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${ki(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function pi(e,t,n,r){let i=yi(e),a=Br(t);if(!Tr(i)&&!Tr(a))return r===`open`?mi(i,a,n):mi(a,i,n);let o={inside:!1,outside:!1},s={inside:!0,outside:!1},c={inside:!1,outside:!0},l={inside:!0,outside:!0};for(let i of[o,s,c,l]){let a=r===`open`?i.outside?Fi:e:i.inside?Fi:e,o=r===`open`?i.inside?Ii:t:i.outside?Ii:t;if(r===`open`?hi(n,a,o):gi(n,a,o))return i}return l}function mi(e,t,n){return vi(e)?vi(t)?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xr(e)?vi(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function hi(e,t,n){let r=yi(t),{close:i,open:a}=_i(r,Br(n));return e===`_`?a&&(Dr(r)||!i):a}function gi(e,t,n){let r=Br(n),{close:i,open:a}=_i(yi(t),r);return e===`_`?i&&(Dr(r)||!a):i}function _i(e,t){let n=Sr(e),r=n||xr(e),i=Sr(t),a=i||xr(t);return{open:!a||i&&(r||Tr(e)),close:!r||n&&(a||Cr(t))}}function vi(e){return!xr(e)&&!Sr(e)}function yi(e){let t=Br(e.current);return e.current===null||!Er(t)?t:Vr(t,()=>e.previous,e.current)}function bi(e,t,n,r){let i=Pi(r),a=Mi(r);if(Si(i)||wi(i,a)){let r=Ti(e,t,n,-1);r&&(i=Pi(r),a=Mi(r))}return{current:i,previous:a}}function xi(e,t,n,r){let i=Ni(r);if(!Ci(i))return i;let a=Ti(e,t,n,1);return a?Ni(a):i}function Si(e){return e!==null&&56320<=e&&e<=57343}function Ci(e){return e!==null&&55296<=e&&e<=56319}function wi(e,t){return Er(Br(e))&&(t===null||t===P.eof)}function Ti(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return Oi(s)||void 0}function Ei(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(Ni(r.value)??0)>65535}function Di(e){return e}function Oi(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(Oi).join(``):``}function ki(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function Ai(e){let[t=``]=[...e];return ki(t.codePointAt(0)??P.eof)+e.slice(t.length)}function ji(e){let t=[...e],n=t.pop();return`${t.join(``)}${ki(n?.codePointAt(0)??P.eof)}`}function Mi(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function Ni(e){return e.codePointAt(0)??P.eof}function Pi(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var Fi={current:ii,previous:P.eof},Ii=ai;function Li(){let e=this.data();(e.toMarkdownExtensions||=[]).push(oi())}function Ri(){ri.call(this),Li.call(this)}var zi=Ri;function Bi(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[P.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[P.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Yr(o,o.length,0,Zr(s,e.slice(r+1,n),t)),Yr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Yr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=Yn.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=Wr(o)?Gr(o,i(),a):o,c=Br(s),l=new qr(s,i(),a),u=Vr(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return P.tilde,s===P.tilde&&d[d.length-1][1].type!==Yn.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=Br(s);if(o===P.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=Br(Ur(o)?Jr(o,i(),a):o),p=Sr(u)||xr(u),h=Sr(d)||xr(d),g=Cr(u)||wr(c);return l._open=!h||d===Jn.attentionSideAfter&&(p||g),l._close=!p||c===Jn.attentionSideAfter&&(h||Cr(d)),n(o)}}}function Vi(e){let t=this.data();(t.micromarkExtensions||=[]).push(Bi(e))}var Hi=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],Ui=`;`.codePointAt(0)??P.eof,Wi=`&`.codePointAt(0)??P.eof;function Gi(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Hi}],handlers:{delete:Ki,text:qi}}}Ki.peek=Ji;function Ki(e,t,n,r){let i=n.enter(`strikethrough`),a=n.createTracker(r),o=a.move(`~~`),s=a.move(n.containerPhrasing(e,{after:`~`,before:o,...a.current()})),c=na(e,t,n,r.before),l=ra(e,t,n,r.after),u=Yi(c,ha(s),`open`);u.inside&&s&&(s=fa(s));let d=Yi({current:ga(s),previous:ma(s)},l,`close`);d.inside&&s&&(s=pa(s));let f=a.move(`~~`);i();let p=d.outside&&ca(t,n);return n.attentionEncodeSurroundingInfo={after:d.outside&&!p,before:u.outside},la(n).cjkFriendlyEncodeAfterSupplementaryText=p,o+s+f}function qi(e,t,n,r){let i=la(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${da(a.codePointAt(0)??P.eof)}${n.safe(o,{...r,before:`;`})}`}function Ji(){return`~`}function Yi(e,t,n){let r=ta(e),i=Br(t);if(!Tr(r)&&!Tr(i))return n===`open`?Xi(r,i):Xi(i,r);let a={inside:!1,outside:!1},o={inside:!0,outside:!1},s={inside:!1,outside:!0},c={inside:!0,outside:!0};for(let r of[a,o,s,c]){let i=n===`open`?r.outside?_a:e:r.inside?_a:e,a=n===`open`?r.inside?va:t:r.outside?va:t;if(n===`open`?Zi(i,a):Qi(i,a))return r}return c}function Xi(e,t){return ea(e)?ea(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:xr(e)?ea(t)?{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:xr(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Zi(e,t){let{open:n}=$i(ta(e),Br(t));return n}function Qi(e,t){let n=Br(t),{close:r}=$i(ta(e),n);return r}function $i(e,t){let n=Sr(e),r=n||xr(e),i=Sr(t),a=i||xr(t);return{open:!a||i&&(r||Tr(e)),close:!r||n&&(a||Cr(t))}}function ea(e){return!xr(e)&&!Sr(e)}function ta(e){let t=Br(e.current);return e.current===null||!Er(t)?t:Vr(t,()=>e.previous,e.current)}function na(e,t,n,r){let i=ga(r),a=ma(r);if(ia(i)||oa(i,a)){let r=sa(e,t,n,-1);r&&(i=ga(r),a=ma(r))}return{current:i,previous:a}}function ra(e,t,n,r){let i=ha(r);if(!aa(i))return i;let a=sa(e,t,n,1);return a?ha(a):i}function ia(e){return e!==null&&56320<=e&&e<=57343}function aa(e){return e!==null&&55296<=e&&e<=56319}function oa(e,t){return Er(Br(e))&&(t===null||t===P.eof)}function sa(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return ua(s)||void 0}function ca(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(ha(r.value)??0)>65535}function la(e){return e}function ua(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(ua).join(``):``}function da(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function fa(e){let[t=``]=[...e];return da(t.codePointAt(0)??P.eof)+e.slice(t.length)}function pa(e){let t=[...e],n=t.pop();return`${t.join(``)}${da(n?.codePointAt(0)??P.eof)}`}function ma(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??P.eof}function ha(e){return e.codePointAt(0)??P.eof}function ga(e){return[...e].at(-1)?.codePointAt(0)??P.eof}var _a={current:Ui,previous:P.eof},va=Wi;function ya(){let e=this.data();(e.toMarkdownExtensions||=[]).push(Gi())}function ba(e){Vi.call(this,e),ya.call(this)}var xa=ba,Sa=(function(e){if(e==null)return Da;if(typeof e==`function`)return Ea(e);if(typeof e==`object`)return Array.isArray(e)?Ca(e):wa(e);if(typeof e==`string`)return Ta(e);throw Error(`Expected function, string, or object as test`)});function Ca(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Sa(e[n]);return Ea(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function wa(e){let t=e;return Ea(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ta(e){return Ea(t);function t(t){return t&&t.type===e}}function Ea(e){return t;function t(t,n,r){return!!(Oa(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Da(){return!0}function Oa(e){return typeof e==`object`&&!!e&&`type`in e}function ka(e){return e}var Aa=[],ja=`skip`;function Ma(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Sa(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+ka(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Aa,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Na(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Na(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Aa:[e]}function Pa(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Ma(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Fa=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),Ia=/^(https?:\/\/|mailto:|www\.)/i,La=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},Ra=e=>{let t=0;for(let n of e){if(Fa.has(n))return t;t+=n.length}return null},za=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Ba=e=>({type:`text`,value:e}),Va=()=>e=>{Pa(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!La(e)||!Ia.test(e.url))return;let r=Ra(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=za(i,e),s=Ba(a);return n.children.splice(t,1,o,s),t+1})};function Ha(){let e=[zi],t=[Va,xa];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var Ua=Ha(),Wa={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function Ga({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=Wa.indicator,imageBlockPolicy:c=Wa.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=to(e,t,n,r,i,a,o,s,c);Za(l),Pa(l,u)}}function Ka(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function qa(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var Ja=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),Ya=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function Xa(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=Ka(e,n);if(!o||Ya.has(o.protocol)||!(Ja.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=qa(e);return o&&t.some(e=>{let t=Ka(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function Za(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)Za(t)}}var Qa=Symbol(`node-seen`);function $a(e,t,n){return t===Wa.remove?{type:`remove`}:t===Wa.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function eo(e,t,n){if(t===Wa.remove)return{type:`remove`};if(t===Wa.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var to=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[Qa])return!0;if(u.tagName===`a`){let n=Xa(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[Qa]=!0,Pa(u,l),f&&typeof d==`number`){let e=$a(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[ja,d];f.children[d]=e.element}return ja}return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=Xa(u.properties.src,n,e,r,!0,i);if(t===null){if(u[Qa]=!0,Pa(u,l),f&&typeof d==`number`){let e=eo(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[ja,d];f.children[d]=e.element}return ja}return u.properties.src=t,!0}return!0};return l},no=typeof self==`object`?self:globalThis,ro=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new no[e](t)},io=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof no[e]==`function`?ro(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(ro(a,o),i)};return r},ao=e=>io(new Map,e)(0),oo=``,{toString:so}={},{keys:co}=Object,lo=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=so.call(e).slice(8,-1);switch(n){case`Array`:return[1,oo];case`Object`:return[2,oo];case`Date`:return[3,oo];case`RegExp`:return[4,oo];case`Map`:return[5,oo];case`Set`:return[6,oo];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},uo=([e,t])=>e===0&&(t===`function`||t===`symbol`),fo=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=lo(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of co(r))(e||!uo(lo(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?oo:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(uo(lo(n))||uo(lo(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!uo(lo(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},po=(e,{json:t,lossy:n}={})=>{let r=[];return fo(!(t||n),!!t,new Map,r)(e),r},mo=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?ao(po(e,t)):structuredClone(e):(e,t)=>ao(po(e,t)),ho=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ho.prototype.normal={},ho.prototype.property={},ho.prototype.space=void 0;function go(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ho(n,r,t)}function _o(e){return e.toLowerCase()}var vo=class{constructor(e,t){this.attribute=t,this.property=e}};vo.prototype.attribute=``,vo.prototype.booleanish=!1,vo.prototype.boolean=!1,vo.prototype.commaOrSpaceSeparated=!1,vo.prototype.commaSeparated=!1,vo.prototype.defined=!1,vo.prototype.mustUseProperty=!1,vo.prototype.number=!1,vo.prototype.overloadedBoolean=!1,vo.prototype.property=``,vo.prototype.spaceSeparated=!1,vo.prototype.space=void 0;var yo=r({boolean:()=>L,booleanish:()=>xo,commaOrSpaceSeparated:()=>To,commaSeparated:()=>wo,number:()=>R,overloadedBoolean:()=>So,spaceSeparated:()=>Co}),bo=0,L=Eo(),xo=Eo(),So=Eo(),R=Eo(),Co=Eo(),wo=Eo(),To=Eo();function Eo(){return 2**++bo}var Do=Object.keys(yo),Oo=class extends vo{constructor(e,t,n,r){let i=-1;if(super(e,t),ko(this,`space`,r),typeof n==`number`)for(;++i<Do.length;){let e=Do[i];ko(this,Do[i],(n&yo[e])===yo[e])}}};Oo.prototype.defined=!0;function ko(e,t,n){n&&(e[t]=n)}function Ao(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Oo(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[_o(r)]=r,n[_o(a.attribute)]=r}return new ho(t,n,e.space)}var jo=Ao({properties:{ariaActiveDescendant:null,ariaAtomic:xo,ariaAutoComplete:null,ariaBusy:xo,ariaChecked:xo,ariaColCount:R,ariaColIndex:R,ariaColSpan:R,ariaControls:Co,ariaCurrent:null,ariaDescribedBy:Co,ariaDetails:null,ariaDisabled:xo,ariaDropEffect:Co,ariaErrorMessage:null,ariaExpanded:xo,ariaFlowTo:Co,ariaGrabbed:xo,ariaHasPopup:null,ariaHidden:xo,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Co,ariaLevel:R,ariaLive:null,ariaModal:xo,ariaMultiLine:xo,ariaMultiSelectable:xo,ariaOrientation:null,ariaOwns:Co,ariaPlaceholder:null,ariaPosInSet:R,ariaPressed:xo,ariaReadOnly:xo,ariaRelevant:null,ariaRequired:xo,ariaRoleDescription:Co,ariaRowCount:R,ariaRowIndex:R,ariaRowSpan:R,ariaSelected:xo,ariaSetSize:R,ariaSort:null,ariaValueMax:R,ariaValueMin:R,ariaValueNow:R,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Mo(e,t){return t in e?e[t]:t}function No(e,t){return Mo(e,t.toLowerCase())}var Po=Ao({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:wo,acceptCharset:Co,accessKey:Co,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:Co,autoFocus:L,autoPlay:L,blocking:Co,capture:null,charSet:null,checked:L,cite:null,className:Co,closedBy:null,colorSpace:null,cols:R,colSpan:R,command:null,commandFor:null,content:null,contentEditable:xo,controls:L,controlsList:Co,coords:R|wo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:So,draggable:xo,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:Co,height:R,hidden:So,high:R,href:null,hrefLang:null,htmlFor:Co,httpEquiv:Co,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:Co,itemRef:Co,itemScope:L,itemType:Co,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:R,manifest:null,max:null,maxLength:R,media:null,method:null,min:null,minLength:R,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,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:L,optimum:R,pattern:null,ping:Co,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:Co,required:L,reversed:L,rows:R,rowSpan:R,sandbox:Co,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:R,sizes:null,slot:null,span:R,spellCheck:xo,src:null,srcDoc:null,srcLang:null,srcSet:null,start:R,step:null,style:null,tabIndex:R,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:xo,width:R,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Co,axis:null,background:null,bgColor:null,border:R,borderColor:null,bottomMargin:R,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:R,leftMargin:R,link:null,longDesc:null,lowSrc:null,marginHeight:R,marginWidth:R,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:R,rules:null,scheme:null,scrolling:xo,standby:null,summary:null,text:null,topMargin:R,valueType:null,version:null,vAlign:null,vLink:null,vSpace:R,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:wo,part:Co,prefix:null,property:null,results:R,security:null,unselectable:null},space:`html`,transform:No}),Fo=Ao({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`,maskType:`mask-type`,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:To,accentHeight:R,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:R,amplitude:R,arabicForm:null,ascent:R,attributeName:null,attributeType:null,azimuth:R,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:R,by:null,calcMode:null,capHeight:R,className:Co,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:R,diffuseConstant:R,direction:null,display:null,dur:null,divisor:R,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:R,enableBackground:null,end:null,event:null,exponent:R,externalResourcesRequired:null,fill:null,fillOpacity:R,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:wo,g2:wo,glyphName:wo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:R,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:R,horizOriginX:R,horizOriginY:R,id:null,ideographic:R,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:R,k:R,k1:R,k2:R,k3:R,k4:R,kernelMatrix:To,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:R,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:R,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:R,overlineThickness:R,paintOrder:null,panose1:null,path:null,pathLength:R,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Co,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:R,pointsAtY:R,pointsAtZ:R,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:To,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:To,rev:To,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:To,requiredFeatures:To,requiredFonts:To,requiredFormats:To,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:R,specularExponent:R,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:R,strikethroughThickness:R,string:null,stroke:null,strokeDashArray:To,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:R,strokeOpacity:R,strokeWidth:null,style:null,surfaceScale:R,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:To,tabIndex:R,tableValues:null,target:null,targetX:R,targetY:R,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:To,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:R,underlineThickness:R,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:R,values:null,vAlphabetic:R,vMathematical:R,vectorEffect:null,vHanging:R,vIdeographic:R,version:null,vertAdvY:R,vertOriginX:R,vertOriginY:R,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:R,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Mo}),Io=Ao({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()}}),Lo=Ao({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:No}),Ro=Ao({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),zo={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`},Bo=/[A-Z]/g,Vo=/-[a-z]/g,Ho=/^data[-\w.:]+$/i;function Uo(e,t){let n=_o(t),r=t,i=vo;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ho.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Vo,Go);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Vo.test(e)){let n=e.replace(Bo,Wo);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Oo}return new i(r,t)}function Wo(e){return`-`+e.toLowerCase()}function Go(e){return e.charAt(1).toUpperCase()}var Ko=go([jo,Po,Io,Lo,Ro],`html`),qo=go([jo,Fo,Io,Lo,Ro],`svg`);function Jo(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Yo(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Xo=/[#.]/g;function Zo(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){Xo.lastIndex=i;let e=Xo.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function Qo(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function $o(e){return e.join(` `).trim()}function es(e,t,n){let r=n?os(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Zo(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,ts(i))a.unshift(i);else for(let[t,n]of Object.entries(i))ns(e,o.properties,t,n)}for(let e of a)rs(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function ts(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function ns(e,t,n,r){let i=Uo(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?Qo(r):i.commaSeparated?Jo(r):i.commaOrSpaceSeparated?Qo(Jo(r).join(` `)):is(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?as(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(is(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function rs(e,t){if(t!=null){if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)rs(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?rs(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function is(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||_o(n)===_o(t)))return!0}return n}function as(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function os(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var ss=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),cs=es(Ko,`div`),ls=es(qo,`g`,ss);function us(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=ds(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=ds(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function ds(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
3
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var fs={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},ps={}.hasOwnProperty,ms=Object.prototype;function hs(e,t){let n=t||{};return gs({file:n.file||void 0,location:!1,schema:n.space===`svg`?qo:Ko,verbose:n.verbose||!1},e)}function gs(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},ys(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:_s(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=us(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},ys(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},ys(e,r,n),n}default:return n=vs(e,t),n}}function _s(e,t){let n=-1,r=[];for(;++n<t.length;){let i=gs(e,t[n]);r.push(i)}return r}function vs(e,t){let n=e.schema;e.schema=t.namespaceURI===fs.svg?qo:Ko;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;ps.call(ms,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?ls:cs)(t.tagName,i,_s(e,t.childNodes));if(ys(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&xs(r.startTag),o=r&&r.endTag&&xs(r.endTag),s=gs(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function ys(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=bs(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function bs(e,t,n){let r=xs(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)ps.call(n.attrs,i)&&(r[Uo(e.schema,i).property]=xs(n.attrs[i]));n.startTag;let a=xs(n.startTag),o=n.endTag?xs(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function xs(e){let t=Ss({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Ss({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Ss(e){return e.line&&e.column?e:void 0}var Cs={}.hasOwnProperty;function ws(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Cs.call(t,e)){let n=String(t[e]);i=Cs.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Ts={},Es={}.hasOwnProperty,Ds=ws(`type`,{handlers:{root:ks,element:Ps,text:Ms,comment:Ns,doctype:js}});function Os(e,t){let n=(t||Ts).space;return Ds(e,n===`svg`?qo:Ko)}function ks(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=Is(e.children,n,t),Ls(e,n),n}function As(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=Is(e.children,n,t),Ls(e,n),n}function js(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return Ls(e,t),t}function Ms(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return Ls(e,t),t}function Ns(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return Ls(e,t),t}function Ps(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=qo);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&Es.call(e.properties,a)){let t=Fs(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:fs[o],childNodes:[],parentNode:null};return s.childNodes=Is(e.children,s,r),Ls(e,s),e.tagName===`template`&&e.content&&(s.content=As(e.content,r)),s}function Fs(e,t,n){let r=Uo(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Yo(n):$o(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=fs[r.space]}return i}function Is(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=Ds(e[r],n);a.parentNode=t,i.push(a)}return i}function Ls(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var Rs=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],zs=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),z;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(z||={});var Bs={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function Vs(e){return e>=55296&&e<=57343}function Hs(e){return e>=56320&&e<=57343}function Us(e,t){return(e-55296)*1024+9216+t}function Ws(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function Gs(e){return e>=64976&&e<=65007||zs.has(e)}var B;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(B||={});var Ks=65536,qs=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Ks,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(Hs(t))return this.pos++,this._addGap(),Us(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,z.EOF;return this._err(B.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,z.EOF;let n=this.html.charCodeAt(t);return n===z.CARRIAGE_RETURN?z.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,z.EOF;let e=this.html.charCodeAt(this.pos);return e===z.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,z.LINE_FEED):e===z.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Vs(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===z.LINE_FEED||e===z.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Ws(e)?this._err(B.controlCharacterInInputStream):Gs(e)&&this._err(B.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},V;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(V||={});function Js(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var Ys=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),Xs=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function Zs(e){return e>=55296&&e<=57343||e>1114111?65533:Xs.get(e)??e}var Qs;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(Qs||={});var $s=32,ec;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(ec||={});function tc(e){return e>=Qs.ZERO&&e<=Qs.NINE}function nc(e){return e>=Qs.UPPER_A&&e<=Qs.UPPER_F||e>=Qs.LOWER_A&&e<=Qs.LOWER_F}function rc(e){return e>=Qs.UPPER_A&&e<=Qs.UPPER_Z||e>=Qs.LOWER_A&&e<=Qs.LOWER_Z||tc(e)}function ic(e){return e===Qs.EQUALS||rc(e)}var ac;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ac||={});var oc;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(oc||={});var sc=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ac.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=oc.Strict}startEntity(e){this.decodeMode=e,this.state=ac.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ac.EntityStart:return e.charCodeAt(t)===Qs.NUM?(this.state=ac.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ac.NamedEntity,this.stateNamedEntity(e,t));case ac.NumericStart:return this.stateNumericStart(e,t);case ac.NumericDecimal:return this.stateNumericDecimal(e,t);case ac.NumericHex:return this.stateNumericHex(e,t);case ac.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|$s)===Qs.LOWER_X?(this.state=ac.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ac.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(tc(r)||nc(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(tc(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Qs.SEMI)this.consumed+=1;else if(this.decodeMode===oc.Strict)return 0;return this.emitCodePoint(Zs(this.result),this.consumed),this.errors&&(e!==Qs.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&ec.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=cc(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===oc.Attribute&&(i===0||ic(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&ec.VALUE_LENGTH)>>14,i!==0){if(a===Qs.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==oc.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&ec.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~ec.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ac.NamedEntity:return this.result!==0&&(this.decodeMode!==oc.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ac.NumericDecimal:return this.emitNumericEntity(0,2);case ac.NumericHex:return this.emitNumericEntity(0,3);case ac.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ac.EntityStart:return 0}}};function cc(e,t,n,r){let i=(t&ec.BRANCH_LENGTH)>>7,a=t&ec.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var H;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(H||={});var lc;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(lc||={});var uc;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(uc||={});var U;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(U||={});var W;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(W||={});var dc=new Map([[U.A,W.A],[U.ADDRESS,W.ADDRESS],[U.ANNOTATION_XML,W.ANNOTATION_XML],[U.APPLET,W.APPLET],[U.AREA,W.AREA],[U.ARTICLE,W.ARTICLE],[U.ASIDE,W.ASIDE],[U.B,W.B],[U.BASE,W.BASE],[U.BASEFONT,W.BASEFONT],[U.BGSOUND,W.BGSOUND],[U.BIG,W.BIG],[U.BLOCKQUOTE,W.BLOCKQUOTE],[U.BODY,W.BODY],[U.BR,W.BR],[U.BUTTON,W.BUTTON],[U.CAPTION,W.CAPTION],[U.CENTER,W.CENTER],[U.CODE,W.CODE],[U.COL,W.COL],[U.COLGROUP,W.COLGROUP],[U.DD,W.DD],[U.DESC,W.DESC],[U.DETAILS,W.DETAILS],[U.DIALOG,W.DIALOG],[U.DIR,W.DIR],[U.DIV,W.DIV],[U.DL,W.DL],[U.DT,W.DT],[U.EM,W.EM],[U.EMBED,W.EMBED],[U.FIELDSET,W.FIELDSET],[U.FIGCAPTION,W.FIGCAPTION],[U.FIGURE,W.FIGURE],[U.FONT,W.FONT],[U.FOOTER,W.FOOTER],[U.FOREIGN_OBJECT,W.FOREIGN_OBJECT],[U.FORM,W.FORM],[U.FRAME,W.FRAME],[U.FRAMESET,W.FRAMESET],[U.H1,W.H1],[U.H2,W.H2],[U.H3,W.H3],[U.H4,W.H4],[U.H5,W.H5],[U.H6,W.H6],[U.HEAD,W.HEAD],[U.HEADER,W.HEADER],[U.HGROUP,W.HGROUP],[U.HR,W.HR],[U.HTML,W.HTML],[U.I,W.I],[U.IMG,W.IMG],[U.IMAGE,W.IMAGE],[U.INPUT,W.INPUT],[U.IFRAME,W.IFRAME],[U.KEYGEN,W.KEYGEN],[U.LABEL,W.LABEL],[U.LI,W.LI],[U.LINK,W.LINK],[U.LISTING,W.LISTING],[U.MAIN,W.MAIN],[U.MALIGNMARK,W.MALIGNMARK],[U.MARQUEE,W.MARQUEE],[U.MATH,W.MATH],[U.MENU,W.MENU],[U.META,W.META],[U.MGLYPH,W.MGLYPH],[U.MI,W.MI],[U.MO,W.MO],[U.MN,W.MN],[U.MS,W.MS],[U.MTEXT,W.MTEXT],[U.NAV,W.NAV],[U.NOBR,W.NOBR],[U.NOFRAMES,W.NOFRAMES],[U.NOEMBED,W.NOEMBED],[U.NOSCRIPT,W.NOSCRIPT],[U.OBJECT,W.OBJECT],[U.OL,W.OL],[U.OPTGROUP,W.OPTGROUP],[U.OPTION,W.OPTION],[U.P,W.P],[U.PARAM,W.PARAM],[U.PLAINTEXT,W.PLAINTEXT],[U.PRE,W.PRE],[U.RB,W.RB],[U.RP,W.RP],[U.RT,W.RT],[U.RTC,W.RTC],[U.RUBY,W.RUBY],[U.S,W.S],[U.SCRIPT,W.SCRIPT],[U.SEARCH,W.SEARCH],[U.SECTION,W.SECTION],[U.SELECT,W.SELECT],[U.SOURCE,W.SOURCE],[U.SMALL,W.SMALL],[U.SPAN,W.SPAN],[U.STRIKE,W.STRIKE],[U.STRONG,W.STRONG],[U.STYLE,W.STYLE],[U.SUB,W.SUB],[U.SUMMARY,W.SUMMARY],[U.SUP,W.SUP],[U.TABLE,W.TABLE],[U.TBODY,W.TBODY],[U.TEMPLATE,W.TEMPLATE],[U.TEXTAREA,W.TEXTAREA],[U.TFOOT,W.TFOOT],[U.TD,W.TD],[U.TH,W.TH],[U.THEAD,W.THEAD],[U.TITLE,W.TITLE],[U.TR,W.TR],[U.TRACK,W.TRACK],[U.TT,W.TT],[U.U,W.U],[U.UL,W.UL],[U.SVG,W.SVG],[U.VAR,W.VAR],[U.WBR,W.WBR],[U.XMP,W.XMP]]);function fc(e){return dc.get(e)??W.UNKNOWN}var G=W,pc={[H.HTML]:new Set([G.ADDRESS,G.APPLET,G.AREA,G.ARTICLE,G.ASIDE,G.BASE,G.BASEFONT,G.BGSOUND,G.BLOCKQUOTE,G.BODY,G.BR,G.BUTTON,G.CAPTION,G.CENTER,G.COL,G.COLGROUP,G.DD,G.DETAILS,G.DIR,G.DIV,G.DL,G.DT,G.EMBED,G.FIELDSET,G.FIGCAPTION,G.FIGURE,G.FOOTER,G.FORM,G.FRAME,G.FRAMESET,G.H1,G.H2,G.H3,G.H4,G.H5,G.H6,G.HEAD,G.HEADER,G.HGROUP,G.HR,G.HTML,G.IFRAME,G.IMG,G.INPUT,G.LI,G.LINK,G.LISTING,G.MAIN,G.MARQUEE,G.MENU,G.META,G.NAV,G.NOEMBED,G.NOFRAMES,G.NOSCRIPT,G.OBJECT,G.OL,G.P,G.PARAM,G.PLAINTEXT,G.PRE,G.SCRIPT,G.SECTION,G.SELECT,G.SOURCE,G.STYLE,G.SUMMARY,G.TABLE,G.TBODY,G.TD,G.TEMPLATE,G.TEXTAREA,G.TFOOT,G.TH,G.THEAD,G.TITLE,G.TR,G.TRACK,G.UL,G.WBR,G.XMP]),[H.MATHML]:new Set([G.MI,G.MO,G.MN,G.MS,G.MTEXT,G.ANNOTATION_XML]),[H.SVG]:new Set([G.TITLE,G.FOREIGN_OBJECT,G.DESC]),[H.XLINK]:new Set,[H.XML]:new Set,[H.XMLNS]:new Set},mc=new Set([G.H1,G.H2,G.H3,G.H4,G.H5,G.H6]);U.STYLE,U.SCRIPT,U.XMP,U.IFRAME,U.NOEMBED,U.NOFRAMES,U.PLAINTEXT;var K;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(K||={});var hc={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function gc(e){return e>=z.DIGIT_0&&e<=z.DIGIT_9}function _c(e){return e>=z.LATIN_CAPITAL_A&&e<=z.LATIN_CAPITAL_Z}function vc(e){return e>=z.LATIN_SMALL_A&&e<=z.LATIN_SMALL_Z}function yc(e){return vc(e)||_c(e)}function bc(e){return yc(e)||gc(e)}function xc(e){return e+32}function Sc(e){return e===z.SPACE||e===z.LINE_FEED||e===z.TABULATION||e===z.FORM_FEED}function Cc(e){return Sc(e)||e===z.SOLIDUS||e===z.GREATER_THAN_SIGN}function wc(e){return e===z.NULL?B.nullCharacterReference:e>1114111?B.characterReferenceOutsideUnicodeRange:Vs(e)?B.surrogateCharacterReference:Gs(e)?B.noncharacterCharacterReference:Ws(e)||e===z.CARRIAGE_RETURN?B.controlCharacterReference:null}var Tc=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new qs(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new sc(Ys,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(B.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(B.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=wc(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:V.START_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:V.END_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:V.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:V.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(Js(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(B.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=fc(e.tagName),e.type===V.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(B.endTagWithAttributes),e.selfClosing&&this._err(B.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case V.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case V.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case V.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:V.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Sc(e)?V.WHITESPACE_CHARACTER:e===z.NULL?V.NULL_CHARACTER:V.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(V.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?oc.Attribute:oc.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case K.DATA:this._stateData(e);break;case K.RCDATA:this._stateRcdata(e);break;case K.RAWTEXT:this._stateRawtext(e);break;case K.SCRIPT_DATA:this._stateScriptData(e);break;case K.PLAINTEXT:this._statePlaintext(e);break;case K.TAG_OPEN:this._stateTagOpen(e);break;case K.END_TAG_OPEN:this._stateEndTagOpen(e);break;case K.TAG_NAME:this._stateTagName(e);break;case K.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case K.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case K.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case K.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case K.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case K.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case K.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case K.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case K.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case K.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case K.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case K.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case K.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case K.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case K.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case K.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case K.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case K.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case K.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case K.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case K.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case K.BOGUS_COMMENT:this._stateBogusComment(e);break;case K.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case K.COMMENT_START:this._stateCommentStart(e);break;case K.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case K.COMMENT:this._stateComment(e);break;case K.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case K.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case K.COMMENT_END:this._stateCommentEnd(e);break;case K.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case K.DOCTYPE:this._stateDoctype(e);break;case K.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case K.DOCTYPE_NAME:this._stateDoctypeName(e);break;case K.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case K.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case K.CDATA_SECTION:this._stateCdataSection(e);break;case K.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case K.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case K.CHARACTER_REFERENCE:this._stateCharacterReference();break;case K.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.TAG_OPEN;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitCodePoint(e);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case z.AMPERSAND:this._startCharacterReference();break;case z.LESS_THAN_SIGN:this.state=K.RCDATA_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.RAWTEXT_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(yc(e))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case z.EXCLAMATION_MARK:this.state=K.MARKUP_DECLARATION_OPEN;break;case z.SOLIDUS:this.state=K.END_TAG_OPEN;break;case z.QUESTION_MARK:this._err(B.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e);break;case z.EOF:this._err(B.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(B.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=K.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(yc(e))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case z.GREATER_THAN_SIGN:this._err(B.missingEndTagName),this.state=K.DATA;break;case z.EOF:this._err(B.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(B.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),t.tagName+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(_c(e)?xc(e):e)}}_stateRcdataLessThanSign(e){e===z.SOLIDUS?this.state=K.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){yc(e)?(this.state=K.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=K.BEFORE_ATTRIBUTE_NAME,!1;case z.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=K.SELF_CLOSING_START_TAG,!1;case z.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=K.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===z.SOLIDUS?this.state=K.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){yc(e)?(this.state=K.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case z.SOLIDUS:this.state=K.SCRIPT_DATA_END_TAG_OPEN;break;case z.EXCLAMATION_MARK:this.state=K.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=K.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){yc(e)?(this.state=K.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===z.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===z.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case z.HYPHEN_MINUS:this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case z.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===z.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:yc(e)?(this._emitChars(`<`),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){yc(e)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Bs.SCRIPT,!1)&&Cc(this.preprocessor.peek(Bs.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Bs.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case z.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case z.HYPHEN_MINUS:this._emitChars(`-`);break;case z.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case z.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case z.EOF:this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===z.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Bs.SCRIPT,!1)&&Cc(this.preprocessor.peek(Bs.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<Bs.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.SOLIDUS:case z.GREATER_THAN_SIGN:case z.EOF:this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case z.EQUALS_SIGN:this._err(B.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=K.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:case z.SOLIDUS:case z.GREATER_THAN_SIGN:case z.EOF:this._leaveAttrName(),this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case z.EQUALS_SIGN:this._leaveAttrName(),this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case z.QUOTATION_MARK:case z.APOSTROPHE:case z.LESS_THAN_SIGN:this._err(B.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(_c(e)?xc(e):e)}}_stateAfterAttributeName(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case z.EQUALS_SIGN:this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:this.state=K.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case z.APOSTROPHE:this.state=K.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingAttributeValue),this.state=K.DATA,this.emitCurrentTagToken();break;default:this.state=K.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case z.APOSTROPHE:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case z.AMPERSAND:this._startCharacterReference();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.AMPERSAND:this._startCharacterReference();break;case z.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case z.QUOTATION_MARK:case z.APOSTROPHE:case z.LESS_THAN_SIGN:case z.EQUALS_SIGN:case z.GRAVE_ACCENT:this._err(B.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case z.SOLIDUS:this._leaveAttrValue(),this.state=K.SELF_CLOSING_START_TAG;break;case z.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._err(B.missingWhitespaceBetweenAttributes),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case z.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=K.DATA,this.emitCurrentTagToken();break}case z.EOF:this._err(B.eofInTag),this._emitEOFToken();break;default:this._err(B.unexpectedSolidusInTag),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case z.NULL:this._err(B.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Bs.DASH_DASH,!0)?(this._createCommentToken(Bs.DASH_DASH.length+1),this.state=K.COMMENT_START):this._consumeSequenceIfMatch(Bs.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bs.DOCTYPE.length+1),this.state=K.DOCTYPE):this._consumeSequenceIfMatch(Bs.CDATA_START,!0)?this.inForeignNode?this.state=K.CDATA_SECTION:(this._err(B.cdataInHtmlContent),this._createCommentToken(Bs.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=K.BOGUS_COMMENT):this._ensureHibernation()||(this._err(B.incorrectlyOpenedComment),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_START_DASH;break;case z.GREATER_THAN_SIGN:{this._err(B.abruptClosingOfEmptyComment),this.state=K.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case z.GREATER_THAN_SIGN:this._err(B.abruptClosingOfEmptyComment),this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END_DASH;break;case z.LESS_THAN_SIGN:t.data+=`<`,this.state=K.COMMENT_LESS_THAN_SIGN;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.data+=`�`;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case z.EXCLAMATION_MARK:t.data+=`!`,this.state=K.COMMENT_LESS_THAN_SIGN_BANG;break;case z.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===z.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=K.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===z.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=K.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==z.GREATER_THAN_SIGN&&e!==z.EOF&&this._err(B.nestedComment),this.state=K.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case z.EXCLAMATION_MARK:this.state=K.COMMENT_END_BANG;break;case z.HYPHEN_MINUS:t.data+=`-`;break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case z.HYPHEN_MINUS:t.data+=`--!`,this.state=K.COMMENT_END_DASH;break;case z.GREATER_THAN_SIGN:this._err(B.incorrectlyClosedComment),this.state=K.DATA,this.emitCurrentComment(t);break;case z.EOF:this._err(B.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=K.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case z.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(B.missingWhitespaceBeforeDoctypeName),this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(_c(e))this._createDoctypeToken(String.fromCharCode(xc(e))),this.state=K.DOCTYPE_NAME;else switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.NULL:this._err(B.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=K.DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:{this._err(B.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=K.DATA;break}case z.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=K.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.AFTER_DOCTYPE_NAME;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.NULL:this._err(B.unexpectedNullCharacter),t.name+=`�`;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(_c(e)?xc(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(Bs.PUBLIC,!1)?this.state=K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bs.SYSTEM,!1)?this.state=K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(B.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.publicId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case z.APOSTROPHE:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.publicId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case z.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:this.state=K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.QUOTATION_MARK:this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case z.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case z.GREATER_THAN_SIGN:this._err(B.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case z.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.systemId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case z.APOSTROPHE:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case z.NULL:this._err(B.unexpectedNullCharacter),t.systemId+=`�`;break;case z.GREATER_THAN_SIGN:this._err(B.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case z.SPACE:case z.LINE_FEED:case z.TABULATION:case z.FORM_FEED:break;case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.EOF:this._err(B.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(B.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case z.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case z.NULL:this._err(B.unexpectedNullCharacter);break;case z.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case z.RIGHT_SQUARE_BRACKET:this.state=K.CDATA_SECTION_BRACKET;break;case z.EOF:this._err(B.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===z.RIGHT_SQUARE_BRACKET?this.state=K.CDATA_SECTION_END:(this._emitChars(`]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case z.GREATER_THAN_SIGN:this.state=K.DATA;break;case z.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(z.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&bc(this.preprocessor.peek(1))?K.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){bc(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===z.SEMICOLON&&this._err(B.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},Ec=new Set([W.DD,W.DT,W.LI,W.OPTGROUP,W.OPTION,W.P,W.RB,W.RP,W.RT,W.RTC]),Dc=new Set([...Ec,W.CAPTION,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]),Oc=new Set([W.APPLET,W.CAPTION,W.HTML,W.MARQUEE,W.OBJECT,W.TABLE,W.TD,W.TEMPLATE,W.TH]),kc=new Set([...Oc,W.OL,W.UL]),Ac=new Set([...Oc,W.BUTTON]),jc=new Set([W.ANNOTATION_XML,W.MI,W.MN,W.MO,W.MS,W.MTEXT]),Mc=new Set([W.DESC,W.FOREIGN_OBJECT,W.TITLE]),Nc=new Set([W.TR,W.TEMPLATE,W.HTML]),Pc=new Set([W.TBODY,W.TFOOT,W.THEAD,W.TEMPLATE,W.HTML]),Fc=new Set([W.TABLE,W.TEMPLATE,W.HTML]),Ic=new Set([W.TD,W.TH]),Lc=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=W.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===W.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===H.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==H.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(mc,H.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Ic,H.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(Fc,H.HTML)}clearBackToTableBodyContext(){this.clearBackTo(Pc,H.HTML)}clearBackToTableRowContext(){this.clearBackTo(Nc,H.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===W.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===W.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case H.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case H.SVG:if(Mc.has(r))return!1;break;case H.MATHML:if(jc.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Oc)}hasInListItemScope(e){return this.hasInDynamicScope(e,kc)}hasInButtonScope(e){return this.hasInDynamicScope(e,Ac)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case H.HTML:if(mc.has(t))return!0;if(Oc.has(t))return!1;break;case H.SVG:if(Mc.has(t))return!1;break;case H.MATHML:if(jc.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===H.HTML)switch(this.tagIDs[e]){case W.TBODY:case W.THEAD:case W.TFOOT:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.OPTION:case W.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Ec.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Dc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Dc.has(this.currentTagId);)this.pop()}},Rc=3,zc;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(zc||={});var Bc={type:zc.Marker},Vc=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===zc.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<Rc)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<Rc)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=Rc&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(Bc)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:zc.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:zc.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(Bc);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===zc.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===zc.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===zc.Element&&t.element===e)}},Hc={createDocument(){return{nodeName:`#document`,mode:uc.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};Hc.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(Hc.isTextNode(n)){n.value+=t;return}}Hc.appendChild(e,Hc.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Hc.isTextNode(r)?r.value+=t:Hc.insertBefore(e,Hc.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Uc=`html`,Wc=`about:legacy-compat`,Gc=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,Kc=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),qc=[...Kc,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Jc=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),Yc=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Xc=[...Yc,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function Zc(e,t){return t.some(t=>e.startsWith(t))}function Qc(e){return e.name===Uc&&e.publicId===null&&(e.systemId===null||e.systemId===Wc)}function $c(e){if(e.name!==Uc)return uc.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===Gc)return uc.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Jc.has(n))return uc.QUIRKS;let e=t===null?qc:Kc;if(Zc(n,e))return uc.QUIRKS;if(e=t===null?Yc:Xc,Zc(n,e))return uc.LIMITED_QUIRKS}return uc.NO_QUIRKS}var el={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},tl=`definitionurl`,nl=`definitionURL`,rl=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),il=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:H.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:H.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:H.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:H.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:H.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:H.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:H.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:H.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:H.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:H.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:H.XMLNS}]]),al=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),ol=new Set([W.B,W.BIG,W.BLOCKQUOTE,W.BODY,W.BR,W.CENTER,W.CODE,W.DD,W.DIV,W.DL,W.DT,W.EM,W.EMBED,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HR,W.I,W.IMG,W.LI,W.LISTING,W.MENU,W.META,W.NOBR,W.OL,W.P,W.PRE,W.RUBY,W.S,W.SMALL,W.SPAN,W.STRONG,W.STRIKE,W.SUB,W.SUP,W.TABLE,W.TT,W.U,W.UL,W.VAR]);function sl(e){let t=e.tagID;return t===W.FONT&&e.attrs.some(({name:e})=>e===lc.COLOR||e===lc.SIZE||e===lc.FACE)||ol.has(t)}function cl(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===tl){e.attrs[t].name=nl;break}}function ll(e){for(let t=0;t<e.attrs.length;t++){let n=rl.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function ul(e){for(let t=0;t<e.attrs.length;t++){let n=il.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function dl(e){let t=al.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=fc(e.tagName))}function fl(e,t){return t===H.MATHML&&(e===W.MI||e===W.MO||e===W.MN||e===W.MS||e===W.MTEXT)}function pl(e,t,n){if(t===H.MATHML&&e===W.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===lc.ENCODING){let t=n[e].value.toLowerCase();return t===el.TEXT_HTML||t===el.APPLICATION_XML}}return t===H.SVG&&(e===W.FOREIGN_OBJECT||e===W.DESC||e===W.TITLE)}function ml(e,t,n,r){return(!r||r===H.HTML)&&pl(e,t,n)||(!r||r===H.MATHML)&&fl(e,t)}var hl=`hidden`,gl=8,_l=3,q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(q||={});var vl={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},yl=new Set([W.TABLE,W.TBODY,W.TFOOT,W.THEAD,W.TR]),bl={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Hc,onParseError:null},xl=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...bl,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new Tc(this.options,this),this.activeFormattingElements=new Vc(this.treeAdapter),this.fragmentContextID=n?fc(this.treeAdapter.getTagName(n)):W.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Lc(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...bl,...t};e??=n.treeAdapter.createElement(U.TEMPLATE,H.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,H.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===W.TEMPLATE&&i.tmplInsertionModeStack.unshift(q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??vl,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===H.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,H.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=hc.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===U.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==H.HTML))switch(this.fragmentContextID){case W.TITLE:case W.TEXTAREA:this.tokenizer.state=hc.RCDATA;break;case W.STYLE:case W.XMP:case W.IFRAME:case W.NOEMBED:case W.NOFRAMES:case W.NOSCRIPT:this.tokenizer.state=hc.RAWTEXT;break;case W.SCRIPT:this.tokenizer.state=hc.SCRIPT_DATA;break;case W.PLAINTEXT:this.tokenizer.state=hc.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,H.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,H.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(U.HTML,H.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,W.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===V.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===W.SVG&&this.treeAdapter.getTagName(t)===U.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===H.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===W.MGLYPH||e.tagID===W.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,H.HTML)}_processToken(e){switch(e.type){case V.CHARACTER:this.onCharacter(e);break;case V.NULL_CHARACTER:this.onNullCharacter(e);break;case V.COMMENT:this.onComment(e);break;case V.DOCTYPE:this.onDoctype(e);break;case V.START_TAG:this._processStartTag(e);break;case V.END_TAG:this.onEndTag(e);break;case V.EOF:this.onEof(e);break;case V.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return ml(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===zc.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(W.P),this.openElements.popUntilTagNamePopped(W.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case W.TR:this.insertionMode=q.IN_ROW;return;case W.TBODY:case W.THEAD:case W.TFOOT:this.insertionMode=q.IN_TABLE_BODY;return;case W.CAPTION:this.insertionMode=q.IN_CAPTION;return;case W.COLGROUP:this.insertionMode=q.IN_COLUMN_GROUP;return;case W.TABLE:this.insertionMode=q.IN_TABLE;return;case W.BODY:this.insertionMode=q.IN_BODY;return;case W.FRAMESET:this.insertionMode=q.IN_FRAMESET;return;case W.SELECT:this._resetInsertionModeForSelect(e);return;case W.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case W.HTML:this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return;case W.TD:case W.TH:if(e>0){this.insertionMode=q.IN_CELL;return}break;case W.HEAD:if(e>0){this.insertionMode=q.IN_HEAD;return}}this.insertionMode=q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===W.TEMPLATE)break;if(e===W.TABLE){this.insertionMode=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(e){return yl.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case W.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===H.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case W.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return pc[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){zd(this,e);return}switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Ll(this,e);break;case q.BEFORE_HEAD:Bl(this,e);break;case q.IN_HEAD:Wl(this,e);break;case q.IN_HEAD_NO_SCRIPT:ql(this,e);break;case q.AFTER_HEAD:Xl(this,e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:$l(this,e);break;case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Ju(this,e);break;case q.IN_TABLE_TEXT:sd(this,e);break;case q.IN_COLUMN_GROUP:md(this,e);break;case q.AFTER_BODY:Ad(this,e);break;case q.AFTER_AFTER_BODY:Id(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Rd(this,e);return}switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Ll(this,e);break;case q.BEFORE_HEAD:Bl(this,e);break;case q.IN_HEAD:Wl(this,e);break;case q.IN_HEAD_NO_SCRIPT:ql(this,e);break;case q.AFTER_HEAD:Xl(this,e);break;case q.TEXT:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Ju(this,e);break;case q.IN_COLUMN_GROUP:md(this,e);break;case q.AFTER_BODY:Ad(this,e);break;case q.AFTER_AFTER_BODY:Id(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){kl(this,e);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:kl(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.AFTER_BODY:Al(this,e);break;case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:jl(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:Nl(this,e);break;case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:this._err(e,B.misplacedDoctype);break;case q.IN_TABLE_TEXT:cd(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,B.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Vd(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Fl(this,e);break;case q.BEFORE_HEAD:Rl(this,e);break;case q.IN_HEAD:Vl(this,e);break;case q.IN_HEAD_NO_SCRIPT:Gl(this,e);break;case q.AFTER_HEAD:Jl(this,e);break;case q.IN_BODY:Mu(this,e);break;case q.IN_TABLE:rd(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.IN_CAPTION:ud(this,e);break;case q.IN_COLUMN_GROUP:fd(this,e);break;case q.IN_TABLE_BODY:hd(this,e);break;case q.IN_ROW:_d(this,e);break;case q.IN_CELL:yd(this,e);break;case q.IN_SELECT:xd(this,e);break;case q.IN_SELECT_IN_TABLE:Cd(this,e);break;case q.IN_TEMPLATE:Td(this,e);break;case q.AFTER_BODY:Od(this,e);break;case q.IN_FRAMESET:jd(this,e);break;case q.AFTER_FRAMESET:Nd(this,e);break;case q.AFTER_AFTER_BODY:Fd(this,e);break;case q.AFTER_AFTER_FRAMESET:Ld(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Hd(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Il(this,e);break;case q.BEFORE_HEAD:zl(this,e);break;case q.IN_HEAD:Hl(this,e);break;case q.IN_HEAD_NO_SCRIPT:Kl(this,e);break;case q.AFTER_HEAD:Yl(this,e);break;case q.IN_BODY:Wu(this,e);break;case q.TEXT:Ku(this,e);break;case q.IN_TABLE:id(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.IN_CAPTION:dd(this,e);break;case q.IN_COLUMN_GROUP:pd(this,e);break;case q.IN_TABLE_BODY:gd(this,e);break;case q.IN_ROW:vd(this,e);break;case q.IN_CELL:bd(this,e);break;case q.IN_SELECT:Sd(this,e);break;case q.IN_SELECT_IN_TABLE:wd(this,e);break;case q.IN_TEMPLATE:Ed(this,e);break;case q.AFTER_BODY:kd(this,e);break;case q.IN_FRAMESET:Md(this,e);break;case q.AFTER_FRAMESET:Pd(this,e);break;case q.AFTER_AFTER_BODY:Id(this,e)}}onEof(e){switch(this.insertionMode){case q.INITIAL:Pl(this,e);break;case q.BEFORE_HTML:Ll(this,e);break;case q.BEFORE_HEAD:Bl(this,e);break;case q.IN_HEAD:Wl(this,e);break;case q.IN_HEAD_NO_SCRIPT:ql(this,e);break;case q.AFTER_HEAD:Xl(this,e);break;case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:Gu(this,e);break;case q.TEXT:qu(this,e);break;case q.IN_TABLE_TEXT:cd(this,e);break;case q.IN_TEMPLATE:Dd(this,e);break;case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Ml(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===z.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:this._insertCharacters(e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Ql(this,e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:Ju(this,e);break;case q.IN_TABLE_TEXT:od(this,e)}}};function Sl(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):Uu(e,t),n}function Cl(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function wl(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=_l;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Tl(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Tl(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function El(e,t,n){let r=fc(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===W.TEMPLATE&&i===H.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Dl(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Ol(e,t){for(let n=0;n<gl;n++){let n=Sl(e,t);if(!n)break;let r=Cl(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=wl(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&El(e,a,i),Dl(e,r,n)}}function kl(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Al(e,t){e._appendCommentNode(t,e.openElements.items[0])}function jl(e,t){e._appendCommentNode(t,e.document)}function Ml(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Nl(e,t){e._setDocumentType(t);let n=t.forceQuirks?uc.QUIRKS:$c(t);Qc(t)||e._err(t,B.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function Pl(e,t){e._err(t,B.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,uc.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function Fl(e,t){t.tagID===W.HTML?(e._insertElement(t,H.HTML),e.insertionMode=q.BEFORE_HEAD):Ll(e,t)}function Il(e,t){let n=t.tagID;(n===W.HTML||n===W.HEAD||n===W.BODY||n===W.BR)&&Ll(e,t)}function Ll(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function Rl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.HEAD:e._insertElement(t,H.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break;default:Bl(e,t)}}function zl(e,t){let n=t.tagID;n===W.HEAD||n===W.BODY||n===W.HTML||n===W.BR?Bl(e,t):e._err(t,B.endTagWithoutMatchingOpenElement)}function Bl(e,t){e._insertFakeElement(U.HEAD,W.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function Vl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TITLE:e._switchToTextParsing(t,hc.RCDATA);break;case W.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,hc.RAWTEXT):(e._insertElement(t,H.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break;case W.NOFRAMES:case W.STYLE:e._switchToTextParsing(t,hc.RAWTEXT);break;case W.SCRIPT:e._switchToTextParsing(t,hc.SCRIPT_DATA);break;case W.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break;case W.HEAD:e._err(t,B.misplacedStartTagForHeadElement);break;default:Wl(e,t)}}function Hl(e,t){switch(t.tagID){case W.HEAD:e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break;case W.BODY:case W.BR:case W.HTML:Wl(e,t);break;case W.TEMPLATE:Ul(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function Ul(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==W.TEMPLATE&&e._err(t,B.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,B.endTagWithoutMatchingOpenElement)}function Wl(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function Gl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.BASEFONT:case W.BGSOUND:case W.HEAD:case W.LINK:case W.META:case W.NOFRAMES:case W.STYLE:Vl(e,t);break;case W.NOSCRIPT:e._err(t,B.nestedNoscriptInHead);break;default:ql(e,t)}}function Kl(e,t){switch(t.tagID){case W.NOSCRIPT:e.openElements.pop(),e.insertionMode=q.IN_HEAD;break;case W.BR:ql(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function ql(e,t){let n=t.type===V.EOF?B.openElementsLeftAfterEof:B.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function Jl(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.BODY:e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break;case W.FRAMESET:e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET;break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:e._err(t,B.abandonedHeadElementChild),e.openElements.push(e.headElement,W.HEAD),Vl(e,t),e.openElements.remove(e.headElement);break;case W.HEAD:e._err(t,B.misplacedStartTagForHeadElement);break;default:Xl(e,t)}}function Yl(e,t){switch(t.tagID){case W.BODY:case W.HTML:case W.BR:Xl(e,t);break;case W.TEMPLATE:Ul(e,t);break;default:e._err(t,B.endTagWithoutMatchingOpenElement)}}function Xl(e,t){e._insertFakeElement(U.BODY,W.BODY),e.insertionMode=q.IN_BODY,Zl(e,t)}function Zl(e,t){switch(t.type){case V.CHARACTER:$l(e,t);break;case V.WHITESPACE_CHARACTER:Ql(e,t);break;case V.COMMENT:kl(e,t);break;case V.START_TAG:Mu(e,t);break;case V.END_TAG:Wu(e,t);break;case V.EOF:Gu(e,t)}}function Ql(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function $l(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function eu(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function tu(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function nu(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET)}function ru(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function iu(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&mc.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,H.HTML)}function au(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function ou(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),n||(e.formElement=e.openElements.current))}function su(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===W.LI&&r===W.LI||(n===W.DD||n===W.DT)&&(r===W.DD||r===W.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==W.ADDRESS&&r!==W.DIV&&r!==W.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function cu(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.tokenizer.state=hc.PLAINTEXT}function lu(e,t){e.openElements.hasInScope(W.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1}function uu(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(U.A);n&&(Ol(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function du(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function fu(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(W.NOBR)&&(Ol(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function pu(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function mu(e,t){e.treeAdapter.getDocumentMode(e.document)!==uc.QUIRKS&&e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function hu(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function gu(e){let t=Js(e,lc.TYPE);return t!=null&&t.toLowerCase()===hl}function _u(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),gu(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function vu(e,t){e._appendElement(t,H.HTML),t.ackSelfClosing=!0}function yu(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function bu(e,t){t.tagName=U.IMG,t.tagID=W.IMG,hu(e,t)}function xu(e,t){e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.tokenizer.state=hc.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function Su(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,hc.RAWTEXT)}function Cu(e,t){e.framesetOk=!1,e._switchToTextParsing(t,hc.RAWTEXT)}function wu(e,t){e._switchToTextParsing(t,hc.RAWTEXT)}function Tu(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function Eu(e,t){e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function Du(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,H.HTML)}function Ou(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(W.RTC),e._insertElement(t,H.HTML)}function ku(e,t){e._reconstructActiveFormattingElements(),cl(t),ul(t),t.selfClosing?e._appendElement(t,H.MATHML):e._insertElement(t,H.MATHML),t.ackSelfClosing=!0}function Au(e,t){e._reconstructActiveFormattingElements(),ll(t),ul(t),t.selfClosing?e._appendElement(t,H.SVG):e._insertElement(t,H.SVG),t.ackSelfClosing=!0}function ju(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function Mu(e,t){switch(t.tagID){case W.I:case W.S:case W.B:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.SMALL:case W.STRIKE:case W.STRONG:du(e,t);break;case W.A:uu(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:iu(e,t);break;case W.P:case W.DL:case W.OL:case W.UL:case W.DIV:case W.DIR:case W.NAV:case W.MAIN:case W.MENU:case W.ASIDE:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.DETAILS:case W.ADDRESS:case W.ARTICLE:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:ru(e,t);break;case W.LI:case W.DD:case W.DT:su(e,t);break;case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:hu(e,t);break;case W.HR:yu(e,t);break;case W.RB:case W.RTC:Du(e,t);break;case W.RT:case W.RP:Ou(e,t);break;case W.PRE:case W.LISTING:au(e,t);break;case W.XMP:Su(e,t);break;case W.SVG:Au(e,t);break;case W.HTML:eu(e,t);break;case W.BASE:case W.LINK:case W.META:case W.STYLE:case W.TITLE:case W.SCRIPT:case W.BGSOUND:case W.BASEFONT:case W.TEMPLATE:Vl(e,t);break;case W.BODY:tu(e,t);break;case W.FORM:ou(e,t);break;case W.NOBR:fu(e,t);break;case W.MATH:ku(e,t);break;case W.TABLE:mu(e,t);break;case W.INPUT:_u(e,t);break;case W.PARAM:case W.TRACK:case W.SOURCE:vu(e,t);break;case W.IMAGE:bu(e,t);break;case W.BUTTON:lu(e,t);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:pu(e,t);break;case W.IFRAME:Cu(e,t);break;case W.SELECT:Tu(e,t);break;case W.OPTION:case W.OPTGROUP:Eu(e,t);break;case W.NOEMBED:case W.NOFRAMES:wu(e,t);break;case W.FRAMESET:nu(e,t);break;case W.TEXTAREA:xu(e,t);break;case W.NOSCRIPT:e.options.scriptingEnabled?wu(e,t):ju(e,t);break;case W.PLAINTEXT:cu(e,t);break;case W.COL:case W.TH:case W.TD:case W.TR:case W.HEAD:case W.FRAME:case W.TBODY:case W.TFOOT:case W.THEAD:case W.CAPTION:case W.COLGROUP:break;default:ju(e,t)}}function Nu(e,t){if(e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Pu(e,t){e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,kd(e,t))}function Fu(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Iu(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(W.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(W.FORM):n&&e.openElements.remove(n))}function Lu(e){e.openElements.hasInButtonScope(W.P)||e._insertFakeElement(U.P,W.P),e._closePElement()}function Ru(e){e.openElements.hasInListItemScope(W.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(W.LI),e.openElements.popUntilTagNamePopped(W.LI))}function zu(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Bu(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Vu(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Hu(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(U.BR,W.BR),e.openElements.pop(),e.framesetOk=!1}function Uu(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==W.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Wu(e,t){switch(t.tagID){case W.A:case W.B:case W.I:case W.S:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.NOBR:case W.SMALL:case W.STRIKE:case W.STRONG:Ol(e,t);break;case W.P:Lu(e);break;case W.DL:case W.UL:case W.OL:case W.DIR:case W.DIV:case W.NAV:case W.PRE:case W.MAIN:case W.MENU:case W.ASIDE:case W.BUTTON:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.ADDRESS:case W.ARTICLE:case W.DETAILS:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.LISTING:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:Fu(e,t);break;case W.LI:Ru(e);break;case W.DD:case W.DT:zu(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:Bu(e);break;case W.BR:Hu(e);break;case W.BODY:Nu(e,t);break;case W.HTML:Pu(e,t);break;case W.FORM:Iu(e);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:Vu(e,t);break;case W.TEMPLATE:Ul(e,t);break;default:Uu(e,t)}}function Gu(e,t){e.tmplInsertionModeStack.length>0?Dd(e,t):Ml(e,t)}function Ku(e,t){var n;t.tagID===W.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function qu(e,t){e._err(t,B.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Ju(e,t){if(e.openElements.currentTagId!==void 0&&yl.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case V.CHARACTER:sd(e,t);break;case V.WHITESPACE_CHARACTER:od(e,t)}else ad(e,t)}function Yu(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CAPTION}function Xu(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function Zu(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.COLGROUP,W.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,fd(e,t)}function Qu(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_TABLE_BODY}function $u(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.TBODY,W.TBODY),e.insertionMode=q.IN_TABLE_BODY,hd(e,t)}function ed(e,t){e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function td(e,t){gu(t)?e._appendElement(t,H.HTML):ad(e,t),t.ackSelfClosing=!0}function nd(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,H.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function rd(e,t){switch(t.tagID){case W.TD:case W.TH:case W.TR:$u(e,t);break;case W.STYLE:case W.SCRIPT:case W.TEMPLATE:Vl(e,t);break;case W.COL:Zu(e,t);break;case W.FORM:nd(e,t);break;case W.TABLE:ed(e,t);break;case W.TBODY:case W.TFOOT:case W.THEAD:Qu(e,t);break;case W.INPUT:td(e,t);break;case W.CAPTION:Yu(e,t);break;case W.COLGROUP:Xu(e,t);break;default:ad(e,t)}}function id(e,t){switch(t.tagID){case W.TABLE:e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode());break;case W.TEMPLATE:Ul(e,t);break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:ad(e,t)}}function ad(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Zl(e,t),e.fosterParentingEnabled=n}function od(e,t){e.pendingCharacterTokens.push(t)}function sd(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function cd(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)ad(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var ld=new Set([W.CAPTION,W.COL,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]);function ud(e,t){let n=t.tagID;ld.has(n)?e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,rd(e,t)):Mu(e,t)}function dd(e,t){let n=t.tagID;switch(n){case W.CAPTION:case W.TABLE:e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,n===W.TABLE&&id(e,t));break;case W.BODY:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:Wu(e,t)}}function fd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.COL:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TEMPLATE:Vl(e,t);break;default:md(e,t)}}function pd(e,t){switch(t.tagID){case W.COLGROUP:e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TEMPLATE:Ul(e,t);break;case W.COL:break;default:md(e,t)}}function md(e,t){e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function hd(e,t){switch(t.tagID){case W.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_ROW;break;case W.TH:case W.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(U.TR,W.TR),e.insertionMode=q.IN_ROW,_d(e,t);break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,rd(e,t));break;default:rd(e,t)}}function gd(e,t){let n=t.tagID;switch(t.tagID){case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,id(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:case W.TR:break;default:id(e,t)}}function _d(e,t){switch(t.tagID){case W.TH:case W.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CELL,e.activeFormattingElements.insertMarker();break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,hd(e,t));break;default:rd(e,t)}}function vd(e,t){switch(t.tagID){case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break;case W.TABLE:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,gd(e,t));break;case W.TBODY:case W.TFOOT:case W.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(W.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,gd(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:break;default:id(e,t)}}function yd(e,t){let n=t.tagID;ld.has(n)?(e.openElements.hasInTableScope(W.TD)||e.openElements.hasInTableScope(W.TH))&&(e._closeTableCell(),_d(e,t)):Mu(e,t)}function bd(e,t){let n=t.tagID;switch(n){case W.TD:case W.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_ROW);break;case W.TABLE:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),vd(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:break;default:Wu(e,t)}}function xd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.OPTGROUP:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.HR:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.INPUT:case W.KEYGEN:case W.TEXTAREA:case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),t.tagID!==W.SELECT&&e._processStartTag(t));break;case W.SCRIPT:case W.TEMPLATE:Vl(e,t)}}function Sd(e,t){switch(t.tagID){case W.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===W.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===W.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop();break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop();break;case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode());break;case W.TEMPLATE:Ul(e,t)}}function Cd(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e._processStartTag(t)):xd(e,t)}function wd(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Sd(e,t)}function Td(e,t){switch(t.tagID){case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:Vl(e,t);break;case W.CAPTION:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,rd(e,t);break;case W.COL:e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,fd(e,t);break;case W.TR:e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,hd(e,t);break;case W.TD:case W.TH:e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,_d(e,t);break;default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,Mu(e,t)}}function Ed(e,t){t.tagID===W.TEMPLATE&&Ul(e,t)}function Dd(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ml(e,t)}function Od(e,t){t.tagID===W.HTML?Mu(e,t):Ad(e,t)}function kd(e,t){if(t.tagID===W.HTML){if(e.fragmentContext||(e.insertionMode=q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===W.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else Ad(e,t)}function Ad(e,t){e.insertionMode=q.IN_BODY,Zl(e,t)}function jd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.FRAMESET:e._insertElement(t,H.HTML);break;case W.FRAME:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.NOFRAMES:Vl(e,t)}}function Md(e,t){t.tagID===W.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==W.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function Nd(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.NOFRAMES:Vl(e,t)}}function Pd(e,t){t.tagID===W.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function Fd(e,t){t.tagID===W.HTML?Mu(e,t):Id(e,t)}function Id(e,t){e.insertionMode=q.IN_BODY,Zl(e,t)}function Ld(e,t){switch(t.tagID){case W.HTML:Mu(e,t);break;case W.NOFRAMES:Vl(e,t)}}function Rd(e,t){t.chars=`�`,e._insertCharacters(t)}function zd(e,t){e._insertCharacters(t),e.framesetOk=!1}function Bd(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==H.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Vd(e,t){if(sl(t))Bd(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===H.MATHML?cl(t):r===H.SVG&&(dl(t),ll(t)),ul(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Hd(e,t){if(t.tagID===W.P||t.tagID===W.BR){Bd(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===H.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}U.AREA,U.BASE,U.BASEFONT,U.BGSOUND,U.BR,U.COL,U.EMBED,U.FRAME,U.HR,U.IMG,U.INPUT,U.KEYGEN,U.LINK,U.META,U.PARAM,U.SOURCE,U.TRACK,U.WBR;var Ud=Gd(`end`),Wd=Gd(`start`);function Gd(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Kd(e){let t=Wd(e),n=Ud(e);if(t&&n)return{start:t,end:n}}var qd=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Jd=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),Yd={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Xd(e,t){let n=df(e),r=ws(`type`,{handlers:{root:Qd,element:$d,text:ef,comment:rf,doctype:tf,raw:af},unknown:of}),i={parser:n?new xl(Yd):xl.getFragmentParser(void 0,Yd),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),sf(i,Wd());let a=hs(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&Pa(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Zd(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Qd(e,t){Zd(e.children,t)}function $d(e,t){lf(e,t),Zd(e.children,t),uf(e,t)}function ef(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:V.CHARACTER,chars:e.value,location:ff(e)};sf(t,Wd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function tf(e,t){let n={type:V.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:ff(e)};sf(t,Wd(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function nf(e,t){t.stitches=!0;let n=pf(e);`children`in e&&`children`in n&&(n.children=Xd({type:`root`,children:e.children},t.options).children),rf({type:`comment`,value:{stitch:n}},t)}function rf(e,t){let n=e.value,r={type:V.COMMENT,data:n,location:ff(e)};sf(t,Wd(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function af(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,cf(t,Wd(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(qd,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function of(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))nf(n,t);else{let e=``;throw Jd.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function sf(e,t){cf(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=hc.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function cf(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function lf(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===hc.PLAINTEXT)return;sf(t,Wd(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:fs.html;i===fs.html&&n===`svg`&&(i=fs.svg);let a=Os({...e,children:[]},{space:i===fs.svg?`svg`:`html`}),o={type:V.START_TAG,tagName:n,tagID:fc(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:ff(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function uf(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&Rs.includes(n)||t.parser.tokenizer.state===hc.PLAINTEXT)return;sf(t,Ud(e));let r={type:V.END_TAG,tagName:n,tagID:fc(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:ff(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===hc.RCDATA||t.parser.tokenizer.state===hc.RAWTEXT||t.parser.tokenizer.state===hc.SCRIPT_DATA)&&(t.parser.tokenizer.state=hc.DATA)}function df(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function ff(e){let t=Wd(e)||{line:void 0,column:void 0,offset:void 0},n=Ud(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function pf(e){return`children`in e?mo({...e,children:[]}):mo(e)}function mf(e){return function(t,n){return Xd(t,{...e,file:n})}}var hf=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],gf={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...hf,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...hf],h2:[[`className`,`sr-only`]],img:[...hf,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...hf,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...hf],table:[...hf],ul:[...hf,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},_f={}.hasOwnProperty;function vf(e,t){let n={type:`root`,children:[]},r=yf({schema:t?{...gf,...t}:gf,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function yf(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return bf(e,n);case`doctype`:return xf(e,n);case`element`:return Sf(e,n);case`root`:return Cf(e,n);case`text`:return wf(e,n)}}}function bf(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return jf(r,t),r}}function xf(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return jf(e,t),e}}function Sf(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=Tf(e,t.children),i=Ef(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&_f.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return jf(o,t),o}function Cf(e,t){let n={type:`root`,children:Tf(e,t.children)};return jf(n,t),n}function wf(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return jf(n,t),n}function Tf(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=yf(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Ef(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&_f.call(r,n)?r[n]:void 0,o=r&&_f.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(_f.call(s,l)){let t=s[l],n=Df(e,Mf(a,l),l,t);n??=Df(e,Mf(o,l),l,t),n!=null&&(c[l]=n)}if(i&&_f.call(i,n)){let e=i[n];for(l in e)_f.call(e,l)&&!_f.call(c,l)&&(c[l]=e[l])}return c}function Df(e,t,n,r){return t?Array.isArray(r)?Of(e,t,n,r):kf(e,t,n,r):void 0}function Of(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=kf(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function kf(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&Af(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function Af(e,t,n){let r=e.schema.protocols&&_f.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function jf(e,t){let n=Kd(t);t.data&&(e.data=mo(t.data)),n&&(e.position=n)}function Mf(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Nf(e){return function(t){return vf(t,e)}}function Pf(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Ff(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function If(e,t,n){let r=Sa((n||{}).ignore||[]),i=Lf(t),a=-1;for(;++a<i.length;)Ma(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Lf(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Rf(e[0]),zf(e[1])])}return t}function Rf(e){return typeof e==`string`?new RegExp(Ff(e),`g`):e}function zf(e){return typeof e==`function`?e:function(){return e}}var Bf=`phrasing`,Vf=[`autolink`,`link`,`image`,`label`];function Hf(){return{transforms:[Xf],enter:{literalAutolink:Wf,literalAutolinkEmail:Gf,literalAutolinkHttp:Gf,literalAutolinkWww:Gf},exit:{literalAutolink:Yf,literalAutolinkEmail:Jf,literalAutolinkHttp:Kf,literalAutolinkWww:qf}}}function Uf(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Bf,notInConstruct:Vf},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Bf,notInConstruct:Vf},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Bf,notInConstruct:Vf}]}}function Wf(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Gf(e){this.config.enter.autolinkProtocol.call(this,e)}function Kf(e){this.config.exit.autolinkProtocol.call(this,e)}function qf(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Jf(e){this.config.exit.autolinkEmail.call(this,e)}function Yf(e){this.exit(e)}function Xf(e){If(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Zf],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Qf]],{ignore:[`link`,`linkReference`]})}function Zf(e,t,n,r,i){let a=``;if(!tp(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!$f(n)))return!1;let o=ep(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Qf(e,t,n,r){return!tp(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function $f(e){let 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 ep(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Pf(e,`(`),a=Pf(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function tp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Lr(n)||Ir(n))&&(!t||n!==47)}function np(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}fp.peek=dp;function rp(){this.buffer()}function ip(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ap(){this.buffer()}function op(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function sp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=np(this.sliceSerialize(e)).toLowerCase(),n.label=t}function cp(e){this.exit(e)}function lp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=np(this.sliceSerialize(e)).toLowerCase(),n.label=t}function up(e){this.exit(e)}function dp(){return`[`}function fp(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function pp(){return{enter:{gfmFootnoteCallString:rp,gfmFootnoteCall:ip,gfmFootnoteDefinitionLabelString:ap,gfmFootnoteDefinition:op},exit:{gfmFootnoteCallString:sp,gfmFootnoteCall:cp,gfmFootnoteDefinitionLabelString:lp,gfmFootnoteDefinition:up}}}function mp(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:fp},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
4
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?gp:hp))),s(),o}}function hp(e,t,n){return t===0?e:gp(e,t,n)}function gp(e,t,n){return(n?``:` `)+e}var _p=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Sp.peek=Cp;function vp(){return{canContainEols:[`delete`],enter:{strikethrough:bp},exit:{strikethrough:xp}}}function yp(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:_p}],handlers:{delete:Sp}}}function bp(e){this.enter({type:`delete`,children:[]},e)}function xp(e){this.exit(e)}function Sp(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Cp(){return`~`}function wp(e){return e.length}function Tp(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||wp,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Ep(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Dp(r[d]);else{let e=Dp(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
5
|
+
`)}function Ep(e){return e==null?``:String(e)}function Dp(e){let 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 Op(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),kp);return i(),o}function kp(e,t,n){return`>`+(n?``:` `)+e}function Ap(e,t){return jp(e,t.inConstruct,!0)&&!jp(e,t.notInConstruct,!1)}function jp(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 Mp(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
6
|
+
`&&Ap(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
7
|
+
`}function Np(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Pp(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 Fp(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Ip(e,t,n,r){let i=Fp(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Pp(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Lp);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Np(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
|
|
8
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
9
|
+
`),a&&(u+=s.move(a+`
|
|
10
|
+
`)),u+=s.move(c),l(),u}function Lp(e,t,n){return(n?``:` `)+e}function Rp(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zp(e,t,n,r){let i=Rp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
11
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Bp(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Vp(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Hp(e){if(e===null||Fr(e)||Lr(e))return 1;if(Ir(e))return 2}function Up(e,t,n){let r=Hp(e),i=Hp(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}}Wp.peek=Gp;function Wp(e,t,n,r){let i=Bp(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Up(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Vp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Up(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Vp(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Gp(e,t,n){return n.options.emphasis||`*`}var Kp={};function qp(e,t){let n=t||Kp;return Jp(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Jp(e,t,n){if(Xp(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 Yp(e.children,t,n)}return Array.isArray(e)?Yp(e,t,n):``}function Yp(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Jp(e[i],t,n);return r.join(``)}function Xp(e){return!!(e&&typeof e==`object`)}function Zp(e,t){let n=!1;return Pa(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&qp(e)&&(t.options.setext||n))}function Qp(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Zp(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
12
|
+
`,after:`
|
|
13
|
+
`});return r(),t(),o+`
|
|
14
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
15
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
16
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=Vp(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}$p.peek=em;function $p(e){return e.value||``}function em(){return`<`}tm.peek=nm;function tm(e,t,n,r){let i=Rp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function nm(){return`!`}rm.peek=im;function rm(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function im(){return`!`}am.peek=om;function am(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function om(){return"`"}function sm(e,t){let n=qp(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))}cm.peek=lm;function cm(e,t,n,r){let i=Rp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(sm(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function lm(e,t,n){return sm(e,n)?`<`:`[`}um.peek=dm;function um(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function dm(){return`[`}function fm(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function pm(e){let t=fm(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function mm(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function hm(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function gm(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?mm(n):fm(n),s=e.ordered?o===`.`?`)`:`.`:pm(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),hm(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function _m(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function vm(e,t,n,r){let i=_m(n),a=n.bulletCurrent||fm(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ym(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var bm=Sa([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function xm(e,t,n,r){return(e.children.some(function(e){return bm(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Sm(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Cm.peek=wm;function Cm(e,t,n,r){let i=Sm(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Up(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Vp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Up(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Vp(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function wm(e,t,n){return n.options.strong||`*`}function Tm(e,t,n,r){return n.safe(e.value,r)}function Em(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Dm(e,t,n){let r=(hm(n)+(n.options.ruleSpaces?` `:``)).repeat(Em(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Om={blockquote:Op,break:Mp,code:Ip,definition:zp,emphasis:Wp,hardBreak:Mp,heading:Qp,html:$p,image:tm,imageReference:rm,inlineCode:am,link:cm,linkReference:um,list:gm,listItem:vm,paragraph:ym,root:xm,strong:Cm,text:Tm,thematicBreak:Dm},km=document.createElement(`i`);function Am(e){let t=`&`+e+`;`;km.innerHTML=t;let n=km.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function jm(e,t){let 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)}var Mm=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Nm(e){return e.replace(Mm,Pm)}function Pm(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return jm(n.slice(t?2:1),t?16:10)}return Am(n)||e}function Fm(){return{enter:{table:Im,tableData:Bm,tableHeader:Bm,tableRow:Rm},exit:{codeText:Vm,table:Lm,tableData:zm,tableHeader:zm,tableRow:zm}}}function Im(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Lm(e){this.exit(e),this.data.inTable=void 0}function Rm(e){this.enter({type:`tableRow`,children:[]},e)}function zm(e){this.exit(e)}function Bm(e){this.enter({type:`tableCell`,children:[]},e)}function Vm(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Hm));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Hm(e,t){return t===`|`?t:e}function Um(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
17
|
+
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
18
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Tp(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Om.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Wm(){return{exit:{taskListCheckValueChecked:Km,taskListCheckValueUnchecked:Km,paragraph:qm}}}function Gm(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Jm}}}function Km(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function qm(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Jm(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Om.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Ym(){return[Hf(),pp(),vp(),Fm(),Wm()]}function Xm(e){return{extensions:[Uf(),mp(e),yp(),Um(e),Gm()]}}var Zm={}.hasOwnProperty;function Qm(e){let t={},n=-1;for(;++n<e.length;)$m(t,e[n]);return t}function $m(e,t){let n;for(n in t){let r=(Zm.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Zm.call(r,a)||(r[a]=[]);let e=i[a];eh(r[a],Array.isArray(e)?e:e?[e]:[])}}}function eh(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Yr(e,0,0,r)}var th={tokenize:hh,partial:!0},nh={tokenize:gh,partial:!0},rh={tokenize:_h,partial:!0},ih={tokenize:vh,partial:!0},ah={tokenize:yh,partial:!0},oh={name:`wwwAutolink`,tokenize:ph,previous:bh},sh={name:`protocolAutolink`,tokenize:mh,previous:xh},ch={name:`emailAutolink`,tokenize:fh,previous:Sh},lh={};function uh(){return{text:lh}}for(var dh=48;dh<123;)lh[dh]=ch,dh++,dh===58?dh=65:dh===91&&(dh=97);lh[43]=ch,lh[45]=ch,lh[46]=ch,lh[95]=ch,lh[72]=[ch,sh],lh[104]=[ch,sh],lh[87]=[ch,oh],lh[119]=[ch,oh];function fh(e,t,n){let r=this,i,a;return o;function o(t){return!Ch(t)||!Sh.call(r,r.previous)||wh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Ch(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ah,u,l)(t):t===45||t===95||kr(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Or(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ph(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!bh.call(r,r.previous)||wh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(th,e.attempt(nh,e.attempt(rh,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function mh(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&xh.call(r,r.previous)&&!wh(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Or(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||jr(t)||Fr(t)||Lr(t)||Ir(t)?n(t):e.attempt(nh,e.attempt(rh,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function hh(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function gh(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ih,c,s)(t):t===null||Fr(t)||Lr(t)||t!==45&&Ir(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function _h(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ih,t,a)(o):o===null||Fr(o)||Lr(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function vh(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Fr(o)||Lr(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Fr(e)||Lr(e)?t(e):r(e)}function a(e){return Or(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Or(t)?(e.consume(t),o):n(t)}}function yh(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return kr(e)?n(e):t(e)}}function bh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Fr(e)}function xh(e){return!Or(e)}function Sh(e){return!(e===47||Ch(e))}function Ch(e){return e===43||e===45||e===46||e===95||kr(e)}function wh(e){let t=e.length,n=!1;for(;t--;){let 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}function Th(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&kr(e.charCodeAt(n+1))&&kr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}var Eh={name:`attention`,resolveAll:Dh,tokenize:Oh};function Dh(e,t){let n=-1,r,i,a,o,s,c,l,u;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;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};kh(d,-c),kh(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Xr(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Xr(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Xr(l,Zr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Xr(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Xr(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Yr(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Oh(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Hp(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Hp(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function kh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Ah={name:`autolink`,tokenize:jh};function jh(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Or(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||kr(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||kr(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||jr(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ar(t)?(e.consume(t),l):n(t)}function u(e){return kr(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||kr(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function J(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return I(r)?(e.enter(n),s(r)):t(r)}function s(r){return I(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Mh={partial:!0,tokenize:Nh};function Nh(e,t,n){return r;function r(t){return I(t)?J(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||F(e)?t(e):n(e)}}var Ph={continuation:{tokenize:Ih},exit:Lh,name:`blockQuote`,tokenize:Fh};function Fh(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return I(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ih(e,t,n){let r=this;return i;function i(t){return I(t)?J(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ph,t,n)(r)}}function Lh(e){e.exit(`blockQuote`)}var Rh={name:`characterEscape`,tokenize:zh};function zh(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Pr(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Bh={name:`characterReference`,tokenize:Vh};function Vh(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=kr,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Nr,u):(e.enter(`characterReferenceValue`),a=7,o=Mr,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===kr&&!Am(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Hh={partial:!0,tokenize:Gh},Uh={concrete:!0,name:`codeFenced`,tokenize:Wh};function Wh(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),I(t)?J(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||F(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Hh,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||F(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):I(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),J(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||F(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||F(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&I(t)?J(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||F(t)?e.check(Hh,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||F(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),I(t)?J(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),I(t)?J(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||F(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Gh(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Kh={name:`codeIndented`,tokenize:Jh},qh={partial:!0,tokenize:Yh};function Jh(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),J(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):F(t)?e.attempt(qh,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||F(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Yh(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):J(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):F(e)?i(e):n(e)}}var Xh={name:`codeText`,previous:Qh,resolve:Zh,tokenize:$h};function Zh(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 Qh(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $h(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||F(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var eg=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&tg(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tg(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tg(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);tg(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tg(this.left,t.reverse())}}}};function tg(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 ng(e){let t={},n=-1,r,i,a,o,s,c,l,u=new eg(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,rg(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Yr(e,0,1/0,u.slice(0)),!l}function rg(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var ig={resolve:og,tokenize:sg},ag={partial:!0,tokenize:cg};function og(e){return ng(e),e}function sg(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):F(t)?e.check(ag,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function cg(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,a,`linePrefix`)}function a(i){if(i===null||F(i))return n(i);let 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(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function lg(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||jr(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||F(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Fr(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||jr(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ug(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):F(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||F(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!I(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dg(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),J(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||F(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fg(e,t){let n;return r;function r(i){return F(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):I(i)?J(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pg={name:`definition`,tokenize:hg},mg={partial:!0,tokenize:gg};function hg(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ug.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=np(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Fr(t)?fg(e,l)(t):l(t)}function l(t){return lg(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mg,d,d)(t)}function d(t){return I(t)?J(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||F(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gg(e,t,n){return r;function r(t){return Fr(t)?fg(e,i)(t):n(t)}function i(t){return dg(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return I(t)?J(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||F(e)?t(e):n(e)}}var _g={name:`hardBreakEscape`,tokenize:vg};function vg(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return F(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yg={name:`headingAtx`,resolve:bg,tokenize:xg};function bg(e,t){let n=e.length-2,r=3,i,a;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},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Yr(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function xg(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Fr(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||F(n)?(e.exit(`atxHeading`),t(n)):I(n)?J(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Fr(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Sg=`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`.split(`.`),Cg=[`pre`,`script`,`style`,`textarea`],wg={concrete:!0,name:`htmlFlow`,resolveTo:Dg,tokenize:Og},Tg={partial:!0,tokenize:Ag},Eg={partial:!0,tokenize:kg};function Dg(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 Og(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:oe):Or(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Or(a)?(e.consume(a),i=4,r.interrupt?t:oe):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:oe):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Or(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Fr(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Cg.includes(l)?(i=1,r.interrupt?t(s):D(s)):Sg.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||kr(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return I(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Or(t)?(e.consume(t),b):I(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||kr(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):I(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):I(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||F(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Fr(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||I(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||F(t)?D(t):I(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),k):t===60&&i===1?(e.consume(t),re):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),oe):t===93&&i===5?(e.consume(t),ae):F(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Tg,A,te)(t)):t===null||F(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(Eg,O,A)(t)}function O(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||F(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function k(t){return t===45?(e.consume(t),oe):D(t)}function re(t){return t===47?(e.consume(t),o=``,ie):D(t)}function ie(t){if(t===62){let n=o.toLowerCase();return Cg.includes(n)?(e.consume(t),se):D(t)}return Or(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):D(t)}function ae(t){return t===93?(e.consume(t),oe):D(t)}function oe(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),oe):D(t)}function se(t){return t===null||F(t)?(e.exit(`htmlFlowData`),A(t)):(e.consume(t),se)}function A(n){return e.exit(`htmlFlow`),t(n)}}function kg(e,t,n){let r=this;return i;function i(t){return F(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Ag(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Mh,t,n)}}var jg={name:`htmlText`,tokenize:Mg};function Mg(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Or(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Or(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):F(t)?(o=d,re(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?k(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):F(t)?(o=h,re(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?k(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?k(t):F(t)?(o=v,re(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):F(t)?(o=y,re(t)):(e.consume(t),y)}function b(e){return e===62?k(e):y(e)}function x(t){return Or(t)?(e.consume(t),S):n(t)}function S(t){return t===45||kr(t)?(e.consume(t),S):C(t)}function C(t){return F(t)?(o=C,re(t)):I(t)?(e.consume(t),C):k(t)}function w(t){return t===45||kr(t)?(e.consume(t),w):t===47||t===62||Fr(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),k):t===58||t===95||Or(t)?(e.consume(t),E):F(t)?(o=T,re(t)):I(t)?(e.consume(t),T):k(t)}function E(t){return t===45||t===46||t===58||t===95||kr(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):F(t)?(o=ee,re(t)):I(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):F(t)?(o=D,re(t)):I(t)?(e.consume(t),D):(e.consume(t),O)}function te(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):F(t)?(o=te,re(t)):(e.consume(t),te)}function O(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Fr(t)?T(t):(e.consume(t),O)}function ne(e){return e===47||e===62||Fr(e)?T(e):n(e)}function k(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function re(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return I(t)?J(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}var Ng={name:`labelEnd`,resolveAll:Lg,resolveTo:Rg,tokenize:zg},Pg={tokenize:Bg},Fg={tokenize:Vg},Ig={tokenize:Hg};function Lg(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Yr(e,0,e.length,n),e}function Rg(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Xr(s,e.slice(a+1,a+r+3)),s=Xr(s,[[`enter`,u,t]]),s=Xr(s,Zr(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Xr(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Xr(s,e.slice(o+1)),s=Xr(s,[[`exit`,c,t]]),Yr(e,a,e.length,s),e}function zg(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(np(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Pg,u,o?u:d)(t):t===91?e.attempt(Fg,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Ig,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Bg(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Fr(t)?fg(e,a)(t):a(t)}function a(t){return t===41?u(t):lg(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Fr(t)?fg(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dg(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Fr(t)?fg(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Vg(e,t,n){let r=this;return i;function i(t){return ug.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(np(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Hg(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Ug={name:`labelStartImage`,resolveAll:Ng.resolveAll,tokenize:Wg};function Wg(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Gg={name:`labelStartLink`,resolveAll:Ng.resolveAll,tokenize:Kg};function Kg(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var qg={name:`lineEnding`,tokenize:Jg};function Jg(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}}var Yg={name:`thematicBreak`,tokenize:Xg};function Xg(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||F(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),I(t)?J(e,s,`whitespace`)(t):s(t))}}var Zg={continuation:{tokenize:t_},exit:r_,name:`list`,tokenize:e_},Qg={partial:!0,tokenize:i_},$g={partial:!0,tokenize:n_};function e_(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Mr(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Yg,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Mr(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Mh,r.interrupt?n:u,e.attempt(Qg,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return I(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function t_(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Mh,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,J(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!I(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($g,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,J(e,e.attempt(Zg,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function n_(e,t,n){let r=this;return J(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function r_(e){e.exit(this.containerState.type)}function i_(e,t,n){let r=this;return J(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!I(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var a_={name:`setextUnderline`,resolveTo:o_,tokenize:s_};function o_(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function s_(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),I(t)?J(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||F(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var c_={tokenize:g_,partial:!0};function l_(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:p_,continuation:{tokenize:m_},exit:h_}},text:{91:{name:`gfmFootnoteCall`,tokenize:f_},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:u_,resolveTo:d_}}}}function u_(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=np(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function d_(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`;let 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++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function f_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Fr(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(np(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Fr(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function p_(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Fr(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=np(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Fr(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),J(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function m_(e,t,n){return e.check(Mh,t,e.attempt(c_,t,n))}function h_(e){e.exit(`gfmFootnoteDefinition`)}function g_(e,t,n){let r=this;return J(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function __(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Yr(o,o.length,0,Zr(s,e.slice(r+1,n),t)),Yr(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Yr(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Hp(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Hp(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var v_=class{constructor(){this.map=[]}add(e,t,n){y_(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function y_(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 b_(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 x_(){return{flow:{null:{name:`table`,tokenize:S_,resolveAll:C_}}}}function S_(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):F(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):I(t)?J(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Fr(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,I(t)?J(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return I(t)?J(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||F(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return I(t)?J(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||F(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||F(n)?(e.exit(`tableRow`),t(n)):I(n)?J(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Fr(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function C_(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new v_;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(T_(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=w_(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=w_(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=w_(f,t,o,i,n,d)):(o[0]=o[1],d=w_(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&T_(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=b_(t.events,n))}return e}function w_(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},E_(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=E_(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=E_(t.events,n[2]),a=E_(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},E_(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function T_(e,t,n,r,i){let a=[],o=E_(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function E_(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var D_={name:`tasklistCheck`,tokenize:k_};function O_(){return{text:{91:D_}}}function k_(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Fr(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return F(r)?t(r):I(r)?e.check({tokenize:A_},t,n)(r):n(r)}}function A_(e,t,n){return J(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function j_(e){return Qm([uh(),l_(),__(e),x_(),O_()])}var M_={};function N_(e){let t=this,n=e||M_,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(j_(n)),a.push(Ym()),o.push(Xm(n))}var P_=Object.defineProperty,F_=Object.defineProperties,I_=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,R_=Object.prototype.hasOwnProperty,z_=Object.prototype.propertyIsEnumerable,B_=(e,t,n)=>t in e?P_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V_=(e,t)=>{for(var n in t||={})R_.call(t,n)&&B_(e,n,t[n]);if(L_)for(var n of L_(t))z_.call(t,n)&&B_(e,n,t[n]);return e},H_=(e,t)=>F_(e,I_(t)),U_=e=>{let t=new Uint8Array(e.length+1),n=!1,r=!1,i=0;for(;i<e.length;){if(e[i]===`\\`&&i+1<e.length&&e[i+1]==="`"){let e=n||r?1:0;t[i+1]=e,t[i+2]=e,i+=2;continue}if(e.substring(i,i+3)==="```"){r=!r;let a=n||r?1:0,o=Math.min(i+3,e.length);for(let e=i+1;e<=o;e+=1)t[e]=a;i=o;continue}!r&&e[i]==="`"&&(n=!n),t[i+1]=n||r?1:0,i+=1}return t},W_=null,G_=(e,t)=>{let n=W_;return(n===null||n.text!==e)&&(n={text:e,lookup:U_(e)},W_=n),n.lookup[Math.min(t,e.length)]===1},K_=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},q_=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]===`\\`&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!K_(e,n)&&(t+=1)}return t},J_=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]===`\\`&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`"){if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}}return!1},Y_=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,X_=e=>!e||typeof e!=`string`||!e.includes(`>`)?e:e.replace(Y_,(t,n,r,i)=>G_(e,i)?t:`${n}\\>${r}`),Z_=/(\*\*)([^*]*\*?)$/,Q_=/(__)([^_]*?)$/,$_=/(\*\*\*)([^*]*?)$/,ev=/(\*)([^*]*?)$/,tv=/(_)([^_]*?)$/,nv=/(`)([^`]*?)$/,rv=/(~~)([^~]*?)$/,iv=/^[\s_~*`]*$/,av=/^[\s]*[-*+][\s]+$/,ov=/[\p{L}\p{N}_]/u,sv=/^```[^`\n]*```?$/,cv=/^\*{4,}$/,lv=/(__)([^_]+)_$/,uv=/(~~)([^~]+)~$/,dv=/~~/g,fv=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95||ov.test(e)},pv=(e,t)=>{let n=1;for(let r=t-1;r>=0;--r)if(e[r]===`]`)n+=1;else if(e[r]===`[`&&(--n,n===0))return r;return-1},mv=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]===`[`)n+=1;else if(e[r]===`]`&&(--n,n===0))return r;return-1},hv=e=>e===`inlineLatex`||e===`blockLatex`,gv=(e,t)=>t===`[`&&e===`none`?`blockLatex`:t===`]`&&e===`blockLatex`?`none`:t===`(`&&e===`none`?`inlineLatex`:t===`)`&&e===`inlineLatex`?`none`:null,_v=(e,t)=>t?e===`blockDollar`?`none`:`blockDollar`:e===`blockDollar`?e:e===`inlineDollar`?`none`:`inlineDollar`,vv=(e,t)=>{let n=`none`;for(let r=0;r<e.length&&r<t;r+=1){if(e[r]===`\\`&&e[r+1]===`$`){r+=1;continue}if(e[r]===`\\`){let t=gv(n,e[r+1]);if(t!==null){n=t,r+=1;continue}}if(e[r]===`$`&&!hv(n)){let t=e[r+1]===`$`;n=_v(n,t),t&&(r+=1)}}return n!==`none`},yv=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===`)`)return!0;if(e[n]===`
|
|
19
|
+
`)return!1}return!1},bv=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`)`)return!1;if(e[n]===`(`)return n>0&&e[n-1]===`]`&&yv(e,t);if(e[n]===`
|
|
20
|
+
`)return!1}return!1},xv=(e,t)=>{for(let n=t-1;n>=0;--n){if(e[n]===`>`)return!1;if(e[n]===`<`){let t=n+1<e.length?e[n+1]:``;return t>=`a`&&t<=`z`||t>=`A`&&t<=`Z`||t===`/`}if(e[n]===`
|
|
21
|
+
`)return!1}return!1},Sv=(e,t,n)=>{let r=0;for(let n=t-1;n>=0;--n)if(e[n]===`
|
|
22
|
+
`){r=n+1;break}let i=e.length;for(let n=t;n<e.length;n+=1)if(e[n]===`
|
|
23
|
+
`){i=n;break}let a=e.substring(r,i),o=0,s=!1;for(let e of a)if(e===n)o+=1;else if(e!==` `&&e!==` `){s=!0;break}return o>=3&&!s},Cv=e=>e.includes(`$`)||e.includes(`\\(`)||e.includes(`\\[`),wv=(e,t,n,r)=>n===`\\`||Cv(e)&&vv(e,t)?!0:n!==`*`&&r===`*`?(t<e.length-2?e[t+2]:``)!==`*`:n===`*`||(!n||n===` `||n===` `||n===`
|
|
24
|
+
`)&&(!r||r===` `||r===` `||r===`
|
|
25
|
+
`),Tv=e=>e===` `||e===` `||e===`
|
|
26
|
+
`,Ev=(e,t)=>!!(e&&t&&fv(e)&&fv(t)),Dv=(e,t,n,r)=>{let i=Ev(e,t),a=!!t&&!Tv(t),o=!!e&&!Tv(e);return i&&n%2==0&&!r?{count:!1}:o&&n%2==1||a?{count:!0,inWordAsteriskChain:i}:{count:!1}},Ov=e=>{let t=0,n=!1,r=!1,i=e.length;for(let a=0;a<i;a+=1){if(e[a]==="`"&&a+2<i&&e[a+1]==="`"&&e[a+2]==="`"){n=!n,a+=2;continue}if(n)continue;if(e[a]!==`*`){fv(e[a])||(r=!1);continue}let o=a>0?e[a-1]:``,s=a<i-1?e[a+1]:``;if(wv(e,a,o,s))continue;let c=Dv(o,s,t,r);c.count&&(t+=1,r=c.inWordAsteriskChain)}return t},kv=(e,t,n,r)=>!!(n===`\\`||Cv(e)&&vv(e,t)||bv(e,t)||xv(e,t)||n===`_`||r===`_`||n&&r&&fv(n)&&fv(r)),Av=e=>{let t=0,n=!1,r=e.length;for(let i=0;i<r;i+=1){if(e[i]==="`"&&i+2<r&&e[i+1]==="`"&&e[i+2]==="`"){n=!n,i+=2;continue}if(n||e[i]!==`_`)continue;let a=i>0?e[i-1]:``,o=i<r-1?e[i+1]:``;kv(e,i,a,o)||(t+=1)}return t},jv=e=>{let t=0,n=0,r=!1;for(let i=0;i<e.length;i+=1){if(e[i]==="`"&&i+2<e.length&&e[i+1]==="`"&&e[i+2]==="`"){n>=3&&(t+=Math.floor(n/3)),n=0,r=!r,i+=2;continue}r||(e[i]===`*`?n+=1:(n>=3&&(t+=Math.floor(n/3)),n=0))}return n>=3&&(t+=Math.floor(n/3)),t},Mv=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`*`&&r+1<e.length&&e[r+1]===`*`&&(t+=1,r+=1)}return t},Nv=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]==="`"&&r+2<e.length&&e[r+1]==="`"&&e[r+2]==="`"){n=!n,r+=2;continue}n||e[r]===`_`&&r+1<e.length&&e[r+1]===`_`&&(t+=1,r+=1)}return t},Pv=(e,t,n)=>{if(!t||iv.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
27
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return av.test(a)&&t.includes(`
|
|
28
|
+
`)?!0:Sv(e,n,`*`)},Fv=e=>{let t=e.match(Z_);if(!t)return e;let n=t[2],r=e.lastIndexOf(t[1]);return G_(e,r)||J_(e,r)||Pv(e,n,r)?e:Mv(e)%2==1?n.endsWith(`*`)?`${e}*`:`${e}**`:e},Iv=(e,t,n)=>{if(!t||iv.test(t))return!0;let r=e.substring(0,n).lastIndexOf(`
|
|
29
|
+
`),i=r===-1?0:r+1,a=e.substring(i,n);return av.test(a)&&t.includes(`
|
|
30
|
+
`)?!0:Sv(e,n,`_`)},Lv=e=>{let t=e.match(Q_);if(!t){let t=e.match(lv);if(t){let n=e.lastIndexOf(t[1]);if(!(G_(e,n)||J_(e,n))&&Nv(e)%2==1)return`${e}_`}return e}let n=t[2],r=e.lastIndexOf(t[1]);return G_(e,r)||J_(e,r)||Iv(e,n,r)?e:Nv(e)%2==1?`${e}__`:e},Rv=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`*`&&e[n-1]!==`*`&&e[n+1]!==`*`&&e[n-1]!==`\\`&&!vv(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``,i=!t||Tv(t),a=!r||Tv(r);if(i&&a||t&&r&&fv(t)&&fv(r)||a)continue;return n}}return-1},zv=e=>{if(!e.match(ev))return e;let t=Rv(e);if(t===-1||G_(e,t)||J_(e,t))return e;let n=e.substring(t+1);return!n||iv.test(n)?e:Ov(e)%2==1?`${e}*`:e},Bv=e=>{let t=!1;for(let n=0;n<e.length;n+=1){if(e[n]==="`"&&n+2<e.length&&e[n+1]==="`"&&e[n+2]==="`"){t=!t,n+=2;continue}if(!t&&e[n]===`_`&&e[n-1]!==`_`&&e[n+1]!==`_`&&e[n-1]!==`\\`&&!vv(e,n)&&!bv(e,n)){let t=n>0?e[n-1]:``,r=n<e.length-1?e[n+1]:``;if(t&&r&&fv(t)&&fv(r))continue;return n}}return-1},Vv=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
31
|
+
`;)--t;return t<e.length?`${e.slice(0,t)}_${e.slice(t)}`:`${e}_`},Hv=e=>{if(!e.endsWith(`**`))return null;let t=e.slice(0,-2);if(Mv(t)%2!=1)return null;let n=t.indexOf(`**`),r=Bv(t);return n!==-1&&r!==-1&&n<r?`${t}_**`:null},Uv=e=>{if(!e.match(tv))return e;let t=Bv(e);if(t===-1)return e;let n=e.substring(t+1);if(!n||iv.test(n)||G_(e,t)||J_(e,t))return e;if(Av(e)%2==1){let t=Hv(e);return t===null?Vv(e):t}return e},Wv=e=>{let t=Mv(e),n=Ov(e);return t%2==0&&n%2==0},Gv=(e,t,n)=>!t||iv.test(t)||G_(e,n)||J_(e,n)?!0:Sv(e,n,`*`),Kv=e=>{if(cv.test(e))return e;let t=e.match($_);if(!t)return e;let n=t[2];return Gv(e,n,e.lastIndexOf(t[1]))?e:jv(e)%2==1?Wv(e)?e:`${e}***`:e},qv=/<[a-zA-Z/][^>]*$/,Jv=e=>{let t=e.match(qv);return!t||t.index===void 0||G_(e,t.index)?e:e.substring(0,t.index).trimEnd()},Yv=e=>!e.match(sv)||e.includes(`
|
|
32
|
+
`)?null:e.endsWith("``")&&!e.endsWith("```")?`${e}\``:e,Xv=e=>(e.match(/```/g)||[]).length%2==1,Zv=e=>{let t=Yv(e);if(t!==null)return t;let n=e.match(nv);if(n&&!Xv(e)){let t=n[2];if(!t||iv.test(t))return e;if(q_(e)%2==1)return`${e}\``}return e},Qv=(e,t)=>t>=2&&e.substring(t-2,t+1)==="```"||t>=1&&e.substring(t-1,t+2)==="```"||t<=e.length-3&&e.substring(t,t+3)==="```",$v=e=>{let t=0,n=!1;for(let r=0;r<e.length-1;r+=1)e[r]==="`"&&!Qv(e,r)&&(n=!n),!n&&e[r]===`$`&&e[r+1]===`$`&&(t+=1,r+=1);return t},ey=e=>{let t=0,n=!1;for(let r=0;r<e.length;r+=1){if(e[r]===`\\`){r+=1;continue}if(e[r]==="`"&&!Qv(e,r)){n=!n;continue}!n&&e[r]===`$`&&(r+1<e.length&&e[r+1]===`$`?r+=1:t+=1)}return t},ty=e=>{if(e.endsWith(`$`)&&!e.endsWith(`$$`))return`${e}$`;let t=e.indexOf(`$$`);return t!==-1&&e.indexOf(`
|
|
33
|
+
`,t)!==-1&&!e.endsWith(`
|
|
34
|
+
`)?`${e}
|
|
35
|
+
$$`:`${e}$$`},ny=e=>$v(e)%2==0?e:ty(e),ry=e=>ey(e)%2==1?`${e}$`:e,iy=(e,t,n)=>{if(e.substring(t+2).includes(`)`))return null;let r=pv(e,t);if(r===-1||G_(e,r))return null;let i=r>0&&e[r-1]===`!`,a=i?r-1:r,o=e.substring(0,a);if(i)return o;let s=e.substring(r+1,t);return n===`text-only`?`${o}${s}`:`${o}[${s}](streamdown:incomplete-link)`},ay=(e,t)=>{for(let n=0;n<t;n++)if(e[n]===`[`&&!G_(e,n)){if(n>0&&e[n-1]===`!`)continue;let t=mv(e,n);if(t===-1)return n;if(t+1<e.length&&e[t+1]===`(`){let r=e.indexOf(`)`,t+2);r!==-1&&(n=r)}}return t},oy=(e,t,n)=>{let r=t>0&&e[t-1]===`!`,i=r?t-1:t;if(!e.substring(t+1).includes(`]`)){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=ay(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}if(mv(e,t)===-1){let a=e.substring(0,i);if(r)return a;if(n===`text-only`){let n=ay(e,t);return e.substring(0,n)+e.substring(n+1)}return`${e}](streamdown:incomplete-link)`}return null},sy=(e,t=`protocol`)=>{let n=e.lastIndexOf(`](`);if(n!==-1&&!G_(e,n)){let r=iy(e,n,t);if(r!==null)return r}for(let n=e.length-1;n>=0;--n)if(e[n]===`[`&&!G_(e,n)){let r=oy(e,n,t);if(r!==null)return r}return e},cy=/^-{1,2}$/,ly=/^[\s]*-{1,2}[\s]+$/,uy=/^={1,2}$/,dy=/^[\s]*={1,2}[\s]+$/,fy=e=>{if(!e||typeof e!=`string`)return e;let t=e.lastIndexOf(`
|
|
36
|
+
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(cy.test(i)&&!n.match(ly)){let t=r.split(`
|
|
37
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}if(uy.test(i)&&!n.match(dy)){let t=r.split(`
|
|
38
|
+
`).at(-1);if(t&&t.trim().length>0)return`${e}\u200B`}return e},py=/([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu,my=e=>!e||typeof e!=`string`||!e.includes(`~`)?e:e.replace(py,(t,n,r)=>G_(e,r+n.length)?t:`${n}\\~`),hy=e=>{let t=e.match(rv);if(t){let n=t[2];if(!n||iv.test(n))return e;let r=e.lastIndexOf(t[1]);if(G_(e,r)||J_(e,r))return e;if(e.match(dv)?.length%2==1)return`${e}~~`}else{let t=e.match(uv);if(t){let n=e.lastIndexOf(t[0].slice(0,2));if(G_(e,n)||J_(e,n))return e;if(e.match(dv)?.length%2==1)return`${e}~`}}return e},gy=e=>e!==!1,_y=e=>e===!0,vy={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},yy=[{handler:{name:`singleTilde`,handle:my,priority:vy.SINGLE_TILDE},optionKey:`singleTilde`},{handler:{name:`comparisonOperators`,handle:X_,priority:vy.COMPARISON_OPERATORS},optionKey:`comparisonOperators`},{handler:{name:`htmlTags`,handle:Jv,priority:vy.HTML_TAGS},optionKey:`htmlTags`},{handler:{name:`setextHeadings`,handle:fy,priority:vy.SETEXT_HEADINGS},optionKey:`setextHeadings`},{handler:{name:`links`,handle:sy,priority:vy.LINKS},optionKey:`links`,earlyReturn:e=>e.endsWith(`](streamdown:incomplete-link)`)},{handler:{name:`boldItalic`,handle:Kv,priority:vy.BOLD_ITALIC},optionKey:`boldItalic`},{handler:{name:`bold`,handle:Fv,priority:vy.BOLD},optionKey:`bold`},{handler:{name:`italicDoubleUnderscore`,handle:Lv,priority:vy.ITALIC_DOUBLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`italicSingleAsterisk`,handle:zv,priority:vy.ITALIC_SINGLE_ASTERISK},optionKey:`italic`},{handler:{name:`italicSingleUnderscore`,handle:Uv,priority:vy.ITALIC_SINGLE_UNDERSCORE},optionKey:`italic`},{handler:{name:`inlineCode`,handle:Zv,priority:vy.INLINE_CODE},optionKey:`inlineCode`},{handler:{name:`strikethrough`,handle:hy,priority:vy.STRIKETHROUGH},optionKey:`strikethrough`},{handler:{name:`katex`,handle:ny,priority:vy.KATEX},optionKey:`katex`},{handler:{name:`inlineKatex`,handle:ry,priority:vy.INLINE_KATEX},optionKey:`inlineKatex`}],by=e=>{let t=e?.linkMode??`protocol`;return yy.filter(({handler:t,optionKey:n})=>t.name===`links`?gy(e?.links)||gy(e?.images):t.name===`inlineKatex`?_y(e?.inlineKatex):gy(e?.[n])).map(({handler:e,earlyReturn:n})=>e.name===`links`?{handler:H_(V_({},e),{handle:e=>sy(e,t)}),earlyReturn:t===`protocol`?n:void 0}:{handler:e,earlyReturn:n})},xy=(e,t)=>{if(!e||typeof e!=`string`)return e;let n=e.endsWith(` `)&&!e.endsWith(` `)?e.slice(0,-1):e,r=by(t),i=(t?.handlers??[]).map(e=>({handler:H_(V_({},e),{priority:e.priority??vy.DEFAULT}),earlyReturn:void 0})),a=[...r,...i].sort((e,t)=>(e.handler.priority??0)-(t.handler.priority??0));for(let{handler:e,earlyReturn:t}of a)if(n=e.handle(n),t!=null&&t(n))return n;return n},Sy=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Cy=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wy={};function Ty(e,t){return((t||wy).jsx?Cy:Sy).test(e)}var Ey=/[ \t\n\f\r]/g;function Dy(e){return typeof e==`object`?e.type===`text`&&Oy(e.value):Oy(e)}function Oy(e){return e.replace(Ey,``)===``}var ky=i(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
39
|
+
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Ay=i((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(ky());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),jy=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),My=i(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ay()),r=jy();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i}));function Ny(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Fy(e.position):`start`in e||`end`in e?Fy(e):`line`in e||`column`in e?Py(e):``}function Py(e){return Iy(e&&e.line)+`:`+Iy(e&&e.column)}function Fy(e){return Py(e&&e.start)+`-`+Py(e&&e.end)}function Iy(e){return e&&typeof e==`number`?e:1}var Ly=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ny(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ly.prototype.file=``,Ly.prototype.name=``,Ly.prototype.reason=``,Ly.prototype.message=``,Ly.prototype.stack=``,Ly.prototype.column=void 0,Ly.prototype.line=void 0,Ly.prototype.ancestors=void 0,Ly.prototype.cause=void 0,Ly.prototype.fatal=void 0,Ly.prototype.place=void 0,Ly.prototype.ruleId=void 0,Ly.prototype.source=void 0;var Ry=e(My(),1),zy={}.hasOwnProperty,By=new Map,Vy=/[A-Z]/g,Hy=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Uy=new Set([`td`,`th`]),Wy=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Gy(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=nb(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=tb(n,t.jsx,t.jsxs)}let 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`?qo:Ko,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ky(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ky(e,t,n){if(t.type===`element`)return qy(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Jy(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Xy(e,t,n);if(t.type===`mdxjsEsm`)return Yy(e,t);if(t.type===`root`)return Zy(e,t,n);if(t.type===`text`)return Qy(e,t)}function qy(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=qo,e.schema=i),e.ancestors.push(t);let a=cb(e,t.tagName,!1),o=rb(e,t),s=ab(e,t);return Hy.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Dy(e)})),$y(e,o,a,t),eb(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Jy(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}lb(e,t.position)}function Yy(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lb(e,t.position)}function Xy(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=qo,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:cb(e,t.name,!0),o=ib(e,t),s=ab(e,t);return $y(e,o,a,t),eb(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zy(e,t,n){let r={};return eb(r,ab(e,t)),e.create(t,e.Fragment,r,n)}function Qy(e,t){return t.value}function $y(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function eb(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function tb(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function nb(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Wd(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function rb(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&zy.call(t.properties,i)){let a=ob(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Uy.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ib(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else lb(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else lb(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ab(e,t){let n=[],r=-1,i=e.passKeys?new Map:By;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ky(e,a,o);s!==void 0&&n.push(s)}return n}function ob(e,t,n){let r=Uo(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Yo(n):$o(n)),r.property===`style`){let t=typeof n==`object`?n:sb(e,String(n));return e.stylePropertyNameCase===`css`&&(t=ub(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?zo[r.property]||r.property:r.attribute,n]}}function sb(e,t){try{return(0,Ry.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Ly("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Wy+`#cannot-parse-style-attribute`,r}}function cb(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Ty(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Ty(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return zy.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);lb(e)}function lb(e,t){let n=new Ly("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=Wy+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function ub(e){let t={},n;for(n in e)zy.call(e,n)&&(t[db(n)]=e[n]);return t}function db(e){let t=e.replace(Vy,fb);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function fb(e){return`-`+e.toLowerCase()}var pb={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`]},mb={tokenize:hb};function hb(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),J(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return F(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var gb={tokenize:vb},_b={tokenize:yb};function vb(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Yr(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_b,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(_b,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return F(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Yr(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yb(e,t,n){return J(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var bb={tokenize:xb};function xb(e){let t=this,n=e.attempt(Mh,r,e.attempt(this.parser.constructs.flowInitial,i,J(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ig,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Sb={resolveAll:Eb()},Cb=Tb(`string`),wb=Tb(`text`);function Tb(e){return{resolveAll:Eb(e===`text`?Db:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Eb(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Db(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Ob=r({attentionMarkers:()=>Ib,contentInitial:()=>Ab,disable:()=>Lb,document:()=>kb,flow:()=>Mb,flowInitial:()=>jb,insideSpan:()=>Fb,string:()=>Nb,text:()=>Pb}),kb={42:Zg,43:Zg,45:Zg,48:Zg,49:Zg,50:Zg,51:Zg,52:Zg,53:Zg,54:Zg,55:Zg,56:Zg,57:Zg,62:Ph},Ab={91:pg},jb={[-2]:Kh,[-1]:Kh,32:Kh},Mb={35:yg,42:Yg,45:[a_,Yg],60:wg,61:a_,95:Yg,96:Uh,126:Uh},Nb={38:Bh,92:Rh},Pb={[-5]:qg,[-4]:qg,[-3]:qg,33:Ug,38:Bh,42:Eh,60:[Ah,jg],91:Gg,92:[_g,Rh],93:Ng,95:Eh,96:Xh},Fb={null:[Eh,Sb]},Ib={null:[42,95]},Lb={null:[]};function Rb(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Xr(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Zr(a,l.events,l),l.events):[]}function f(e,t){return Bb(p(e),t)}function p(e){return zb(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){F(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Yr(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zb(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Bb(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
40
|
+
`;break;case-3:o=`\r
|
|
41
|
+
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Vb(e){let t={constructs:Qm([Ob,...(e||{}).extensions||[]]),content:n(mb),defined:[],document:n(gb),flow:n(bb),lazy:{},string:n(Cb),text:n(wb)};return t;function n(e){return n;function n(n){return Rb(t,e,n)}}}function Hb(e){for(;!ng(e););return e}var Ub=/[\0\t\n\r]/g;function Wb(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Ub.lastIndex=u,c=Ub.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Gb={}.hasOwnProperty;function Kb(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),qb(n)(Hb(Vb(n).document().write(Wb()(e,t,!0))))}function qb(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:ce,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(O),htmlTextData:E,image:c(re),label:ae,labelText:ie,lineEnding:ee,link:c(k),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:j,resourceDestinationString:oe,resourceTitleString:se,resource:A,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Yb(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Gb.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Zb).call(a,void 0,e[0])}for(r.position={start:Jb(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Jb(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Jb(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Zb).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ny({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Jb(e.end)}function u(){return qp(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=np(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:Jb(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Jb(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Jb(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Nm(t),n.identifier=np(t).toLowerCase()}function ae(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function A(){this.data.inReference=void 0}function ce(){this.data.referenceType=`collapsed`}function j(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=np(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=jm(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Am(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=Jb(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function Jb(e){return{line:e.line,column:e.column,offset:e.offset}}function Yb(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Yb(e,r):Xb(e,r)}}function Xb(e,t){let n;for(n in t)if(Gb.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Zb(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ny({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ny({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ny({start:t.start,end:t.end})+`) is still open`)}function Qb(e){let t=this;t.parser=n;function n(n){return Kb(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function $b(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ex(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
42
|
+
`}]}function tx(e,t){let n=t.value?t.value+`
|
|
43
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function nx(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rx(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ix(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Th(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function ax(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ox(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function sx(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function cx(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sx(e,t);let i={src:Th(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function lx(e,t){let n={src:Th(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ux(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function dx(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return sx(e,t);let i={href:Th(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function fx(e,t){let n={href:Th(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function px(e,t,n){let r=e.all(t),i=n?mx(n):hx(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
44
|
+
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
45
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function mx(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=hx(n[r])}return t}function hx(e){return e.spread??e.children.length>1}function gx(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function _x(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vx(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function yx(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bx(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Wd(t.children[1]),o=Ud(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function xx(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Sx(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var Cx=9,wx=32;function Tx(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Ex(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Ex(t.slice(i),i>0,!1)),a.join(``)}function Ex(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===Cx||t===wx;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===Cx||t===wx;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Dx(e,t){let n={type:`text`,value:Tx(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ox(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var kx={blockquote:$b,break:ex,code:tx,delete:nx,emphasis:rx,footnoteReference:ix,heading:ax,html:ox,imageReference:cx,image:lx,inlineCode:ux,linkReference:dx,link:fx,listItem:px,list:gx,paragraph:_x,root:vx,strong:yx,table:bx,tableCell:Sx,tableRow:xx,text:Dx,thematicBreak:Ox,toml:Ax,yaml:Ax,definition:Ax,footnoteDefinition:Ax};function Ax(){}function jx(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Mx(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Nx(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||jx,r=e.options.footnoteBackLabel||Mx,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=Th(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...mo(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
46
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
47
|
+
`}]}}var Px={}.hasOwnProperty,Fx={};function Ix(e,t){let n=t||Fx,r=new Map,i=new Map,a={all:s,applyData:Rx,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...kx,...n.handlers},one:o,options:n,patch:Lx,wrap:Bx};return Pa(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Px.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=mo(n);return r.children=a.all(e),r}return mo(e)}return(a.options.unknownHandler||zx)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Vx(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Vx(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Lx(e,t){e.position&&(t.position=Kd(e))}function Rx(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,mo(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function zx(e,t){let n=t.data||{},r=`value`in t&&!(Px.call(n,`hProperties`)||Px.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 Bx(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
48
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
49
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
50
|
+
`}),n}function Vx(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Hx(e,t){let n=Ix(e,t),r=n.one(e,void 0),i=Nx(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
51
|
+
`},i)),a}function Ux(e,t){return e&&`run`in e?async function(n,r){let i=Hx(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Hx(n,{file:r,...e||t})}}function Wx(e){if(e)throw e}var Gx=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Kx(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qx(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Jx(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Jx(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Yx={basename:Xx,dirname:Zx,extname:Qx,join:$x,sep:`/`};function Xx(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);nS(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Zx(e){if(nS(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Qx(e){nS(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function $x(...e){let t=-1,n;for(;++t<e.length;)nS(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:eS(n)}function eS(e){nS(e);let t=e.codePointAt(0)===47,n=tS(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function tS(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function nS(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var rS={cwd:iS};function iS(){return`/`}function aS(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function oS(e){if(typeof e==`string`)e=new URL(e);else if(!aS(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return sS(e)}function sS(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var cS=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],lS=class{constructor(e){let t;t=e?aS(e)?{path:e}:typeof e==`string`||pS(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:rS.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<cS.length;){let e=cS[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)cS.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Yx.basename(this.path):void 0}set basename(e){dS(e,`basename`),uS(e,`basename`),this.path=Yx.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Yx.dirname(this.path):void 0}set dirname(e){fS(this.basename,`dirname`),this.path=Yx.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Yx.extname(this.path):void 0}set extname(e){if(uS(e,`extname`),fS(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Yx.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){aS(e)&&(e=oS(e)),dS(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Yx.basename(this.path,this.extname):void 0}set stem(e){dS(e,`stem`),uS(e,`stem`),this.path=Yx.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Ly(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function uS(e,t){if(e&&e.includes(Yx.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Yx.sep+"`")}function dS(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function fS(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function pS(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var mS=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),hS=e(Gx(),1),gS={}.hasOwnProperty,_S=new class e extends mS{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=qx()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,hS.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(bS(`data`,this.frozen),this.namespace[e]=t,this):gS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(bS(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=CS(e),n=this.parser||this.Parser;return vS(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),vS(`process`,this.parser||this.Parser),yS(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=CS(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);TS(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),vS(`processSync`,this.parser||this.Parser),yS(`processSync`,this.compiler||this.Compiler),this.process(e,r),SS(`processSync`,`process`,t),n;function r(e,r){t=!0,Wx(e),n=r}}run(e,t,n){xS(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=CS(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),SS(`runSync`,`run`,n),r;function i(e,t){Wx(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=CS(t),r=this.compiler||this.Compiler;return yS(`stringify`,r),xS(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(bS(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,hS.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Kx(o)&&Kx(r)&&(r=(0,hS.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function vS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function yS(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function bS(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function xS(e){if(!Kx(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function SS(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function CS(e){return wS(e)?e:new lS(e)}function wS(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function TS(e){return typeof e==`string`||ES(e)}function ES(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function DS(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var OS=DS();function kS(e){OS=e}var AS={exec:()=>null};function Y(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(MS.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var jS=(()=>{try{return!0}catch{return!1}})(),MS={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},NS=/^(?:[ \t]*(?:\n|$))+/,PS=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,FS=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,IS=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,LS=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,RS=/(?:[*+-]|\d{1,9}[.)])/,zS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,BS=Y(zS).replace(/bull/g,RS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),VS=Y(zS).replace(/bull/g,RS).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),HS=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,US=/^[^\n]+/,WS=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,GS=Y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,WS).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),KS=Y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,RS).getRegex(),qS=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,JS=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,YS=Y(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,JS).replace(`tag`,qS).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),XS=Y(HS).replace(`hr`,IS).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,qS).getRegex(),ZS={blockquote:Y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,XS).getRegex(),code:PS,def:GS,fences:FS,heading:LS,hr:IS,html:YS,lheading:BS,list:KS,newline:NS,paragraph:XS,table:AS,text:US},QS=Y(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,IS).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,qS).getRegex(),$S={...ZS,lheading:VS,table:QS,paragraph:Y(HS).replace(`hr`,IS).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,QS).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,qS).getRegex()},eC={...ZS,html:Y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,JS).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:AS,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Y(HS).replace(`hr`,IS).replace(`heading`,` *#{1,6} *[^
|
|
52
|
+
]`).replace(`lheading`,BS).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},tC=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,nC=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,rC=/^( {2,}|\\)\n(?!\s*$)/,iC=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,aC=/[\p{P}\p{S}]/u,oC=/[\s\p{P}\p{S}]/u,sC=/[^\s\p{P}\p{S}]/u,cC=Y(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,oC).getRegex(),lC=/(?!~)[\p{P}\p{S}]/u,uC=/(?!~)[\s\p{P}\p{S}]/u,dC=/(?:[^\s\p{P}\p{S}]|~)/u,fC=Y(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,jS?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),pC=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mC=Y(pC,`u`).replace(/punct/g,aC).getRegex(),hC=Y(pC,`u`).replace(/punct/g,lC).getRegex(),gC=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,_C=Y(gC,`gu`).replace(/notPunctSpace/g,sC).replace(/punctSpace/g,oC).replace(/punct/g,aC).getRegex(),vC=Y(gC,`gu`).replace(/notPunctSpace/g,dC).replace(/punctSpace/g,uC).replace(/punct/g,lC).getRegex(),yC=Y(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,sC).replace(/punctSpace/g,oC).replace(/punct/g,aC).getRegex(),bC=Y(/\\(punct)/,`gu`).replace(/punct/g,aC).getRegex(),xC=Y(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),SC=Y(JS).replace(`(?:-->|$)`,`-->`).getRegex(),CC=Y(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,SC).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wC=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,TC=Y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,wC).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),EC=Y(/^!?\[(label)\]\[(ref)\]/).replace(`label`,wC).replace(`ref`,WS).getRegex(),DC=Y(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,WS).getRegex(),OC=Y(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,EC).replace(`nolink`,DC).getRegex(),kC=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,AC={_backpedal:AS,anyPunctuation:bC,autolink:xC,blockSkip:fC,br:rC,code:nC,del:AS,emStrongLDelim:mC,emStrongRDelimAst:_C,emStrongRDelimUnd:yC,escape:tC,link:TC,nolink:DC,punctuation:cC,reflink:EC,reflinkSearch:OC,tag:CC,text:iC,url:AS},jC={...AC,link:Y(/^!?\[(label)\]\((.*?)\)/).replace(`label`,wC).getRegex(),reflink:Y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,wC).getRegex()},MC={...AC,emStrongRDelimAst:vC,emStrongLDelim:hC,url:Y(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,kC).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Y(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,kC).getRegex()},NC={...MC,br:Y(rC).replace(`{2,}`,`*`).getRegex(),text:Y(MC.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},PC={normal:ZS,gfm:$S,pedantic:eC},FC={normal:AC,gfm:MC,breaks:NC,pedantic:jC},IC={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},LC=e=>IC[e];function RC(e,t){if(t){if(MS.escapeTest.test(e))return e.replace(MS.escapeReplace,LC)}else if(MS.escapeTestNoEncode.test(e))return e.replace(MS.escapeReplaceNoEncode,LC);return e}function zC(e){try{e=encodeURI(e).replace(MS.percentDecode,`%`)}catch{return null}return e}function BC(e,t){let n=e.replace(MS.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(MS.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(MS.slashPipe,`|`);return n}function VC(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function HC(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function UC(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function WC(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
53
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
54
|
+
`)}var GC=class{options;rules;lexer;constructor(e){this.options=e||OS}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:VC(e,`
|
|
55
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=WC(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=VC(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:VC(t[0],`
|
|
56
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=VC(t[0],`
|
|
57
|
+
`).split(`
|
|
58
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
59
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
60
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
61
|
+
${s}`:s,r=r?`${r}
|
|
62
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
63
|
+
`+e.join(`
|
|
64
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
65
|
+
`+e.join(`
|
|
66
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
67
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
68
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
69
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
70
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
71
|
+
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
72
|
+
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
73
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
74
|
+
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=BC(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
75
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(BC(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
76
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=VC(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=HC(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),UC(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return UC(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},KC=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||OS,this.options.tokenizer=this.options.tokenizer||new GC,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:MS,block:PC.normal,inline:FC.normal};this.options.pedantic?(t.block=PC.pedantic,t.inline=FC.pedantic):this.options.gfm&&(t.block=PC.gfm,t.inline=this.options.breaks?FC.breaks:FC.gfm),this.tokenizer.rules=t}static get rules(){return{block:PC,inline:FC}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(MS.carriageReturn,`
|
|
77
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(MS.tabCharGlobal,` `).replace(MS.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
78
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
79
|
+
`)?``:`
|
|
80
|
+
`)+r.raw,n.text+=`
|
|
81
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
82
|
+
`)?``:`
|
|
83
|
+
`)+r.raw,n.text+=`
|
|
84
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
85
|
+
`)?``:`
|
|
86
|
+
`)+r.raw,a.text+=`
|
|
87
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
88
|
+
`)?``:`
|
|
89
|
+
`)+r.raw,n.text+=`
|
|
90
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},qC=class{options;parser;constructor(e){this.options=e||OS}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(MS.notSpaceStart)?.[0],i=e.replace(MS.endingNewline,``)+`
|
|
91
|
+
`;return r?`<pre><code class="language-`+RC(r)+`">`+(n?i:RC(i,!0))+`</code></pre>
|
|
92
|
+
`:`<pre><code>`+(n?i:RC(i,!0))+`</code></pre>
|
|
93
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
94
|
+
${this.parser.parse(e)}</blockquote>
|
|
95
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
96
|
+
`}hr(e){return`<hr>
|
|
97
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
98
|
+
`+r+`</`+i+`>
|
|
99
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
100
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
101
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
102
|
+
<thead>
|
|
103
|
+
`+t+`</thead>
|
|
104
|
+
`+r+`</table>
|
|
105
|
+
`}tablerow({text:e}){return`<tr>
|
|
106
|
+
${e}</tr>
|
|
107
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
108
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${RC(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=zC(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+RC(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=zC(e);if(i===null)return RC(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${RC(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:RC(e.text)}},JC=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},YC=class e{options;renderer;textRenderer;constructor(e){this.options=e||OS,this.options.renderer=this.options.renderer||new qC,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new JC}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},XC=class{options;block;constructor(e){this.options=e||OS}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?KC.lex:KC.lexInline}provideParser(){return this.block?YC.parse:YC.parseInline}},ZC=new class{defaults=DS();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=YC;Renderer=qC;TextRenderer=JC;Lexer=KC;Tokenizer=GC;Hooks=XC;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new qC(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new GC(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new XC;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=XC.passThroughHooks.has(n)?e=>{if(this.defaults.async&&XC.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return KC.lex(e,t??this.defaults)}parser(e,t){return YC.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?KC.lex:KC.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?YC.parse:YC.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?KC.lex:KC.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?YC.parse:YC.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
109
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+RC(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function QC(e,t){return ZC.parse(e,t)}QC.options=QC.setOptions=function(e){return ZC.setOptions(e),QC.defaults=ZC.defaults,kS(QC.defaults),QC},QC.getDefaults=DS,QC.defaults=OS,QC.use=function(...e){return ZC.use(...e),QC.defaults=ZC.defaults,kS(QC.defaults),QC},QC.walkTokens=function(e,t){return ZC.walkTokens(e,t)},QC.parseInline=ZC.parseInline,QC.Parser=YC,QC.parser=YC.parse,QC.Renderer=qC,QC.TextRenderer=JC,QC.Lexer=KC,QC.lexer=KC.lex,QC.Tokenizer=GC,QC.Hooks=XC,QC.parse=QC,QC.options,QC.setOptions,QC.use,QC.walkTokens,QC.parseInline,YC.parse,KC.lex;var $C=300,ew=`300px`,tw=500;function nw(e={}){let{immediate:t=!1,debounceDelay:n=$C,rootMargin:r=ew,idleTimeout:i=tw}=e,[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),c=(0,N.useRef)(null),l=(0,N.useRef)(null),u=(0,N.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,N.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,N.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,N.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var rw=320,iw=4,aw=()=>typeof performance>`u`?Date.now():performance.now();function ow(e){let t=e?.now??aw,n=e?.maxBacklogMs??rw,r=0,i=0;return{now:t,beginPass(e){i=Math.min(Math.max(r,e),e+n)},mark(){return i},rewind(e){i=e},take(e,t,r){if(e<=0)return{baseDelay:0,step:Math.max(0,t)};let a=Math.max(0,t),o=a===0?0:Math.min(a,iw),s=Math.max(i,r),c=r+n,l=s+Math.max(0,e-1)*a,u=a;if(l>c&&e>1){if(s<c){let t=c-s;u=Math.max(o,t/(e-1))}else u=o}let d=Math.max(0,Math.round(s-r));return i=s+e*u,{baseDelay:d,step:u}},commitPass(){r=i}}}var sw=/\s/,cw=/^\s+$/,lw=new Set([`pre`,`svg`,`math`,`annotation`]),uw=new Set([`img`,`hr`]),dw=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,fw=e=>e.some(e=>dw(e)&&lw.has(e.tagName)),pw=e=>{for(let t=e.length-1;t>=0;t--){let n=e[t];if(dw(n)&&n.tagName===`li`)return n}},mw=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate-marker`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-marker-duration:${t}ms;--sd-marker-delay:${Math.round(n)}ms;--sd-marker-easing:${r}`},hw=new Set([`ul`,`ol`,`li`]),gw=e=>{for(let t of e.children)if(dw(t)){if(t.tagName===`input`)return t;if(hw.has(t.tagName))continue;let e=gw(t);if(e)return e}},_w=(e,t,n,r)=>{e.properties??={},e.properties[`data-sd-animate`]=!0;let i=typeof e.properties.style==`string`?`${e.properties.style};`:``;e.properties.style=`${i}--sd-animation:sd-${t.animation};--sd-duration:${n}ms;--sd-easing:${t.easing};--sd-delay:${Math.round(r)}ms`},vw=(e,t,n,r)=>{let i=gw(e);i&&_w(i,t,n,r)},yw=(e,t,n,r,i,a)=>{if(fw(t))return;let o=r.prevContentLength,s=i.count;i.count+=1;let c=o>0&&s<o,l=c?0:a.baseDelay+i.newIndex++*a.step;_w(e,n,c?0:n.duration,l)},bw=e=>{var t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(dw(r)){if((t=r.properties)!=null&&t[`data-sd-animated`])break;r.properties={...r.properties,"data-sd-animated":!0}}}},xw=e=>{let t=[],n=``,r=!1;for(let i of e){let e=sw.test(i);if(e!==r&&n){if(e){n+=i,r=!0;continue}t.push(n),n=``}n+=i,r=e}return n&&t.push(n),t},Sw=e=>{let t=[],n=``;for(let r of e)sw.test(r)?t.length>0&&!cw.test(t.at(-1))?t[t.length-1]+=r:n+=r:(n&&=(t.push(n),``),t.push(r));return n&&(t.length>0?t[t.length-1]+=n:t.push(n)),t},Cw=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${Math.round(a)}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},ww=(e,t)=>!(e>0&&t<e),Tw=e=>dw(e)&&uw.has(e.tagName),Ew=(e,t,n)=>{let r=0,i=0;return Ma(e,e=>e.type===`text`||Tw(e),(e,a)=>{if(fw(a))return ja;if(Tw(e)){ww(n,i)&&(r+=1),i+=1;return}let o=e.value;if(!o.trim()){i+=o.length;return}let s=t.sep===`char`?Sw(o):xw(o);for(let e of s){let t=i;i+=e.length,!cw.test(e)&&ww(n,t)&&(r+=1)}}),r},Dw=(e,t,n,r,i,a)=>{var o;let s=t.at(-1);if(!(s&&`children`in s))return;if(fw(t))return ja;let c=s,l=c.children.indexOf(e);if(l===-1)return;let u=e.value;if(!u.trim()){i.count+=u.length;return}let d=n.sep===`char`?Sw(u):xw(u),f=r.prevContentLength,p=!1,m=pw(t),h=!!(m&&!((o=m.properties)!=null&&o[`data-sd-animate-marker`])),g=!1,_=d.map(e=>{let t=i.count;if(i.count+=e.length,cw.test(e))return{type:`text`,value:e};let r=f>0&&t<f,o=r?0:a.baseDelay+i.newIndex++*a.step;if(p=!0,m&&h&&!g){let e=r?0:n.duration;mw(m,e,o,n.easing),vw(m,n,e,o),g=!0}return Cw(e,n.animation,n.duration,n.easing,r,o)});return p&&bw(t),c.children.splice(l,1,..._),l+_.length},Ow=0;function kw(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40,timeline:e?.timeline},n={committedCharCount:0,prevContentLength:0,lastRenderCharCount:0,pendingMark:null},r=Ow++,i=()=>e=>{let r={count:0,newIndex:0};n.prevContentLength=n.committedCharCount;let i=t.timeline,a=i?.now()??aw();i&&(n.pendingMark===null?n.pendingMark=i.mark():i.rewind(n.pendingMark));let o=i?i.take(Ew(e,t,n.prevContentLength),t.stagger,a):{baseDelay:0,step:t.stagger};Ma(e,e=>e.type===`text`||Tw(e),(e,i)=>{if(e.type===`text`)return Dw(e,i,t,n,r,o);yw(e,i,t,n,r,o)}),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,"name",{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.committedCharCount=e,n.prevContentLength=e},getLastRenderCharCount(){return n.lastRenderCharCount},commit(){n.committedCharCount=n.lastRenderCharCount,n.pendingMark=null}}}kw();var Aw=(0,N.createContext)(!1),jw=()=>(0,N.useContext)(Aw),Mw=(...e)=>l(s(e)),Nw=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Pw=e=>e?(...t)=>Nw(e,l(s(t))):Mw,Fw=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Iw=(0,N.createContext)(Mw),X=()=>(0,N.useContext)(Iw),Lw=8,Rw=e=>{if(e!==void 0&&e!==0&&e!==1/0){if(typeof e==`number`)return Number.isFinite(e)&&e>0?`${e}px`:void 0;if(e!==`0`&&e!==`none`&&e!==`Infinity`)return e}},zw=(e,t,n)=>{let r=(0,N.useRef)(null),i=(0,N.useRef)(!0),a=(0,N.useRef)(!1);return(0,N.useEffect)(()=>{let e=r.current;if(!(e&&t))return;let n=()=>{let t=e.scrollHeight-e.scrollTop-e.clientHeight<Lw;i.current=t};return e.addEventListener(`scroll`,n,{passive:!0}),()=>e.removeEventListener(`scroll`,n)},[t]),(0,N.useEffect)(()=>{e&&!a.current&&(i.current=!0),e||(i.current=!0),a.current=e},[e]),(0,N.useEffect)(()=>{let n=r.current;n&&t&&e&&i.current&&n.scrollTo({top:n.scrollHeight,behavior:`instant`})},[e,t,n]),r},Bw=Mw(`block`),Vw=Mw(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),Hw=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},Uw=(0,N.memo)(({children:e,result:t,language:n,className:r,maxHeight:i,startLine:a,lineNumbers:o=!0,...s})=>{let c=X(),{isAnimating:l}=(0,N.useContext)(ED),u=Rw(i),d=zw(l,!!u,t),f=(0,N.useMemo)(()=>c(Vw),[c]),p=(0,N.useMemo)(()=>c(Bw),[c]),m=(0,N.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,Hw(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,M.jsx)(`div`,{className:c(r,u?`overflow-y-auto`:null,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,ref:d,style:u?{maxHeight:u}:void 0,...s,children:(0,M.jsx)(`pre`,{className:c(r,`bg-[var(--sdm-bg,inherit)]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit))]`),style:m,children:(0,M.jsx)(`code`,{className:o?c(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:o&&a&&a>1?{counterReset:`line ${a-1}`}:void 0,children:t.tokens.map((e,t)=>(0,M.jsx)(`span`,{className:o?f:p,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
110
|
+
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,M.jsx)(`span`,{className:c(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})}),Ww=({className:e,language:t,style:n,isIncomplete:r,...i})=>{let a=X();return(0,M.jsx)(`div`,{className:a(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i})},Gw=(0,N.createContext)({code:``}),Kw=()=>(0,N.useContext)(Gw),qw=({language:e})=>{let t=X();return(0,M.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,M.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},Jw=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
111
|
+
`;)t--;return e.slice(0,t)},Yw=(0,N.lazy)(()=>Fe(()=>import(`./highlighted-body-KPVGNVTW-D_zYfwaW.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([20,1,21]),import.meta.url)),Xw=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=X(),{codeBlockMaxHeight:l}=(0,N.useContext)(ED),u=(0,N.useMemo)(()=>Jw(e),[e]),d=(0,N.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:u.split(`
|
|
112
|
+
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[u]);return(0,M.jsx)(Gw.Provider,{value:{code:e},children:(0,M.jsxs)(Ww,{dir:`ltr`,isIncomplete:i,language:t,children:[(0,M.jsx)(qw,{language:t}),r?(0,M.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(Uw,{className:n,language:t,lineNumbers:o,maxHeight:l,result:d,startLine:a,...s}),children:(0,M.jsx)(Yw,{className:n,code:u,language:t,lineNumbers:o,maxHeight:l,raw:d,startLine:a,...s})})]})})},Zw={CheckIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,M.jsxs)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,M.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,M.jsx)(`svg`,{"aria-hidden":`true`,color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},Qw=(0,N.createContext)(Zw),$w=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>e[n]===t[n])},eT=({icons:e,children:t})=>{let n=(0,N.useRef)(e),r=(0,N.useRef)(e?{...Zw,...e}:Zw);$w(n.current,e)||(n.current=e,r.current=e?{...Zw,...e}:Zw);let i=r.current;return(0,M.jsx)(Qw.Provider,{value:i,children:t})},tT=()=>(0,N.useContext)(Qw),nT={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,zoomIn:`Zoom in`,zoomOut:`Zoom out`,resetView:`Reset zoom and pan`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},rT=(0,N.createContext)(nT),iT=()=>(0,N.useContext)(rT),aT=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=X(),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(0),{code:d}=Kw(),{isAnimating:f}=(0,N.useContext)(ED),p=iT(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,N.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=tT(),_=c?g.CheckIcon:g.CopyIcon;return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{"aria-label":p.copyCode,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,M.jsx)(_,{"aria-hidden":`true`,size:14})}),c&&(0,M.jsx)(`output`,{"aria-live":`polite`,className:`sr-only`,children:p.copied})]})},oT=(e,t,n)=>{if(typeof e==`boolean`)return n;let r=e[t];if(typeof r!=`object`)return n;let i=r.download;return typeof i==`object`&&i.filename||n},sT={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},cT=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=X(),{code:c}=Kw(),{isAnimating:l,controls:u}=(0,N.useContext)(ED),d=iT(),f=tT(),p=a??c,m=n&&n in sT?sT[n]:`txt`,h=`${oT(u,`code`,`file`)}.${m}`;return(0,M.jsx)(`button`,{"aria-label":d.downloadFile,className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:()=>{try{Fw(h,p,`text/plain`),e?.()}catch(e){t?.(e)}},title:d.downloadFile,type:`button`,...o,children:r??(0,M.jsx)(f.DownloadIcon,{size:14})})},lT=()=>{let{Loader2Icon:e}=tT(),t=X();return(0,M.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,M.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,M.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,M.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},uT=/\.[^/.]+$/,dT=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,showControls:o=!0,showDownloadControl:s=!0,...c})=>{let{DownloadIcon:l}=tT(),u=X(),d=(0,N.useRef)(null),[f,p]=(0,N.useState)(!1),[m,h]=(0,N.useState)(!1),g=iT(),_=c.width!=null||c.height!=null,v=(f||_)&&!m&&o&&s,y=m&&!_;(0,N.useEffect)(()=>{let e=d.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;p(t),h(!t)}},[]);let b=(0,N.useCallback)(e=>{p(!0),h(!1),i?.(e)},[i]),x=(0,N.useCallback)(e=>{p(!1),h(!0),a?.(e)},[a]),S=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(uT,``)}.${i}`}Fw(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,M.jsxs)(`div`,{className:u(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,M.jsx)(`img`,{alt:r,className:u(`max-w-full rounded-lg`,y&&`hidden`,t),"data-streamdown":`image`,onError:x,onLoad:b,ref:d,src:n,...c}),y&&(0,M.jsx)(`span`,{className:u(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:g.imageNotAvailable}),o&&(0,M.jsx)(`div`,{className:u(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`),"data-streamdown":`image-overlay`}),v&&(0,M.jsx)(`button`,{className:u(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:S,title:g.downloadImage,type:`button`,children:(0,M.jsx)(l,{size:14})})]}):null},fT=0,pT=()=>{fT+=1,fT===1&&(document.body.style.overflow=`hidden`)},mT=()=>{fT=Math.max(0,fT-1),fT===0&&(document.body.style.overflow=``)},hT=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=tT(),c=X(),[l,u]=(0,N.useState)(!1),d=iT(),f=(0,N.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,N.useCallback)(()=>{r(),n()},[r,n]);if((0,N.useEffect)(()=>{if(t){pT();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),mT()}}},[t,n]),!t||typeof document>`u`)return null;let m=(0,M.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,M.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,M.jsx)(s,{size:16})}),(0,M.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,M.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,M.jsx)(o,{size:20}),(0,M.jsx)(`span`,{children:d.openExternalLink})]}),(0,M.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,M.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,M.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,M.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(i,{size:14}),(0,M.jsx)(`span`,{children:d.copied})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(a,{size:14}),(0,M.jsx)(`span`,{children:d.copyLink})]})}),(0,M.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,M.jsx)(o,{size:14}),(0,M.jsx)(`span`,{children:d.openLink})]})]})]})});return(0,pt.createPortal)(m,document.body)},gT=(0,N.createContext)(null),_T=()=>(0,N.useContext)(gT),vT=()=>_T()?.code??null,yT=()=>_T()?.mermaid??null,bT=e=>{var t;let n=_T();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},xT=e=>{if(typeof DOMParser>`u`||typeof XMLSerializer>`u`)return e;let t=new DOMParser().parseFromString(e,`text/html`).querySelector(`svg`);return t?new XMLSerializer().serializeToString(t):e},ST=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),CT=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=X(),[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),{isAnimating:u,controls:d}=(0,N.useContext)(ED),f=tT(),p=yT(),m=iT(),h=oT(d,`mermaid`,`diagram`),g=async t=>{try{if(t===`mmd`){Fw(`${h}.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!p){a?.(Error(`Mermaid plugin not available`));return}let n=p.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}let u=xT(l);if(t===`svg`){Fw(`${h}.svg`,u,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){let e=await ST(u);Fw(`${h}.png`,e,`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,M.jsx)(`button`,{"aria-label":m.downloadDiagram,className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:m.downloadDiagram,type:`button`,children:t??(0,M.jsx)(f.DownloadIcon,{"aria-hidden":`true`,size:14})}),s?(0,M.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsSvg,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`svg`),title:m.downloadDiagramAsSvg,type:`button`,children:m.mermaidFormatSvg}),(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsPng,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`png`),title:m.downloadDiagramAsPng,type:`button`,children:m.mermaidFormatPng}),(0,M.jsx)(`button`,{"aria-label":m.downloadDiagramAsMmd,className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`mmd`),title:m.downloadDiagramAsMmd,type:`button`,children:m.mermaidFormatMmd})]}):null]})},wT=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=tT(),c=X(),[l,u]=(0,N.useState)(!1),{isAnimating:d,controls:f}=(0,N.useContext)(ED),p=iT(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.panZoom!==!1})(),h=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.download!==!1})(),g=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0||e.copy!==!1})(),_=()=>{u(!l)};return(0,N.useEffect)(()=>{if(l){pT();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),mT()}}},[l]),(0,N.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:_,title:p.viewFullscreen,type:`button`,...a,"aria-label":p.viewFullscreen,children:(0,M.jsx)(o,{"aria-hidden":`true`,size:14})}),l?(0,pt.createPortal)((0,M.jsxs)(`div`,{"aria-label":p.viewFullscreen,"aria-modal":`true`,className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),"data-streamdown":`mermaid-fullscreen`,onClick:_,onKeyDown:e=>{e.key===`Escape`&&_()},role:`dialog`,children:[(0,M.jsxs)(`div`,{className:c(`absolute top-4 right-4 z-10 flex items-center gap-1`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[h?(0,M.jsx)(CT,{chart:e,config:t}):null,g?(0,M.jsx)(aT,{code:e}):null,(0,M.jsx)(`button`,{"aria-label":p.exitFullscreen,className:c(`rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:_,title:p.exitFullscreen,type:`button`,children:(0,M.jsx)(s,{"aria-hidden":`true`,size:20})})]}),(0,M.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,M.jsx)(AD,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})};function TT(e){if(e.nodeType===Node.TEXT_NODE)return e.textContent??``;if(e.nodeType!==Node.ELEMENT_NODE)return``;let t=e;return t.tagName===`BR`?`
|
|
113
|
+
`:Array.from(t.childNodes).map(TT).join(``)}var ET=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(TT(e).trim());let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(TT(e).trim());n.push(t)}return{headers:t,rows:n}},DT=e=>{if(typeof e!=`object`)return`,`;let t=e.table;return typeof t==`object`?t.csvSeparator??`,`:`,`},OT=(e,t=`,`)=>{let n;n=t===`auto`?Intl.NumberFormat().format(1.1).includes(`,`)?`;`:`,`:t;let{headers:r,rows:i}=e,a=e=>{let t=!1;for(let r of e)if(r===n||r===`"`||r===`
|
|
114
|
+
`||r===`\r`){t=!0;break}return t?`"${e.replace(/"/g,`""`)}"`:e},o=r.length>0?i.length+1:i.length,s=Array(o),c=0;r.length>0&&(s[c]=r.map(a).join(n),c+=1);for(let e of i)s[c]=e.map(a).join(n),c+=1;return s.join(`
|
|
115
|
+
`)},kT=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
116
|
+
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
117
|
+
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
118
|
+
`)},AT=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`||n===`
|
|
119
|
+
`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):t===`
|
|
120
|
+
`?n.push(`<br>`):n.push(t);return n.join(``)},jT=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0,a=t.map(e=>AT(e));r[i]=`| ${a.join(` | `)} |`,i+=1;let o=Array(t.length);for(let e=0;e<t.length;e+=1)o[e]=`---`;r[i]=`| ${o.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?AT(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else{let t=e.map(e=>AT(e));r[i]=`| ${t.join(` | `)} |`,i+=1}return r.join(`
|
|
121
|
+
`)},MT=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=X(),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(null),d=(0,N.useRef)(0),{isAnimating:f,controls:p}=(0,N.useContext)(ED),m=iT(),h=DT(p),g=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=ET(t),o=``;o=e===`csv`?OT(a,h):e===`tsv`?kT(a):jT(a);let c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let _=tT(),v=c?_.CheckIcon:_.CopyIcon;return(0,M.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,M.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:m.copyTable,type:`button`,children:e??(0,M.jsx)(v,{height:14,width:14})}),o?(0,M.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`md`),title:m.copyTableAsMarkdown,type:`button`,children:m.tableFormatMarkdown}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`csv`),title:m.copyTableAsCsv,type:`button`,children:m.tableFormatCsv}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>g(`tsv`),title:m.copyTableAsTsv,type:`button`,children:m.tableFormatTsv})]}):null]})},NT=({children:e,className:t,onDownload:n,onError:r})=>{let i=X(),[a,o]=(0,N.useState)(!1),s=(0,N.useRef)(null),{isAnimating:c,controls:l}=(0,N.useContext)(ED),u=iT(),d=tT(),f=DT(l),p=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=ET(t),a=e===`csv`?OT(i,f):jT(i),c=e===`csv`?`csv`:`md`;Fw(`${oT(l,`table`,`table`)}.${c}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,N.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,M.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:u.downloadTable,type:`button`,children:e??(0,M.jsx)(d.DownloadIcon,{size:14})}),a?(0,M.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`csv`),title:u.downloadTableAsCsv,type:`button`,children:u.tableFormatCsv}),(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>p(`markdown`),title:u.downloadTableAsMarkdown,type:`button`,children:u.tableFormatMarkdown})]}):null]})},PT=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=tT(),o=X(),[s,c]=(0,N.useState)(!1),{isAnimating:l}=(0,N.useContext)(ED),u=iT(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,N.useEffect)(()=>{if(s){pT();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),mT()}}},[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,M.jsx)(i,{size:14})}),s?(0,pt.createPortal)((0,M.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,M.jsxs)(`div`,{className:o(`flex h-full flex-col`),"data-streamdown":`table-wrapper`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,M.jsx)(MT,{}):null,r?(0,M.jsx)(NT,{}):null,(0,M.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,M.jsx)(a,{size:20})})]}),(0,M.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,M.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},FT=({children:e,className:t,maxHeight:n,showControls:r,showCopy:i=!0,showDownload:a=!0,showFullscreen:o=!0,...s})=>{let c=X(),{isAnimating:l}=(0,N.useContext)(ED),u=Rw(n),d=zw(l,!!u,e),f=r&&i,p=r&&a,m=r&&o,h=f||p||m;return(0,M.jsxs)(`div`,{className:c(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[h?(0,M.jsxs)(`div`,{className:c(`flex items-center justify-end gap-1`),children:[f?(0,M.jsx)(MT,{}):null,p?(0,M.jsx)(NT,{}):null,m?(0,M.jsx)(PT,{showCopy:f,showDownload:p,children:e}):null]}):null,(0,M.jsx)(`div`,{className:c(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),ref:d,style:u?{maxHeight:u}:void 0,children:(0,M.jsx)(`table`,{className:c(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...s,children:e})})]})},IT=/startLine=(\d+)/,LT=/\bnoLineNumbers\b/,RT=(0,N.lazy)(()=>Fe(()=>import(`./mermaid-HWGCJPDP-NlsJ0x2Y.js`).then(e=>({default:e.Mermaid})),[],import.meta.url)),zT=/language-([^\s]+)/,BT=`node`;function VT(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;for(let e of n)if(e!==BT&&!Object.is(r[e],i[e]))return!1;return!0}function HT(e,t){return e?.properties?.metastring===t?.properties?.metastring}var UT=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,WT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},GT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},KT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},qT=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.image;return n===!1?!1:n===!0||n===void 0||n[t]!==!1},JT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ol`,{className:i(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e})},(e,t)=>VT(e,t));JT.displayName=`MarkdownOl`;var YT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`li`,{className:i(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e})},(e,t)=>VT(e,t));YT.displayName=`MarkdownLi`;var XT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`ul`,{className:i(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e})},(e,t)=>VT(e,t));XT.displayName=`MarkdownUl`;var ZT=(0,N.memo)(({className:e,node:t,...n})=>{let r=X();return(0,M.jsx)(`hr`,{className:r(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n})},(e,t)=>VT(e,t));ZT.displayName=`MarkdownHr`;var QT=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`span`,{className:i(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e})},(e,t)=>VT(e,t));QT.displayName=`MarkdownStrong`;var $T=(0,N.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=X(),{linkSafety:o}=(0,N.useContext)(ED),[s,c]=(0,N.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,N.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,N.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,N.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(hT,{...p})]}):(0,M.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>VT(e,t));$T.displayName=`MarkdownA`;var eE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h1`,{className:i(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e})},(e,t)=>VT(e,t));eE.displayName=`MarkdownH1`;var tE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h2`,{className:i(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e})},(e,t)=>VT(e,t));tE.displayName=`MarkdownH2`;var nE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h3`,{className:i(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e})},(e,t)=>VT(e,t));nE.displayName=`MarkdownH3`;var rE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h4`,{className:i(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e})},(e,t)=>VT(e,t));rE.displayName=`MarkdownH4`;var iE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h5`,{className:i(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e})},(e,t)=>VT(e,t));iE.displayName=`MarkdownH5`;var aE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`h6`,{className:i(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e})},(e,t)=>VT(e,t));aE.displayName=`MarkdownH6`;var oE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i,tableMaxHeight:a}=(0,N.useContext)(ED),o=UT(i,`table`),s=WT(i,`copy`),c=WT(i,`download`),l=WT(i,`fullscreen`);return(0,M.jsx)(FT,{className:t,maxHeight:a,showControls:o,showCopy:s,showDownload:c,showFullscreen:l,...r,children:e})},(e,t)=>VT(e,t));oE.displayName=`MarkdownTable`;var sE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`thead`,{className:i(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e})},(e,t)=>VT(e,t));sE.displayName=`MarkdownThead`;var cE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tbody`,{className:i(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e})},(e,t)=>VT(e,t));cE.displayName=`MarkdownTbody`;var lE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`tr`,{className:i(`border-border`,t),"data-streamdown":`table-row`,...r,children:e})},(e,t)=>VT(e,t));lE.displayName=`MarkdownTr`;var uE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`th`,{className:i(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e})},(e,t)=>VT(e,t));uE.displayName=`MarkdownTh`;var dE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`td`,{className:i(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e})},(e,t)=>VT(e,t));dE.displayName=`MarkdownTd`;var fE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`blockquote`,{className:i(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e})},(e,t)=>VT(e,t));fE.displayName=`MarkdownBlockquote`;var pE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sup`,{className:i(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e})},(e,t)=>VT(e,t));pE.displayName=`MarkdownSup`;var mE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{let i=X();return(0,M.jsx)(`sub`,{className:i(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e})},(e,t)=>VT(e,t));mE.displayName=`MarkdownSub`;var hE=(0,N.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,N.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,N.isValidElement)(e)){if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,N.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,N.isValidElement)(e))return e;if(e.type===JT){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,M.jsx)(`section`,{className:t,...r,children:i}):null}return(0,M.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>VT(e,t));hE.displayName=`MarkdownSection`;var gE=(0,N.memo)(({node:e,className:t,children:n,...r})=>{let i=X(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,N.useContext)(ED),l=yT(),u=jw(),d=(t?.match(zT))?.at(1)??``,f=bT(d);if(a)return(0,M.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(IT),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&<.test(p))&&c!==!1,v=``;if((0,N.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(lT,{}),children:(0,M.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=UT(s,`mermaid`),n=KT(s,`download`),r=KT(s,`copy`),a=KT(s,`fullscreen`),c=KT(s,`panZoom`),l=e&&(n||r||a);return(0,M.jsx)(N.Suspense,{fallback:(0,M.jsx)(lT,{}),children:(0,M.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,M.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,M.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,M.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,M.jsx)(CT,{chart:v,config:o?.config}):null,r?(0,M.jsx)(aT,{code:v}):null,a?(0,M.jsx)(wT,{chart:v,config:o?.config}):null]})}):null,(0,M.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,M.jsx)(RT,{chart:v,config:o?.config,showControls:c})})]})})}let y=UT(s,`code`),b=GT(s,`download`),x=GT(s,`copy`),{"data-block":S,...C}=r;return(0,M.jsx)(Xw,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,...C,children:y?(0,M.jsxs)(M.Fragment,{children:[b?(0,M.jsx)(cT,{code:v,language:d}):null,x?(0,M.jsx)(aT,{}):null]}):null})},(e,t)=>VT(e,t)&&HT(e.node,t.node));gE.displayName=`MarkdownCode`;var _E=(0,N.memo)(({node:e,className:t,...n})=>{let{controls:r}=(0,N.useContext)(ED),i=UT(r,`image`),a=i&&qT(r,`download`);return(0,M.jsx)(dT,{className:t,node:e,showControls:i,showDownloadControl:a,...n})},(e,t)=>VT(e,t));_E.displayName=`MarkdownImg`;var vE=(0,N.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,N.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)(`p`,{...n,children:e})},(e,t)=>VT(e,t));vE.displayName=`MarkdownParagraph`;var yE={ol:JT,li:YT,ul:XT,hr:ZT,strong:QT,a:$T,h1:eE,h2:tE,h3:nE,h4:rE,h5:iE,h6:aE,table:oE,thead:sE,tbody:cE,tr:lE,th:uE,td:dE,blockquote:fE,code:gE,img:_E,pre:({children:e})=>(0,N.isValidElement)(e)?(0,N.cloneElement)(e,{"data-block":`true`}):e,sup:pE,sub:mE,p:vE,section:hE},bE=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,xE=/\p{L}/u;function SE(e){let t=e.replace(/(```|~~~)[\s\S]*?\1/g,``).replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``),n,r=0,i=0;for(let e of t){if(bE.test(e)){n??=`rtl`,i+=1;continue}xE.test(e)&&(n??=`ltr`,r+=1)}return i>r?`rtl`:r>i?`ltr`:n??`ltr`}var CE=/^[ \t]{0,3}(`{3,}|~{3,})/,wE=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,TE=e=>{let t=e.split(`
|
|
122
|
+
`),n=null,r=0;for(let e of t){let t=CE.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},EE=e=>{let t=e.split(`
|
|
123
|
+
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&wE.test(t))return!0}return!1},DE=()=>e=>{Pa(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},OE=[],kE={allowDangerousHtml:!0},AE=new WeakMap,jE=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=AE.get(e);n||(n=e.name,AE.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=AE.get(r);e||(e=r.name,AE.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},ME=e=>{let t=NE(e),n=e.children||``;return BE(t.runSync(t.parse(n),n),e)},NE=e=>{let t=jE.get(e);if(t)return t;let n=FE(e);return jE.set(e,n),n},PE=e=>e.some(e=>Array.isArray(e)?e[0]===mf:e===mf),FE=e=>{let t=e.rehypePlugins||OE,n=e.remarkPlugins||OE,r=PE(t)?n:[...n,DE],i=e.remarkRehypeOptions?{...kE,...e.remarkRehypeOptions}:kE;return _S().use(Qb).use(r).use(Ux,i).use(t)},IE=e=>e,LE=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},RE=(e,t)=>{for(let n in pb)if(Object.hasOwn(pb,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=pb[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},zE=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},BE=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||IE;Pa(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return LE(c,s,a,e.value),s;if(e.type===`element`&&(RE(e,t),zE(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return Gy(e,{Fragment:M.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:M.jsx,jsxs:M.jsxs,passKeys:!0,passNode:!0})},VE=/\[\^[\w-]{1,200}\](?!:)/,HE=/\[\^[\w-]{1,200}\]:/,UE=/<([A-Za-z][\w:-]*)[\s>/]/,WE=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),GE=new Map,KE=new Map,qE=e=>{let t=e.toLowerCase(),n=GE.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return GE.set(t,r),r},JE=e=>{let t=e.toLowerCase(),n=KE.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return KE.set(t,r),r},YE=(e,t)=>{if(WE.has(t.toLowerCase()))return 0;let n=e.match(qE(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},XE=(e,t)=>{let n=e.match(JE(t));return n?n.length:0},ZE=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},QE=e=>{let t=VE.test(e),n=HE.test(e);if(t||n)return[e];let r=KC.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=YE(t,e),o=XE(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(UE);if(e){let n=e[1];YE(t,n)>XE(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(ZE(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},$E=/^\n*/,eD=/\n*$/,tD=/\n\n/g,nD=(e,t,n)=>t.includes(`
|
|
124
|
+
`)?`${e}${t.replace(tD,`
|
|
125
|
+
<!---->
|
|
126
|
+
`).replace($E,`
|
|
127
|
+
|
|
128
|
+
`).replace(eD,`
|
|
129
|
+
|
|
130
|
+
`)}${n}
|
|
131
|
+
|
|
132
|
+
`:e+t+n,rD=(e,t)=>{let n=RegExp(`<(${t})(?=[\\s>/])([^>]*)>`,`gi`),r=``,i=0,a=n.exec(e);for(;a;){let t=a[0],o=a[1],s=a.index+t.length,c=e.slice(s);if(RegExp(`</${o}\\s*>`,`i`).test(c)){a=n.exec(e);continue}if(r+=e.slice(i,a.index),c.length===0){r+=t,i=s,a=n.exec(e);continue}if(c.startsWith(`
|
|
133
|
+
|
|
134
|
+
`)){let n=c.slice(2).replace(tD,`
|
|
135
|
+
<!---->
|
|
136
|
+
`);r+=`${t}
|
|
137
|
+
|
|
138
|
+
${n}`,i=e.length;break}if(!c.startsWith(`
|
|
139
|
+
`)){r+=t,i=s,a=n.exec(e);continue}let l=c.slice(1);if(l.trim().length===0){r+=t,i=s,a=n.exec(e);continue}let u=l.replace(tD,`
|
|
140
|
+
<!---->
|
|
141
|
+
`);r+=`${t}
|
|
142
|
+
|
|
143
|
+
${u}`,i=e.length;break}return i===0?e:r+e.slice(i)},iD=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>nD(t,n,r)),n=rD(n,e)}return n},aD=/([\\`*_~[\]|])/g,oD=e=>e.replace(aD,`\\$1`),sD=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>t+oD(n).replace(/\n\n/g,` `)+r)}return n},cD=new Set([`blockquote`,`dd`,`dt`,`figcaption`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`p`,`td`,`th`]),lD=new Set([`code`,`kbd`,`pre`,`samp`,`var`]);function uD(e){return e.children.map(e=>e.type===`text`?e.value:e.type===`element`&&!lD.has(e.tagName)?uD(e):``).join(``)}function dD(){return e=>{Pa(e,`element`,e=>{if(lD.has(e.tagName)){e.properties??={},e.properties.dir=`ltr`;return}cD.has(e.tagName)&&(e.properties??={},typeof e.properties.dir!=`string`&&(e.properties.dir=SE(uD(e))))})}}var fD=e=>e.type===`text`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(fD).join(``):``,pD=e=>t=>{if(!e||e.length===0)return;let n=new Set(e.map(e=>e.toLowerCase()));Pa(t,`element`,e=>{if(n.has(e.tagName.toLowerCase())){let t=fD(e);e.children=t?[{type:`text`,value:t}]:[]}})},mD=()=>e=>{Pa(e,`code`,e=>{e.meta&&(e.data=e.data??{},e.data.hProperties={...e.data.hProperties??{},metastring:e.meta})})},hD=/^[ \t]*<[\w!/?-]/,gD=/(^|\n)[ \t]{4,}(?=<[\w!/?-])/g,_D=e=>typeof e!=`string`||e.length===0||!hD.test(e)?e:e.replace(gD,`$1`),vD={...gf,clobberPrefix:``,protocols:{...gf.protocols,href:[...gf.protocols?.href??[],`tel`,`streamdown`]},attributes:{...gf.attributes,code:[...gf.attributes?.code??[],`metastring`]}},yD={raw:mf,sanitize:[Nf,vD],harden:[Ga,{allowedImagePrefixes:[`*`],allowedLinkPrefixes:[`*`],allowedProtocols:[`*`],defaultOrigin:void 0,allowDataImages:!0}]},bD={gfm:[N_,{}],codeMeta:mD},xD=Object.values(yD),SD=Object.values(bD),CD={block:` ▋`,circle:` ●`},wD=[`github-light`,`github-dark`],TD={enabled:!0},ED=(0,N.createContext)({codeBlockMaxHeight:400,shikiTheme:wD,controls:!0,isAnimating:!1,lineNumbers:!0,mode:`streaming`,mermaid:void 0,linkSafety:TD,tableMaxHeight:300}),DD=(0,N.memo)(({content:e,shouldParseIncompleteMarkdown:t,shouldNormalizeHtmlIndentation:n,index:r,isIncomplete:i,dir:a,animatePlugin:o,...s})=>{(0,N.useLayoutEffect)(()=>{o?.commit()});let c=typeof e==`string`&&n?_D(e):e,l=(0,M.jsx)(ME,{...s,children:c});return(0,M.jsx)(Aw.Provider,{value:i,children:a?(0,M.jsx)(`div`,{dir:a,style:{display:`contents`},children:l}):l})},(e,t)=>{if(e.content!==t.content||e.shouldNormalizeHtmlIndentation!==t.shouldNormalizeHtmlIndentation||e.index!==t.index||e.isIncomplete!==t.isIncomplete||e.dir!==t.dir)return!1;if(e.components!==t.components){let n=Object.keys(e.components||{}),r=Object.keys(t.components||{});if(n.length!==r.length||n.some(n=>e.components?.[n]!==t.components?.[n]))return!1}return e.rehypePlugins===t.rehypePlugins&&e.remarkPlugins===t.remarkPlugins&&!!e.animatePlugin==!!t.animatePlugin});DD.displayName=`Block`;var OD=(0,N.memo)(({children:e,mode:t=`streaming`,dir:n,parseIncompleteMarkdown:r=!0,normalizeHtmlIndentation:i=!1,components:a,rehypePlugins:o=xD,remarkPlugins:s=SD,className:c,shikiTheme:l,mermaid:u,codeBlockMaxHeight:d=400,controls:f=!0,isAnimating:p=!1,tableMaxHeight:m=300,animated:h,BlockComponent:g=DD,parseMarkdownIntoBlocksFn:_=QE,caret:v,plugins:y,remend:b,linkSafety:x=TD,lineNumbers:S=!0,allowedTags:C,literalTagContent:w,translations:T,icons:E,prefix:ee,onAnimationStart:D,onAnimationEnd:te,...O})=>{let ne=(0,N.useId)(),k=(0,N.useMemo)(()=>Pw(ee),[ee]),re=(0,N.useRef)(null),ie=(0,N.useRef)(D),ae=(0,N.useRef)(te);ie.current=D,ae.current=te,(0,N.useEffect)(()=>{var e,n,r;if(t===`static`)return;let i=re.current;if(re.current=p,i===null){p&&((e=ie.current)==null||e.call(ie));return}p&&!i?(n=ie.current)==null||n.call(ie):!p&&i&&((r=ae.current)==null||r.call(ae))},[p,t]);let oe=(0,N.useMemo)(()=>C?Object.keys(C):[],[C]),se=(0,N.useMemo)(()=>{if(typeof e!=`string`)return``;let n=t===`streaming`&&r?xy(e,b):e;return w&&w.length>0&&(n=sD(n,w)),oe.length>0&&(n=iD(n,oe)),n},[e,t,r,b,oe,w]),A=(0,N.useMemo)(()=>_(se),[se,_]),ce=(0,N.useMemo)(()=>n===`auto`?A.map(SE):void 0,[A,n]),j=(0,N.useMemo)(()=>A.map((e,t)=>`${ne}-${t}`),[A.length,ne]),le=(0,N.useMemo)(()=>h===!0?`true`:h?JSON.stringify(h):``,[h]),ue=(0,N.useRef)(null),de=(0,N.useRef)([]),fe=(0,N.useRef)([]),pe=(0,N.useRef)(null),me=(0,N.useRef)(``);le?(me.current===le?ue.current||=ow():(me.current=le,ue.current=ow({maxBacklogMs:le===`true`?void 0:h.maxBacklogMs}),de.current=[],fe.current=[]),p&&ue.current&&ue.current.beginPass(ue.current.now())):(ue.current=null,de.current=[],fe.current=[],me.current=``),(0,N.useLayoutEffect)(()=>{var e;p&&((e=ue.current)==null||e.commitPass())});let he=(0,N.useMemo)(()=>({codeBlockMaxHeight:d,shikiTheme:l??(y?.code)?.getThemes()??wD,controls:f,isAnimating:p,lineNumbers:S,mode:t,mermaid:u,linkSafety:x,tableMaxHeight:m}),[d,l,f,p,S,t,u,x,y?.code,m]),ge=(0,N.useMemo)(()=>T?JSON.stringify(T):``,[T]),_e=(0,N.useMemo)(()=>({...nT,...T}),[ge]),ve=(0,N.useMemo)(()=>{let{inlineCode:e,...t}=a??{},n={...yE,...t};if(e){let t=n.code;n.code=n=>`data-block`in n?t?(0,N.createElement)(t,n):null:(0,N.createElement)(e,n)}return n},[a]),ye=(0,N.useMemo)(()=>{let e=[];return y!=null&&y.cjk&&(e=[...e,...y.cjk.remarkPluginsBefore]),e=[...e,...s],y!=null&&y.cjk&&(e=[...e,...y.cjk.remarkPluginsAfter]),y!=null&&y.math&&(e=[...e,y.math.remarkPlugin]),e},[s,y?.math,y?.cjk]),be=(0,N.useMemo)(()=>{let e=o;if(C&&Object.keys(C).length>0&&o===xD){let t={...vD,tagNames:[...vD.tagNames??[],...Object.keys(C)],attributes:{...vD.attributes,...C}};e=[yD.raw,[Nf,t],yD.harden]}return w&&w.length>0&&(e=[...e,[pD,w]]),y!=null&&y.math&&(e=[...e,y.math.rehypePlugin]),n===`auto`&&t===`static`&&(e=[...e,dD]),e},[o,y?.math,C,w,n,t]),xe=(0,N.useMemo)(()=>{if(!p||A.length===0)return!1;let e=A.at(-1);return TE(e)||EE(e)},[p,A]),Se=(0,N.useMemo)(()=>v&&p&&!xe?{"--streamdown-caret":`"${CD[v]}"`}:void 0,[v,p,xe]),Ce=e=>{let t=null;if(ue.current&&p){if(!de.current[e]){let{maxBacklogMs:t,...n}=le&&le!==`true`?h:{};de.current[e]=kw({...n,timeline:ue.current})}t=de.current[e]}pe.current!==be&&(fe.current=[],pe.current=be),t&&!fe.current[e]&&(fe.current[e]=[...be,t.rehypePlugin]);let n=t&&fe.current[e]?fe.current[e]:be;return{blockAnimatePlugin:t,blockRehypePlugins:n}};return t===`static`?(0,M.jsx)(rT.Provider,{value:_e,children:(0,M.jsx)(gT.Provider,{value:y??null,children:(0,M.jsx)(ED.Provider,{value:he,children:(0,M.jsx)(eT,{icons:E,children:(0,M.jsx)(Iw.Provider,{value:k,children:(0,M.jsx)(`div`,{className:k(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,c),dir:n===`auto`?void 0:n,children:(0,M.jsx)(ME,{components:ve,rehypePlugins:be,remarkPlugins:ye,...O,children:se})})})})})})}):(0,M.jsx)(rT.Provider,{value:_e,children:(0,M.jsx)(gT.Provider,{value:y??null,children:(0,M.jsx)(ED.Provider,{value:he,children:(0,M.jsx)(eT,{icons:E,children:(0,M.jsx)(Iw.Provider,{value:k,children:(0,M.jsxs)(`div`,{className:k(`space-y-4 whitespace-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,v&&!xe?`[&>*:last-child]:after:inline [&>*:last-child]:after:align-baseline [&>*:last-child]:after:content-[var(--streamdown-caret)]`:null,c),style:Se,children:[A.length===0&&v&&p&&(0,M.jsx)(`span`,{}),A.map((e,t)=>{let a=t===A.length-1,o=p&&a&&TE(e),{blockAnimatePlugin:s,blockRehypePlugins:c}=Ce(t);return(0,M.jsx)(g,{animatePlugin:s,components:ve,content:e,dir:ce?.[t]??(n===`auto`?void 0:n),index:t,isIncomplete:o,rehypePlugins:c,remarkPlugins:ye,shouldNormalizeHtmlIndentation:i,shouldParseIncompleteMarkdown:r,...O},j[t])})]})})})})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.animated===t.animated&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety&&e.lineNumbers===t.lineNumbers&&e.codeBlockMaxHeight===t.codeBlockMaxHeight&&e.tableMaxHeight===t.tableMaxHeight&&e.normalizeHtmlIndentation===t.normalizeHtmlIndentation&&e.literalTagContent===t.literalTagContent&&JSON.stringify(e.translations)===JSON.stringify(t.translations)&&e.prefix===t.prefix&&e.dir===t.dir);OD.displayName=`Streamdown`;var kD=({children:e,className:t,minZoom:n=.5,maxZoom:r=3,zoomStep:i=.1,showControls:a=!0,initialZoom:o=1,fullscreen:s=!1})=>{let{RotateCcwIcon:c,ZoomInIcon:l,ZoomOutIcon:u}=tT(),d=X(),f=iT(),p=(0,N.useRef)(null),m=(0,N.useRef)(null),[h,g]=(0,N.useState)(o),[_,v]=(0,N.useState)({x:0,y:0}),[y,b]=(0,N.useState)(!1),[x,S]=(0,N.useState)({x:0,y:0}),[C,w]=(0,N.useState)({x:0,y:0}),T=(0,N.useCallback)(e=>{g(t=>Math.max(n,Math.min(r,t+e)))},[n,r]),E=(0,N.useCallback)(()=>{T(i)},[T,i]),ee=(0,N.useCallback)(()=>{T(-i)},[T,i]),D=(0,N.useCallback)(()=>{g(o),v({x:0,y:0})},[o]),te=(0,N.useCallback)(e=>{e.preventDefault();let t=e.deltaY>0?-i:i;T(t)},[T,i]),O=(0,N.useCallback)(e=>{if(e.button!==0||e.isPrimary===!1)return;b(!0),S({x:e.clientX,y:e.clientY}),w(_);let t=e.currentTarget;t instanceof HTMLElement&&t.setPointerCapture(e.pointerId)},[_]),ne=(0,N.useCallback)(e=>{if(!y)return;e.preventDefault();let t=e.clientX-x.x,n=e.clientY-x.y;v({x:C.x+t,y:C.y+n})},[y,x,C]),k=(0,N.useCallback)(e=>{b(!1);let t=e.currentTarget;t instanceof HTMLElement&&t.releasePointerCapture(e.pointerId)},[]);return(0,N.useEffect)(()=>{let e=p.current;if(e)return e.addEventListener(`wheel`,te,{passive:!1}),()=>{e.removeEventListener(`wheel`,te)}},[te]),(0,N.useEffect)(()=>{let e=m.current;if(e&&y)return document.body.style.userSelect=`none`,e.addEventListener(`pointermove`,ne,{passive:!1}),e.addEventListener(`pointerup`,k),e.addEventListener(`pointercancel`,k),()=>{document.body.style.userSelect=``,e.removeEventListener(`pointermove`,ne),e.removeEventListener(`pointerup`,k),e.removeEventListener(`pointercancel`,k)}},[y,ne,k]),(0,M.jsxs)(`div`,{className:d(`relative flex flex-col`,s?`h-full w-full`:`min-h-28 w-full`,t),ref:p,style:{cursor:y?`grabbing`:`grab`},children:[a?(0,M.jsxs)(`div`,{className:d(`absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/80 p-1 supports-[backdrop-filter]:bg-background/70 supports-[backdrop-filter]:backdrop-blur-sm`,s?`bottom-4 left-4`:`bottom-2 left-2`),children:[(0,M.jsx)(`button`,{"aria-label":f.zoomIn,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h>=r,onClick:E,title:f.zoomIn,type:`button`,children:(0,M.jsx)(l,{"aria-hidden":`true`,size:16})}),(0,M.jsx)(`button`,{"aria-label":f.zoomOut,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`),disabled:h<=n,onClick:ee,title:f.zoomOut,type:`button`,children:(0,M.jsx)(u,{"aria-hidden":`true`,size:16})}),(0,M.jsx)(`button`,{"aria-label":f.resetView,className:d(`flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`),onClick:D,title:f.resetView,type:`button`,children:(0,M.jsx)(c,{"aria-hidden":`true`,size:16})})]}):null,(0,M.jsx)(`div`,{className:d(`flex-1 origin-center transition-transform duration-150 ease-out`,s?`flex h-full w-full items-center justify-center`:`flex w-full items-center justify-center`),onPointerDown:O,ref:m,role:`application`,style:{transform:`translate(${_.x}px, ${_.y}px) scale(${h})`,transformOrigin:`center center`,touchAction:`none`,willChange:`transform`},children:e})]})},AD=({chart:e,className:t,config:n,fullscreen:r=!1,showControls:i=!0})=>{let a=X(),[o,s]=(0,N.useState)(null),[c,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(``),[f,p]=(0,N.useState)(``),[m,h]=(0,N.useState)(0),{mermaid:g}=(0,N.useContext)(ED),_=yT(),v=g?.errorComponent,{shouldRender:y,containerRef:b}=nw({immediate:r});if((0,N.useEffect)(()=>{if(y){if(!_){s(`Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.`);return}(async()=>{try{s(null),l(!0);let t=_.getMermaid(n),r=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),i=`mermaid-${Math.abs(r)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:a}=await t.render(i,e);d(a),p(a)}catch(e){if(!(f||u)){let t=e instanceof Error?e.message:`Failed to render Mermaid chart`;s(t)}}finally{l(!1)}})()}},[e,n,m,y,_]),!(y||u||f))return(0,M.jsx)(`div`,{className:a(`my-4 min-h-[200px]`,t),ref:b});if(c&&!u&&!f)return(0,M.jsx)(`div`,{className:a(`my-4 flex justify-center p-4`,t),ref:b,children:(0,M.jsxs)(`div`,{className:a(`flex items-center space-x-2 text-muted-foreground`),children:[(0,M.jsx)(`div`,{className:a(`h-4 w-4 animate-spin rounded-full border-current border-b-2`)}),(0,M.jsx)(`span`,{className:a(`text-sm`),children:`Loading diagram...`})]})});if(o&&!u&&!f)return v?(0,M.jsx)(`div`,{ref:b,children:(0,M.jsx)(v,{chart:e,error:o,retry:()=>h(e=>e+1)})}):(0,M.jsxs)(`div`,{className:a(`rounded-md bg-red-50 p-4`,t),ref:b,children:[(0,M.jsxs)(`p`,{className:a(`font-mono text-red-700 text-sm`),children:[`Mermaid Error: `,o]}),(0,M.jsxs)(`details`,{className:a(`mt-2`),children:[(0,M.jsx)(`summary`,{className:a(`cursor-pointer text-red-600 text-xs`),children:`Show Code`}),(0,M.jsx)(`pre`,{className:a(`mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs`),children:e})]})]});let x=u||f;return(0,M.jsx)(`div`,{className:a(`size-full`,t),"data-streamdown":`mermaid`,ref:b,children:(0,M.jsx)(kD,{className:a(r?`size-full overflow-hidden`:`overflow-hidden`,t),fullscreen:r,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:(0,M.jsx)(`div`,{"aria-label":`Mermaid chart`,className:a(`flex justify-center`,r?`size-full items-center`:null),dangerouslySetInnerHTML:{__html:x},role:`img`})})})},jD=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function MD(e){return ND(e)}function ND(e){return Array.isArray(e)?PD(e):e instanceof RegExp?e:typeof e==`object`?FD(e):e}function PD(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=ND(e[n]);return t}function FD(e){let t={};for(let n in e)t[n]=ND(e[n]);return t}function ID(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function LD(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?LD(e.substring(0,e.length-1)):e.substr(~t+1)}var RD=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,zD=class{static hasCaptures(e){return e!==null&&(RD.lastIndex=0,RD.test(e))}static replaceCaptures(e,t,n){return e.replace(RD,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function BD(e,t){return e<t?-1:+(e>t)}function VD(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=BD(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function HD(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function UD(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var WD=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},GD=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(XD(e),t)}static createFromParsedTheme(e,t){return $D(e,t)}_cachedMatchRoot=new WD(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>qD(e.parent,t.parentScopes));return n?new YD(n.fontStyle,n.foreground,n.background):null}},KD=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function qD(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!JD(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function JD(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var YD=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function XD(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&HD(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&HD(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new ZD(l,u,e,o,s,c)}}return n}var ZD=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},QD=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(QD||{});function $D(e,t){e.sort((e,t)=>{let n=BD(e.scope,t.scope);return n!==0||(n=VD(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new eO(t),o=new YD(n,a.getId(r),a.getId(i)),s=new rO(new nO(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new GD(a,o,s)}var eO=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},tO=Object.freeze([]),nO=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||tO,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},rO=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),nO.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(VD(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new nO(e,t,n,r,i))}},iO=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=oO(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function aO(e){return e}function oO(e){return e}function sO(e,t){let n=[],r=lO(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(cO(i)){let e=[];do e.push(i),i=r.next();while(cO(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function cO(e){return!!e&&!!e.match(/[\w\.:]+/)}function lO(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function uO(e){typeof e.dispose==`function`&&e.dispose()}var dO=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},fO=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},pO=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},mO=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new dO(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new pO;for(let n of e)hO(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof dO){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function hO(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof dO?_O({baseGrammar:a,selfGrammar:i},r):gO(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new dO(e))}function gO(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];vO([r],t,n)}}function _O(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&vO(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&vO(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function vO(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?ID({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&vO(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=wO(i);switch(a.kind){case 0:_O({...t,selfGrammar:t.baseGrammar},n);break;case 1:_O(t,n);break;case 2:gO(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?gO(a.ruleName,i,n):_O(i,n)}else a.kind===4?n.add(new fO(a.scopeName,a.ruleName)):n.add(new dO(a.scopeName))}}}var yO=class{kind=0},bO=class{kind=1},xO=class{constructor(e){this.ruleName=e}kind=2},SO=class{constructor(e){this.scopeName=e}kind=3},CO=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function wO(e){if(e===`$base`)return new yO;if(e===`$self`)return new bO;let t=e.indexOf(`#`);return t===-1?new SO(e):t===0?new xO(e.substring(1)):new CO(e.substring(0,t),e.substring(t+1))}var TO=/\\(\d+)/,EO=/\\(\d+)/g,DO=-1,OO=-2;function kO(e){return e}function AO(e){return e}var jO=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=zD.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=zD.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${LD(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:zD.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:zD.replaceCaptures(this._contentName,e,t)}},MO=class extends jO{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},NO=class extends jO{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new RO(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new zO,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},PO=class extends jO{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new zO,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},FO=class extends jO{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new RO(i,this.id),this.beginCaptures=a,this._end=new RO(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new zO;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},IO=class extends jO{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new RO(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new RO(o,OO),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new zO;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new zO,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},LO=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new MO(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new NO(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=ID({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new PO(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new IO(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new FO(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=wO(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof PO||e instanceof FO||e instanceof IO)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},RO=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&TO.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return EO.lastIndex=0,this.source.replace(EO,(e,t)=>UD(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},zO=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new BO(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new BO(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},BO=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
144
|
+
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},VO=class{constructor(e,t){this.languageId=e,this.tokenType=t}},HO=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new VO(e,8),this._embeddedLanguagesMatcher=new UO(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new VO(0,0);_getBasicScopeAttributes=new WD(e=>new VO(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},UO=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>UD(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var WO=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function GO(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=KO(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new WO(i,!0);f()}return new WO(i,!1);function f(){let o=qO(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===DO){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),QO(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof FO){let r=o;QO(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof IO){let r=o;QO(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(QO(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function KO(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof IO&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=ZO(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==OO){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),QO(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function qO(e,t,n,r,i,a){let o=JO(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=YO(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function JO(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=XO(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function YO(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=XO(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function XO(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function ZO(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function QO(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));GO(e,p,n&&d.start===0,d.start,f,i,!1,0),uO(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new $O(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var $O=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ek(e,t,n,r,i,a,o,s){return new ik(e,t,n,r,i,a,o,s)}function tk(e,t,n,r,i){let a=sO(t,nk),o=LO.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function nk(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(rk(t[r],e))return n=r+1,!0;return!1})}function rk(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var ik=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new HO(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ak(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=sO(e,nk);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)tk(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&tk(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(kO(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[AO(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ak(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=LO.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===sk.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=iO.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?ok.createRootAndLookUpScopeName(a,r,this):ok.createRoot(`unknown`,r),t=new sk(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
145
|
+
`;let a=this.createOnigString(e),o=a.content.length,s=new lk(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=GO(this,a,i,0,t,s,!0,r);return uO(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ak(e,t){return e=MD(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var ok=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=KD.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new KD(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new KD(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),iO.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},sk=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?ok.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:AO(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=ok.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,kO(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ok.fromExtension(r,n.contentNameScopesList))}},ck=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):sO(e,nk).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>sO(e,nk).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},lk=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=iO.set(n,0,aO(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=iO.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},uk=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,ek(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},dk=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new uk(GD.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(GD.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ck(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new mO(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},fk=sk.NULL;function pk(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function mk(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function hk(e){return Array.isArray(e)?e:[e]}async function gk(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function _k(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function vk(e){return e===`ansi`||_k(e)}function yk(e){return e===`none`}function bk(e){return yk(e)}var xk=/(\r?\n)/g;function Sk(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(xk),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Ck={light:`#333333`,dark:`#bbbbbb`},wk={light:`#fffffe`,dark:`#1e1e1e`},Tk=`__shiki_resolved`;function Ek(e){if(e?.[Tk])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Ck.light:Ck.dark,n||=t.type===`light`?wk.light:wk.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Tk,{enumerable:!1,writable:!1,value:!0}),t}async function Dk(e){return[...new Set((await Promise.all(e.filter(e=>!vk(e)).map(async e=>await gk(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ok(e){return(await Promise.all(e.map(async e=>bk(e)?null:Ek(await gk(e))))).filter(e=>!!e)}function kk(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new jD(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Ak=class extends dk{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Ek(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=GD.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=kk(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new jD(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},jk=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Mk=0;function Nk(e){Mk+=1,e.warnings!==!1&&Mk>=10&&Mk%10==0&&console.warn(`[Shiki] ${Mk} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new jD("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Ek),i=new Ak(new jk(e.engine,n),r,n,e.langAlias),a;function o(t){return kk(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new jD(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new jD(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Dk(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Ok(e))}function g(){if(t)throw new jD(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Mk)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Pk(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ok(e.themes||[]),Dk(e.langs||[]),e.engine]);return Nk({...e,themes:t,langs:n,engine:r})}var Fk=new WeakMap;function Ik(e,t){Fk.set(e,t)}function Lk(e){return Fk.get(e)}var Rk=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(hk(n).map(e=>[e,fk])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return zk(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function zk(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Bk(e,t){if(!(e instanceof Rk))throw new jD(`Invalid grammar state`);return e.getInternalStack(t)}var Vk=/,/,Hk=/ /;function Uk(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(_k(e.resolveLangAlias(n.lang||`text`))||yk(r))return Sk(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new jD(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new jD(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Gk(t,o,i,a,n)}function Wk(...e){if(e.length===2)return Lk(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(_k(i)||yk(a))throw new jD(`Plain language does not have grammar state`);if(i===`ansi`)throw new jD(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Rk(Kk(n,c,o,s,r).stateStack,c.name,o.name)}function Gk(e,t,n,r,i){let a=Kk(e,t,n,r,i),o=new Rk(a.stateStack,t.name,n.name);return Ik(a.tokens,o),a.tokens}function Kk(e,t,n,r,i){let a=pk(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Sk(e),u=i.grammarState?Bk(i.grammarState,n.name)??fk:i.grammarContextCode==null?fk:Kk(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=mk(r[iO.getForeground(s)],a),u=iO.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=iO.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Vk).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Hk))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?qk(t.scopes):Jk(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function qk(e){return e.map(e=>({scopeName:e}))}function Jk(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Zk(e,i,t.slice(0,r))}}return n}function Yk(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Xk(e,t,n){if(!Yk(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Yk(e[r],n[i])&&--r,--i;return r===-1}function Zk(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Xk(e,t,n)){r.push(a);break}return r}function Qk(e,t,n,r=Uk){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Lk(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=$k(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Rk(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Ik(s,c),s}function $k(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var eA=/["&'<>`]/g,tA=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,nA=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,rA=/[|\\{}()[\]^$+*?.]/g,iA=new WeakMap;function aA(e,t){if(e=e.replace(t.subset?oA(t.subset):eA,r),t.subset||t.escapeOnly)return e;return e.replace(tA,n).replace(nA,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function oA(e){let t=iA.get(e);return t||(t=sA(e),iA.set(e,t)),t}function sA(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(rA,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var cA=/[\dA-Fa-f]/;function lA(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!cA.test(String.fromCharCode(t))?r:r+`;`}var uA=/\d/;function dA(e,t,n){let r=`&#`+String(e);return n&&t&&!uA.test(String.fromCharCode(t))?r:r+`;`}var fA=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),pA={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},mA=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],hA={}.hasOwnProperty,gA={},_A;for(_A in pA)hA.call(pA,_A)&&(gA[pA[_A]]=_A);var vA=/[^\dA-Za-z]/;function yA(e,t,n,r){let i=String.fromCharCode(e);if(hA.call(gA,i)){let e=gA[i],a=`&`+e;return n&&fA.includes(e)&&!mA.includes(e)&&(!r||t&&t!==61&&vA.test(String.fromCharCode(t)))?a:a+`;`}return``}function bA(e,t,n){let r=lA(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=yA(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=dA(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function xA(e,t){return aA(e,Object.assign({format:bA},t))}var SA=/^>|^->|<!--|-->|--!>|<!-$/g,CA=[`>`],wA=[`<`,`>`];function TA(e,t,n,r){return r.settings.bogusComments?`<?`+xA(e.value,Object.assign({},r.settings.characterReferences,{subset:CA}))+`>`:`<!--`+e.value.replace(SA,i)+`-->`;function i(e){return xA(e,Object.assign({},r.settings.characterReferences,{subset:wA}))}}function EA(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var DA=AA(1),OA=AA(-1),kA=[];function AA(e){return t;function t(t,n,r){let i=t?t.children:kA,a=(n||0)+e,o=i[a];if(!r)for(;o&&Dy(o);)a+=e,o=i[a];return o}}var jA={}.hasOwnProperty;function MA(e){return t;function t(t,n,r){return jA.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var NA=MA({body:IA,caption:PA,colgroup:PA,dd:BA,dt:zA,head:PA,html:FA,li:RA,optgroup:HA,option:UA,p:LA,rp:VA,rt:VA,tbody:GA,td:JA,tfoot:KA,th:JA,thead:WA,tr:qA});function PA(e,t,n){let r=DA(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Dy(r.value.charAt(0)))}function FA(e,t,n){let r=DA(n,t);return!r||r.type!==`comment`}function IA(e,t,n){let r=DA(n,t);return!r||r.type!==`comment`}function LA(e,t,n){let r=DA(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function RA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&r.tagName===`li`}function zA(e,t,n){let r=DA(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function BA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function VA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function HA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function UA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function WA(e,t,n){let r=DA(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function GA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function KA(e,t,n){return!DA(n,t)}function qA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function JA(e,t,n){let r=DA(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var YA=MA({body:QA,colgroup:$A,head:ZA,html:XA,tbody:ej});function XA(e){let t=DA(e,-1);return!t||t.type!==`comment`}function ZA(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function QA(e){let t=DA(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Dy(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function $A(e,t,n){let r=OA(n,t),i=DA(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&NA(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function ej(e,t,n){let r=OA(n,t),i=DA(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&NA(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var tj={name:[[`
|
|
146
|
+
\f\r &/=>`.split(``),`
|
|
147
|
+
\f\r "&'/=>\``.split(``)],[`\0
|
|
148
|
+
\f\r "&'/<=>`.split(``),`\0
|
|
149
|
+
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
150
|
+
\f\r &>`.split(``),`\0
|
|
151
|
+
\f\r "&'<=>\``.split(``)],[`\0
|
|
152
|
+
\f\r "&'<=>\``.split(``),`\0
|
|
153
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function nj(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=qo);let l=rj(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!YA(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!NA(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function rj(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=ij(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function ij(e,t,n){let r=Uo(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=xA(r.attribute,Object.assign({},e.settings.characterReferences,{subset:tj.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Yo:$o)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=xA(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:tj.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Pf(n,o)>Pf(n,e.alternative)&&(o=e.alternative),s=o+xA(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?tj.single:tj.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var aj=[`<`,`&`];function oj(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:xA(e.value,Object.assign({},r.settings.characterReferences,{subset:aj}))}function sj(e,t,n,r){return r.settings.allowDangerousHtml?e.value:oj(e,t,n,r)}function cj(e,t,n,r){return r.all(e)}var lj=ws(`type`,{invalid:uj,unknown:dj,handlers:{comment:TA,doctype:EA,element:nj,raw:sj,root:cj,text:oj}});function uj(e){throw Error("Expected node, not `"+e+"`")}function dj(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var fj={},pj={},mj=[];function hj(e,t){let n=t||fj,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:gj,all:_j,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Rs,characterReferences:n.characterReferences||pj,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?qo:Ko,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function gj(e,t,n){return lj(e,t,n,this)}function _j(e){let t=[],n=e&&e.children||mj,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var vj=/\s+/g;function yj(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(vj)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(vj);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function bj(e){let t=Sk(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var xj=[`color`,`background-color`];function Sj(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Cj(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function wj(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Cj(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return Sj(e,a)})):e}function Tj(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Ej(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&xj.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new jD('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Ej(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&QD.Italic&&(t[`font-style`]=`italic`),e.fontStyle&QD.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&QD.Underline&&n.push(`underline`),e.fontStyle&QD.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Dj(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Oj(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=bj(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new jD(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new jD(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new jD(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));kj(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return wj(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new jD(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Aj(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new jD(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new jD(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&yj(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function kj(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new jD(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new jD(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Aj(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Aj).join(``):``}var jj=[Oj()];function Mj(e){let t=Nj(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...jj]}function Nj(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Pj=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Fj={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ij(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Lj(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Rj(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Fj[r]&&t.push({type:`setDecoration`,value:Fj[r]});else if(r<=29){let e=Fj[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Pj[r-30]}});else if(r===38){let n=Lj(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Pj[r-40]}});else if(r===48){let n=Lj(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:Pj[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Pj[r-100+8]}})}}return t}function zj(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ij(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Rj(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Bj={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Vj(e=Bj){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Pj.length;e++)r.push(t(Pj[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Hj=/#([0-9a-f]{3,8})/i,Uj=/var\((--[\w-]+-ansi-[\w-]+)\)/,Wj={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Gj(e,t,n){let r=pk(e,n),i=Sk(t),a=Vj(Object.fromEntries(Pj.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Wj[t]]}))),o=zj();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=mk(i,r),o=mk(o,r),n.decorations.has(`dim`)&&(i=Kj(i));let s=QD.None;return n.decorations.has(`bold`)&&(s|=QD.Bold),n.decorations.has(`italic`)&&(s|=QD.Italic),n.decorations.has(`underline`)&&(s|=QD.Underline),n.decorations.has(`strikethrough`)&&(s|=QD.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Kj(e){let t=e.match(Hj);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Uj);return n?`var(${n[1]}-dim)`:e}function qj(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!_k(r)&&!yk(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Gj(r,t,n)}return Uk(e,t,n)}function Jj(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new jD("`themes` option must not be empty");let p=Qk(e,t,n,qj);if(c=Lk(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new jD(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Tj(e,h,u,l,d))),c&&Ik(a,c);let g=f.map(e=>pk(e.theme,n));i=Yj(f,m,g,u,l,`fg`,d),r=Yj(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=pk(n.theme,n);a=qj(e,t,n);let l=e.getTheme(n.theme);r=mk(l.bg,s),i=mk(l.fg,s),o=l.name,c=Lk(a)}else throw new jD("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Yj(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=mk(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new jD('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${mk(t[r][a],n[r])||`inherit`}, ${mk(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Xj=/^\s+$/,Zj=/^(\s*)(.*?)(\s*)$/;function Qj(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Qj(e,t,n),codeToTokens:(t,n)=>Jj(e,t,n)}){let i=t;for(let e of Mj(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Jj(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=eM(a):d===`never`&&(a=tM(a)),f&&(a=nM(a));let p={...r,get source(){return i}};for(let e of Mj(n))a=e.tokens?.call(p,a)||a;return $j(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function $j(e,t,n,r=Lk(e)){let i=Mj(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:yj,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
154
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Dj(a.htmlStyle||Ej(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Ik(m,r),m}function eM(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&QD.Underline||i.fontStyle&QD.Strikethrough));o&&Xj.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function tM(e){return e.map(e=>e.flatMap(e=>{if(Xj.test(e.content))return e;let t=e.content.match(Zj);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function nM(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Dj(e.htmlStyle||Ej(e)),i=Dj(n.htmlStyle||Ej(n)),a=e.fontStyle&&(e.fontStyle&QD.Underline||e.fontStyle&QD.Strikethrough),o=n.fontStyle&&(n.fontStyle&QD.Underline||n.fontStyle&QD.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var rM=hj;function iM(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Qj(e,t,n),codeToTokens:(t,n)=>Jj(e,t,n)},i=rM(Qj(e,t,n,r));for(let e of Mj(n))i=e.postprocess?.call(r,i,n)||i;return i}async function aM(e){let t=await Pk(e);return{getLastGrammarState:(...e)=>Wk(t,...e),codeToTokensBase:(e,n)=>qj(t,e,n),codeToTokensWithThemes:(e,n)=>Qk(t,e,n),codeToTokens:(e,n)=>Jj(t,e,n),codeToHast:(e,n)=>Qj(t,e,n),codeToHtml:(e,n)=>iM(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var oM=4294967295,sM=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:oM,end:oM,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function cM(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function lM(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var uM=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),dM=String.raw;function fM(e,t){if(e==null)throw Error(t??`Value expected`);return e}var pM=dM`\[\^?`,mM=`c.? | C(?:-.?)?|${dM`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${dM`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${dM`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${dM`o\{[^\}]*\}?`}|${dM`\d{1,3}`}`,hM=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,gM=new RegExp(dM`
|
|
155
|
+
\\ (?:
|
|
156
|
+
${mM}
|
|
157
|
+
| [gk]<[^>]*>?
|
|
158
|
+
| [gk]'[^']*'?
|
|
159
|
+
| .
|
|
160
|
+
)
|
|
161
|
+
| \( (?:
|
|
162
|
+
\? (?:
|
|
163
|
+
[:=!>({]
|
|
164
|
+
| <[=!]
|
|
165
|
+
| <[^>]*>
|
|
166
|
+
| '[^']*'
|
|
167
|
+
| ~\|?
|
|
168
|
+
| #(?:[^)\\]|\\.?)*
|
|
169
|
+
| [^:)]*[:)]
|
|
170
|
+
)?
|
|
171
|
+
| \*[^\)]*\)?
|
|
172
|
+
)?
|
|
173
|
+
| (?:${hM.source})+
|
|
174
|
+
| ${pM}
|
|
175
|
+
| .
|
|
176
|
+
`.replace(/\s+/g,``),`gsu`),_M=new RegExp(dM`
|
|
177
|
+
\\ (?:
|
|
178
|
+
${mM}
|
|
179
|
+
| .
|
|
180
|
+
)
|
|
181
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
182
|
+
| ${pM}
|
|
183
|
+
| &&
|
|
184
|
+
| .
|
|
185
|
+
`.replace(/\s+/g,``),`gsu`);function vM(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=JM(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(gM.lastIndex=0;s=gM.exec(e);){let t=yM(a,e,s[0],gM.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(gM.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?XM(e,u):e).flat(),flags:r}}function yM(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=bM(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:wM(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:RM(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:TM(n)}}if(a===`K`)return{token:MM(`keep`,n)};if(a===`N`||a===`R`)return{token:jM(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:jM(`any`,n)};if(a===`X`)return{token:jM(`text_segment`,n)};let e=SM(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:UM(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:HM(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:FM(`group`,n)};if(n===`(?>`)return{token:FM(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:FM(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:FM(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:FM(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:PM(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
|
186
|
+
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:jM(`dot`,n)}:n===`^`||n===`$`?{token:wM(e.singleline?{"^":dM`\A`,$:dM`\Z`}[n]:n,n)}:n===`|`?{token:CM(n)}:hM.test(n)?{tokens:ZM(n)}:{token:EM(cM(n),n)}}function bM(e,t,n){let r=[AM(t[1]===`^`,t)],i=1,a;for(_M.lastIndex=n;a=_M.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(AM(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(EM(93,e));else if(i--,r.push(DM(e)),!i)break}else{let t=xM(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:_M.lastIndex||e.length}}function xM(e){if(e[0]===`\\`)return SM(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!uM.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return jM(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?OM(e):e===`&&`?kM(e):EM(cM(e),e)}function SM(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return VM(e);if(`dDhHsSwW`.includes(n))return GM(e);if(e.startsWith(dM`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return KM(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return EM(cM(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return EM(YM(e),e);if(BM.has(n))return EM(BM.get(n),e);if(/\d/.test(n))return NM(t,e);if(e===`\\`)throw Error(dM`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return EM(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function CM(e){return{type:`Alternator`,raw:e}}function wM(e,t){return{type:`Assertion`,kind:e,raw:t}}function TM(e){return{type:`Backreference`,raw:e}}function EM(e,t){return{type:`Character`,value:e,raw:t}}function DM(e){return{type:`CharacterClassClose`,raw:e}}function OM(e){return{type:`CharacterClassHyphen`,raw:e}}function kM(e){return{type:`CharacterClassIntersector`,raw:e}}function AM(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function jM(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function MM(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:fM(n.flags),raw:t}}function NM(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function PM(e){return{type:`GroupClose`,raw:e}}function FM(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function IM(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function LM(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function RM(e){return{type:`Subroutine`,raw:e}}var zM=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),BM=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function VM(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return EM(cM(t.toUpperCase())-64,e)}function HM(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=qM(n),o=qM(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),MM(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,FM(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function UM(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=zM.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return IM(l,r??null,i?.split(`,`)??null,e)}function WM(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return LM(t,n,r,e)}function GM(e){let t=e[1].toLowerCase();return jM({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function KM(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return jM(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function qM(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function JM(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function YM(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function XM(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[TM(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(dM`Octal encoded byte above 177 unsupported "${n}"`)}else r=cM(t);a.push(EM(r,(e===0?`\\`:``)+t))}return a}function ZM(e){let t=[],n=new RegExp(hM,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(WM(e.slice(0,-1)));continue}}}t.push(WM(e))}return t}function QM(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function $M(e){return eN.has(e.type)}var eN=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function tN(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=vM(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return dN();case`Assertion`:return nN(n);case`Backreference`:return rN(n,a);case`Character`:return hN(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return iN(n,a,t);case`CharacterClassOpen`:return aN(n,a,t);case`CharacterSet`:return oN(n,a);case`Directive`:return yN(n.kind,{flags:n.flags});case`GroupOpen`:return sN(n,a,t);case`NamedCallout`:return CN(n.kind,n.tag,n.arguments);case`Quantifier`:return cN(n,a);case`Subroutine`:return lN(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=EN(bN(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(dM`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(dM`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function nN({kind:e}){return fN(fM({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===dM`\B`||e===dM`\Y`})}function rN({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,pN(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return pN(r)}return i(+r)}function iN(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),_N(o,e);throw Error(`Invalid character class range`)}return hN(cM(`-`))}function aN({negate:e},t,n){let{tokens:r,walk:i}=t,a=[gN()],o=r[t.nextIndex],s=LN(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(gN()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=LN(r[t.nextIndex],o)}let c=gN({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function oN({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=IN(n);if(uM.has(r)&&!o?.has(r))e=`posix`,n=r;else return ON(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?wN(n,{negate:t}):vN(e,{negate:t})}function sN(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=kN(e),l=c.type===`AbsenceFunction`,u=NN(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&lM(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=RN(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(dN()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(MN(t)||t.type===`CapturingGroup`)throw Error(e)}else if(MN(t)||NN(t)&&t.negate)throw Error(e)}}f=RN(r[t.nextIndex])}return t.nextIndex++,c}function cN({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!$M(a))throw Error(`Quantifier requires a repeatable token`);let o=TN(e,t,n,a);return i.body.pop(),o}function lN({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=DN(i);return r.push(o),o}function uN(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:AN(t?.body)}}function dN(e){return{type:`Alternative`,body:jN(e?.body)}}function fN(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function pN(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function mN(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!PN(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:AN(t?.body)}}function hN(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function gN(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:jN(e?.body)}}function _N(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function vN(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function yN(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:fM(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function bN(e){return{type:`Flags`,...e}}function xN(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:AN(e?.body)}}function SN(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:AN(e?.body)}}function CN(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function wN(e,t){let n=!!t?.negate;if(!uM.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function TN(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function EN(e,t){return{type:`Regex`,body:AN(t?.body),flags:e}}function DN(e){return{type:`Subroutine`,ref:e}}function ON(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(IN(e));if(!r){if(n.normalizeUnknownPropertyNames)r=FN(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(dM`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function kN({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return uN(`repeater`);case`atomic`:return xN({atomic:!0});case`capturing`:return mN(i,{name:n});case`group`:return xN({flags:e});case`lookahead`:case`lookbehind`:return SN({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function AN(e){if(e===void 0)e=[dN()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function jN(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function MN(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function NN(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function PN(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function FN(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function IN(e){return e.replace(/[- _]+/g,``).toLowerCase()}function LN(e,t){let n=t;return fM(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function RN(e){return fM(e,`Unclosed group`)}function zN(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){BN(c).splice(Math.max(0,VN(s)+l),1),l--,u=!0},removeAllNextSiblings(){return BN(c).splice(VN(s)+1)},removeAllPrevSiblings(){let e=VN(s)+l;return l-=e,BN(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,VN(s)+l)]=e:fM(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(BN(c).splice(Math.max(0,VN(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,VN(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function BN(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function VN(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var HN=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function UN(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function WN(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var GN=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function KN(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===GN.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?GN.CHAR_CLASS:GN.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function qN(e,t,n,r){KN(e,t,n,r)}function JN(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===GN.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function YN(e,t,n){return!!JN(e,t,0,n)}function XN(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var ZN=new RegExp(String.raw`(?<noncapturingStart>${HN})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function QN(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(ZN.lastIndex=Number.isNaN(c)?0:c+7;f=ZN.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),UN(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=KN(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},GN.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var $N=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,eP=new RegExp(String.raw`
|
|
187
|
+
\\(?: \d+
|
|
188
|
+
| c[A-Za-z]
|
|
189
|
+
| [gk]<[^>]+>
|
|
190
|
+
| [pPu]\{[^\}]+\}
|
|
191
|
+
| u[A-Fa-f\d]{4}
|
|
192
|
+
| x[A-Fa-f\d]{2}
|
|
193
|
+
)
|
|
194
|
+
| \((?: \? (?: [:=!>]
|
|
195
|
+
| <(?:[=!]|[^>]+>)
|
|
196
|
+
| [A-Za-z\-]+:
|
|
197
|
+
| \(DEFINE\)
|
|
198
|
+
))?
|
|
199
|
+
| (?<qBase>${$N})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
200
|
+
| \\?.
|
|
201
|
+
`.replace(/\s+/g,``),`gsu`);function tP(e){if(!RegExp(`${$N}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(eP.lastIndex=0;o=eP.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=WN(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}eP.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var nP=String.raw,rP=nP`\(\?R=(?<rDepth>[^\)]+)\)|${nP`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,iP=nP`\(\?<(?![=!])(?<captureName>[^>]+)>`,aP=nP`${iP}|(?<unnamed>\()(?!\?)`,oP=new RegExp(nP`${iP}|${rP}|\(\?|\\?.`,`gsu`),sP=`Cannot use multiple overlapping recursions`;function cP(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(rP,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&YN(e,nP`\(\?\(DEFINE\)`,GN.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=YN(e,nP`\\[1-9]`,GN.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(oP.lastIndex=0;f=oP.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(lP(m),l)throw Error(sP);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(oP.lastIndex);if(YN(s,rP,GN.DEFAULT))throw Error(sP);let c=m-1;e=uP(t,s,c,!1,n,a,d),i=pP(i,t,c,a.length,0,d);break}if(h){lP(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(sP);break}if(!u)throw Error(nP`Recursive \g cannot be used outside the referenced group "${r===`external`?h:nP`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=XN(e,p);if(o&&YN(m,nP`${iP}|\((?!\?)`,GN.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=uP(_,v,b,!0,n,a,d);i=pP(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,oP.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),oP.lastIndex),s.set(p,oP.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),oP.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function lP(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function uP(e,t,n,r,i,a,o){let s=new Set;r&&qN(e+t,iP,({groups:{captureName:e}})=>{s.add(e)},GN.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${dP(`(?:${e}`,`forward`,...c)}(?:)${dP(`${t})`,`backward`,...c)}${t}`}function dP(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=KN(e,nP`${aP}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),fP(i,n),s?e:`(?<${t}${l}>`}return nP`\k<${c}${l}>`},GN.DEFAULT)}return c}function fP(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function pP(e,t,n,r,i,a){if(e.size&&r){let o=0;qN(t,aP,()=>o++,GN.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var mP=String.fromCodePoint,Z=String.raw,hP={},gP=globalThis.RegExp;hP.flagGroups=(()=>{try{new gP(`(?i:)`)}catch{return!1}return!0})(),hP.unicodeSets=(()=>{try{new gP(`[[]]`,`v`)}catch{return!1}return!0})(),hP.bugFlagVLiteralHyphenIsRange=hP.unicodeSets?(()=>{try{new gP(Z`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,hP.bugNestedClassIgnoresNegation=hP.unicodeSets&&new gP(`[[^a]]`,`v`).test(`a`);function _P(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function vP(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function yP(e,t){return xP[e]>=xP[t]}function bP(e,t){if(e==null)throw Error(t??`Value expected`);return e}var xP={ES2025:2025,ES2024:2024,ES2018:2018},SP={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function CP(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!SP[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=hP.flagGroups?`ES2025`:hP.unicodeSets?`ES2024`:`ES2018`),t}var wP=`[ -\r ]`,TP=new Set([mP(304),mP(305)]),EP=Z`[\p{L}\p{M}\p{N}\p{Pc}]`;function DP(e){if(TP.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=jP.get(n),a=kP.get(n),o=AP.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var OP=new Map(`C Other
|
|
202
|
+
Cc Control cntrl
|
|
203
|
+
Cf Format
|
|
204
|
+
Cn Unassigned
|
|
205
|
+
Co Private_Use
|
|
206
|
+
Cs Surrogate
|
|
207
|
+
L Letter
|
|
208
|
+
LC Cased_Letter
|
|
209
|
+
Ll Lowercase_Letter
|
|
210
|
+
Lm Modifier_Letter
|
|
211
|
+
Lo Other_Letter
|
|
212
|
+
Lt Titlecase_Letter
|
|
213
|
+
Lu Uppercase_Letter
|
|
214
|
+
M Mark Combining_Mark
|
|
215
|
+
Mc Spacing_Mark
|
|
216
|
+
Me Enclosing_Mark
|
|
217
|
+
Mn Nonspacing_Mark
|
|
218
|
+
N Number
|
|
219
|
+
Nd Decimal_Number digit
|
|
220
|
+
Nl Letter_Number
|
|
221
|
+
No Other_Number
|
|
222
|
+
P Punctuation punct
|
|
223
|
+
Pc Connector_Punctuation
|
|
224
|
+
Pd Dash_Punctuation
|
|
225
|
+
Pe Close_Punctuation
|
|
226
|
+
Pf Final_Punctuation
|
|
227
|
+
Pi Initial_Punctuation
|
|
228
|
+
Po Other_Punctuation
|
|
229
|
+
Ps Open_Punctuation
|
|
230
|
+
S Symbol
|
|
231
|
+
Sc Currency_Symbol
|
|
232
|
+
Sk Modifier_Symbol
|
|
233
|
+
Sm Math_Symbol
|
|
234
|
+
So Other_Symbol
|
|
235
|
+
Z Separator
|
|
236
|
+
Zl Line_Separator
|
|
237
|
+
Zp Paragraph_Separator
|
|
238
|
+
Zs Space_Separator
|
|
239
|
+
ASCII
|
|
240
|
+
ASCII_Hex_Digit AHex
|
|
241
|
+
Alphabetic Alpha
|
|
242
|
+
Any
|
|
243
|
+
Assigned
|
|
244
|
+
Bidi_Control Bidi_C
|
|
245
|
+
Bidi_Mirrored Bidi_M
|
|
246
|
+
Case_Ignorable CI
|
|
247
|
+
Cased
|
|
248
|
+
Changes_When_Casefolded CWCF
|
|
249
|
+
Changes_When_Casemapped CWCM
|
|
250
|
+
Changes_When_Lowercased CWL
|
|
251
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
252
|
+
Changes_When_Titlecased CWT
|
|
253
|
+
Changes_When_Uppercased CWU
|
|
254
|
+
Dash
|
|
255
|
+
Default_Ignorable_Code_Point DI
|
|
256
|
+
Deprecated Dep
|
|
257
|
+
Diacritic Dia
|
|
258
|
+
Emoji
|
|
259
|
+
Emoji_Component EComp
|
|
260
|
+
Emoji_Modifier EMod
|
|
261
|
+
Emoji_Modifier_Base EBase
|
|
262
|
+
Emoji_Presentation EPres
|
|
263
|
+
Extended_Pictographic ExtPict
|
|
264
|
+
Extender Ext
|
|
265
|
+
Grapheme_Base Gr_Base
|
|
266
|
+
Grapheme_Extend Gr_Ext
|
|
267
|
+
Hex_Digit Hex
|
|
268
|
+
IDS_Binary_Operator IDSB
|
|
269
|
+
IDS_Trinary_Operator IDST
|
|
270
|
+
ID_Continue IDC
|
|
271
|
+
ID_Start IDS
|
|
272
|
+
Ideographic Ideo
|
|
273
|
+
Join_Control Join_C
|
|
274
|
+
Logical_Order_Exception LOE
|
|
275
|
+
Lowercase Lower
|
|
276
|
+
Math
|
|
277
|
+
Noncharacter_Code_Point NChar
|
|
278
|
+
Pattern_Syntax Pat_Syn
|
|
279
|
+
Pattern_White_Space Pat_WS
|
|
280
|
+
Quotation_Mark QMark
|
|
281
|
+
Radical
|
|
282
|
+
Regional_Indicator RI
|
|
283
|
+
Sentence_Terminal STerm
|
|
284
|
+
Soft_Dotted SD
|
|
285
|
+
Terminal_Punctuation Term
|
|
286
|
+
Unified_Ideograph UIdeo
|
|
287
|
+
Uppercase Upper
|
|
288
|
+
Variation_Selector VS
|
|
289
|
+
White_Space space
|
|
290
|
+
XID_Continue XIDC
|
|
291
|
+
XID_Start XIDS`.split(/\s/).map(e=>[IN(e),e])),kP=new Map([[`s`,mP(383)],[mP(383),`s`]]),AP=new Map([[mP(223),mP(7838)],[mP(107),mP(8490)],[mP(229),mP(8491)],[mP(969),mP(8486)]]),jP=new Map([PP(453),PP(456),PP(459),PP(498),...FP(8072,8079),...FP(8088,8095),...FP(8104,8111),PP(8124),PP(8140),PP(8188)]),MP=new Map([[`alnum`,Z`[\p{Alpha}\p{Nd}]`],[`alpha`,Z`\p{Alpha}`],[`ascii`,Z`\p{ASCII}`],[`blank`,Z`[\p{Zs}\t]`],[`cntrl`,Z`\p{Cc}`],[`digit`,Z`\p{Nd}`],[`graph`,Z`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Z`\p{Lower}`],[`print`,Z`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Z`[\p{P}\p{S}]`],[`space`,Z`\p{space}`],[`upper`,Z`\p{Upper}`],[`word`,Z`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Z`\p{AHex}`]]);function NP(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function PP(e){let t=mP(e);return[t.toLowerCase(),t]}function FP(e,t){return NP(e,t).map(e=>PP(e))}var IP=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function LP(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};VP(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:yP(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};zN(e,RP,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return zN(e,zP,a),zN(e,BP,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var RP={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=xN();e.body[0].body.push(SN({negate:!0,body:r}),ON(`Any`));let i=xN();i.body[0].body.push(TN(`greedy`,0,1/0,e)),n(oF(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];vP(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=JP(t.get(e));if(n){let t=xN({flags:n});t.body[0].body=e.body,e.body=[oF(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(oF(SN({body:[dN({body:[fN(`string_end`)]}),dN({body:[hN(10)]})]}),t));else if(c===`line_start`)o(oF(rF(Z`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&eF(e))o(oF(SN({negate:!0}),t));else if(d)throw Error(Z`Uses "\G" in a way that requires a subclass`);else o(aF(fN(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(oF(rF(Z`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${EP})(?!${EP})|(?<!${EP})(?=${EP}))`,n=`(?:(?<=${EP})(?=${EP})|(?<!${EP})(?!${EP}))`;o(oF(rF(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!nF(n)&&(n=qP(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!nF(r)&&(r=qP(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(oF(gN({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(aF(vN(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(oF(iF(rF(wP),l),t));return}if(s&&(c===`word`||u===`word`)){n(aF(vN(`word`,{negate:l}),t));return}if(c===`any`)n(aF(ON(`Any`),t));else if(c===`digit`)n(aF(ON(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Z`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Z`\p{RI}{2}|${e}(?:\u200D${e})*`;n(oF(rF(Z`(?>\r\n|${i?Z`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(aF(ON(`AHex`,{negate:l}),t));else if(c===`newline`)n(oF(rF(l?`[^
|
|
292
|
+
]`:`(?>\r
|
|
293
|
+
?|[
|
|
294
|
+
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${mP(e.codePointAt(0)-1)}${mP(e.codePointAt(2)+1)}-\u{10FFFF}`),n(oF(rF(`[${e}]`),t))}else n(oF(iF(rF(MP.get(u)),l),t))}else if(c===`property`)OP.has(IN(u))||(e.key=`sc`);else if(c===`space`)n(aF(ON(`space`,{negate:l}),t));else if(c===`word`)n(oF(iF(rF(EP),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=xN({flags:c});e.body[0].body=o(),i(oF(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&QM(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=SN({behind:!0});o.body[0].body=a(),i(oF(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(oF(SN({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=xN();t.body[0].body.push(e.body),e.body=oF(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=ZP(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!nF(n)&&(n=qP(n,t),e.ref=n)}},zP={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=aF(GP(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&vP(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=vP(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=_P(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?GP(0):WP(o,r.groupOriginByCopy,null),l=c;if(!s){let e=JP(KP(o,e=>e.type===`Group`&&!!e.flags)),t=e?_P(r.globalFlags,e):r.globalFlags;HP(t,r.currentFlags)||(l=xN({flags:YP(t)}),l.body[0].body.push(c))}n(oF(l,t),{traverse:!s})}},BP={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>UP(t,e));i.length?i.length>1?n(oF(xN({atomic:!0,body:i.reverse().map(e=>dN({body:[pN(e.number)]}))}),t)):e.ref=i[0].number:n(oF(SN({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=mN();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function VP(e){zN(e,{"*"({node:e,parent:t}){e.parent=t}})}function HP(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function UP(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=XP(n.parent);for(let r of t){if(r===n)break;if(r===e||QP(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function WP(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=WP(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function GP(e){let t=DN(e);return t.isRecursive=!0,t}function KP(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function qP(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function JP(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function YP({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function XP(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function ZP(e){let t=e.find(e=>e.kind===`search_start`||tF(e,{negate:!1})||!$P(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=ZP(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function QP(e,t){let n=XP(e)??[];for(let e of n)if(e===t||QP(e,t))return!0;return!1}function $P({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function eF(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function tF(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&QM(e.body[0],{type:`Assertion`,kind:`search_start`})}function nF(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function rF(e,t){let n=tN(e,{...t,unicodePropertyMap:OP}).body;return n.length>1||n[0].body.length>1?xN({body:n}):n[0].body[0]}function iF(e,t){return e.negate=t,e}function aF(e,t){return e.parent=t,e}function oF(e,t){return VP(e),e.parent=t,e}function sF(e,t){let n=CP(t),r=yP(n.target,`ES2024`),i=yP(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];zN(e,cF,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,bP(lF[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&vP(f._captureTransfers,e.transferTo,[]).push(t)}),f}var cF={"*":{enter({node:e},t){if(xF(e)){let n=t.getCurrentModI();t.pushModI(e.flags?_P({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){xF(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){hF(mP(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),gF(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&IP.has(e.value)&&t.setHasCasedChar()}},lF={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=mP(e),r=_F(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&hF(n)){let e=DP(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);hP.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(CF)&&(o=[hN(45),...o.filter(e=>!CF(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||hP.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=xN(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=dN({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(hP.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=_F(n,i),o=_F(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&vF(gF(e)).forEach(e=>{s.add(Array.isArray(e)?`${_F(e[0],i)}-${_F(e[1],i)}`:_F(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&IP.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=_P(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${yF(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+bF(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},uF=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),dF=new Set([`-`,`\\`,`]`,`^`,`[`]),fF=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),pF=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),mF=/^\p{Cased}$/u;function hF(e){return mF.test(e)}function gF(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=mP(e);if(!hF(t))continue;let o=DP(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function _F(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(pF.has(e))return pF.get(e);if(e<32||e>126&&e<160||e>262143||t&&SF(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?fF:dF:uF,a=mP(e);return(i.has(a)?`\\`:``)+a}function vF(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function yF(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function bF({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function xF({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function SF(e){return e>47&&e<58}function CF({type:e,value:t}){return e===`Character`&&t===45}var wF=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=EF(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(TF(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=DF(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function TF(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function EF(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)vP(n,t,{}).transferTo=e;return n}function DF(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function OF(e,t){let n=kF(e,t);return n.options?new wF(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function kF(e,t){let n=CP(t),r=LP(tN(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:OP}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=sF(r,n),a=cP(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=QN(tP(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function AF(e,t){return OF(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function jF(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>AF(e,{target:t.target}),{createScanner(e){return new sM(e,t)},createString(e){return{content:e}}}}var MF=e=>e&&e&1,NF=e=>e&&e&2,PF=e=>e&&e&4,FF=new Set([`bash`,`css`,`diff`,`html`,`javascript`,`json`,`jsonc`,`jsx`,`markdown`,`python`,`shellscript`,`tsx`,`typescript`,`yaml`]),IF={bash:()=>Fe(()=>import(`./bash-B7CDPTg5.js`).then(e=>e.default),__vite__mapDeps([22,23]),import.meta.url),css:()=>Fe(()=>import(`./css-BsVw1vtW.js`).then(e=>e.default),[],import.meta.url),diff:()=>Fe(()=>import(`./diff-woXpYk--.js`).then(e=>e.default),[],import.meta.url),html:()=>Fe(()=>import(`./html-BY76lXLH.js`).then(e=>e.default),__vite__mapDeps([24,25,26]),import.meta.url),javascript:()=>Fe(()=>import(`./javascript-BgS3c2Ky.js`).then(e=>e.default),[],import.meta.url),json:()=>Fe(()=>import(`./json-qhed-kSA.js`).then(e=>e.default),[],import.meta.url),jsonc:()=>Fe(()=>import(`./jsonc-CYpm1nAK.js`).then(e=>e.default),[],import.meta.url),jsx:()=>Fe(()=>import(`./jsx-Bz0zcwM4.js`).then(e=>e.default),[],import.meta.url),markdown:()=>Fe(()=>import(`./markdown-BYOwaDjH.js`).then(e=>e.default),[],import.meta.url),python:()=>Fe(()=>import(`./python-gzcpVVnB.js`).then(e=>e.default),[],import.meta.url),shellscript:()=>Fe(()=>import(`./shellscript-CLZ0U2zV.js`).then(e=>e.default),[],import.meta.url),tsx:()=>Fe(()=>import(`./tsx-udAQXfEw.js`).then(e=>e.default),[],import.meta.url),typescript:()=>Fe(()=>import(`./typescript-bsJCZSQ-.js`).then(e=>e.default),[],import.meta.url),yaml:()=>Fe(()=>import(`./yaml-rwi0_p6S.js`).then(e=>e.default),[],import.meta.url)},LF={console:`shellscript`,cjs:`javascript`,htm:`html`,js:`javascript`,json5:`jsonc`,md:`markdown`,mjs:`javascript`,py:`python`,sh:`shellscript`,shell:`shellscript`,ts:`typescript`,yml:`yaml`},RF=e=>{let t=e.trim().toLowerCase();if(!t)return`text`;let n=LF[t]??t;return FF.has(n)?n:`text`},zF=e=>e.map((e,t)=>({key:`line-${t}`,tokens:e.map((e,n)=>({key:`line-${t}-${n}`,token:e}))})),BF=({token:e})=>(0,M.jsx)(`span`,{className:`dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)!`,style:{backgroundColor:e.bgColor,color:e.color,fontStyle:MF(e.fontStyle)?`italic`:void 0,fontWeight:NF(e.fontStyle)?`bold`:void 0,textDecoration:PF(e.fontStyle)?`underline`:void 0,...e.htmlStyle},children:e.content}),VF=j(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-8`,`before:mr-4`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),HF=({keyedLine:e,showLineNumbers:t})=>(0,M.jsx)(`span`,{className:t?VF:`block`,children:e.tokens.length===0?`
|
|
295
|
+
`:e.tokens.map(({token:e,key:t})=>(0,M.jsx)(BF,{token:e},t))}),UF=(0,N.createContext)({code:``}),WF,GF,KF=new Map,qF=new Map,JF=new Map,YF=(e,t)=>{let n=e.slice(0,100),r=e.length>100?e.slice(-100):``;return`${t}:${e.length}:${n}:${r}`},XF=()=>(WF||=aM({engine:jF({forgiving:!0})}),WF),ZF=e=>(GF||=Promise.all([Fe(()=>import(`./github-light-EUqPIrTm.js`).then(e=>e.default),[],import.meta.url),Fe(()=>import(`./github-dark-C-LZuMrd.js`).then(e=>e.default),[],import.meta.url)]).then(t=>e.loadTheme(...t)),GF),QF=(e,t)=>{let n=KF.get(t);if(n)return n;let r=IF[t]().then(t=>e.loadLanguage(...t));return KF.set(t,r),r},$F=e=>({bg:`transparent`,fg:`inherit`,tokens:e.split(`
|
|
296
|
+
`).map(e=>e===``?[]:[{color:`inherit`,content:e}])}),eI=(e,t,n)=>{let r=RF(t);if(r===`text`)return $F(e);let i=YF(e,r);return qF.get(i)||(n&&(JF.has(i)||JF.set(i,new Set),JF.get(i)?.add(n)),XF().then(async t=>{await ZF(t),await QF(t,r);let n=t.codeToTokens(e,{lang:r,themes:{dark:`github-dark`,light:`github-light`}}),a={bg:n.bg??`transparent`,fg:n.fg??`inherit`,tokens:n.tokens};qF.set(i,a);let o=JF.get(i);if(o){for(let e of o)e(a);JF.delete(i)}}).catch(e=>{console.error(`Failed to highlight code:`,e),JF.delete(i)}),null)},tI=(0,N.memo)(({tokenized:e,showLineNumbers:t,className:n})=>{let r=(0,N.useMemo)(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),i=(0,N.useMemo)(()=>zF(e.tokens),[e.tokens]);return(0,M.jsx)(`pre`,{className:j(`dark:bg-(--shiki-dark-bg)! dark:text-(--shiki-dark)! m-0 p-4 text-sm`,n),style:r,children:(0,M.jsx)(`code`,{className:j(`font-mono text-sm`,t&&`[counter-increment:line_0] [counter-reset:line]`),children:i.map(e=>(0,M.jsx)(HF,{keyedLine:e,showLineNumbers:t},e.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);tI.displayName=`CodeBlockBody`;var nI=({className:e,language:t,style:n,...r})=>(0,M.jsx)(`div`,{className:j(`group relative w-full overflow-hidden rounded-sm border bg-background text-foreground`,e),"data-language":t,style:{containIntrinsicSize:`auto 200px`,contentVisibility:`auto`,...n},...r}),rI=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`flex items-center justify-between border-b bg-muted/80 px-3 py-2 text-muted-foreground text-xs`,t),...n,children:e}),iI=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`flex items-center gap-2`,t),...n,children:e}),aI=({children:e,className:t,...n})=>(0,M.jsx)(`span`,{className:j(`font-mono`,t),...n,children:e}),oI=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`-my-1 -mr-1 flex items-center gap-2`,t),...n,children:e}),sI=({code:e,language:t,showLineNumbers:n=!1})=>{let r=(0,N.useMemo)(()=>$F(e),[e]),i=(0,N.useMemo)(()=>eI(e,t)??r,[e,t,r]),a=(0,N.useMemo)(()=>({code:e,language:t}),[e,t]),[o,s]=(0,N.useState)({key:a,tokens:null}),c=o.key===a?o.tokens:null;return(0,N.useEffect)(()=>{let n=!1;return eI(e,t,e=>{n||s({key:a,tokens:e})}),()=>{n=!0}},[e,t,a]),(0,M.jsx)(`div`,{className:`relative overflow-auto`,children:(0,M.jsx)(tI,{showLineNumbers:n,tokenized:c??i})})},cI=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let o=(0,N.useMemo)(()=>({code:e}),[e]);return(0,M.jsx)(UF.Provider,{value:o,children:(0,M.jsxs)(nI,{className:r,language:t,...a,children:[i,(0,M.jsx)(sI,{code:e,language:t,showLineNumbers:n})]})})},lI=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,...a})=>{let[o,s]=(0,N.useState)(!1),c=(0,N.useRef)(0),{code:l}=(0,N.useContext)(UF),u=(0,N.useCallback)(async()=>{if(typeof window>`u`||!navigator?.clipboard?.writeText){t?.(Error(`Clipboard API not available`));return}try{o||(await navigator.clipboard.writeText(l),s(!0),e?.(),c.current=window.setTimeout(()=>s(!1),n))}catch(e){t?.(e)}},[l,e,t,n,o]);(0,N.useEffect)(()=>()=>{window.clearTimeout(c.current)},[]);let d=o?g:je;return(0,M.jsx)(A,{className:j(`shrink-0`,i),onClick:u,size:`icon`,variant:`ghost`,...a,children:r??(0,M.jsx)(d,{size:14})})},uI=/(?:^|\s)language-([^\s]+)/,dI=/startLine=(\d+)/,fI=/\bnoLineNumbers\b/;function pI(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(pI).join(``):(0,N.isValidElement)(e)?pI(e.props.children):``}var mI={code:({children:e,className:t,node:n,"data-block":r,...i})=>{let a=t?.match(uI)?.[1]??`text`;if(!r)return(0,M.jsx)(`code`,{className:j(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),...i,children:e});let o=n?.properties?.metastring,s=typeof o==`string`?o:void 0,c=s?.match(dI),l=c?Number.parseInt(c[1],10):1,u=!s||!fI.test(s);return(0,M.jsx)(cI,{code:pI(e),"data-start-line":l>1?l:void 0,language:a,showLineNumbers:u,children:(0,M.jsxs)(rI,{children:[(0,M.jsx)(iI,{children:(0,M.jsx)(aI,{children:a})}),(0,M.jsx)(oI,{children:(0,M.jsx)(lI,{})})]})})}},hI={cjk:Ua,mermaid:qn()},gI=(0,N.memo)(({className:e,components:t,...n})=>{let r=t?{...mI,...t}:mI;return(0,M.jsx)(OD,{className:e,components:r,plugins:hI,...n})});gI.displayName=`HubStreamdown`;var _I=({className:e,from:t,...n})=>(0,M.jsx)(`div`,{className:j(`group flex w-full flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n}),vI=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`is-user:dark flex w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`,t),...n,children:e});(0,N.createContext)(null);var yI=(0,N.memo)(({className:e,...t})=>(0,M.jsx)(gI,{className:j(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),...t}));yI.displayName=`MessageResponse`;var bI=1,xI=.9,SI=.8,CI=.17,wI=.1,TI=.999,EI=.9999,DI=.99,OI=/[\\\/_+.#"@\[\(\{&]/,kI=/[\\\/_+.#"@\[\(\{&]/g,AI=/[\s-]/,jI=/[\s-]/g;function MI(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?bI:DI;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=MI(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=bI:OI.test(e.charAt(l-1))?(d*=SI,p=e.slice(i,l-1).match(kI),p&&i>0&&(d*=TI**+p.length)):AI.test(e.charAt(l-1))?(d*=xI,m=e.slice(i,l-1).match(jI),m&&i>0&&(d*=TI**+m.length)):(d*=CI,i>0&&(d*=TI**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=EI)),(d<wI&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=MI(e,t,n,r,l+1,a+2,o),f*wI>d&&(d=f*wI)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function NI(e){return e.toLowerCase().replace(jI,` `)}function PI(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,MI(e,t,NI(e),NI(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function FI(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function II(e,t){let n=N.createContext(t),r=e=>{let{children:t,...r}=e,i=N.useMemo(()=>r,Object.values(r));return(0,M.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=N.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function LI(e,t=[]){let n=[];function r(t,r){let i=N.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=N.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=N.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>N.createContext(e));return function(n){let r=n?.[e]||t;return N.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,RI(i,...t)]}function RI(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var zI=globalThis?.document?N.useLayoutEffect:()=>{},BI=N.useId||(()=>void 0),VI=0;function HI(e){let[t,n]=N.useState(BI());return zI(()=>{e||n(e=>e??String(VI++))},[e]),e||(t?`radix-${t}`:``)}var UI=N.useInsertionEffect||zI;function WI({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=GI({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=N.useRef(e!==void 0);N.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,N.useCallback(t=>{if(s){let n=KI(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function GI({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return UI(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function KI(e){return typeof e==`function`}function qI(e){let t=JI(e),n=N.forwardRef((e,n)=>{let{children:r,...i}=e,a=N.Children.toArray(r),o=a.find(XI);if(o){let e=o.props.children,r=a.map(t=>t===o?N.Children.count(e)>1?N.Children.only(null):N.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:N.isValidElement(e)?N.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function JI(e){let t=N.forwardRef((e,t)=>{let{children:n,...r}=e;if(N.isValidElement(n)){let e=QI(n),i=ZI(r,n.props);return n.type!==N.Fragment&&(i.ref=t?ht(t,e):e),N.cloneElement(n,i)}return N.Children.count(n)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YI=Symbol(`radix.slottable`);function XI(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===YI}function ZI(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function QI(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $I=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=qI(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function eL(e,t){e&&pt.flushSync(()=>e.dispatchEvent(t))}function tL(e){let t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...e)=>t.current?.(...e),[])}function nL(e,t=globalThis?.document){let n=tL(e);N.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var rL=`DismissableLayer`,iL=`dismissableLayer.update`,aL=`dismissableLayer.pointerDownOutside`,oL=`dismissableLayer.focusOutside`,sL,cL=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lL=N.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=N.useContext(cL),[u,d]=N.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=N.useState({}),m=gt(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=fL(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=pL(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return nL(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),N.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(sL=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),mL(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=sL)}},[u,f,n,l]),N.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),mL())},[u,l]),N.useEffect(()=>{let e=()=>p({});return document.addEventListener(iL,e),()=>document.removeEventListener(iL,e)},[]),(0,M.jsx)($I.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:FI(e.onFocusCapture,S.onFocusCapture),onBlurCapture:FI(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:FI(e.onPointerDownCapture,x.onPointerDownCapture)})});lL.displayName=rL;var uL=`DismissableLayerBranch`,dL=N.forwardRef((e,t)=>{let n=N.useContext(cL),r=N.useRef(null),i=gt(t,r);return N.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,M.jsx)($I.div,{...e,ref:i})});dL.displayName=uL;function fL(e,t=globalThis?.document){let n=tL(e),r=N.useRef(!1),i=N.useRef(()=>{});return N.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){hL(aL,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pL(e,t=globalThis?.document){let n=tL(e),r=N.useRef(!1);return N.useEffect(()=>{let e=e=>{e.target&&!r.current&&hL(oL,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function mL(){let e=new CustomEvent(iL);document.dispatchEvent(e)}function hL(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?eL(i,a):i.dispatchEvent(a)}var gL=`focusScope.autoFocusOnMount`,_L=`focusScope.autoFocusOnUnmount`,vL={bubbles:!1,cancelable:!0},yL=`FocusScope`,bL=N.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=N.useState(null),l=tL(i),u=tL(a),d=N.useRef(null),f=gt(t,e=>c(e)),p=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:DL(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||DL(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&DL(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),N.useEffect(()=>{if(s){OL.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(gL,vL);s.addEventListener(gL,l),s.dispatchEvent(t),t.defaultPrevented||(xL(jL(CL(s)),{select:!0}),document.activeElement===e&&DL(s))}return()=>{s.removeEventListener(gL,l),setTimeout(()=>{let t=new CustomEvent(_L,vL);s.addEventListener(_L,u),s.dispatchEvent(t),t.defaultPrevented||DL(e??document.body,{select:!0}),s.removeEventListener(_L,u),OL.remove(p)},0)}}},[s,l,u,p]);let m=N.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=SL(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&DL(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&DL(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)($I.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});bL.displayName=yL;function xL(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(DL(r,{select:t}),document.activeElement!==n)return}function SL(e){let t=CL(e);return[wL(t,e),wL(t.reverse(),e)]}function CL(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wL(e,t){for(let n of e)if(!TL(n,{upTo:t}))return n}function TL(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function EL(e){return e instanceof HTMLInputElement&&`select`in e}function DL(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&EL(e)&&t&&e.select()}}var OL=kL();function kL(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=AL(e,t),e.unshift(t)},remove(t){e=AL(e,t),e[0]?.resume()}}}function AL(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function jL(e){return e.filter(e=>e.tagName!==`A`)}var ML=`Portal`,NL=N.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=N.useState(!1);zI(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?pt.createPortal((0,M.jsx)($I.div,{...r,ref:t}),o):null});NL.displayName=ML;function PL(e,t){return N.useReducer((e,n)=>t[e][n]??e,e)}var FL=e=>{let{present:t,children:n}=e,r=IL(t),i=typeof n==`function`?n({present:r.isPresent}):N.Children.only(n),a=gt(r.ref,RL(i));return typeof n==`function`||r.isPresent?N.cloneElement(i,{ref:a}):null};FL.displayName=`Presence`;function IL(e){let[t,n]=N.useState(),r=N.useRef(null),i=N.useRef(e),a=N.useRef(`none`),[o,s]=PL(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return N.useEffect(()=>{let e=LL(r.current);a.current=o===`mounted`?e:`none`},[o]),zI(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=LL(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),zI(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=LL(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=LL(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:N.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function LL(e){return e?.animationName||`none`}function RL(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var zL=0;function BL(){N.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??VL()),document.body.insertAdjacentElement(`beforeend`,e[1]??VL()),zL++,()=>{zL===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),zL--}},[])}function VL(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var HL=function(){return HL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},HL.apply(this,arguments)};function UL(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function WL(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var GL=`right-scroll-bar-position`,KL=`width-before-scroll-bar`,qL=`with-scroll-bars-hidden`,JL=`--removed-body-scroll-bar-size`;function YL(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function XL(e,t){var n=(0,N.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ZL=typeof window<`u`?N.useLayoutEffect:N.useEffect,QL=new WeakMap;function $L(e,t){var n=XL(t||null,function(t){return e.forEach(function(e){return YL(e,t)})});return ZL(function(){var t=QL.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||YL(e,null)}),i.forEach(function(e){r.has(e)||YL(e,a)})}QL.set(n,e)},[e]),n}function eR(e){return e}function tR(e,t){t===void 0&&(t=eR);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function nR(e){e===void 0&&(e={});var t=tR(null);return t.options=HL({async:!0,ssr:!1},e),t}var rR=function(e){var t=e.sideCar,n=UL(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return N.createElement(r,HL({},n))};rR.isSideCarExport=!0;function iR(e,t){return e.useMedium(t),rR}var aR=nR(),oR=function(){},sR=N.forwardRef(function(e,t){var n=N.useRef(null),r=N.useState({onScrollCapture:oR,onWheelCapture:oR,onTouchMoveCapture:oR}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=UL(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=$L([n,t]),C=HL(HL({},b),i);return N.createElement(N.Fragment,null,u&&N.createElement(x,{sideCar:aR,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?N.cloneElement(N.Children.only(s),HL(HL({},C),{ref:S})):N.createElement(v,HL({},C,{className:c,ref:S}),s))});sR.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sR.classNames={fullWidth:KL,zeroRight:GL};var cR=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function lR(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=cR();return t&&e.setAttribute(`nonce`,t),e}function uR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dR(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var fR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lR())&&(uR(t,n),dR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pR=function(){var e=fR();return function(t,n){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mR=function(){var e=pR();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},hR={left:0,top:0,right:0,gap:0},gR=function(e){return parseInt(e||``,10)||0},_R=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[gR(n),gR(r),gR(i)]},vR=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return hR;var t=_R(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yR=mR(),bR=`data-scroll-locked`,xR=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
297
|
+
.${qL} {
|
|
298
|
+
overflow: hidden ${r};
|
|
299
|
+
padding-right: ${s}px ${r};
|
|
300
|
+
}
|
|
301
|
+
body[${bR}] {
|
|
302
|
+
overflow: hidden ${r};
|
|
303
|
+
overscroll-behavior: contain;
|
|
304
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
305
|
+
padding-left: ${i}px;
|
|
306
|
+
padding-top: ${a}px;
|
|
307
|
+
padding-right: ${o}px;
|
|
308
|
+
margin-left:0;
|
|
309
|
+
margin-top:0;
|
|
310
|
+
margin-right: ${s}px ${r};
|
|
311
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.${GL} {
|
|
315
|
+
right: ${s}px ${r};
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.${KL} {
|
|
319
|
+
margin-right: ${s}px ${r};
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.${GL} .${GL} {
|
|
323
|
+
right: 0 ${r};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.${KL} .${KL} {
|
|
327
|
+
margin-right: 0 ${r};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
body[${bR}] {
|
|
331
|
+
${JL}: ${s}px;
|
|
332
|
+
}
|
|
333
|
+
`},SR=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},CR=function(){N.useEffect(function(){return document.body.setAttribute(bR,(SR()+1).toString()),function(){var e=SR()-1;e<=0?document.body.removeAttribute(bR):document.body.setAttribute(bR,e.toString())}},[])},wR=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;CR();var a=N.useMemo(function(){return vR(i)},[i]);return N.createElement(yR,{styles:xR(a,!t,i,n?``:`!important`)})},TR=!1;if(typeof window<`u`)try{var ER=Object.defineProperty({},"passive",{get:function(){return TR=!0,!0}});window.addEventListener(`test`,ER,ER),window.removeEventListener(`test`,ER,ER)}catch{TR=!1}var DR=TR?{passive:!1}:!1,OR=function(e){return e.tagName===`TEXTAREA`},kR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!OR(e)&&n[t]===`visible`)},AR=function(e){return kR(e,`overflowY`)},jR=function(e){return kR(e,`overflowX`)},MR=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),FR(e,r)){var i=IR(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},NR=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},PR=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},FR=function(e,t){return e===`v`?AR(t):jR(t)},IR=function(e,t){return e===`v`?NR(t):PR(t)},LR=function(e,t){return e===`h`&&t===`rtl`?-1:1},RR=function(e,t,n,r,i){var a=LR(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=IR(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&FR(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},zR=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BR=function(e){return[e.deltaX,e.deltaY]},VR=function(e){return e&&`current`in e?e.current:e},HR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UR=function(e){return`
|
|
334
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
335
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
336
|
+
`},WR=0,GR=[];function KR(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(WR++)[0],a=N.useState(mR)[0],o=N.useRef(e);N.useEffect(function(){o.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=WL([e.lockRef.current],(e.shards||[]).map(VR),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=N.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=zR(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=MR(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=MR(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return RR(h,t,e,h===`h`?s:c,!0)},[]),c=N.useCallback(function(e){var n=e;if(!(!GR.length||GR[GR.length-1]!==a)){var r=`deltaY`in n?BR(n):zR(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&HR(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(VR).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=N.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:qR(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=N.useCallback(function(e){n.current=zR(e),r.current=void 0},[]),d=N.useCallback(function(t){l(t.type,BR(t),t.target,s(t,e.lockRef.current))},[]),f=N.useCallback(function(t){l(t.type,zR(t),t.target,s(t,e.lockRef.current))},[]);N.useEffect(function(){return GR.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,DR),document.addEventListener(`touchmove`,c,DR),document.addEventListener(`touchstart`,u,DR),function(){GR=GR.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,DR),document.removeEventListener(`touchmove`,c,DR),document.removeEventListener(`touchstart`,u,DR)}},[]);var p=e.removeScrollBar,m=e.inert;return N.createElement(N.Fragment,null,m?N.createElement(a,{styles:UR(i)}):null,p?N.createElement(wR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var JR=iR(aR,KR),YR=N.forwardRef(function(e,t){return N.createElement(sR,HL({},e,{ref:t,sideCar:JR}))});YR.classNames=sR.classNames;var XR=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ZR=new WeakMap,QR=new WeakMap,$R={},ez=0,tz=function(e){return e&&(e.host||tz(e.parentNode))},nz=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=tz(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},rz=function(e,t,n,r){var i=nz(t,Array.isArray(e)?e:[e]);$R[n]||($R[n]=new WeakMap);var a=$R[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(ZR.get(e)||0)+1,l=(a.get(e)||0)+1;ZR.set(e,c),a.set(e,l),o.push(e),c===1&&i&&QR.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ez++,function(){o.forEach(function(e){var t=ZR.get(e)-1,i=a.get(e)-1;ZR.set(e,t),a.set(e,i),t||(QR.has(e)||e.removeAttribute(r),QR.delete(e)),i||e.removeAttribute(n)}),ez--,ez||(ZR=new WeakMap,ZR=new WeakMap,QR=new WeakMap,$R={})}},iz=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||XR(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),rz(r,i,n,`aria-hidden`)):function(){return null}},az=`Dialog`,[oz,sz]=LI(az),[cz,lz]=oz(az),uz=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=N.useRef(null),c=N.useRef(null),[l,u]=WI({prop:r,defaultProp:i??!1,onChange:a,caller:az});return(0,M.jsx)(cz,{scope:t,triggerRef:s,contentRef:c,contentId:HI(),titleId:HI(),descriptionId:HI(),open:l,onOpenChange:u,onOpenToggle:N.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};uz.displayName=az;var dz=`DialogTrigger`,fz=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=lz(dz,n),a=gt(t,i.triggerRef);return(0,M.jsx)($I.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Mz(i.open),...r,ref:a,onClick:FI(e.onClick,i.onOpenToggle)})});fz.displayName=dz;var pz=`DialogPortal`,[mz,hz]=oz(pz,{forceMount:void 0}),gz=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=lz(pz,t);return(0,M.jsx)(mz,{scope:t,forceMount:n,children:N.Children.map(r,e=>(0,M.jsx)(FL,{present:n||a.open,children:(0,M.jsx)(NL,{asChild:!0,container:i,children:e})}))})};gz.displayName=pz;var _z=`DialogOverlay`,vz=N.forwardRef((e,t)=>{let n=hz(_z,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=lz(_z,e.__scopeDialog);return a.modal?(0,M.jsx)(FL,{present:r||a.open,children:(0,M.jsx)(bz,{...i,ref:t})}):null});vz.displayName=_z;var yz=qI(`DialogOverlay.RemoveScroll`),bz=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=lz(_z,n);return(0,M.jsx)(YR,{as:yz,allowPinchZoom:!0,shards:[i.contentRef],children:(0,M.jsx)($I.div,{"data-state":Mz(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),xz=`DialogContent`,Sz=N.forwardRef((e,t)=>{let n=hz(xz,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=lz(xz,e.__scopeDialog);return(0,M.jsx)(FL,{present:r||a.open,children:a.modal?(0,M.jsx)(Cz,{...i,ref:t}):(0,M.jsx)(wz,{...i,ref:t})})});Sz.displayName=xz;var Cz=N.forwardRef((e,t)=>{let n=lz(xz,e.__scopeDialog),r=N.useRef(null),i=gt(t,n.contentRef,r);return N.useEffect(()=>{let e=r.current;if(e)return iz(e)},[]),(0,M.jsx)(Tz,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:FI(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:FI(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:FI(e.onFocusOutside,e=>e.preventDefault())})}),wz=N.forwardRef((e,t)=>{let n=lz(xz,e.__scopeDialog),r=N.useRef(!1),i=N.useRef(!1);return(0,M.jsx)(Tz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Tz=N.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=lz(xz,n),c=N.useRef(null),l=gt(t,c);return BL(),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(bL,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,M.jsx)(lL,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Mz(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Iz,{titleId:s.titleId}),(0,M.jsx)(Rz,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Ez=`DialogTitle`,Dz=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=lz(Ez,n);return(0,M.jsx)($I.h2,{id:i.titleId,...r,ref:t})});Dz.displayName=Ez;var Oz=`DialogDescription`,kz=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=lz(Oz,n);return(0,M.jsx)($I.p,{id:i.descriptionId,...r,ref:t})});kz.displayName=Oz;var Az=`DialogClose`,jz=N.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=lz(Az,n);return(0,M.jsx)($I.button,{type:`button`,...r,ref:t,onClick:FI(e.onClick,()=>i.onOpenChange(!1))})});jz.displayName=Az;function Mz(e){return e?`open`:`closed`}var Nz=`DialogTitleWarning`,[Pz,Fz]=II(Nz,{contentName:xz,titleName:Ez,docsSlug:`dialog`}),Iz=({titleId:e})=>{let t=Fz(Nz),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
337
|
+
|
|
338
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
339
|
+
|
|
340
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Lz=`DialogDescriptionWarning`,Rz=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fz(Lz).contentName}}.`;return N.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},zz=uz,Bz=gz,Vz=vz,Hz=Sz,Uz=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=xt(`Primitive.${t}`),r=N.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Wz=`[cmdk-group=""]`,Gz=`[cmdk-group-items=""]`,Kz=`[cmdk-group-heading=""]`,qz=`[cmdk-item=""]`,Jz=`${qz}:not([aria-disabled="true"])`,Yz=`cmdk-item-select`,Xz=`data-value`,Zz=(e,t,n)=>PI(e,t,n),Qz=N.createContext(void 0),$z=()=>N.useContext(Qz),eB=N.createContext(void 0),tB=()=>N.useContext(eB),nB=N.createContext(void 0),rB=N.forwardRef((e,t)=>{let n=_B(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=_B(()=>new Set),i=_B(()=>new Map),a=_B(()=>new Map),o=_B(()=>new Set),s=hB(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=HI(),y=HI(),b=HI(),x=N.useRef(null),S=bB();gB(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),gB(()=>{S(6,te)},[]);let C=N.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)D(),E(),S(1,ee);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=O()?.id,C.emit()}),r||S(5,te),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=N.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{D(),E(),n.current.value||ee(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();S(4,()=>{D(),t?.getAttribute(`id`)===e&&ee(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??Zz;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;ne().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Gz);t?t.appendChild(e.parentElement===t?e:e.closest(`${Gz} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Gz} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Wz}[${Xz}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function ee(){let e=ne().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Xz);C.setState(`value`,e||void 0)}function D(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function te(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Wz)?.querySelector(Kz))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return x.current?.querySelector(`${qz}[aria-selected="true"]`)}function ne(){return Array.from(x.current?.querySelectorAll(Jz)||[])}function k(e){let t=ne()[e];t&&C.setState(`value`,t.getAttribute(Xz))}function re(e){var t;let n=O(),r=ne(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(Xz))}function ie(e){let t=O()?.closest(Wz),n;for(;t&&!n;)t=e>0?pB(t,Wz):mB(t,Wz),n=t?.querySelector(Jz);n?C.setState(`value`,n.getAttribute(Xz)):re(e)}let ae=()=>k(ne().length-1),oe=e=>{e.preventDefault(),e.metaKey?ae():e.altKey?ie(1):re(1)},se=e=>{e.preventDefault(),e.metaKey?k(0):e.altKey?ie(-1):re(-1)};return N.createElement(Uz.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&oe(e);break;case`ArrowDown`:oe(e);break;case`p`:case`k`:g&&e.ctrlKey&&se(e);break;case`ArrowUp`:se(e);break;case`Home`:e.preventDefault(),k(0);break;case`End`:e.preventDefault(),ae();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(Yz);t.dispatchEvent(e)}}}}},N.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:CB},c),SB(e,e=>N.createElement(eB.Provider,{value:C},N.createElement(Qz.Provider,{value:w},e))))}),iB=N.forwardRef((e,t)=>{let n=HI(),r=N.useRef(null),i=N.useContext(nB),a=$z(),o=hB(e),s=o.current?.forceMount??i?.forceMount;gB(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=yB(n,r,[e.value,e.children,r],e.keywords),l=tB(),u=vB(e=>e.value&&e.value===c.current),d=vB(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);N.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(Yz,f),()=>t.removeEventListener(Yz,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return N.createElement(Uz.div,{ref:ht(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),aB=N.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=HI(),s=N.useRef(null),c=N.useRef(null),l=HI(),u=$z(),d=vB(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));gB(()=>u.group(o),[]),yB(o,s,[e.value,e.heading,c]);let f=N.useMemo(()=>({id:o,forceMount:i}),[i]);return N.createElement(Uz.div,{ref:ht(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&N.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),SB(e,e=>N.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},N.createElement(nB.Provider,{value:f},e))))}),oB=N.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=N.useRef(null),a=vB(e=>!e.search);return!n&&!a?null:N.createElement(Uz.div,{ref:ht(i,t),...r,"cmdk-separator":``,role:`separator`})}),sB=N.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=tB(),o=vB(e=>e.search),s=vB(e=>e.selectedItemId),c=$z();return N.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),N.createElement(Uz.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),cB=N.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=N.useRef(null),o=N.useRef(null),s=vB(e=>e.selectedItemId),c=$z();return N.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),N.createElement(Uz.div,{ref:ht(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},SB(e,e=>N.createElement(`div`,{ref:ht(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),lB=N.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return N.createElement(zz,{open:n,onOpenChange:r},N.createElement(Bz,{container:o},N.createElement(Vz,{"cmdk-overlay":``,className:i}),N.createElement(Hz,{"aria-label":e.label,"cmdk-dialog":``,className:a},N.createElement(rB,{ref:t,...s}))))}),uB=N.forwardRef((e,t)=>vB(e=>e.filtered.count===0)?N.createElement(Uz.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),dB=N.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return N.createElement(Uz.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},SB(e,e=>N.createElement(`div`,{"aria-hidden":!0},e)))}),fB=Object.assign(rB,{List:cB,Item:iB,Input:sB,Group:aB,Separator:oB,Dialog:lB,Empty:uB,Loading:dB});function pB(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function mB(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hB(e){let t=N.useRef(e);return gB(()=>{t.current=e}),t}var gB=typeof window>`u`?N.useEffect:N.useLayoutEffect;function _B(e){let t=N.useRef();return t.current===void 0&&(t.current=e()),t}function vB(e){let t=tB(),n=()=>e(t.snapshot());return N.useSyncExternalStore(t.subscribe,n,n)}function yB(e,t,n,r=[]){let i=N.useRef(),a=$z();return gB(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Xz,s),i.current=s}),i}var bB=()=>{let[e,t]=N.useState(),n=_B(()=>new Map);return gB(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function xB(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function SB({asChild:e,children:t},n){return e&&N.isValidElement(t)?N.cloneElement(xB(t),{ref:t.ref},n(t.props.children)):n(t)}var CB={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function wB({className:e,...t}){return(0,M.jsx)(fB,{"data-slot":`command`,className:j(`flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground`,e),...t})}function TB({className:e,...t}){return(0,M.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,M.jsxs)(Ce,{className:`h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!`,children:[(0,M.jsx)(fB.Input,{"data-slot":`command-input`,className:j(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,M.jsx)(Ee,{children:(0,M.jsx)(h,{className:`size-4 shrink-0 opacity-50`})})]})})}function EB({className:e,...t}){return(0,M.jsx)(fB.List,{"data-slot":`command-list`,className:j(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function DB({className:e,...t}){return(0,M.jsx)(fB.Empty,{"data-slot":`command-empty`,className:j(`py-6 text-center text-sm`,e),...t})}function OB({className:e,...t}){return(0,M.jsx)(fB.Group,{"data-slot":`command-group`,className:j(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function kB({className:e,children:t,...n}){return(0,M.jsxs)(fB.Item,{"data-slot":`command-item`,className:j(`group/command-item relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,M.jsx)(g,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}var AB=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},jB=async e=>await new Promise(t=>{let n=new FileReader;n.onloadend=()=>t(n.result??null),n.onerror=()=>t(null),n.readAsDataURL(e)}),MB=(0,N.createContext)(null),NB=(0,N.createContext)(null),PB=()=>{let e=(0,N.useContext)(MB);if(!e)throw Error(`Wrap your component inside <PromptInputProvider> to use usePromptInputController().`);return e},FB=()=>(0,N.useContext)(MB),IB=()=>(0,N.useContext)(NB),LB=({initialInput:e=``,children:t})=>{let[n,r]=(0,N.useState)(e),i=(0,N.useCallback)(()=>r(``),[]),[a,o]=(0,N.useState)([]),s=(0,N.useRef)(null),c=(0,N.useRef)(()=>{}),l=(0,N.useCallback)(e=>{let t=[...e];t.length!==0&&o(e=>[...e,...t.map(e=>({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)}))])},[]),u=(0,N.useCallback)(e=>{o(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)})},[]),d=(0,N.useCallback)(()=>{o(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]})},[]),f=(0,N.useRef)(a);(0,N.useEffect)(()=>{f.current=a},[a]),(0,N.useEffect)(()=>()=>{for(let e of f.current)e.url&&URL.revokeObjectURL(e.url)},[]);let p=(0,N.useCallback)(()=>{c.current?.()},[]),m=(0,N.useMemo)(()=>({add:l,clear:d,fileInputRef:s,files:a,openFileDialog:p,remove:u}),[a,l,u,d,p]),h=(0,N.useCallback)((e,t)=>{s.current=e.current,c.current=t},[]),g=(0,N.useMemo)(()=>({__registerFileInput:h,attachments:m,textInput:{clear:i,setInput:r,value:n}}),[n,i,m,h]);return(0,M.jsx)(MB.Provider,{value:g,children:(0,M.jsx)(NB.Provider,{value:m,children:t})})},RB=(0,N.createContext)(null),zB=()=>{let e=IB(),t=(0,N.useContext)(RB)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},BB=(0,N.createContext)(null),VB=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=FB(),f=!!d,p=(0,N.useRef)(null),m=(0,N.useRef)(null),[h,g]=(0,N.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,N.useState)([]),b=(0,N.useRef)(_);(0,N.useEffect)(()=>{b.current=_},[_]);let x=(0,N.useCallback)(()=>{p.current?.click()},[]),S=(0,N.useCallback)(e=>!t||t.trim()===``||t.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[t]),C=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:Pt(),mediaType:e.type,rawFile:e,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,N.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),T=(0,N.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!o||e.size<=o);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=_.length,c=typeof a==`number`?Math.max(0,a-i):void 0,l=typeof c==`number`?r.slice(0,c):r;typeof c==`number`&&r.length>c&&s?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&d?.attachments.add(l)},[S,o,a,s,_.length,d]),E=(0,N.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),ee=(0,N.useCallback)(()=>y([]),[]),D=f?T:C,te=f?d.attachments.remove:w,O=f?d.attachments.openFileDialog:x,ne=(0,N.useCallback)(()=>{E(),ee()},[E,ee]);(0,N.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,N.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,N.useEffect)(()=>{let e=m.current;if(!e||r)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[D,r]),(0,N.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[D,r]),(0,N.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let k=(0,N.useCallback)(e=>{e.currentTarget.files&&D(e.currentTarget.files),e.currentTarget.value=``},[D]),re=(0,N.useMemo)(()=>({add:D,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:O,remove:te}),[_,D,te,E,O]),ie=(0,N.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:Pt()}))])},clear:ee,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,ee]),ae=(0,N.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:new FormData(t).get(`message`)||``;f||t.reset();try{let t=c({files:await Promise.all(_.map(async({id:e,rawFile:t,...n})=>{if(t){let e=await jB(t);return{...n,url:e??n.url}}if(n.url?.startsWith(`blob:`)){let e=await AB(n.url);return{...n,url:e??n.url}}return n})),text:n},e);if(t instanceof Promise)try{await t,ne(),f&&d.textInput.clear()}catch{}else ne(),f&&d.textInput.clear()}catch{}},[f,d,_,c,ne]),oe=(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:k,ref:p,title:`Upload files`,type:`file`}),(0,M.jsx)(`form`,{className:j(`w-full`,e),onSubmit:ae,ref:m,...u,children:(0,M.jsx)(Ce,{className:`overflow-hidden`,children:l})})]}),se=(0,M.jsx)(BB.Provider,{value:ie,children:oe});return(0,M.jsx)(RB.Provider,{value:re,children:se})},HB=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`contents`,e),...t}),UB=({onChange:e,onKeyDown:t,className:n,placeholder:r=`How can I help you?`,...i})=>{let a=FB(),o=zB(),[s,c]=(0,N.useState)(!1),l=(0,N.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),u=(0,N.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),d=(0,N.useCallback)(()=>c(!1),[]),f=(0,N.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,M.jsx)(we,{className:j(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},WB=({className:e,...t})=>(0,M.jsx)(Ee,{align:`block-end`,className:j(`order-first flex-wrap gap-1`,e),...t}),GB=({className:e,...t})=>(0,M.jsx)(Ee,{align:`block-end`,className:j(`justify-between gap-1`,e),...t}),KB=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex min-w-0 items-center gap-1`,e),...t}),qB=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(N.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,M.jsx)(be,{className:j(t),size:a,type:`button`,variant:e,...i});if(!r)return o;let s=typeof r==`string`?r:r.content,c=typeof r==`string`?void 0:r.shortcut,l=typeof r==`string`?`top`:r.side??`top`;return(0,M.jsxs)(Ie,{children:[(0,M.jsx)(Re,{children:o}),(0,M.jsxs)(Ve,{side:l,children:[s,c&&(0,M.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},JB=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,l=(0,M.jsx)(Ze,{className:`size-3`});r===`submitted`?l=(0,M.jsx)(We,{}):r===`streaming`?l=(0,M.jsx)(lt,{className:`size-3`}):r===`error`&&(l=(0,M.jsx)(le,{className:`size-3`}));let u=(0,N.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,M.jsx)(be,{"aria-label":c?`Stop`:`Submit`,className:j(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})},YB=globalThis?.document?N.useLayoutEffect:()=>{},XB=Object.defineProperty,ZB=(e,t)=>XB(e,`name`,{value:t,configurable:!0}),QB=N.useEffectEvent,$B=N.useInsertionEffect;function eV(e){if(typeof QB==`function`)return QB(e);let t=N.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof $B==`function`?$B(()=>{t.current=e}):YB(()=>{t.current=e}),N.useMemo(()=>((...e)=>t.current?.(...e)),[])}ZB(eV,`useEffectEvent`);var tV=Object.defineProperty,nV=(e,t)=>tV(e,`name`,{value:t,configurable:!0}),rV=N.useInsertionEffect||YB;function iV({prop:e,defaultProp:t,onChange:n=nV(()=>{},`onChange`),caller:r}){let[i,a,o]=aV({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,N.useCallback(t=>{if(s){let n=oV(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}nV(iV,`useControllableState`);function aV({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return rV(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}nV(aV,`useUncontrolledState`);function oV(e){return typeof e==`function`}nV(oV,`isFunction`);var sV=Symbol(`RADIX:SYNC_STATE`);function cV(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=eV(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=N.useReducer((t,n)=>{if(n.type===sV)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=N.useRef(p);N.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=N.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return N.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:sV,state:i})},[i,d.state,c]),[h,f]}nV(cV,`useControllableStateReducer`);function lV(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=d({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=ce(a,!0,!0),u=p(),[f,m]=N.useState(),h=f===null?void 0:f??u,g=w(e=>{let t=!a,n=oe(D,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return N.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:g,mounted:s,open:a,panelId:h,setMounted:c,setOpen:o,setPanelIdState:m,transitionStatus:l}),[u,i,g,s,a,h,c,o,m,l])}var uV=N.createContext(void 0);function dV(){let e=N.useContext(uV);if(e===void 0)throw Error(T(15));return e}var fV=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=x.startingStyle]=`startingStyle`,e[e.endingStyle=x.endingStyle]=`endingStyle`,e}({}),pV=function(e){return e.panelOpen=`data-panel-open`,e}({}),mV={[fV.open]:``},hV={[fV.closed]:``},gV={open(e){return e?{[pV.panelOpen]:``}:null}},_V={open(e){return e?mV:hV},...S},vV=N.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,d=w(o),f=lV({open:s,defaultOpen:i,onOpenChange:d,disabled:a}),p=N.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),m=N.useMemo(()=>({...f,onOpenChange:d,state:p}),[f,d,p]),h=u(`div`,e,{state:p,ref:t,props:l,stateAttributesMapping:_V});return(0,M.jsx)(uV.Provider,{value:m,children:h})}),yV={...gV,...S},bV=N.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=dV(),{className:s,disabled:c=o,render:l,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=ee({disabled:c,focusableWhenDisabled:!0,native:d});return u(`button`,e,{state:a,ref:[t,h],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},p,m],stateAttributesMapping:yV})}),xV={height:void 0,width:void 0};function SV(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=N.useRef(null),f=N.useRef(null),[p,m]=N.useState(xV),h=N.useRef(xV),g=N.useRef(!1),_=N.useRef(s),v=N.useRef(!1),[b,x]=N.useState(!1),S=N.useRef(null),T=ie(t,d),E=ne(s),ee=se(d),D=!s&&!a,O=b?`idle`:u,ae=s&&(_.current||v.current),A=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,ce=n&&D&&f.current!==`css-animation`,j=w((e,t=!0)=>{t&&(h.current=e),m(e)}),le=w(()=>{S.current?.(),S.current=null}),ue=w(e=>{le(),S.current=()=>{S.current=null,e()}}),de=w(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});k(()=>{!b||u===`starting`||x(!1)},[b,u]),N.useEffect(()=>()=>{de(),le()},[de,le]),k(()=>{let e=d.current;if(!e)return;!s&&S.current&&le();let t=wV(e,ae);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=CV(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){j(CV(e)),x(!0);return}if(t===`css-transition`){let t=DV(e);if(j(CV(e)),!n)return t;let r=EV(e,`transition-duration`,`0s`);return ue(r),x(!0),t}j(CV(e));let r=EV(e,`animation-name`,`none`);if(!n){r();return}let i=EV(e,`animation-duration`,`0s`);r(),ue(i),x(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(_.current=!1,v.current=!1,t===`none`){j(xV,!1),c(!1);return}j(CV(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=CV(e);if(!(n.height>0||n.width>0)){c(!1);return}j(n),t===`css-animation`&&EV(e,`animation-name`,`none`)()},[a,s,le,j,c,ue,ae,u]),C({enabled:s&&a&&O===`idle`,open:!0,ref:d,onComplete(){s&&j(xV,!1)}}),N.useEffect(()=>{if(s||!a||O!==`ending`||!d.current)return;let e=new AbortController,t=-1;function n(){E.current||(c(!1),j(xV,!1))}return t=re.request(()=>{ee(n,e.signal)}),()=>{re.cancel(t),e.abort()}},[E,a,s,O,ee,j,c]),k(()=>{let e=d.current;!e||!n||!D||e.setAttribute(`hidden`,`until-found`)},[D,n]),N.useEffect(function(){let e=d.current;if(!e)return;function t(e){let t=oe(y,e);o(!0,t),!t.isCanceled&&(g.current=!0,l(!0))}return te(e,`beforematch`,t)},[o,l]);let fe=i||n||a||s;return{height:A.height,props:{...ce?{[fV.startingStyle]:``}:void 0,hidden:D,id:r},ref:T,shouldPreventOpenAnimation:ae,shouldRender:fe,transitionStatus:O,width:A.width}}function CV(e){return{height:e.scrollHeight,width:e.scrollWidth}}function wV(e,t){let n=b(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&TV(n.animationDuration),i=TV(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function TV(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function EV(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function DV(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=re.request(n);return()=>{re.cancel(r),n()}}var OV=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),kV=N.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:d,onOpenChange:f,open:p,setMounted:h,setPanelIdState:g,setOpen:_,state:v,transitionStatus:y}=dV(),b=r??!1,x=i??!1,S=o||void 0,C=S??l;k(()=>(g(e=>S??(e===null?void 0:e)),()=>{g(e=>e===S?null:e)}),[S,g]);let{height:w,props:T,ref:E,shouldPreventOpenAnimation:ee,shouldRender:D,transitionStatus:te,width:O}=SV({externalRef:t,hiddenUntilFound:b,id:C,keepMounted:x,mounted:d,onOpenChange:f,open:p,setMounted:h,setOpen:_,transitionStatus:y}),ne={...v,transitionStatus:te},re=m(s,ne),ie=u(`div`,{...e,style:void 0},{state:ne,ref:E,props:[T,{style:{[OV.collapsiblePanelHeight]:w===void 0?`auto`:`${w}px`,[OV.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c,re?{style:re}:void 0,ee?{style:{animationName:`none`}}:void 0],stateAttributesMapping:_V});return D?ie:null});function AV({...e}){return(0,M.jsx)(vV,{"data-slot":`collapsible`,...e})}function jV({...e}){return(0,M.jsx)(bV,{"data-slot":`collapsible-trigger`,...e})}function MV({...e}){return(0,M.jsx)(kV,{"data-slot":`collapsible-content`,...e})}var NV=(0,N.createContext)({});function PV(e){let t=(0,N.useRef)(null);return t.current===null&&(t.current=e()),t.current}var FV=typeof window<`u`?N.useLayoutEffect:N.useEffect,IV=(0,N.createContext)(null);function LV(e,t){e.indexOf(t)===-1&&e.push(t)}function RV(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var zV=(e,t,n)=>n>t?t:n<e?e:n,BV={},VV=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),HV=e=>typeof e==`object`&&!!e,UV=e=>/^0[^.\s]+$/u.test(e);function WV(e){let t;return()=>(t===void 0&&(t=e()),t)}var GV=e=>e,KV=(...e)=>e.reduce((e,t)=>n=>t(e(n))),qV=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},JV=class{constructor(){this.subscriptions=[]}add(e){return LV(this.subscriptions,e),()=>RV(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},YV=e=>e*1e3,XV=e=>e/1e3,ZV=(e,t)=>t?1e3/t*e:0,QV=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$V=1e-7,eH=12;function tH(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=QV(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>$V&&++s<eH);return o}function nH(e,t,n,r){if(e===t&&n===r)return GV;let i=t=>tH(t,0,1,e,n);return e=>e===0||e===1?e:QV(i(e),t,r)}var rH=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iH=e=>t=>1-e(1-t),aH=nH(.33,1.53,.69,.99),oH=iH(aH),sH=rH(oH),cH=e=>e>=1?1:(e*=2)<1?.5*oH(e):.5*(2-2**(-10*(e-1))),lH=e=>1-Math.sin(Math.acos(e)),uH=iH(lH),dH=rH(lH),fH=nH(.42,0,1,1),pH=nH(0,0,.58,1),mH=nH(.42,0,.58,1),hH=e=>Array.isArray(e)&&typeof e[0]!=`number`,gH=e=>Array.isArray(e)&&typeof e[0]==`number`,_H={linear:GV,easeIn:fH,easeInOut:mH,easeOut:pH,circIn:lH,circInOut:dH,circOut:uH,backIn:oH,backInOut:sH,backOut:aH,anticipate:cH},vH=e=>typeof e==`string`,yH=e=>{if(gH(e)){e.length;let[t,n,r,i]=e;return nH(t,n,r,i)}return vH(e)?(_H[e],`${e}`,_H[e]):e},bH=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function xH(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var SH=40;function CH(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=bH.reduce((e,t)=>(e[t]=xH(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=BV.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,SH),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:bH.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<bH.length;t++)o[bH[t]].cancel(e)},state:i,steps:o}}var{schedule:wH,cancel:TH,state:EH,steps:DH}=CH(typeof requestAnimationFrame<`u`?requestAnimationFrame:GV,!0),OH;function kH(){OH=void 0}var AH={now:()=>(OH===void 0&&AH.set(EH.isProcessing||BV.useManualTiming?EH.timestamp:performance.now()),OH),set:e=>{OH=e,queueMicrotask(kH)}},jH=e=>t=>typeof t==`string`&&t.startsWith(e),MH=jH(`--`),NH=jH(`var(--`),PH=e=>NH(e)?FH.test(e.split(`/*`)[0].trim()):!1,FH=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function IH(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var LH={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},RH={...LH,transform:e=>zV(0,1,e)},zH={...LH,default:1},BH=e=>Math.round(e*1e5)/1e5,VH=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function HH(e){return e==null}var UH=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,WH=(e,t)=>n=>!!(typeof n==`string`&&UH.test(n)&&n.startsWith(e)||t&&!HH(n)&&Object.prototype.hasOwnProperty.call(n,t)),GH=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(VH);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},KH=e=>zV(0,255,e),qH={...LH,transform:e=>Math.round(KH(e))},JH={test:WH(`rgb`,`red`),parse:GH(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+qH.transform(e)+`, `+qH.transform(t)+`, `+qH.transform(n)+`, `+BH(RH.transform(r))+`)`};function YH(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var XH={test:WH(`#`),parse:YH,transform:JH.transform},ZH=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),QH=ZH(`deg`),$H=ZH(`%`),Q=ZH(`px`),eU=ZH(`vh`),tU=ZH(`vw`),nU={...$H,parse:e=>$H.parse(e)/100,transform:e=>$H.transform(e*100)},rU={test:WH(`hsl`,`hue`),parse:GH(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+$H.transform(BH(t))+`, `+$H.transform(BH(n))+`, `+BH(RH.transform(r))+`)`},iU={test:e=>JH.test(e)||XH.test(e)||rU.test(e),parse:e=>JH.test(e)?JH.parse(e):rU.test(e)?rU.parse(e):XH.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?JH.transform(e):rU.transform(e),getAnimatableNone:e=>{let t=iU.parse(e);return t.alpha=0,iU.transform(t)}},aU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oU(e){return isNaN(e)&&typeof e==`string`&&(e.match(VH)?.length||0)+(e.match(aU)?.length||0)>0}var sU=`number`,cU=`color`,lU=`var`,uU=`var(`,dU="${}",fU=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pU(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(fU,e=>(iU.test(e)?(r.color.push(a),i.push(cU),n.push(iU.parse(e))):e.startsWith(uU)?(r.var.push(a),i.push(lU),n.push(e)):(r.number.push(a),i.push(sU),n.push(parseFloat(e))),++a,dU)).split(dU),indexes:r,types:i}}function mU(e){return pU(e).values}function hU({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===sU?BH(r[a]):e===cU?iU.transform(r[a]):r[a]}return i}}function gU(e){return hU(pU(e))}var _U=e=>typeof e==`number`?0:iU.test(e)?iU.getAnimatableNone(e):e,vU=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:_U(e);function yU(e){let t=pU(e);return hU(t)(t.values.map((e,n)=>vU(e,t.split[n])))}var bU={test:oU,parse:mU,createTransformer:gU,getAnimatableNone:yU};function xU(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function SU({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=xU(s,r,e+1/3),a=xU(s,r,e),o=xU(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function CU(e,t){return n=>n>0?t:e}var wU=(e,t,n)=>e+(t-e)*n,TU=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},EU=[XH,JH,rU],DU=e=>EU.find(t=>t.test(e));function OU(e){let t=DU(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===rU&&(n=SU(n)),n}var kU=(e,t)=>{let n=OU(e),r=OU(t);if(!n||!r)return CU(e,t);let i={...n};return e=>(i.red=TU(n.red,r.red,e),i.green=TU(n.green,r.green,e),i.blue=TU(n.blue,r.blue,e),i.alpha=wU(n.alpha,r.alpha,e),JH.transform(i))},AU=new Set([`none`,`hidden`]);function jU(e,t){return AU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function MU(e,t){return n=>wU(e,t,n)}function NU(e){return typeof e==`number`?MU:typeof e==`string`?PH(e)?CU:iU.test(e)?kU:LU:Array.isArray(e)?PU:typeof e==`object`?iU.test(e)?kU:FU:CU}function PU(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>NU(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function FU(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=NU(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function IU(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var LU=(e,t)=>{let n=bU.createTransformer(t),r=pU(e),i=pU(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?AU.has(e)&&!i.values.length||AU.has(t)&&!r.values.length?jU(e,t):KV(PU(IU(r,i),i.values),n):(`${e}${t}`,CU(e,t))};function RU(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?wU(e,t,n):NU(e)(e,t)}var zU=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>wH.update(t,e),stop:()=>TH(t),now:()=>EH.isProcessing?EH.timestamp:AH.now()}},BU=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},VU=2e4;function HU(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function UU(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(HU(r),VU);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:XV(i)}}var WU={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function GU(e,t){return e*Math.sqrt(1-t*t)}var KU=12;function qU(e,t,n){let r=n;for(let n=1;n<KU;n++)r-=e(r)/t(r);return r}var JU=.001;function YU({duration:e=WU.duration,bounce:t=WU.bounce,velocity:n=WU.velocity,mass:r=WU.mass}){let i,a;WU.maxDuration;let o=1-t;o=zV(WU.minDamping,WU.maxDamping,o),e=zV(WU.minDuration,WU.maxDuration,XV(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=GU(t,o),c=Math.exp(-i);return JU-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=GU(t**2,o);return(-i(t)+JU>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=qU(i,a,s);if(e=YV(e),isNaN(c))return{stiffness:WU.stiffness,damping:WU.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var XU=[`duration`,`bounce`],ZU=[`stiffness`,`damping`,`mass`];function QU(e,t){return t.some(t=>e[t]!==void 0)}function $U(e){let t={velocity:WU.velocity,stiffness:WU.stiffness,damping:WU.damping,mass:WU.mass,isResolvedFromDuration:!1,...e};if(!QU(e,ZU)&&QU(e,XU)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*zV(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:WU.mass,stiffness:i,damping:a}}else{let n=YU({...e,velocity:0});t={...t,...n,mass:WU.mass},t.isResolvedFromDuration=!0}}return t}function eW(e=WU.visualDuration,t=WU.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=$U({...n,velocity:-XV(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=XV(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?WU.restSpeed.granular:WU.restSpeed.default,i||=v?WU.restDelta.granular:WU.restDelta.default;let y,b,x,S,C,w;if(h<1)x=GU(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>YV(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=YV(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=YV(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(HU(T),VU),t=BU(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}eW.applyToOptions=e=>{let t=UU(e,100,eW);return e.ease=t.ease,e.duration=YV(t.duration),e.type=`keyframes`,e};var tW=5;function nW(e,t,n){let r=Math.max(t-tW,0);return ZV(n-e(r),t-r)}function rW({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=eW({keyframes:[f.value,m(f.value)],velocity:nW(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function iW(e,t,n){let r=[],i=n||BV.mix||RU,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=KV(Array.isArray(t)?t[n]||GV:t,a)),r.push(a)}return r}function aW(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=iW(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=qV(e[r],e[r+1],n);return s[r](i)};return n?t=>l(zV(e[0],e[a-1],t)):l}function oW(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=qV(0,t,r);e.push(wU(n,1,i))}}function sW(e){let t=[0];return oW(t,e.length-1),t}function cW(e,t){return e.map(e=>e*t)}function lW(e,t){return e.map(()=>t||mH).splice(0,e.length-1)}function uW({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=hH(r)?r.map(yH):yH(r),a={done:!1,value:t[0]},o=aW(cW(n&&n.length===t.length?n:sW(t),e),t,{ease:Array.isArray(i)?i:lW(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var dW=e=>e!==null;function fW(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(dW),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var pW={decay:rW,inertia:rW,tween:uW,keyframes:uW,spring:eW};function mW(e){typeof e.type==`string`&&(e.type=pW[e.type])}var hW=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},gW=e=>e/100,_W=class extends hW{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==AH.now()&&this.tick(AH.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;mW(e);let{type:t=uW,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||uW;s!==uW&&typeof o[0]!=`number`&&(this.mixKeyframes=KV(gW,RU(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=HU(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=zV(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==rW&&(b.value=fW(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return XV(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+XV(e)}get time(){return XV(this.currentTime)}set time(e){e=YV(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return nW(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(AH.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=XV(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=zU,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(AH.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function vW(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var yW=e=>e*180/Math.PI,bW=e=>SW(yW(Math.atan2(e[1],e[0]))),xW={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:bW,rotateZ:bW,skewX:e=>yW(Math.atan(e[1])),skewY:e=>yW(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},SW=e=>(e%=360,e<0&&(e+=360),e),CW=bW,wW=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),TW=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),EW={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:wW,scaleY:TW,scale:e=>(wW(e)+TW(e))/2,rotateX:e=>SW(yW(Math.atan2(e[6],e[5]))),rotateY:e=>SW(yW(Math.atan2(-e[2],e[0]))),rotateZ:CW,rotate:CW,skewX:e=>yW(Math.atan(e[4])),skewY:e=>yW(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function DW(e){return+!!e.includes(`scale`)}function OW(e,t){if(!e||e===`none`)return DW(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=EW,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xW,i=t}if(!i)return DW(t);let a=r[t],o=i[1].split(`,`).map(AW);return typeof a==`function`?a(o):o[a]}var kW=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return OW(n,t)};function AW(e){return parseFloat(e.trim())}var jW=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],MW=new Set([...jW,`pathRotation`]),NW=e=>e===LH||e===Q,PW=new Set([`x`,`y`,`z`]),FW=jW.filter(e=>!PW.has(e));function IW(e){let t=[];return FW.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var LW={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>OW(t,`x`),y:(e,{transform:t})=>OW(t,`y`)};LW.translateX=LW.x,LW.translateY=LW.y;var RW=new Set,zW=!1,BW=!1,VW=!1;function HW(){if(BW){let e=Array.from(RW).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=IW(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}BW=!1,zW=!1,RW.forEach(e=>e.complete(VW)),RW.clear()}function UW(){RW.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(BW=!0)})}function WW(){VW=!0,UW(),HW(),VW=!1}var GW=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(RW.add(this),zW||(zW=!0,wH.read(UW),wH.resolveKeyframes(HW))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}vW(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),RW.delete(this)}cancel(){this.state===`scheduled`&&(RW.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},KW=e=>e.startsWith(`--`);function qW(e,t,n){KW(t)?e.style.setProperty(t,n):e.style[t]=n}var JW={};function YW(e,t){let n=WV(e);return()=>JW[t]??n()}var XW=YW(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),ZW=YW(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),QW=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,$W={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:QW([0,.65,.55,1]),circOut:QW([.55,0,1,.45]),backIn:QW([.31,.01,.66,-.59]),backOut:QW([.33,1.53,.69,.99])};function eG(e,t){if(e)return typeof e==`function`?ZW()?BU(e,t):`ease-out`:gH(e)?QW(e):Array.isArray(e)?e.map(e=>eG(e,t)||$W.easeOut):$W[e]}function tG(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=eG(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function nG(e){return typeof e==`function`&&`applyToOptions`in e}function rG({type:e,...t}){return nG(e)&&ZW()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var iG=class extends hW{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=rG(e);this.animation=tG(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=fW(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),qW(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return XV(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+XV(e)}get time(){return XV(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=YV(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&XW()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),GV):r(this)}},aG={anticipate:cH,backInOut:sH,circInOut:dH};function oG(e){return e in aG}function sG(e){typeof e.ease==`string`&&oG(e.ease)&&(e.ease=aG[e.ease])}var cG=10,lG=class extends iG{constructor(e){sG(e),mW(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new _W({...a,autoplay:!1}),s=Math.max(cG,AH.now()-this.startTime),c=zV(0,cG,s-cG),l=o.sample(s).value,{name:u}=this.options;i&&u&&qW(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},uG=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(bU.test(e)||e===`0`)&&!e.startsWith(`url(`));function dG(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function fG(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=uG(i,t),s=uG(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:dG(e)||(n===`spring`||nG(n))&&r}function pG(e){e.duration=0,e.type=`keyframes`}var mG=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),hG=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function gG(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&hG.test(e[t]))return!0;return!1}var _G=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),vG=WV(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function yG(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return vG()&&n&&(mG.has(n)||_G.has(n)&&gG(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var bG=40,xG=class extends hW{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=AH.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||GW;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=AH.now();let u=!0;fG(e,i,a,o)||(u=!1,(BV.instantAnimations||!s)&&l?.(fW(e,n,t)),e[0]=e[e.length-1],pG(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>bG?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&yG(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new lG({...d,element:p})}catch{m=new _W(d)}else m=new _W(d);m.finished.then(()=>{this.notifyFinished()}).catch(GV),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),WW()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function SG(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var CG=30,wG=e=>!isNaN(parseFloat(e)),TG={current:void 0},EG=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=AH.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=AH.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wG(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new JV);let n=this.events[e].add(t);return e===`change`?()=>{n(),wH.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return TG.current&&TG.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=AH.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>CG)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,CG);return ZV(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function DG(e,t){return new EG(e,t)}function OG(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function kG(e,t){let n=e?.[t]??e?.default??e;return n===e?n:OG(n,e)}var AG={type:`spring`,stiffness:500,damping:25,restSpeed:10},jG=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MG={type:`keyframes`,duration:.8},NG={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},PG=(e,{keyframes:t})=>t.length>2?MG:MW.has(e)?e.startsWith(`scale`)?jG(t[1]):AG:NG,FG=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function IG(e){for(let t in e)if(!FG.has(t))return!0;return!1}var LG=(e,t,n,r={},i,a)=>o=>{let s=kG(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=YV(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};IG(s)||Object.assign(u,PG(e,u)),u.duration&&=YV(u.duration),u.repeatDelay&&=YV(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(pG(u),u.delay===0&&(d=!0)),(BV.instantAnimations||BV.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,pG(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=fW(u.keyframes,s);if(e!==void 0){wH.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new _W(u):new xG(u)},RG=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zG(e){let t=RG.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function BG(e,t,n=1){`${e}`;let[r,i]=zG(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return VV(e)?parseFloat(e):e}return PH(i)?BG(i,t,n+1):i}function VG(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function HG(e,t,n,r){if(typeof t==`function`){let[i,a]=VG(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=VG(r);t=t(n===void 0?e.custom:n,i,a)}return t}function UG(e,t,n){let r=e.getProps();return HG(r,t,n===void 0?r.custom:n,e)}var WG=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...jW]),GG=e=>Array.isArray(e);function KG(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,DG(n))}function qG(e){return GG(e)?e[e.length-1]||0:e}function JG(e,t){let{transitionEnd:n={},transition:r={},...i}=UG(e,t)||{};i={...i,...n};for(let t in i)KG(e,t,qG(i[t]))}var YG=e=>!!(e&&e.getVelocity);function XG(e){return!!(YG(e)&&e.add)}function ZG(e,t){let n=e.getValue(`willChange`);if(XG(n))return n.add(t);if(!n&&BV.WillChange){let n=new BV.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function QG(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var $G=`data-`+QG(`framerAppearId`);function eK(e){return e.props[$G]}function tK({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function nK(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?OG(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&tK(f,t))continue;let o={delay:n,...kG(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){wH.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=eK(e);if(n){let e=window.MotionHandoffAnimation(n,t,wH);e!==null&&(o.startTime=e,p=!0)}}ZG(e,t);let m=l??e.shouldReduceMotion;r.start(LG(t,r,i,m&&WG.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>wH.update(()=>{o&&JG(e,o)});d.length?Promise.all(d).then(t):t()}return d}function rK(e,t,n={}){let r=UG(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(nK(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return iK(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function iK(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(rK(c,t,{...o,delay:n+(typeof r==`function`?0:r)+SG(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function aK(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>rK(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=rK(e,t,n);else{let i=typeof t==`function`?UG(e,t,n.custom):t;r=Promise.all(nK(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var oK={test:e=>e===`auto`,parse:e=>e},sK=e=>t=>t.test(e),cK=[LH,Q,$H,QH,tU,eU,oK],lK=e=>cK.find(sK(e));function uK(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||UV(e)}var dK=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function fK(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(VH)||[];if(!r)return e;let i=n.replace(r,``),a=+!!dK.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var pK=/\b([a-z-]*)\(.*?\)/gu,mK={...bU,getAnimatableNone:e=>{let t=e.match(pK);return t?t.map(fK).join(` `):e}},hK={...bU,getAnimatableNone:e=>{let t=bU.parse(e);return bU.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},gK={...LH,transform:Math.round},_K={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,top:Q,right:Q,bottom:Q,left:Q,inset:Q,insetBlock:Q,insetBlockStart:Q,insetBlockEnd:Q,insetInline:Q,insetInlineStart:Q,insetInlineEnd:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,paddingBlock:Q,paddingBlockStart:Q,paddingBlockEnd:Q,paddingInline:Q,paddingInlineStart:Q,paddingInlineEnd:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,marginBlock:Q,marginBlockStart:Q,marginBlockEnd:Q,marginInline:Q,marginInlineStart:Q,marginInlineEnd:Q,fontSize:Q,backgroundPositionX:Q,backgroundPositionY:Q,rotate:QH,pathRotation:QH,rotateX:QH,rotateY:QH,rotateZ:QH,scale:zH,scaleX:zH,scaleY:zH,scaleZ:zH,skew:QH,skewX:QH,skewY:QH,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:RH,originX:nU,originY:nU,originZ:Q,zIndex:gK,fillOpacity:RH,strokeOpacity:RH,numOctaves:gK},vK={..._K,color:iU,backgroundColor:iU,outlineColor:iU,fill:iU,stroke:iU,borderColor:iU,borderTopColor:iU,borderRightColor:iU,borderBottomColor:iU,borderLeftColor:iU,filter:mK,WebkitFilter:mK,mask:hK,WebkitMask:hK},yK=e=>vK[e],bK=new Set([mK,hK]);function xK(e,t){let n=yK(e);return bK.has(n)||(n=bU),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var SK=new Set([`auto`,`none`,`0`]);function CK(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!SK.has(t)&&pU(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=xK(n,i)}var wK=class extends GW{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),PH(r))){let i=BG(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!WG.has(n)||e.length!==2)return;let[r,i]=e,a=lK(r),o=lK(i);if(IH(r)!==IH(i)&&LW[n]){this.needsMeasurement=!0;return}if(a!==o){if(NW(a)&&NW(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else LW[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||uK(e[t]))&&n.push(t);n.length&&CK(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=LW[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=LW[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},TK=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function EK(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var DK=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function OK(e){return HV(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:kK,cancel:AK}=CH(queueMicrotask,!1),jK={x:!1,y:!1};function MK(){return jK.x||jK.y}function NK(e){return e===`x`||e===`y`?jK[e]?null:(jK[e]=!0,()=>{jK[e]=!1}):jK.x||jK.y?null:(jK.x=jK.y=!0,()=>{jK.x=jK.y=!1})}function PK(e,t){let n=EK(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function FK(e){return!(e.pointerType===`touch`||MK())}function IK(e,t,n={}){let[r,i,a]=PK(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!FK(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var LK=(e,t)=>t?e===t||LK(e,t.parentElement):!1,RK=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,zK=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function BK(e){return zK.has(e.tagName)||e.isContentEditable===!0}var VK=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function HK(e){return VK.has(e.tagName)||e.isContentEditable===!0}var UK=new WeakSet;function WK(e){return t=>{t.key===`Enter`&&e(t)}}function GK(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var KK=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=WK(()=>{if(UK.has(n))return;GK(n,`down`);let e=WK(()=>{GK(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>GK(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function qK(e){return RK(e)&&!MK()}var JK=new WeakSet;function YK(e,t,n={}){let[r,i,a]=PK(e,n),o=e=>{let r=e.currentTarget;if(!qK(e)||JK.has(e))return;UK.add(r),n.stopPropagation&&JK.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),UK.has(r)&&UK.delete(r),qK(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||LK(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),OK(e)&&(e.addEventListener(`focus`,e=>KK(e,i)),!BK(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function XK(e){return HV(e)&&`ownerSVGElement`in e}var ZK=new WeakMap,QK,$K=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:XK(r)&&`getBBox`in r?r.getBBox()[t]:r[n],eq=$K(`inline`,`width`,`offsetWidth`),tq=$K(`block`,`height`,`offsetHeight`);function nq({target:e,borderBoxSize:t}){ZK.get(e)?.forEach(n=>{n(e,{get width(){return eq(e,t)},get height(){return tq(e,t)}})})}function rq(e){e.forEach(nq)}function iq(){typeof ResizeObserver>`u`||(QK=new ResizeObserver(rq))}function aq(e,t){QK||iq();let n=EK(e);return n.forEach(e=>{let n=ZK.get(e);n||(n=new Set,ZK.set(e,n)),n.add(t),QK?.observe(e)}),()=>{n.forEach(e=>{let n=ZK.get(e);n?.delete(t),n?.size||QK?.unobserve(e)})}}var oq=new Set,sq;function cq(){sq=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};oq.forEach(t=>t(e))},window.addEventListener(`resize`,sq)}function lq(e){return oq.add(e),sq||cq(),()=>{oq.delete(e),!oq.size&&typeof sq==`function`&&(window.removeEventListener(`resize`,sq),sq=void 0)}}function uq(e,t){return typeof e==`function`?lq(e):aq(e,t)}var dq={value:null,addProjectionMetrics:null};function fq(e){return XK(e)&&e.tagName===`svg`}var pq=[...cK,iU,bU],mq=e=>pq.find(sK(e)),hq=()=>({translate:0,scale:1,origin:0,originPoint:0}),gq=()=>({x:hq(),y:hq()}),_q=()=>({min:0,max:0}),vq=()=>({x:_q(),y:_q()}),yq=new WeakMap;function bq(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function xq(e){return typeof e==`string`||Array.isArray(e)}var Sq=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Cq=[`initial`,...Sq];function wq(e){return bq(e.animate)||Cq.some(t=>xq(e[t]))}function Tq(e){return!!(wq(e)||e.variants)}function Eq(e,t,n){for(let r in t){let i=t[r],a=n[r];if(YG(i))e.addValue(r,i);else if(YG(a))e.addValue(r,DG(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,DG(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Dq={current:null},Oq={current:!1},kq=typeof window<`u`;function Aq(){if(Oq.current=!0,kq){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Dq.current=e.matches;e.addEventListener(`change`,t),t()}else Dq.current=!1}}var jq=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Mq={};function Nq(e){Mq=e}function Pq(){return Mq}var Fq=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=GW,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=AH.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,wH.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=wq(t),this.isVariantNode=Tq(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&YG(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,yq.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Oq.current||Aq(),this.shouldReduceMotion=Dq.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),TH(this.notifyUpdate),TH(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&mG.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new iG({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:YV(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=MW.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&wH.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Mq){let t=Mq[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vq()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<jq.length;t++){let n=jq[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Eq(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=DG(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(VV(n)||UV(n))?n=parseFloat(n):!mq(n)&&bU.test(t)&&(n=xK(e,t)),this.setBaseTarget(e,YG(n)?n.get():n)),YG(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=HG(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!YG(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new JV),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){kK.render(this.render)}},Iq=class extends Fq{constructor(){super(...arguments),this.KeyframeResolver=wK}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;YG(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Lq=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Rq({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function zq({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Bq(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Vq(e){return e===void 0||e===1}function Hq({scale:e,scaleX:t,scaleY:n}){return!Vq(e)||!Vq(t)||!Vq(n)}function Uq(e){return Hq(e)||Wq(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Wq(e){return Gq(e.x)||Gq(e.y)}function Gq(e){return e&&e!==`0%`}function Kq(e,t,n){return n+t*(e-n)}function qq(e,t,n,r,i){return i!==void 0&&(e=Kq(e,i,r)),Kq(e,n,r)+t}function Jq(e,t=0,n=1,r,i){e.min=qq(e.min,t,n,r,i),e.max=qq(e.max,t,n,r,i)}function Yq(e,{x:t,y:n}){Jq(e.x,t.translate,t.scale,t.originPoint),Jq(e.y,n.translate,n.scale,n.originPoint)}var Xq=.999999999999,Zq=1.0000000000001;function Qq(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&($q(e.x,-a.scroll.offset.x),$q(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Yq(e,o)),r&&Uq(a.latestValues)&&nJ(e,a.latestValues,a.layout?.layoutBox))}t.x<Zq&&t.x>Xq&&(t.x=1),t.y<Zq&&t.y>Xq&&(t.y=1)}function $q(e,t){e.min+=t,e.max+=t}function eJ(e,t,n,r,i=.5){Jq(e,t,n,wU(e.min,e.max,i),r)}function tJ(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function nJ(e,t,n){let r=n??e;eJ(e.x,tJ(t.x,r.x),t.scaleX,t.scale,t.originX),eJ(e.y,tJ(t.y,r.y),t.scaleY,t.scale,t.originY)}function rJ(e,t){return Rq(Bq(e.getBoundingClientRect(),t))}function iJ(e,t,n){let r=rJ(e,n),{scroll:i}=t;return i&&($q(r.x,i.offset.x),$q(r.y,i.offset.y)),r}var aJ={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},oJ=jW.length;function sJ(e,t,n){let r=``,i=!0;for(let a=0;a<oJ;a++){let o=jW[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=DK(s,_K[o]);if(!c){i=!1;let t=aJ[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${DK(a,_K.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function cJ(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(MW.has(e)){o=!0;continue}if(MH(e)){i[e]=n;continue}{let t=DK(n,_K[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=sJ(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function lJ(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function uJ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var dJ={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(Q.test(e))e=parseFloat(e);else return e}return`${uJ(e,t.target.x)}% ${uJ(e,t.target.y)}%`}},fJ={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=bU.parse(e);if(i.length>5)return r;let a=bU.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=wU(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},pJ={borderRadius:{...dJ,applyTo:[...TK]},borderTopLeftRadius:dJ,borderTopRightRadius:dJ,borderBottomLeftRadius:dJ,borderBottomRightRadius:dJ,boxShadow:fJ};function mJ(e,{layout:t,layoutId:n}){return MW.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!pJ[e]||e===`opacity`)}function hJ(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(YG(r[t])||i&&YG(i[t])||mJ(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function gJ(e){return window.getComputedStyle(e)}var _J=class extends Iq{constructor(){super(...arguments),this.type=`html`,this.renderInstance=lJ}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(MW.has(t))return this.projection?.isProjecting?DW(t):kW(e,t);{let n=gJ(e),r=(MH(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return rJ(e,t)}build(e,t,n){cJ(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return hJ(e,t,n)}},vJ={offset:`stroke-dashoffset`,array:`stroke-dasharray`},yJ={offset:`strokeDashoffset`,array:`strokeDasharray`};function bJ(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?vJ:yJ;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var xJ=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function SJ(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(cJ(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of xJ)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&bJ(d,i,a,o,!1)}var CJ=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),wJ=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function TJ(e,t,n,r){lJ(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(CJ.has(n)?n:QG(n),t.attrs[n])}function EJ(e,t,n){let r=hJ(e,t,n);for(let n in e)if(YG(e[n])||YG(t[n])){let t=jW.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var DJ=class extends Iq{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=vq}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(MW.has(t)){let e=yK(t);return e&&e.default||0}return t=CJ.has(t)?t:QG(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return EJ(e,t,n)}build(e,t,n){SJ(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){TJ(e,t,n,r)}mount(e){this.isSVGTag=wJ(e.tagName),super.mount(e)}},OJ=Cq.length;function kJ(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&kJ(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<OJ;n++){let r=Cq[n],i=e.props[r];(xq(i)||i===!1)&&(t[r]=i)}return t}function AJ(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var jJ=[...Sq].reverse(),MJ=Sq.length;function NJ(e){return t=>Promise.all(t.map(({animation:t,options:n})=>aK(e,t,n)))}function PJ(e){let t=NJ(e),n=LJ(),r=!0,i=!1,a=t=>(n,r)=>{let i=UG(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=kJ(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<MJ;t++){let p=jJ[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=xq(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||bq(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=FJ(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=GG(t)&&GG(n)?!AJ(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let ee=v&&y;b&&(!ee||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!ee&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=UG(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=SG(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=UG(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=LJ(),i=!0}}}function FJ(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!AJ(t,e):!1}function IJ(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function LJ(){return{animate:IJ(!0),whileInView:IJ(),whileHover:IJ(),whileTap:IJ(),whileDrag:IJ(),whileFocus:IJ(),exit:IJ()}}function RJ(e,t){e.min=t.min,e.max=t.max}function zJ(e,t){RJ(e.x,t.x),RJ(e.y,t.y)}function BJ(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var VJ=.9999,HJ=1.0001,UJ=-.01,WJ=.01;function GJ(e){return e.max-e.min}function KJ(e,t,n){return Math.abs(e-t)<=n}function qJ(e,t,n,r=.5){e.origin=r,e.originPoint=wU(t.min,t.max,e.origin),e.scale=GJ(n)/GJ(t),e.translate=wU(n.min,n.max,e.origin)-e.originPoint,(e.scale>=VJ&&e.scale<=HJ||isNaN(e.scale))&&(e.scale=1),(e.translate>=UJ&&e.translate<=WJ||isNaN(e.translate))&&(e.translate=0)}function JJ(e,t,n,r){qJ(e.x,t.x,n.x,r?r.originX:void 0),qJ(e.y,t.y,n.y,r?r.originY:void 0)}function YJ(e,t,n,r=0){e.min=(r?wU(n.min,n.max,r):n.min)+t.min,e.max=e.min+GJ(t)}function XJ(e,t,n,r){YJ(e.x,t.x,n.x,r?.x),YJ(e.y,t.y,n.y,r?.y)}function ZJ(e,t,n,r=0){let i=r?wU(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+GJ(t)}function QJ(e,t,n,r){ZJ(e.x,t.x,n.x,r?.x),ZJ(e.y,t.y,n.y,r?.y)}function $J(e,t,n,r,i){return e-=t,e=Kq(e,1/n,r),i!==void 0&&(e=Kq(e,1/i,r)),e}function eY(e,t=0,n=1,r=.5,i,a=e,o=e){if($H.test(t)&&(t=parseFloat(t),t=wU(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=wU(a.min,a.max,r);e===a&&(s-=t),e.min=$J(e.min,t,n,s,i),e.max=$J(e.max,t,n,s,i)}function tY(e,t,[n,r,i],a,o){eY(e,t[n],t[r],t[i],t.scale,a,o)}var nY=[`x`,`scaleX`,`originX`],rY=[`y`,`scaleY`,`originY`];function iY(e,t,n,r){tY(e.x,t,nY,n?n.x:void 0,r?r.x:void 0),tY(e.y,t,rY,n?n.y:void 0,r?r.y:void 0)}function aY(e){return e.translate===0&&e.scale===1}function oY(e){return aY(e.x)&&aY(e.y)}function sY(e,t){return e.min===t.min&&e.max===t.max}function cY(e,t){return sY(e.x,t.x)&&sY(e.y,t.y)}function lY(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uY(e,t){return lY(e.x,t.x)&&lY(e.y,t.y)}function dY(e){return GJ(e.x)/GJ(e.y)}function fY(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function pY(e){return[e(`x`),e(`y`)]}function mY(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var hY=TK.length,gY=e=>typeof e==`string`?parseFloat(e):e,_Y=e=>typeof e==`number`||Q.test(e);function vY(e,t,n,r,i,a){i?(e.opacity=wU(0,n.opacity??1,bY(r)),e.opacityExit=wU(t.opacity??1,0,xY(r))):a&&(e.opacity=wU(t.opacity??1,n.opacity??1,r));for(let i=0;i<hY;i++){let a=TK[i],o=yY(t,a),s=yY(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||_Y(o)===_Y(s)?(e[a]=Math.max(wU(gY(o),gY(s),r),0),($H.test(s)||$H.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=wU(t.rotate||0,n.rotate||0,r))}function yY(e,t){return e[t]===void 0?e.borderRadius:e[t]}var bY=SY(0,.5,uH),xY=SY(.5,.95,GV);function SY(e,t,n){return r=>r<e?0:r>t?1:n(qV(e,t,r))}function CY(e,t,n){let r=YG(e)?e:DG(e);return r.start(LG(``,r,t,n)),r.animation}function wY(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var TY=(e,t)=>e.depth-t.depth,EY=class{constructor(){this.children=[],this.isDirty=!1}add(e){LV(this.children,e),this.isDirty=!0}remove(e){RV(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(TY),this.isDirty=!1,this.children.forEach(e)}};function DY(e,t){let n=AH.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(TH(r),e(a-t))};return wH.setup(r,!0),()=>TH(r)}function OY(e){return YG(e)?e.get():e}var kY=class{constructor(){this.members=[]}add(e){LV(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(RV(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(RV(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},AY={hasAnimatedSinceResize:!0,hasEverUpdated:!1},jY={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},MY=[``,`X`,`Y`,`Z`],NY=1e3,PY=0;function FY(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function IY(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=eK(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,wH,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&IY(r)}function LY({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=PY++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,dq.value&&(jY.nodes=jY.calculatedTargetDeltas=jY.calculatedProjections=0),this.nodes.forEach(BY),this.nodes.forEach(YY),this.nodes.forEach(XY),this.nodes.forEach(VY),dq.addProjectionMetrics&&dq.addProjectionMetrics(jY)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new EY)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new JV),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=XK(t)&&!fq(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;wH.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=DY(i,250),AY.hasAnimatedSinceResize&&(AY.hasAnimatedSinceResize=!1,this.nodes.forEach(JY)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||rX,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!uY(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...kG(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||JY(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),TH(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ZY),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&IY(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(WY),this.nodes.forEach(UY);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(GY);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(KY),this.nodes.forEach(qY),this.nodes.forEach(RY),this.nodes.forEach(zY)):this.nodes.forEach(GY),this.clearAllSnapshots();let e=AH.now();EH.delta=zV(0,1e3/60,e-EH.timestamp),EH.timestamp=e,EH.isProcessing=!0,DH.update.process(EH),DH.preRender.process(EH),DH.render.process(EH),EH.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,kK.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(HY),this.sharedNodes.forEach(QY)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wH.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wH.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!GJ(this.snapshot.measuredBox.x)&&!GJ(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=vq(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!oY(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Uq(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),sX(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return vq();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(lX))){let{scroll:e}=this.root;e&&($q(t.x,e.offset.x),$q(t.y,e.offset.y))}return t}removeElementScroll(e){let t=vq();if(zJ(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&zJ(t,e),$q(t.x,i.offset.x),$q(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||vq();zJ(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&($q(r.x,-n.scroll.offset.x),$q(r.y,-n.scroll.offset.y)),Uq(n.latestValues)&&nJ(r,n.latestValues,n.layout?.layoutBox)}return Uq(this.latestValues)&&nJ(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=vq();zJ(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Uq(n.latestValues))continue;let r;n.instance&&(Hq(n.latestValues)&&n.updateSnapshot(),r=vq(),zJ(r,n.measurePageBox())),iY(t,n.latestValues,n.snapshot?.layoutBox,r)}return Uq(this.latestValues)&&iY(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==EH.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=EH.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=vq(),this.targetWithTransforms=vq()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),XJ(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):zJ(this.target,this.layout.layoutBox),Yq(this.target,this.targetDelta)):zJ(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),dq.value&&jY.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Hq(this.parent.latestValues)||Wq(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vq(),this.relativeTargetOrigin=vq(),QJ(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),zJ(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===EH.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;zJ(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Qq(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=vq());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(BJ(this.prevProjectionDelta.x,this.projectionDelta.x),BJ(this.prevProjectionDelta.y,this.projectionDelta.y)),JJ(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!fY(this.projectionDelta.x,this.prevProjectionDelta.x)||!fY(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),dq.value&&jY.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=gq(),this.projectionDelta=gq(),this.projectionDeltaWithTransform=gq()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=gq();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=vq(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(nX));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=wU(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=wU(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):($Y(o.x,e.x,n),$Y(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(QJ(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),tX(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&cY(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=vq(),zJ(f,this.relativeTarget)),c&&(this.animationValues=a,vY(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(TH(this.pendingAnimation),void 0),this.pendingAnimation=wH.update(()=>{AY.hasAnimatedSinceResize=!0,this.motionValue||=DG(0),this.motionValue.jump(0,!1),this.currentAnimation=CY(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(NY),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&cX(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||vq();let t=GJ(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=GJ(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}zJ(t,n),nJ(t,i),JJ(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new kY),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&FY(`z`,e,r,this.animationValues);for(let t=0;t<MY.length;t++)FY(`rotate${MY[t]}`,e,r,this.animationValues),FY(`skew${MY[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=OY(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=OY(t?.pointerEvents)||``),this.hasProjected&&!Uq(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=mY(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in pJ){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=pJ[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?OY(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(UY),this.root.sharedNodes.clear()}}}function RY(e){e.updateLayout()}function zY(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)pY(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=GJ(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;RJ(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else cX(i,t.layoutBox,n)&&pY(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=GJ(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=gq();JJ(o,n,t.layoutBox);let s=gq();a?JJ(s,e.applyTransform(r,!0),t.measuredBox):JJ(s,n,t.layoutBox);let c=!oY(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=vq();QJ(s,t.layoutBox,i.layoutBox,o);let c=vq();QJ(c,n,a.layoutBox,o),uY(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function BY(e){dq.value&&jY.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function VY(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function HY(e){e.clearSnapshot()}function UY(e){e.clearMeasurements()}function WY(e){e.isLayoutDirty=!0,e.updateLayout()}function GY(e){e.isLayoutDirty=!1}function KY(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function qY(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function JY(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YY(e){e.resolveTargetDelta()}function XY(e){e.calcProjection()}function ZY(e){e.resetSkewAndRotation()}function QY(e){e.removeLeadSnapshot()}function $Y(e,t,n){e.translate=wU(t.translate,0,n),e.scale=wU(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function eX(e,t,n,r){e.min=wU(t.min,n.min,r),e.max=wU(t.max,n.max,r)}function tX(e,t,n,r){eX(e.x,t.x,n.x,r),eX(e.y,t.y,n.y,r)}function nX(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var rX={duration:.45,ease:[.4,0,.1,1]},iX=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),aX=iX(`applewebkit/`)&&!iX(`chrome/`)?Math.round:GV;function oX(e){e.min=aX(e.min),e.max=aX(e.max)}function sX(e){oX(e.x),oX(e.y)}function cX(e,t,n){return e===`position`||e===`preserve-aspect`&&!KJ(dY(t),dY(n),.2)}function lX(e){return e!==e.root&&e.scroll?.wasRoot}var uX=LY({attachResizeListener:(e,t)=>wY(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),dX={current:void 0},fX=LY({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dX.current){let e=new uX({});e.mount(window),e.setOptions({layoutScroll:!0}),dX.current=e}return dX.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),pX=(0,N.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function mX(e=!0){let t=(0,N.useContext)(IV);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,N.useId)();(0,N.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,N.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var hX=(0,N.createContext)({strict:!1}),gX={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},_X=!1;function vX(){if(_X)return;let e={};for(let t in gX)e[t]={isEnabled:e=>gX[t].some(t=>!!e[t])};Nq(e),_X=!0}function yX(){return vX(),Pq()}function bX(e){let t=yX();for(let n in e)t[n]={...t[n],...e[n]};Nq(t)}var xX=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function SX(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||xX.has(e)}function CX(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var wX=n((()=>{})),TX=r({default:()=>DX}),EX,DX,OX=n((()=>{wX(),EX=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,DX=CX(function(e){return EX.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91})})),kX=e=>!SX(e);function AX(e){typeof e==`function`&&(kX=t=>t.startsWith(`on`)?!SX(t):e(t))}try{AX((OX(),t(TX)).default)}catch{}function jX(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(YG(e[i])||(kX(i)||n===!0&&SX(i)||!t&&!SX(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var MX=(0,N.createContext)({});function NX(e,t){if(wq(e)){let{initial:t,animate:n}=e;return{initial:t===!1||xq(t)?t:void 0,animate:xq(n)?n:void 0}}return e.inherit===!1?{}:t}function PX(e){let{initial:t,animate:n}=NX(e,(0,N.useContext)(MX));return(0,N.useMemo)(()=>({initial:t,animate:n}),[FX(t),FX(n)])}function FX(e){return Array.isArray(e)?e.join(` `):e}var IX=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function LX(e,t,n){for(let r in t)!YG(t[r])&&!mJ(r,n)&&(e[r]=t[r])}function RX({transformTemplate:e},t){return(0,N.useMemo)(()=>{let n=IX();return cJ(n,t,e),Object.assign({},n.vars,n.style)},[t])}function zX(e,t){let n=e.style||{},r={};return LX(r,n,e),Object.assign(r,RX(e,t)),r}function BX(e,t){let n={},r=zX(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var VX=()=>({...IX(),attrs:{}});function HX(e,t,n,r){let i=(0,N.useMemo)(()=>{let n=VX();return SJ(n,t,wJ(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};LX(t,e.style,e),i.style={...t,...i.style}}return i}var UX=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function WX(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(UX.indexOf(e)>-1||/[A-Z]/u.test(e))}function GX(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??WX(e)?HX:BX)(t,r,i,e),c=jX(t,typeof e==`string`,a),l=e===N.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,N.useMemo)(()=>YG(u)?u.get():u,[u]);return(0,N.createElement)(e,{...l,children:d})}function KX({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:qX(n,r,i,e),renderState:t()}}function qX(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=OY(a[e]);let{initial:o,animate:s}=e,c=wq(e),l=Tq(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!bq(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=HG(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var JX=e=>(t,n)=>{let r=(0,N.useContext)(MX),i=(0,N.useContext)(IV),a=()=>KX(e,t,r,i);return n?a():PV(a)},YX=JX({scrapeMotionValuesFromProps:hJ,createRenderState:IX}),XX=JX({scrapeMotionValuesFromProps:EJ,createRenderState:VX}),ZX=Symbol.for(`motionComponentSymbol`);function QX(e,t,n){let r=(0,N.useRef)(n);(0,N.useInsertionEffect)(()=>{r.current=n});let i=(0,N.useRef)(null);return(0,N.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var $X=(0,N.createContext)({});function eZ(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function tZ(e,t,n,r,i,a){let{visualElement:o}=(0,N.useContext)(MX),s=(0,N.useContext)(hX),c=(0,N.useContext)(IV),l=(0,N.useContext)(pX),u=l.reducedMotion,d=l.skipAnimations,f=(0,N.useRef)(null),p=(0,N.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,N.useContext)($X);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&nZ(f.current,n,i,h);let g=(0,N.useRef)(!1);(0,N.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[$G],v=(0,N.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return FV(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,N.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function nZ(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:rZ(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&eZ(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function rZ(e){if(e)return e.options.allowProjection===!1?rZ(e.parent):e.projection}function iZ(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&bX(r);let a=n?n===`svg`:WX(e),o=a?XX:YX;function s(n,s){let c,l={...(0,N.useContext)(pX),...n,layoutId:aZ(n)},{isStatic:u}=l,d=PX(n),f=o(n,u);if(!u&&typeof window<`u`){oZ(l,r);let t=sZ(l);c=t.MeasureLayout,d.visualElement=tZ(e,f,l,i,t.ProjectionNode,a)}return(0,M.jsxs)(MX.Provider,{value:d,children:[c&&d.visualElement?(0,M.jsx)(c,{visualElement:d.visualElement,...l}):null,GX(e,n,QX(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,N.forwardRef)(s);return c[ZX]=e,c}function aZ({layoutId:e}){let t=(0,N.useContext)(NV).id;return t&&e!==void 0?t+`-`+e:e}function oZ(e,t){(0,N.useContext)(hX).strict}function sZ(e){let{drag:t,layout:n}=yX();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function cZ(e,t){if(typeof Proxy>`u`)return iZ;let n=new Map,r=(n,r)=>iZ(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,iZ(a,void 0,e,t)),n.get(a))})}var lZ=(e,t)=>t.isSVG??WX(e)?new DJ(t):new _J(t,{allowProjection:e!==N.Fragment}),uZ=class extends Lq{constructor(e){super(e),e.animationState||=PJ(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();bq(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},dZ=0,fZ={animation:{Feature:uZ},exit:{Feature:class extends Lq{constructor(){super(...arguments),this.id=dZ++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=UG(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function pZ(e){return{point:{x:e.pageX,y:e.pageY}}}var mZ=e=>t=>RK(t)&&e(t,pZ(t));function hZ(e,t,n,r){return wY(e,t,mZ(n),r)}var gZ=({current:e})=>e?e.ownerDocument.defaultView:null,_Z=(e,t)=>Math.abs(e-t);function vZ(e,t){let n=_Z(e.x,t.x),r=_Z(e.y,t.y);return Math.sqrt(n**2+r**2)}var yZ=new Set([`auto`,`scroll`]),bZ=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xZ(this.lastRawMoveEventInfo,this.transformPagePoint));let e=CZ(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=vZ(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=EH;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=xZ(t,this.transformPagePoint),wH.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=CZ(e.type===`pointercancel`?this.lastMoveEventInfo:xZ(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!RK(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=xZ(pZ(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=EH;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,CZ(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=KV(hZ(this.contextWindow,`pointermove`,this.handlePointerMove,d),hZ(this.contextWindow,`pointerup`,this.handlePointerUp,d),hZ(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(yZ.has(e.overflowX)||yZ.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),wH.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),TH(this.updatePoint)}};function xZ(e,t){return t?{point:t(e.point)}:e}function SZ(e,t){return{x:e.x-t.x,y:e.y-t.y}}function CZ({point:e},t){return{point:e,delta:SZ(e,TZ(t)),offset:SZ(e,wZ(t)),velocity:EZ(t,.1)}}function wZ(e){return e[0]}function TZ(e){return e[e.length-1]}function EZ(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=TZ(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>YV(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>YV(t)*2&&(r=e[1]);let a=XV(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function DZ(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?wU(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?wU(n,e,r.max):Math.min(e,n)),e}function OZ(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function kZ(e,{top:t,left:n,bottom:r,right:i}){return{x:OZ(e.x,n,i),y:OZ(e.y,t,r)}}function AZ(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function jZ(e,t){return{x:AZ(e.x,t.x),y:AZ(e.y,t.y)}}function MZ(e,t){let n=.5,r=GJ(e),i=GJ(t);return i>r?n=qV(t.min,t.max-r,e.min):r>i&&(n=qV(e.min,e.max-i,t.min)),zV(0,1,n)}function NZ(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var PZ=.35;function FZ(e=PZ){return e===!1?e=0:e===!0&&(e=PZ),{x:IZ(e,`left`,`right`),y:IZ(e,`top`,`bottom`)}}function IZ(e,t,n){return{min:LZ(e,t),max:LZ(e,n)}}function LZ(e,t){return typeof e==`number`?e:e[t]||0}var RZ=new WeakMap,zZ=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vq(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(pZ(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=NK(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),pY(e=>{let t=this.getAxisMotionValue(e).get()||0;if($H.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=GJ(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&wH.update(()=>i(e,t),!1,!0),ZG(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=UZ(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&wH.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new bZ(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:gZ(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&wH.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!HZ(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=DZ(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&eZ(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?kZ(n.layoutBox,e):!1,this.elastic=FZ(t),r!==this.constraints&&!eZ(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&pY(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=NZ(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!eZ(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=iJ(n,r.root,this.visualElement.getTransformPagePoint()),a=jZ(r.layout.layoutBox,i);if(t){let e=t(zq(a));this.hasMutatedConstraints=!!e,e&&(a=Rq(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=pY(o=>{if(!HZ(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return ZG(this.visualElement,e),n.start(LG(e,n,0,t,this.visualElement,!1))}stopAnimation(){pY(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){pY(t=>{let{drag:n}=this.getProps();if(!HZ(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-wU(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!eZ(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};pY(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=MZ({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),pY(t=>{if(!HZ(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(wU(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;RZ.set(this.visualElement,this);let e=this.visualElement.current,t=hZ(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&HK(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();eZ(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=VZ(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),wH.read(r);let o=wY(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(pY(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=PZ,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function BZ(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function VZ(e,t,n){let r=uq(e,BZ(n)),i=uq(t,BZ(n));return()=>{r(),i()}}function HZ(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function UZ(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var WZ=class extends Lq{constructor(e){super(e),this.removeGroupControls=GV,this.removeListeners=GV,this.controls=new zZ(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||GV}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},GZ=e=>(t,n)=>{e&&wH.update(()=>e(t,n),!1,!0)},KZ=class extends Lq{constructor(){super(...arguments),this.removePointerDownListener=GV}onPointerDown(e){this.session=new bZ(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gZ(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:GZ(e),onStart:GZ(t),onMove:GZ(n),onEnd:(e,t)=>{delete this.session,r&&wH.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=hZ(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},qZ=!1,JZ=class extends N.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),qZ&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),AY.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),qZ=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||wH.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),kK.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;qZ=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function YZ(e){let[t,n]=mX(),r=(0,N.useContext)(NV);return(0,M.jsx)(JZ,{...e,layoutGroup:r,switchLayoutGroup:(0,N.useContext)($X),isPresent:t,safeToRemove:n})}var XZ={pan:{Feature:KZ},drag:{Feature:WZ,ProjectionNode:fX,MeasureLayout:YZ}};function ZZ(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&wH.postRender(()=>i(t,pZ(t)))}var QZ=class extends Lq{mount(){let{current:e}=this.node;e&&(this.unmount=IK(e,(e,t)=>(ZZ(this.node,t,`Start`),e=>ZZ(this.node,e,`End`))))}unmount(){}},$Z=class extends Lq{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=KV(wY(this.node.current,`focus`,()=>this.onFocus()),wY(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function eQ(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&wH.postRender(()=>i(t,pZ(t)))}var tQ=class extends Lq{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=YK(e,(e,t)=>(eQ(this.node,t,`Start`),(e,{success:t})=>eQ(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},nQ=new WeakMap,rQ=new WeakMap,iQ=e=>{let t=nQ.get(e.target);t&&t(e)},aQ=e=>{e.forEach(iQ)};function oQ({root:e,...t}){let n=e||document;rQ.has(n)||rQ.set(n,{});let r=rQ.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(aQ,{root:e,...t})),r[i]}function sQ(e,t,n){let r=oQ(t);return nQ.set(e,n),r.observe(e),()=>{nQ.delete(e),r.unobserve(e)}}var cQ={some:0,all:1},lQ=class extends Lq{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:cQ[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=sQ(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(uQ(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function uQ({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var dQ={inView:{Feature:lQ},tap:{Feature:tQ},focus:{Feature:$Z},hover:{Feature:QZ}},fQ={layout:{ProjectionNode:fX,MeasureLayout:YZ}},pQ=cZ({...fZ,...dQ,...XZ,...fQ},lZ),mQ=new Map,hQ=e=>{let t=mQ.get(e);return t||(t=pQ.create(e),mQ.set(e,t)),t},gQ=(0,N.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=hQ(t),o=(0,N.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,M.jsx)(a,{animate:{backgroundPosition:`0% center`},className:j(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),_Q=(0,N.createContext)(null),vQ=()=>{let e=(0,N.useContext)(_Q);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},yQ=1e3,bQ=1e3,xQ=(0,N.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:i,duration:a,children:o,...s})=>{let c=r??t,l=r===!1,[u,d]=iV({defaultProp:c,onChange:i,prop:n}),[f,p]=iV({defaultProp:void 0,prop:a}),m=(0,N.useRef)(t),[h,g]=(0,N.useState)(!1),_=(0,N.useRef)(null);(0,N.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/bQ)),_.current=null)},[t,p]),(0,N.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,N.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},yQ);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,N.useCallback)(e=>{d(e)},[d]),y=(0,N.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,M.jsx)(_Q.Provider,{value:y,children:(0,M.jsx)(AV,{className:j(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),SQ=(e,t)=>e||t===0?(0,M.jsx)(gQ,{duration:1,children:`Thinking...`}):t===void 0?(0,M.jsx)(`p`,{children:`Thought for a few seconds`}):(0,M.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),CQ=(0,N.memo)(({className:e,children:t,getThinkingMessage:n=SQ,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=vQ();return(0,M.jsx)(jV,{className:j(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Je,{className:`size-4`}),n(i,o),(0,M.jsx)(he,{className:j(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),wQ=(0,N.memo)(({className:e,children:t,...n})=>(0,M.jsx)(MV,{className:j(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,M.jsx)(gI,{children:t})}));xQ.displayName=`Reasoning`,CQ.displayName=`ReasoningTrigger`,wQ.displayName=`ReasoningContent`;var TQ={"approval-requested":(0,M.jsx)(ze,{className:`size-4 text-yellow-600`}),"approval-responded":(0,M.jsx)(Ye,{className:`size-4 text-blue-600`}),"input-available":(0,M.jsx)(ze,{className:`size-4 animate-pulse`}),"input-streaming":(0,M.jsx)(pe,{className:`size-4`}),"output-available":(0,M.jsx)(Ye,{className:`size-4 text-green-600`}),"output-denied":(0,M.jsx)(Xe,{className:`size-4 text-orange-600`}),"output-error":(0,M.jsx)(Xe,{className:`size-4 text-red-600`})};function EQ(e){return(0,M.jsx)(Ge,{className:`gap-1.5 text-xs`,variant:`secondary`,children:TQ[e]})}var DQ=({className:e,...t})=>(0,M.jsx)(AV,{className:j(`group not-prose mb-4 w-full rounded-sm border`,e),...t}),OQ={run_commands:(0,M.jsx)(ut,{className:`size-4`}),read_files:(0,M.jsx)(Qe,{className:`size-4`}),editor:(0,M.jsx)(Be,{className:`size-4`}),ask_question:(0,M.jsx)(nt,{className:`size-4`})},kQ=e=>(0,M.jsx)(Ge,{className:`text-xs`,variant:`ghost`,children:e&&OQ[e]||(0,M.jsx)(He,{className:`size-4`})}),AQ=({className:e,title:t,type:n,state:r,toolName:i,...a})=>{let o=t?.split(`:`),s=o?.[0]||i,c=o?.[1],l=s||t||n.split(`-`).slice(1).join(`-`);return(0,M.jsx)(jV,{className:j(`flex w-full overflow-hidden items-center justify-between gap-4 p-3 cursor-pointer`,e),...a,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[kQ(l),(0,M.jsx)(`span`,{className:`font-light text-muted-foreground text-sm truncated wrap-break-word ellipses`,children:c}),EQ(r)]})})},jQ=({className:e,...t})=>(0,M.jsx)(MV,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-1 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in overflow-hidden font-mono`,e),...t}),MQ=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,M.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,N.isValidElement)(t)?i=(0,M.jsx)(cI,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,M.jsx)(cI,{code:t,language:`json`})),(0,M.jsx)(`div`,{className:j(`space-y-2`,e),...r,children:(0,M.jsxs)(`div`,{className:j(`overflow-auto rounded-md text-xs [&_table]:w-full max-h-20`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,M.jsx)(`div`,{children:n}),i]})})},NQ=({children:e,className:t,...n})=>(0,M.jsx)(`div`,{className:j(`text-muted-foreground text-sm`,t),...n,children:e}),PQ=({defaultOpen:e=!0,className:t,...n})=>(0,M.jsx)(AV,{className:j(t),defaultOpen:e,...n}),FQ=({children:e,className:t,title:n,...r})=>(0,M.jsx)(jV,{className:j(`group`,t),...r,children:e??(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(h,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:n}),(0,M.jsx)(he,{className:`size-4 transition-transform group-data-[state=open]:rotate-180`})]})}),IQ=({children:e,className:t,...n})=>(0,M.jsx)(MV,{className:j(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,t),...n,children:(0,M.jsx)(`div`,{className:`mt-4 space-y-2 border-muted border-l-2 pl-4`,children:e})});function LQ(e){return typeof e==`object`&&e?e:void 0}function $(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function RQ(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):void 0}function zQ(e){return e===`output-error`?`Failed`:e===`output-available`?`Done`:`Running`}function BQ(e){let t=LQ(e.input),n=LQ(e.output),r=zQ(e.state);switch(e.name){case`team_spawn_teammate`:return`${r} spawn teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_shutdown_teammate`:return`${r} shutdown teammate ${$(t?.agentId)??$(n?.agentId)??`agent`}`;case`team_status`:return`${r} fetch team status`;case`team_task`:{let e=$(t?.action);return e===`create`?`${r} create task ${$(n?.taskId)??``}${$(t?.title)?`: ${$(t?.title)}`:``}`.trim():e===`list`?`${r} list team tasks`:e===`claim`?`${r} claim task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`complete`?`${r} complete task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():e===`block`?`${r} block task ${$(t?.taskId)??$(n?.taskId)??``}`.trim():`${r} update team task`}case`team_run_task`:{let e=$(t?.agentId)??$(n?.agentId)??`agent`,i=$(n?.mode)??$(t?.runMode),a=$(n?.status),o=$(t?.task),s=o?`: ${o}`:``;return`${r} ${i===`async`?`queue`:a===`joined`?`join`:`run`} task with ${e}${a?` (${a})`:``}${s}`}case`team_cancel_run`:return`${r} cancel run ${$(t?.runId)??$(n?.runId)??``}`.trim();case`team_list_runs`:return`${r} list teammate runs`;case`team_await_run`:return`${r} await run ${$(t?.runId)??``}`.trim();case`team_await_all_runs`:return`${r} await all active runs`;case`team_send_message`:return`${r} message ${$(t?.toAgentId)??$(n?.toAgentId)??`agent`}${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_broadcast`:return`${r} broadcast${$(t?.subject)?`: ${$(t?.subject)}`:``}`;case`team_read_mailbox`:return`${r} read mailbox`;case`team_mission_log`:return`${r} log ${$(t?.kind)??`update`}${$(t?.summary)?`: ${$(t?.summary)}`:``}`;case`team_cleanup`:return`${r} clean up team runtime`;case`team_create_outcome`:return`${r} create outcome${$(t?.title)?`: ${$(t?.title)}`:``}`;case`team_attach_outcome_fragment`:return`${r} attach fragment to ${$(t?.section)??`section`}`;case`team_review_outcome_fragment`:return`${r} ${t?.approved===!1?`reject`:`review`} fragment ${$(t?.fragmentId)??``}`.trim();case`team_finalize_outcome`:return`${r} finalize outcome ${$(t?.outcomeId)??$(n?.outcomeId)??``}`.trim();case`team_list_outcomes`:return`${r} list outcomes`;default:return`${r} ${e.name.replace(/^team_/,``).replaceAll(`_`,` `)}`}}function VQ(e){if(e.error)return e.error;let t=LQ(e.input),n=LQ(e.output);switch(e.name){case`team_task`:{let e=$(t?.action);if(e===`create`)return $(t?.description);if(e===`block`)return $(t?.reason);if(e===`list`){let e=Array.isArray(n?.tasks)?n.tasks.length:void 0;return typeof e==`number`?`${e} task${e===1?``:`s`}`:void 0}return}case`team_run_task`:return $(n?.message)??$(n?.runId)??$(n?.text);case`team_send_message`:case`team_broadcast`:return $(t?.body);case`team_mission_log`:return $(t?.nextAction)??$(t?.summary);case`team_attach_outcome_fragment`:return $(t?.content);case`team_status`:{let e=Array.isArray(n?.members)?n.members.length:void 0,t=Array.isArray(n?.tasks)?n.tasks.length:void 0,r=Array.isArray(n?.runs)?n.runs.length:void 0;return[typeof e==`number`?`${e} members`:void 0,typeof t==`number`?`${t} tasks`:void 0,typeof r==`number`?`${r} runs`:void 0].filter(Boolean).join(` • `)||void 0}case`team_list_runs`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} run${t.length===1?``:`s`}`:`No runs`}case`team_read_mailbox`:{let t=Array.isArray(e.output)?e.output:void 0;return t?.length?`${t.length} message${t.length===1?``:`s`}`:`No messages`}case`team_create_outcome`:{let e=RQ(t?.requiredSections);return e?.length?e.join(`, `):void 0}default:return}}function HQ({className:e,defaultOpen:t=!0,events:n,...r}){if(n.length===0)return null;let i=n.length===1?`Team activity`:`Team activity (${n.length})`;return(0,M.jsxs)(PQ,{className:e,defaultOpen:t,...r,children:[(0,M.jsx)(FQ,{title:i,children:(0,M.jsxs)(`div`,{className:`flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,children:[(0,M.jsx)(dt,{className:`size-4`}),(0,M.jsx)(`p`,{className:`text-sm`,children:i})]})}),(0,M.jsx)(IQ,{children:n.map(e=>{let t=VQ(e);return(0,M.jsxs)(NQ,{className:`space-y-1`,children:[(0,M.jsx)(`div`,{children:BQ(e)}),t?(0,M.jsx)(`div`,{className:`line-clamp-3 text-xs text-muted-foreground/90`,children:t}):null]},e.id)})})]})}function UQ(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);var WQ=1,GQ=100,KQ=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:WQ++,qQ=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-GQ;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=KQ(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],N.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(YQ(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!N.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=KQ(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},JQ=(e,t)=>qQ.message(e,t),YQ=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,XQ=Object.assign(JQ,{success:qQ.success,info:qQ.info,warning:qQ.warning,error:qQ.error,custom:qQ.custom,message:qQ.message,promise:qQ.promise,dismiss:qQ.dismiss,loading:qQ.loading},{getHistory:()=>qQ.toasts,getToasts:()=>qQ.getActiveToasts()});UQ(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);var ZQ={audio:rt,document:Le,image:ue,source:et,unknown:it,video:ft},QQ=e=>{if(e.type===`source-document`)return`source`;let t=e.mediaType??``;return t.startsWith(`image/`)?`image`:t.startsWith(`video/`)?`video`:t.startsWith(`audio/`)?`audio`:t.startsWith(`application/`)||t.startsWith(`text/`)?`document`:`unknown`},$Q=(e,t,n)=>n?(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full object-cover`,height:96,src:e,width:96}):(0,M.jsx)(`img`,{alt:t||`Image`,className:`size-full rounded object-cover`,height:20,src:e,width:20}),e$=(0,N.createContext)(null),t$=(0,N.createContext)(null),n$=()=>(0,N.useContext)(e$)??{variant:`grid`},r$=()=>{let e=(0,N.useContext)(t$);if(!e)throw Error(`Attachment components must be used within <Attachment>`);return e},i$=({variant:e=`grid`,className:t,children:n,...r})=>{let i=(0,N.useMemo)(()=>({variant:e}),[e]);return(0,M.jsx)(e$.Provider,{value:i,children:(0,M.jsx)(`div`,{className:j(`flex items-start`,e===`list`?`flex-col gap-2`:`flex-wrap gap-2`,e===`grid`&&`ml-auto w-fit`,t),...r,children:n})})},a$=({data:e,onRemove:t,className:n,children:r,...i})=>{let{variant:a}=n$(),o=QQ(e),s=(0,N.useMemo)(()=>({data:e,mediaCategory:o,onRemove:t,variant:a}),[e,o,t,a]);return(0,M.jsx)(t$.Provider,{value:s,children:(0,M.jsx)(`div`,{className:j(`group relative`,a===`grid`&&`size-24 overflow-hidden rounded-lg`,a===`inline`&&[`flex h-8 cursor-pointer select-none items-center gap-1.5`,`rounded-md border border-border px-1.5`,`font-medium text-sm transition-all`,`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`],a===`list`&&[`flex w-full items-center gap-3 rounded-lg border p-3`,`hover:bg-accent/50`],n),...i,children:r})})},o$=({fallbackIcon:e,className:t,...n})=>{let{data:r,mediaCategory:i,variant:a}=r$(),o=a===`inline`?`size-3`:`size-4`,s=e=>(0,M.jsx)(e,{className:j(o,`text-muted-foreground`)}),c=()=>{if(i===`image`&&r.type===`file`&&r.url)return $Q(r.url,r.filename,a===`grid`);if(i===`video`&&r.type===`file`&&r.url)return(0,M.jsx)(`video`,{className:`size-full object-cover`,muted:!0,src:r.url});let t=ZQ[i];return e??s(t)};return(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center justify-center overflow-hidden`,a===`grid`&&`size-full bg-muted`,a===`inline`&&`size-5 rounded bg-background`,a===`list`&&`size-12 rounded bg-muted`,t),...n,children:c()})},s$=({label:e=`Remove`,className:t,children:n,...r})=>{let{onRemove:i,variant:a}=r$(),o=(0,N.useCallback)(e=>{e.stopPropagation(),i?.()},[i]);return i?(0,M.jsxs)(A,{"aria-label":e,className:j(a===`grid`&&[`absolute top-2 right-2 size-6 rounded-full p-0`,`bg-background/80 backdrop-blur-sm`,`opacity-0 transition-opacity group-hover:opacity-100`,`hover:bg-background`,`[&>svg]:size-3`],a===`inline`&&[`size-5 rounded p-0`,`opacity-0 transition-opacity group-hover:opacity-100`,`[&>svg]:size-2.5`],a===`list`&&[`size-8 shrink-0 rounded p-0`,`[&>svg]:size-4`],t),onClick:o,type:`button`,variant:`ghost`,...r,children:[n??(0,M.jsx)(le,{}),(0,M.jsx)(`span`,{className:`sr-only`,children:e})]}):null},c$=e=>(0,M.jsx)(_e,{...e}),l$=e=>(0,M.jsx)(Se,{...e}),u$=({className:e,children:t,title:n=`Model Selector`,...r})=>(0,M.jsxs)(xe,{"aria-describedby":void 0,className:j(`outline! border-none! p-0 outline-border! outline-solid!`,e),...r,children:[(0,M.jsx)(Te,{className:`sr-only`,children:n}),(0,M.jsx)(wB,{className:`**:data-[slot=command-input-wrapper]:h-auto`,children:t})]}),d$=({className:e,...t})=>(0,M.jsx)(TB,{className:j(`h-auto py-3.5`,e),...t}),f$=e=>(0,M.jsx)(EB,{...e}),p$=e=>(0,M.jsx)(DB,{...e}),m$=e=>(0,M.jsx)(OB,{...e}),h$=e=>(0,M.jsx)(kB,{...e}),g$=({provider:e,className:t,...n})=>(0,M.jsx)(`img`,{...n,alt:`${e} logo`,className:j(`size-3 dark:invert`,t),height:12,src:`https://models.dev/logos/${e}.svg`,width:12}),_$=({className:e,...t})=>(0,M.jsx)(`div`,{className:j(`flex shrink-0 items-center -space-x-1 [&>img]:rounded-full [&>img]:bg-background [&>img]:p-px [&>img]:ring-1 dark:[&>img]:bg-foreground`,e),...t}),v$=({className:e,...t})=>(0,M.jsx)(`span`,{className:j(`flex-1 truncate text-left`,e),...t});function y$(){let e=zB();return e.files.length===0?null:(0,M.jsx)(i$,{variant:`inline`,children:e.files.map(t=>(0,M.jsxs)(a$,{data:t,onRemove:()=>e.remove(t.id),children:[(0,M.jsx)(o$,{}),(0,M.jsx)(s$,{})]},t.id))})}function b$({autoApproveTools:e,enableSpawn:t,enableTeams:n,model:r,modelSelectorOpen:i,models:a,onAutoApproveToolsChange:o,onEnableSpawnChange:s,onEnableTeamsChange:c,onModelChange:l,onModelSelectorOpenChange:u,onProviderChange:d,provider:f,providers:p,workspaceRoot:m}){let h=p.find(e=>e.id===f),_=a.find(e=>e.id===r)??a[0]??void 0;return(0,M.jsxs)(`div`,{className:`grid gap-3 bg-background/70 p-3`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(De,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Provider`}),(0,M.jsxs)(ye,{onValueChange:e=>{e&&d(e)},value:f,children:[(0,M.jsx)(Oe,{className:`w-full`,children:(0,M.jsx)(ke,{placeholder:`Select provider`})}),(0,M.jsx)(ve,{children:p.map(e=>(0,M.jsx)(ge,{value:e.id,children:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x$(e.id),(0,M.jsx)(`span`,{children:e.name})]})},e.id))})]})]}),(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(De,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,children:`Model`}),(0,M.jsxs)(c$,{onOpenChange:u,open:i,children:[(0,M.jsx)(l$,{children:(0,M.jsx)(A,{className:`w-full justify-between`,variant:`outline`,children:(0,M.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[h&&x$(h.id),(0,M.jsx)(`span`,{className:`truncate`,children:_?.name||_?.id||`Select model`})]})})}),(0,M.jsxs)(u$,{children:[(0,M.jsx)(d$,{placeholder:`Search models...`}),(0,M.jsxs)(f$,{children:[(0,M.jsx)(p$,{children:`No models found.`}),(0,M.jsx)(m$,{heading:h?.name||`Models`,children:a.map(e=>(0,M.jsxs)(h$,{onSelect:()=>{l(e.id),u(!1)},value:e.id,children:[h&&x$(h.id),(0,M.jsx)(v$,{children:e.name||e.id}),(0,M.jsx)(_$,{children:h&&x$(h.id)}),r===e.id?(0,M.jsx)(g,{className:`ml-auto size-4`}):(0,M.jsx)(`div`,{className:`ml-auto size-4`})]},e.id))})]})]})]})]})]}),(0,M.jsx)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:(0,M.jsxs)(`div`,{className:`grid gap-2`,children:[(0,M.jsx)(De,{className:`text-xs uppercase tracking-[0.16em] text-muted-foreground`,htmlFor:`workspace-root`,children:`Workspace`}),(0,M.jsx)(E,{id:`workspace-root`,readOnly:!0,value:m})]})}),(0,M.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-2`,children:[(0,M.jsx)(S$,{checked:t,label:`Subagents`,onChange:s}),(0,M.jsx)(S$,{checked:n,label:`Agent Teams`,onChange:c}),(0,M.jsx)(S$,{checked:e,label:`Auto-approves`,onChange:o})]})]})}function x$(e){return(0,M.jsx)(g$,{className:`size-3.5`,provider:e||`openai`})}function S$({checked:e,label:t,onChange:n,disabled:r}){return(0,M.jsxs)(`div`,{className:`flex items-center justify-between rounded-lg border bg-background/60 px-3 py-2`,children:[(0,M.jsx)(De,{className:`text-sm`,htmlFor:t,children:t}),(0,M.jsx)(Pe,{checked:e,id:t,onCheckedChange:e=>n(e),disabled:r})]})}var C$={None:`none`,Low:`low`,Medium:`medium`,High:`high`},w$=[{value:C$.None,label:`Thinking Off`,icon:st},{value:C$.Low,label:`Low`,icon:ot},{value:C$.Medium,label:`Medium`,icon:ct},{value:C$.High,label:`High`,icon:st}];function T$({autoApproveTools:e,disabled:t=!1,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,mode:s,modelSelectorOpen:c,models:l,onAbort:u,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onModeChange:h,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSend:b,onSystemPromptChange:x,onReasonLevelChange:S,provider:C,providers:w,sending:T,status:E,systemPrompt:ee,reasonLevel:D,workspaceRoot:te}){let[O,ne]=(0,N.useState)(!1),k=PB(),re=zB(),ie=l.find(e=>e.id===o)?.supportsThinking===!0,ae=ie?D:C$.None,oe=Math.max(w$.findIndex(e=>e.value===ae),0),se=w$[oe].icon;return(0,M.jsx)(`div`,{className:`border-t bg-background`,children:(0,M.jsxs)(VB,{accept:`image/*,.txt,.md,.json,.ts,.tsx,.js,.jsx`,globalDrop:!0,className:`rounded-none [&>[data-slot=input-group]]:border-0! [&>[data-slot=input-group]]:ring-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:border-0! [&>[data-slot=input-group]]:has-[[data-slot=input-group-control]:focus-visible]:ring-0!`,maxFiles:8,multiple:!0,onError:e=>XQ.error(e.message),onSubmit:async e=>{let t=e.text.trim();if(!t&&!e.files.length)return;let n;if(e.files.length>0){let t=(await Promise.all(e.files.map(e=>E$(e.url)))).filter(e=>!!e);t.length>0&&(n={userImages:t}),t.length!==e.files.length&&XQ.warning(`Only image attachments are currently sent in the VS Code chat runtime.`)}!t&&!n?.userImages?.length||b({prompt:t,attachments:n,attachmentCount:e.files.length})},children:[(0,M.jsx)(WB,{children:(0,M.jsx)(y$,{})}),(0,M.jsx)(HB,{children:(0,M.jsx)(UB,{disabled:t||E.includes(`Failed`),onChange:e=>k.textInput.setInput(e.target.value),placeholder:`Type @ for context and / for skills`,value:k.textInput.value,className:`text-sm outline-none ring-0`})}),(0,M.jsxs)(GB,{className:`flex-col items-stretch gap-1 px-0`,children:[O?(0,M.jsx)(b$,{autoApproveTools:e,enableSpawn:n,enableTeams:r,enableTools:i,maxIterations:a,model:o,modelSelectorOpen:c,models:l,onAutoApproveToolsChange:d,onEnableSpawnChange:f,onEnableTeamsChange:p,onEnableToolsChange:m,onMaxIterationsChange:g,onModelChange:_,onModelSelectorOpenChange:v,onProviderChange:y,onSystemPromptChange:x,provider:C,providers:w,systemPrompt:ee,workspaceRoot:te}):null,(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsxs)(KB,{className:`shrink-0`,children:[(0,M.jsx)(qB,{disabled:t,onClick:()=>re.openFileDialog(),type:`button`,variant:`ghost`,children:(0,M.jsx)(it,{className:`size-3`})}),(0,M.jsxs)(qB,{disabled:t,onClick:()=>ne(e=>!e),type:`button`,variant:O?`default`:`ghost`,children:[(0,M.jsx)(at,{className:`size-3`}),(0,M.jsxs)(`span`,{children:[C,`:`,o]})]}),(0,M.jsx)(qB,{disabled:t||!ie,onClick:()=>{S(w$[(oe+1)%w$.length].value)},type:`button`,title:w$[oe].label,variant:ae===C$.None?`ghost`:`default`,children:(0,M.jsx)(se,{className:`size-3`})}),(0,M.jsxs)(qB,{disabled:t,onClick:()=>h(s===`act`?`plan`:`act`),type:`button`,variant:s===`plan`?`default`:`ghost`,className:`hidden`,children:[s===`act`?(0,M.jsx)(Ne,{className:`size-3`}):(0,M.jsx)(tt,{className:`size-3`}),s]}),(0,M.jsx)(Ge,{className:`rounded-sm px-3 py-1 text-xs hidden`,variant:E.includes(`Error`)?`destructive`:`secondary`,children:E})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[T?(0,M.jsx)(A,{onClick:u,type:`button`,variant:`destructive`,children:`Abort`}):null,(0,M.jsx)(JB,{disabled:t||E.includes(`Failed`),status:T?`submitted`:`ready`,variant:`ghost`})]})]})]})]})})}async function E$(e){if(e){if(e.startsWith(`data:image/`))return e;if(e.startsWith(`blob:`))try{let t=await(await fetch(e)).blob();return t.type.startsWith(`image/`)?await new Promise(e=>{let n=new FileReader;n.onloadend=()=>{e(typeof n.result==`string`?n.result:void 0)},n.onerror=()=>e(void 0),n.readAsDataURL(t)}):void 0}catch{return}}}var D$=r({default:()=>r1}),O$={lastProvider:``,lastModelByProvider:{}};function k$(){try{let e=ae()?.getState();if(e?.modelSelection)return e.modelSelection}catch{}return O$}function A$(e){try{let t=ae();if(!t)return;let n=t.getState()??{};t.setState({...n,modelSelection:e})}catch{}}function j$(e){let t=Number.parseInt(e,10);return Number.isInteger(t)&&t>0?t:void 0}function M$(e,t,n){return{id:`${Date.now()}-${Math.random().toString(16).slice(2)}`,role:e,text:t,...n}}function N$(e,t,n=0){let r=n||(t?.userImages?.length??0);return r===0?e:`${e}${e.length>0?`
|
|
341
|
+
|
|
342
|
+
`:``}[attached ${r} file${r===1?``:`s`}]`}function P$(e){if(typeof e==`string`)return e;try{return JSON.stringify(e??null,null,2)}catch{return String(e)}}function F$(e,t,n){if(!t)return e;let r=n.current;if(r){let n=e.findIndex(e=>e.id===r);if(n>=0)return e.map((e,r)=>r===n?{...e,text:`${e.text}${t}`,blocks:I$(e.blocks,t)}:e)}let i=e.at(-1);if(i?.role===`assistant`)return n.current=i.id,[...e.slice(0,-1),{...i,text:`${i.text}${t}`,blocks:I$(i.blocks,t)}];let a=M$(`assistant`,t,{blocks:[{id:Pt(),type:`text`,text:t}]});return n.current=a.id,[...e,a]}function I$(e,t){let n=e??[];return n.at(-1)?.type===`text`?n.map((e,r)=>r===n.length-1&&e.type===`text`?{...e,text:`${e.text}${t}`}:e):[...n,{id:Pt(),type:`text`,text:t}]}function L$(e,t,n){let r=e??[];return r.at(-1)?.type===`reasoning`?r.map((e,i)=>i===r.length-1&&e.type===`reasoning`?{...e,text:`${e.text}${t}`,redacted:e.redacted||n}:e):[...r,{id:Pt(),type:`reasoning`,text:t,redacted:n}]}function R$(e,t){let n=e??[],r=n.findIndex(e=>e.type===`tool`&&(e.toolEvent.toolCallId&&t.toolCallId&&e.toolEvent.toolCallId===t.toolCallId||!e.toolEvent.toolCallId&&!t.toolCallId&&e.toolEvent.name===t.name&&e.toolEvent.state===`input-available`&&t.state!==`input-available`));return r===-1?[...n,{id:Pt(),type:`tool`,toolEvent:t}]:n.map((e,n)=>n===r&&e.type===`tool`?{...e,toolEvent:{...e.toolEvent,...t}}:e)}function z$(e,t,n,r){let i=t||(n?`[redacted]`:``);if(!i)return e;let a=r.current;if(a){let t=e.findIndex(e=>e.id===a);if(t>=0)return e.map((e,r)=>r===t?{...e,reasoning:`${e.reasoning??``}${i}`,reasoningRedacted:e.reasoningRedacted||n,blocks:L$(e.blocks,i,n)}:e)}let o=e.at(-1);if(o?.role===`assistant`)return r.current=o.id,[...e.slice(0,-1),{...o,reasoning:`${o.reasoning??``}${i}`,reasoningRedacted:o.reasoningRedacted||n,blocks:L$(o.blocks,i,n)}];let s=M$(`assistant`,``,{reasoning:i,reasoningRedacted:n,blocks:[{id:Pt(),type:`reasoning`,text:i,redacted:n}]});return r.current=s.id,[...e,s]}function B$(e,t,n){return e.some(e=>e.blocks?.some(e=>e.type===`media`&&e.media.id===t.id))?e:(n.current=void 0,[...e,M$(`assistant`,``,{blocks:[{id:`media:${t.id}`,type:`media`,media:t}]})])}function V$(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`object`&&e[0]!==null&&`result`in e[0]}function H$(e){return e==null?``:typeof e==`string`?e:typeof e==`object`?Object.values(e).filter(e=>typeof e==`string`||typeof e==`number`).map(String).join(` `):String(e)}function U$(e,t){return e==null?t:typeof e==`string`?e:JSON.stringify(e,null,2)}function W$(e){if(V$(e.output))return e.output.map((t,n)=>{let r=t.query??``,i=r?`${e.name}: ${r}`:e.name,a=t.success===!1?`output-error`:e.state,o=t.result??(t.success===!1?`(failed)`:`(no output)`),s=t.success===!1?t.result??`failed`:void 0;return{id:`${e.id}-${n}`,name:e.name,title:i,state:a,output:o,error:s}});let t=H$(e.input),n=t?`${e.name}: ${t}`:e.name;return[{id:e.id,name:e.name,title:n,state:e.state,output:e.error??U$(e.output,e.text),error:e.error}]}function G$(e){let t=/^Running (.+)\.\.\.$/.exec(e);return t?.[1]?t[1]:/^(.+?) (completed|failed:.*)$/.exec(e)?.[1]??`tool`}function K$(e){return e.includes(`failed:`)?`output-error`:e.endsWith(`completed`)?`output-available`:`input-available`}function q$(e,t){return e?.status===`failed`?`output-error`:e?.status===`completed`?`output-available`:e?.status===`running`?`input-available`:K$(t??``)}function J$(e,t){let n=e.findIndex(e=>e.toolCallId&&t.toolCallId&&e.toolCallId===t.toolCallId||!e.toolCallId&&!t.toolCallId&&e.name===t.name&&e.state===`input-available`&&t.state!==`input-available`);return n===-1?[...e,t]:e.map((e,r)=>r===n?{...e,text:t.text,state:t.state,output:t.output,error:t.error}:e)}function Y$(e,t,n,r){let i=r.current,a={id:Pt(),toolCallId:n?.toolCallId,name:n?.toolName??G$(t),state:q$(n,t),text:t,input:n?.input,output:n?.output,error:n?.error};return i?e.map(e=>e.id===i?{...e,toolEvents:J$(e.toolEvents??[],a),blocks:R$(e.blocks,a)}:e):[...e,M$(`meta`,t,{toolEvents:[a],blocks:[{id:Pt(),type:`tool`,toolEvent:a}]})]}function X$(e,t){if(t.length===0)return e;let n=[...e];for(let e of t){let t=n.at(-1);if(e.role===`assistant`&&t?.role===`assistant`){n[n.length-1]={...t,text:`${t.text}${e.text}`,reasoning:`${t.reasoning??``}${e.reasoning??``}`||void 0,reasoningRedacted:t.reasoningRedacted||e.reasoningRedacted||void 0,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}if(e.role===`meta`&&t?.role===`meta`&&(e.toolEvents?.length??0)>0){n[n.length-1]={...t,text:e.text||t.text,toolEvents:[...t.toolEvents??[],...e.toolEvents??[]],blocks:[...t.blocks??[],...e.blocks??[]]};continue}n.push(e)}return n}function Z$(e,t){return W$(e).map(e=>(0,M.jsxs)(DQ,{className:t,children:[(0,M.jsx)(AQ,{state:e.state,title:e.title,type:`dynamic-tool`,toolName:e.name}),(0,M.jsx)(jQ,{children:(0,M.jsx)(MQ,{errorText:e.error,output:e.output})})]},e.id))}function Q$(e){let t=[];for(let n of e.toolEvents??[])t.push({id:`legacy-tool-${n.id}`,type:`tool`,toolEvent:n});return e.reasoning&&t.push({id:`legacy-reasoning-${e.id}`,type:`reasoning`,text:e.reasoning,redacted:e.reasoningRedacted}),e.text&&t.push({id:`legacy-text-${e.id}`,type:`text`,text:e.text}),t}function $$(e,t){return(e.blocks?.length?e.blocks:Q$(e)).flatMap(e=>{switch(e.type){case`tool`:return e.toolEvent.name.startsWith(`team_`)?[(0,M.jsx)(HQ,{className:t.isMeta?`mt-3 w-full`:`mb-3 w-full`,events:[e.toolEvent]},e.id)]:Z$(e.toolEvent,t.isMeta?`mt-3`:`mb-3`);case`reasoning`:return[(0,M.jsxs)(xQ,{className:t.isMeta?`mt-3`:`mb-3`,defaultOpen:!1,children:[(0,M.jsx)(CQ,{}),(0,M.jsx)(wQ,{children:e.text})]},e.id)];case`media`:return[(0,M.jsx)(Mt,{classNames:{image:`max-h-96 max-w-full rounded-md`,audio:`w-full`,video:`max-h-96 max-w-full`,unavailable:`rounded-md border p-3 text-sm`},media:e.media},e.id)];case`text`:return t.isMeta?[(0,M.jsx)(`pre`,{className:`whitespace-pre-wrap font-inherit`,children:e.text},e.id)]:[(0,M.jsx)(vI,{children:(0,M.jsx)(yI,{children:e.text})},e.id)]}return[]})}function e1(e,t,n,r){return[...e,M$(`meta`,`Done (${t}) • iterations=${n} • input=${r?.inputTokens??0} output=${r?.outputTokens??0}`)]}function t1(e){return[e.title?.trim()||e.sessionId.slice(0,12),e.workspaceRoot?.trim()?e.workspaceRoot.trim().split(`/`).pop():void 0].filter(Boolean).join(` • `)}function n1(e){try{return new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(new Date(e))}catch{return`Checkpoint`}}function r1({initialSessionId:e,onSessionSelected:t}){let[n,r]=(0,N.useState)([]),[i,a]=(0,N.useState)(`Waiting for RPC initialization...`),[o,s]=(0,N.useState)(),[c,l]=(0,N.useState)(),[u,d]=(0,N.useState)(!1),[p,m]=(0,N.useState)([]),[h,_]=(0,N.useState)({}),[v,y]=(0,N.useState)({workspaceRoot:``,cwd:``}),[b,x]=(0,N.useState)([]),[S,C]=(0,N.useState)(``),[w,T]=(0,N.useState)(k$),[E,ee]=(0,N.useState)(()=>w.lastProvider),[D,te]=(0,N.useState)(()=>w.lastModelByProvider[w.lastProvider]??``),[ne,k]=(0,N.useState)(``),[re,ie]=(0,N.useState)(``),[ae,oe]=(0,N.useState)(`act`),[se,ce]=(0,N.useState)(`none`),[ue,de]=(0,N.useState)(!0),[pe,he]=(0,N.useState)(!1),[ge,_e]=(0,N.useState)(!0),[ve,ye]=(0,N.useState)(!0),[be,xe]=(0,N.useState)([]),[Se,Ce]=(0,N.useState)(!1),[we,Te]=(0,N.useState)(!1),[Ee,De]=(0,N.useState)(!1),[Oe,ke]=(0,N.useState)(null),Ae=(0,N.useRef)(void 0),je=(0,N.useRef)(void 0),Ne=(0,N.useRef)(void 0),Pe=(0,N.useRef)(void 0),Fe=(0,N.useRef)(t),Ie=(0,N.useRef)(w),Le=(0,N.useRef)(b),Re=(0,N.useRef)(v),ze=(0,N.useCallback)(e=>{Ne.current===e||Pe.current===e&&!Ne.current||(Pe.current=e,Ne.current=e,s(e),l(e),r([]),d(!1),xe([]),Ae.current=void 0,a(`Loading chat history for ${e}...`),t?.(e),O({type:`attachSession`,sessionId:e}))},[t]);(0,N.useEffect)(()=>{Ne.current=c},[c]),(0,N.useEffect)(()=>{Pe.current=o},[o]),(0,N.useEffect)(()=>{Fe.current=t},[t]),(0,N.useEffect)(()=>{Le.current=b},[b]),(0,N.useEffect)(()=>{Re.current=v},[v]),(0,N.useEffect)(()=>{let e=e=>{let t=e.data;if(!(!t||typeof t!=`object`||!(`type`in t)))switch(t.type){case`status`:a(t.text);return;case`error`:if(t.recoverable){a(`Recoverable error (run continues): ${t.text}`);return}a(`Error: ${t.text}`),d(!1),l(void 0),Ne.current=void 0,Ae.current=void 0,r(e=>{if(e.length===0)return e;let n=`Error: ${t.text}`,r=e.at(-1);return r?.role===`error`&&r.text===n?e:[...e,M$(`error`,n)]});return;case`defaults`:y(t.defaults),t.defaults.provider&&ee(t.defaults.provider),t.defaults.model&&te(t.defaults.model);return;case`sessions`:x(t.sessions);return;case`providers`:m(t.providers),ee(e=>{let n=e&&t.providers.some(t=>t.id===e)?e:``,r=k$().lastProvider,i=n||(r&&t.providers.some(e=>e.id===r)?r:``)||t.providers.find(e=>e.enabled)?.id||t.providers[0]?.id||``;return i&&O({type:`loadModels`,providerId:i}),i});return;case`models`:_(e=>({...e,[t.providerId]:t.models})),te(e=>{if(e&&t.models.some(t=>t.id===e))return e;let n=Re.current;if(n.provider===t.providerId&&n.model&&t.models.some(e=>e.id===n.model))return n.model;let r=k$().lastModelByProvider[t.providerId];return r&&t.models.some(e=>e.id===r)?r:t.models[0]?.id||``});return;case`session_started`:Pe.current=t.sessionId,s(t.sessionId),Fe.current?.(t.sessionId),Te(!1),C(``);return;case`session_hydrated`:if(Ne.current&&Ne.current!==t.sessionId)return;if(Pe.current=t.sessionId,Ne.current=void 0,s(t.sessionId),l(void 0),d(t.status===`running`),t.providerId&&ee(t.providerId),t.providerId&&t.modelId){let e={lastProvider:t.providerId,lastModelByProvider:{...Ie.current.lastModelByProvider,[t.providerId]:t.modelId}};Ie.current=e,T(e),A$(e),te(t.modelId)}Te(!1),C(Le.current.find(e=>e.sessionId===t.sessionId)?.title?.trim()||``),r(e=>{let n=t.status===`running`?X$(t.messages,e):t.messages;return Ae.current=t.status===`running`?[...n].reverse().find(e=>e.role===`assistant`)?.id:void 0,n}),a(t.status===`running`?`Attached to ${t.sessionId} (running)`:`Attached to ${t.sessionId}`);return;case`assistant_delta`:r(e=>F$(e,t.text,Ae));return;case`reasoning_delta`:r(e=>z$(e,t.text,t.redacted,Ae));return;case`assistant_media`:r(e=>B$(e,t.media,Ae));return;case`tool_event`:r(e=>Y$(e,t.text,t.event,Ae));return;case`approval_request`:xe(e=>{let n=e.findIndex(e=>e.approvalId===t.approvalId),r={...t,responding:!1};return n===-1?[...e,r]:e.map((e,t)=>t===n?r:e)}),a(`Waiting for approval: ${t.toolName}`);return;case`approval_resolved`:xe(e=>e.filter(e=>e.approvalId!==t.approvalId));return;case`turn_done`:a(`Done (${t.finishReason})`),d(!1),xe([]),Ae.current=void 0,r(e=>e1(e,t.finishReason,t.iterations,t.usage));return;case`reset_done`:Pe.current=void 0,Ne.current=void 0,s(void 0),l(void 0),d(!1),xe([]),Te(!1),C(``),Ae.current=void 0,Fe.current?.(void 0),a(`Started a new chat session.`),r([]);return;case`fork_done`:De(!1),ke(null),a(`Forked → new session ${t.newSessionId}`);return;case`fork_error`:De(!1),ke(t.text),a(`Fork failed: ${t.text}`);return}};return window.addEventListener(`message`,e),O({type:`ready`}),()=>{window.removeEventListener(`message`,e)}},[]),(0,N.useEffect)(()=>{!e||je.current===e||(je.current=e,ze(e))},[ze,e]),(0,N.useEffect)(()=>{E&&O({type:`loadModels`,providerId:E})},[E]),(0,N.useEffect)(()=>{if(!E||!D)return;let e=Ie.current;if(e.lastProvider===E&&e.lastModelByProvider[E]===D)return;let t={lastProvider:E,lastModelByProvider:{...e.lastModelByProvider,[E]:D}};Ie.current=t,T(t),A$(t)},[E,D]);let Be=h[E]??[],Ve=!!c,He=Be.find(e=>e.id===D)?.supportsThinking===!0?se:`none`,Ue=(0,N.useMemo)(()=>n.filter(e=>e.role!==`meta`||e.text),[n]),We=o&&typeof b.find(e=>e.sessionId===o)?.title==`string`&&b.find(e=>e.sessionId===o)?.title?.trim()||``,Ge=we?S:We,Ke=()=>{if(!o){Te(!1);return}let e=S.replace(/\s+/g,` `).trim();Te(!1),e!==We&&(C(e),O({type:`updateSessionMetadata`,sessionId:o,metadata:{title:e}}))},qe=(e,t)=>{xe(t=>t.map(t=>t.approvalId===e?{...t,responding:!0}:t)),O({type:`approval_response`,approvalId:e,approved:t,reason:t?`Approved in Cline Hub.`:fe}),a(t?`Approval sent.`:`Rejection sent.`)};return(0,M.jsx)(LB,{children:(0,M.jsxs)(`div`,{className:`relative flex h-screen flex-col overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between border-b px-4 py-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[b.length>0?(0,M.jsxs)(`select`,{className:`max-w-48 rounded-md border bg-background px-2 py-1 text-xs`,disabled:Ve,onChange:e=>{let t=e.target.value;if(!t){O({type:`reset`}),a(`Resetting session...`),xe([]);return}ze(t)},value:o??``,children:[(0,M.jsx)(`option`,{value:``,children:`New session`}),b.map(e=>(0,M.jsx)(`option`,{value:e.sessionId,children:t1(e)},e.sessionId))]}):null,Ve?(0,M.jsxs)(`span`,{className:`ml-2 inline-flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,M.jsx)(Me,{className:`size-3 animate-spin`}),`Loading history`]}):null,o?(0,M.jsx)(`input`,{className:`min-w-0 max-w-56 rounded-md border bg-muted px-2 py-1 text-xs`,disabled:Ve,onBlur:Ke,onChange:e=>C(e.target.value),onFocus:()=>{Te(!0),C(We)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),Ke())},placeholder:`Session title`,value:Ge}):null,o?(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{a(`Deleting ${o}...`),O({type:`deleteSession`,sessionId:o})},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(f,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`Delete session`})]}):null]}),(0,M.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,M.jsxs)(A,{disabled:Ve,onClick:()=>{O({type:`reset`}),a(`Resetting session...`),xe([])},size:`icon-sm`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(me,{className:`size-4`}),(0,M.jsx)(`span`,{className:`sr-only`,children:`New chat`})]})})]}),(0,M.jsxs)(Qt,{className:`min-h-0 flex-1`,children:[(0,M.jsxs)($t,{className:`px-4 py-5`,children:[Ve?(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,M.jsx)(Me,{className:`size-4 animate-spin`}),`Loading chat history...`]})}):Ue.length===0?(0,M.jsx)(`div`,{className:`flex h-full items-center align-middle justify-center rounded-xl border border-dashed px-6 py-16 text-center text-sm text-muted-foreground`,children:`How can I help you?`}):null,Ue.map(e=>e.role===`meta`||e.role===`error`?(0,M.jsx)(`div`,{className:j(`w-full rounded-lg border px-4 py-3 text-sm`,e.role===`error`?`border-destructive/40 bg-destructive/10 text-destructive`:`bg-muted/40 text-muted-foreground`),children:$$(e,{isMeta:!0})},e.id):(0,M.jsx)(_I,{from:e.role,children:(0,M.jsxs)(`div`,{children:[$$(e,{sending:u}),e.role===`user`&&e.checkpoint?(0,M.jsx)(It,{className:`mt-1 justify-end`,children:(0,M.jsxs)(Rt,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:u,onClick:()=>{e.checkpoint&&O({type:`restore`,checkpointRunCount:e.checkpoint.runCount})},tooltip:`Checkpoint from run ${e.checkpoint.runCount}`,type:`button`,variant:`ghost`,children:[(0,M.jsx)(Lt,{className:`size-3`}),n1(e.checkpoint.createdAt)]})}):null,e.role===`assistant`&&e.text&&!u?(0,M.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,M.jsxs)(A,{className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground`,disabled:Ee,onClick:()=>{De(!0),ke(null),O({type:`forkSession`})},size:`sm`,title:`Fork session — copy full message history into a new session`,type:`button`,variant:`ghost`,children:[Ee?(0,M.jsx)(Me,{className:`size-3 animate-spin`}):(0,M.jsx)($e,{className:`size-3`}),`Fork`]}),Oe?(0,M.jsx)(`span`,{className:`text-[11px] text-destructive`,children:Oe}):null]}):null]})},e.id))]}),(0,M.jsx)(en,{})]}),be.length>0?(0,M.jsx)(`div`,{className:`grid max-h-72 gap-2 overflow-auto border-t bg-background/95 px-4 py-3`,children:be.map(e=>(0,M.jsxs)(`div`,{className:`grid gap-2 rounded-lg border bg-card p-3 text-sm`,children:[(0,M.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`p`,{className:`font-semibold`,children:`Approve tool call?`}),(0,M.jsx)(`p`,{className:`break-all text-muted-foreground text-xs`,children:e.toolName})]}),(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!1),size:`sm`,type:`button`,variant:`destructive`,children:[(0,M.jsx)(le,{className:`size-4`}),`Reject`]}),(0,M.jsxs)(A,{disabled:e.responding,onClick:()=>qe(e.approvalId,!0),size:`sm`,type:`button`,children:[e.responding?(0,M.jsx)(Me,{className:`size-4 animate-spin`}):(0,M.jsx)(g,{className:`size-4`}),`Approve`]})]})]}),(0,M.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-md border bg-background p-2 text-[11px]`,children:P$(e.input)})]},e.approvalId))}):null,(0,M.jsx)(T$,{autoApproveTools:ve,disabled:Ve,enableSpawn:pe,enableTeams:ge,enableTools:ue,maxIterations:re,model:D,mode:ae,modelSelectorOpen:Se,models:Be,onAbort:()=>{O({type:`abort`}),a(`Abort requested...`)},onAutoApproveToolsChange:ye,onEnableSpawnChange:he,onEnableTeamsChange:_e,onEnableToolsChange:de,onModeChange:oe,onMaxIterationsChange:ie,onModelChange:te,onModelSelectorOpenChange:Ce,onProviderChange:e=>{ee(e);let t=w.lastModelByProvider[e],n=(h[e]??[]).map(e=>e.id);if(t&&n.includes(t)){te(t);return}te(``)},onSend:({prompt:e,attachments:t,attachmentCount:n})=>{if(Ve)return;let i=M$(`assistant`,``);Ae.current=i.id,r(r=>[...r,M$(`user`,N$(e,t,n)),i]),d(!0),a(`Running...`),O({type:`send`,prompt:e,attachments:t,config:{autoApproveTools:ve,enableSpawn:pe,enableTeams:ge,enableTools:ue,maxIterations:j$(re),model:D||void 0,mode:ae,provider:E||void 0,reasonLevel:He,systemPrompt:ne.trim()||void 0}})},onSystemPromptChange:k,onReasonLevelChange:ce,provider:E,providers:p,sending:u,status:i,systemPrompt:ne,reasonLevel:He,workspaceRoot:v.workspaceRoot})]})})}export{Uw as a,r1 as default,AD as i,vT as n,ED as r,D$ as t};
|