@vertesia/ui 1.5.0-dev.20260826.064249Z → 1.5.0-dev.20260901.033115Z
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/lib/core/components/FormItem.d.ts.map +1 -1
- package/lib/core/components/FormItem.js +2 -3
- package/lib/core/components/FormItem.js.map +1 -1
- package/lib/core/components/InfoTip.d.ts +20 -0
- package/lib/core/components/InfoTip.d.ts.map +1 -0
- package/lib/core/components/InfoTip.js +18 -0
- package/lib/core/components/InfoTip.js.map +1 -0
- package/lib/core/components/index.d.ts +1 -0
- package/lib/core/components/index.d.ts.map +1 -1
- package/lib/core/components/index.js +1 -0
- package/lib/core/components/index.js.map +1 -1
- package/lib/core/components/shadcn/Panel.d.ts.map +1 -1
- package/lib/core/components/shadcn/Panel.js +3 -3
- package/lib/core/components/shadcn/Panel.js.map +1 -1
- package/lib/features/store/objects/search/DocumentSearchContext.d.ts +15 -0
- package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
- package/lib/features/store/objects/search/DocumentSearchContext.js +45 -2
- package/lib/features/store/objects/search/DocumentSearchContext.js.map +1 -1
- package/lib/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
- package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js +5 -0
- package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.js +1 -1
- package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
- package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -1
- package/lib/features/store/types/IntakePolicyForm.js +15 -15
- package/lib/features/store/types/IntakePolicyForm.js.map +1 -1
- package/lib/features/store/types/TypeRegistry.d.ts +10 -0
- package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +10 -0
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
- package/lib/i18n/locales/ar.json +35 -0
- package/lib/i18n/locales/de.json +35 -0
- package/lib/i18n/locales/en.json +35 -0
- package/lib/i18n/locales/es.json +35 -0
- package/lib/i18n/locales/fr.json +35 -0
- package/lib/i18n/locales/it.json +35 -0
- package/lib/i18n/locales/ja.json +35 -0
- package/lib/i18n/locales/ko.json +35 -0
- package/lib/i18n/locales/pt.json +35 -0
- package/lib/i18n/locales/ru.json +35 -0
- package/lib/i18n/locales/tr.json +35 -0
- package/lib/i18n/locales/zh-TW.json +35 -0
- package/lib/i18n/locales/zh.json +35 -0
- package/lib/router/RouteComponent.d.ts +8 -0
- package/lib/router/RouteComponent.d.ts.map +1 -1
- package/lib/router/RouteComponent.js +41 -9
- package/lib/router/RouteComponent.js.map +1 -1
- package/lib/session/UserSessionProvider.d.ts.map +1 -1
- package/lib/session/UserSessionProvider.js +12 -13
- package/lib/session/UserSessionProvider.js.map +1 -1
- package/lib/session/auth/domainRouting.d.ts +11 -0
- package/lib/session/auth/domainRouting.d.ts.map +1 -1
- package/lib/session/auth/domainRouting.js +13 -0
- package/lib/session/auth/domainRouting.js.map +1 -1
- package/lib/session/useUXTracking.d.ts.map +1 -1
- package/lib/session/useUXTracking.js +6 -1
- package/lib/session/useUXTracking.js.map +1 -1
- package/lib/vertesia-ui-core.js +199 -4
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +975 -33
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.js +2 -38
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js.map +1 -0
- package/lib/vertesia-ui-layout.js +80 -1
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-rich-text.js +278 -4
- package/lib/vertesia-ui-rich-text.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +118 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +336 -20
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +7 -7
- package/src/core/components/FormItem.tsx +2 -5
- package/src/core/components/InfoTip.test.tsx +33 -0
- package/src/core/components/InfoTip.tsx +32 -0
- package/src/core/components/index.ts +1 -0
- package/src/core/components/shadcn/Panel.tsx +3 -7
- package/src/features/store/objects/search/DocumentSearchContext.test.ts +45 -0
- package/src/features/store/objects/search/DocumentSearchContext.ts +50 -2
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +5 -0
- package/src/features/store/types/IntakePolicyEditor.tsx +3 -4
- package/src/features/store/types/IntakePolicyForm.tsx +120 -20
- package/src/i18n/locales/ar.json +35 -0
- package/src/i18n/locales/de.json +35 -0
- package/src/i18n/locales/en.json +35 -0
- package/src/i18n/locales/es.json +35 -0
- package/src/i18n/locales/fr.json +35 -0
- package/src/i18n/locales/it.json +35 -0
- package/src/i18n/locales/ja.json +35 -0
- package/src/i18n/locales/ko.json +35 -0
- package/src/i18n/locales/pt.json +35 -0
- package/src/i18n/locales/ru.json +35 -0
- package/src/i18n/locales/tr.json +35 -0
- package/src/i18n/locales/zh-TW.json +35 -0
- package/src/i18n/locales/zh.json +35 -0
- package/src/router/RouteComponent.test.tsx +139 -0
- package/src/router/RouteComponent.tsx +54 -9
- package/src/session/UserSessionProvider.tsx +12 -11
- package/src/session/auth/domainRouting.test.ts +24 -1
- package/src/session/auth/domainRouting.ts +29 -0
- package/src/session/useUXTracking.tsx +6 -1
|
@@ -1,5 +1,279 @@
|
|
|
1
|
-
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{MarkdownComponentEditor as r,MarkdownDocumentEditor as i,MarkdownRichTextEditor as a,getMarkdownCompatibility as o}from"@vertesia/rich-text";import{Button as s,DropdownMenu as c,DropdownMenuContent as l,DropdownMenuItem as u,DropdownMenuTrigger as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,Spinner as g,Textarea as _,VTooltip as v,cn as y,usePortalContainer as b,useToast as x}from"@vertesia/ui/core";import{useUITranslation as S}from"@vertesia/ui/i18n";import C,{Suspense as w,createContext as T,lazy as E,memo as D,useCallback as O,useContext as k,useEffect as A,useId as ee,useMemo as j,useRef as M,useState as N}from"react";import*as P from"@radix-ui/react-dialog";import{useUserSession as te}from"@vertesia/ui/session";import{BarChart3 as F,Bold as ne,Check as re,ChevronDown as ie,Code as I,Copy as ae,Download as oe,FileText as L,GitBranch as se,Image as R,Italic as ce,Link as le,List as ue,ListOrdered as z,Loader2 as de,Maximize2 as B,MessageSquare as fe,MessageSquarePlus as V,Minimize2 as pe,Minus as me,Quote as H,Redo2 as U,Send as he,SquareCode as ge,Strikethrough as _e,Table as ve,Undo2 as ye,X as be}from"lucide-react";import xe from"papaparse";import{clsx as Se}from"clsx";import{twMerge as Ce}from"tailwind-merge";import{FusionFragmentHandler as W,FusionFragmentProvider as we}from"@vertesia/fusion-ux";import Te from"dompurify";import Ee,{defaultUrlTransform as De}from"react-markdown";import{defListHastHandlers as Oe,remarkDefinitionList as ke}from"remark-definition-list";import Ae from"remark-directive";import je from"remark-gfm";import Me from"remark-github-blockquote-alert";import Ne from"remark-math";import Pe from"remark-supersub";import{SKIP as Fe,visit as Ie}from"unist-util-visit";import{FloatingPortal as Le,autoUpdate as Re,flip as ze,offset as Be,shift as Ve,useFloating as He}from"@floating-ui/react";const Ue=C.createContext({});function We({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=j(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(Ue.Provider,{value:o,children:e})}function G(){return C.useContext(Ue)}const Ge=T(null);function Ke(){return k(Ge)}function qe(...e){return Ce(Se(e))}const Je=T(null);function Ye(){return k(Je)}function Xe(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function Ze(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function Qe(e){return`file:${e}`}const $e=E(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function et({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-red-600 dark:text-red-400`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate`,children:e})]})})}function tt(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(de,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function nt({isOpen:e,onClose:r,title:i,description:a,children:o}){let{t:c}=S();return t(P.Root,{open:e,onOpenChange:e=>!e&&r(),children:n(P.Portal,{children:[t(P.Overlay,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(P.Content,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-white dark:bg-gray-900 rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:r,children:[t(P.Close,{asChild:!0,children:t(s,{variant:`unstyled`,onClick:r,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(be,{className:`w-5 h-5 text-gray-600 dark:text-gray-300`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:o}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-gray-200 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50 rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(P.Title,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:i||c(`agent.dashboard`)}),a&&t(P.Description,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:a})]})})]})]})})}function rt(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}const it={categorical:[`#6366f1`,`#8b5cf6`,`#ec4899`,`#f43f5e`,`#f97316`,`#eab308`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#3b82f6`],blues:[`#dbeafe`,`#93c5fd`,`#3b82f6`,`#1d4ed8`,`#1e3a8a`],purples:[`#f3e8ff`,`#c4b5fd`,`#8b5cf6`,`#6d28d9`,`#4c1d95`],greens:[`#dcfce7`,`#86efac`,`#22c55e`,`#15803d`,`#14532d`],diverging:[`#ef4444`,`#fca5a5`,`#fef3c7`,`#86efac`,`#22c55e`]};function at(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ot(e){return at(e)}function st(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(lt(t,r)||a&&ut(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function ct(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function lt(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(lt(n,t))return!0}return!1}function ut(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function dt(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{ot(e)&&n.push(...dt(e,[...t,r,String(i)]))}):ot(i)&&n.push(...dt(i,[...t,r]))}return n}function ft(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!at(n))break;i=n}let a=t[t.length-1],o=i[a];at(o)&&(delete o.url,o.values=r)}return n}function pt(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:it.categorical,diverging:it.diverging,heatmap:it.purples,ramp:it.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80}};return e?{...t,axis:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,gridColor:`#3f3f46`,domainColor:`#52525b`,tickColor:`#52525b`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#fafafa`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}:{...t,axis:{labelColor:`#71717a`,titleColor:`#3f3f46`,gridColor:`#e4e4e7`,domainColor:`#d4d4d8`,tickColor:`#d4d4d8`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#71717a`,titleColor:`#3f3f46`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#18181b`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}}const K=D(function({spec:r,artifactRunId:i}){let{t:a}=S(),{title:o,description:c,options:l}=r,u=r.spec,[d,f]=N(!1),[p,m]=N(!1),[h,g]=N(null),[_,v]=N(!1),y=M(null),b=M(null),x=M(null),{client:C}=te(),T=Ye(),E=M(C);E.current=C;let D=M(T);D.current=T;let[k,ee]=N(null),[P,F]=N(!1),[ne,ie]=N(null),I=l?.mode||`chart`,L=I===`dashboard`,se=l?.enableFullscreen??L,R=l?.height||rt(u,I);A(()=>{let e=dt(u);if(e.length===0){ee(u),F(!1),ie(null);return}i?console.info(`[VegaLiteChart] resolving artifacts with runId:`,i,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:i});let t=!1;return F(!0),ie(null),(async()=>{let n=new Map,r=E.current,a=D.current;for(let o of e)try{let e=o.path.join(`.`),t;if(i&&!Xe(o.artifactPath)){let e=Ze(i,o.artifactPath,`inline`);t=a?await a.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url}else{let e=Qe(o.artifactPath);t=a?await a.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let e=await s.text();l=xe.parse(e,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||ie(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=ft(u,n);ee(e),F(!1)}})(),()=>{t=!0}},[u,i]);let[ce,le]=N(!1),ue=M(!1);A(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==ue.current&&(ue.current=e,le(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[z,fe]=N(0),V=M(0);A(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==V.current&&(V.current=e,fe(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return V.current=n,fe(n),()=>{clearTimeout(e),t.disconnect()}},[]);let me=j(()=>dt(u).length>0,[u]),H=j(()=>{if(me&&!k)return null;let e=k||u;return e?(l?.parameterValues&&(e=ct(e,l.parameterValues)),st(e)):null},[k,u,me,l?.parameterValues]),U=O((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>U(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>U(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>U(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),he=O((e,t=!1)=>{if(!H)return null;let n=pt(ce),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:z>0?z-24:500,i=`vconcat`in H||`hconcat`in H||`concat`in H,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},s=H;i&&r&&(s=U(H,r));let c=s.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=s;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?s:d,...o&&!H.title?{title:o}:{},config:{...n,...H.config}}},[H,o,ce,z,U]),ge=O(async()=>{let e=_?b.current:y.current;if(!(!e||p))try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),_e=O(async()=>{let e=_?b.current:y.current;if(!(!e||d)){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${o||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[o,d,_]),ve=O(e=>{y.current=e,g(null)},[]),ye=O(e=>{b.current=e},[]),be=O(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),Se=O(()=>{v(e=>!e)},[]);A(()=>{g(null)},[u]);let Ce=({className:e})=>n(`div`,{className:qe(`flex items-center gap-2`,e),children:[n(s,{variant:`unstyled`,onClick:ge,disabled:p,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:a(`agent.copyToClipboard`),children:[t(p?re:ae,{className:`w-3 h-3`}),a(p?`agent.copied`:`agent.copy`)]}),n(s,{variant:`unstyled`,onClick:_e,disabled:d,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:a(`agent.exportAsPng`),children:[t(oe,{className:`w-3 h-3`}),a(d?`agent.exporting`:`agent.export`)]}),se&&n(s,{variant:`unstyled`,onClick:Se,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors flex items-center gap-1`,title:a(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?pe:B,{className:`w-3 h-3`}),a(_?`agent.exit`:`agent.fullscreen`)]})]});if(P||me&&!k)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:R},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(de,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(ne)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:R},children:t(et,{error:ne,chartTitle:o})})]})});if(h)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:R},children:t(et,{error:h,chartTitle:o})})]})});let W=he(R),we=he(0,!0);return W?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:o,hasData:!!W.data?.values,dataLength:W.data?.values?.length}),n(e,{children:[t(`div`,{className:qe(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,L&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||(L?`Dashboard`:`Chart`)}),L&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-300`,children:`Interactive`})]}),t(Ce,{})]}),c&&t(`span`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:c}),t(`div`,{ref:x,className:`bg-white dark:bg-gray-900 rounded overflow-hidden`,style:{width:`100%`,height:R,minWidth:0},children:t(w,{fallback:t(tt,{}),children:t($e,{spec:W,onEmbed:e=>ve(e.view),onError:be,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(nt,{isOpen:_,onClose:()=>v(!1),title:o||(L?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:we&&t(w,{fallback:t(tt,{}),children:t($e,{spec:we,onEmbed:e=>ye(e.view),onError:be,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(Ce,{className:`bg-white dark:bg-gray-800 rounded-lg shadow-lg p-2 border border-gray-200 dark:border-gray-700`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),mt={chart:{icon:F,label:`chart`,defaultHeight:200},mermaid:{icon:se,label:`diagram`,defaultHeight:150},proposal:{icon:fe,label:`options`,defaultHeight:100},code:{icon:I,label:`code`,defaultHeight:80},image:{icon:R,label:`image`,defaultHeight:150},link:{icon:le,label:`link`,defaultHeight:24},expand:{icon:oe,label:`content`,defaultHeight:100},table:{icon:ve,label:`table`,defaultHeight:150},markdown:{icon:L,label:`content`,defaultHeight:100},"fusion-fragment":{icon:I,label:`fragment`,defaultHeight:150}};function q({type:e,error:r,onRetry:i,message:a,height:o}){let c=mt[e],l=o??c.defaultHeight,u=e===`link`;if(r)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),i&&t(s,{variant:`unstyled`,onClick:i,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:a||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:a||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var J=class extends C.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(q,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function ht(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function gt(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function _t({content:e}){let{headers:r,rows:i}=j(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(q,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function vt({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function yt(e){return Te.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function bt(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function xt({content:e}){let n=j(()=>{let t=typeof e==`string`?e.trim():``;return t?bt(yt(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(q,{type:`expand`,error:`Empty mockup`})}function St({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function Ct({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=G();switch(j(()=>n===`auto`?ht(e,r,a):n,[e,r,a,n])){case`chart`:{let n=gt(e);return n?t(J,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(K,{spec:n,artifactRunId:i})}):t(q,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=gt(e);return n?t(J,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(K,{spec:n,artifactRunId:i})}):t(q,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!K}),n.template&&n.data?t(J,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(we,{data:n.data,ChartComponent:K,artifactRunId:i,children:t(W,{code:JSON.stringify(n.template),data:n.data})})}):t(J,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(W,{code:JSON.stringify(e)})})}case`table`:return t(J,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(_t,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(J,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(J,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(xt,{content:e})});case`image`:return t(J,{type:`image`,fallbackCode:r,children:t(St,{content:e,path:r})});default:return t(vt,{content:e,path:r})}}const wt=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function Tt(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function Et(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let Dt;function Ot(){return Dt||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:wt,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:wt}}),e)),Dt}function kt({code:e,className:n}){let r=M(null),[i,a]=N(null),[o,s]=N(null),c=ee().replace(/:/g,`_`);return A(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=Tt(e),{svg:i}=await(await Ot()).render(n,r),o=Et(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-gray-200 dark:bg-gray-700 rounded`})})}function At(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function jt({runId:e,path:t,parseJson:n=!0}){let{client:r}=te(),i=Ye(),a=M(r);a.current=r;let o=M(i);o.current=i;let[s,c]=N({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=O(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=At(t);try{let a=Ze(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);A(()=>{l()},[l]);let u=O(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Mt(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function Nt(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function Pt(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function Ft({code:e}){let{artifactRunId:n}=G();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=j(()=>Mt(e),[e]),i=j(()=>{if(r)return null;let t=Nt(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(q,{type:`chart`,message:`Loading chart...`}):i?t(J,{type:`chart`,fallbackCode:e,children:t(K,{spec:i,artifactRunId:n})}):t(q,{type:`chart`,error:`Invalid Vega-Lite specification`})}function It({code:e}){let{artifactRunId:n}=G();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=j(()=>Mt(e),[e]),i=j(()=>{if(r)return null;let t=Nt(e);return!t||!Pt(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(q,{type:`chart`,message:`Loading chart...`}):i?t(J,{type:`chart`,fallbackCode:e,children:t(K,{spec:i,artifactRunId:n})}):t(q,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function Lt({code:e}){let n=e.trim();return n?t(J,{type:`mermaid`,fallbackCode:e,children:t(kt,{code:n})}):t(q,{type:`mermaid`,error:`Empty diagram`})}function Rt({code:e}){let n=j(()=>{let t=e.trim();return t?bt(yt(t)):null},[e]);return n?t(J,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(q,{type:`code`,error:`Empty mockup`})}function zt({code:e,language:n}){let{artifactRunId:r}=G(),i=e.trim(),a=j(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=jt({runId:r,path:i});return r?s?t(q,{type:`expand`,message:`Loading ${i}...`}):c?t(q,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(q,{type:`expand`,error:`No content found in artifact`}):t(Ct,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(q,{type:`expand`,error:`No artifact run ID available`})}function Bt(e){return e?.startsWith(`expand`)??!1}function Vt(){return{chart:It,"vega-lite":Ft,vegalite:Ft,mermaid:Lt,mockup:Rt,svg:Rt}}const Ht=new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function Ut(e){return e.trim().replace(/^\/+/,``)}function Wt(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(Ht.has(n))return{scheme:n,path:Ut(e.slice(t+1))}}return{scheme:`standard`,path:e}}function Gt({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=te(),i=Ye(),a=M(r);a.current=r;let o=M(i);o.current=i;let{scheme:s,path:c}=Wt(e),[l,u]=N(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!Xe(c)?Ze(t,c,n):Qe(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=O(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!Xe(c)){let a=Ze(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=Qe(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=Qe(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);A(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=O(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function Kt({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=Wt(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(qt,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function qt({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=Gt({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(q,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(q,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function Jt({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=Wt(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(Yt,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function Yt({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=Gt({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(q,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(q,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}const Xt=T(()=>({kind:`none`}));Xt.Provider;function Zt(){return k(Xt)}const Qt={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function $t(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(Qt,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:Qt[n],id:r}}function en({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=$t(l);if(u)return t(tn,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=Wt(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(nn,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function tn({resource:e,rawHref:n,artifactRunId:r,className:i,children:a,ExistingLink:o,rest:c}){let l=Zt()(e,{workflowRunId:r,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof o==`function`?t(o,{href:l.href,className:i,...c,children:a}):t(`a`,{href:l.href,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:a}):l.kind===`activate`?t(s,{variant:`link`,size:`none`,className:i,onClick:l.onActivate,children:a}):t(`span`,{className:i,children:a})}function nn({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=Gt({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(q,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(q,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}const rn=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],an=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,on=/`[^`\n]*`/g,sn=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,cn=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function ln(e){return rn.some(t=>e.startsWith(t))}function un(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&ln(t.slice(1,n).trim()))return e}let n=t.match(cn)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return ln(r)?`<${r}>${i}`:e}function dn(e){return e.replace(an,(e,t,n,r)=>`${t}${un(n)}${r}`)}function fn(e){let t=``,n=0;for(let r of e.matchAll(on))t+=dn(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=dn(e.slice(n)),t}function pn(e){if(!e||!rn.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(sn))t+=fn(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=fn(e.slice(n)),t}const mn=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,hn=/^\w+/;function gn(e){return e?.includes(`:::`)?e.replace(mn,(e,t,n)=>{let r=n.trim(),i=hn.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const _n=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,vn=/`[^`\n]*`/g,yn=/\\\$/g,bn=/\\[^\s]/,xn=/[{}]/,Sn=/[_^][\w{]/,Cn=/^[a-zA-Z]$/,wn=/^[a-zA-Z]\s*=/,Tn=/^\s/,En=/\s$/,Dn=/[+*/-]$/,On=/\^[+-]$/;function kn(e){return bn.test(e)||xn.test(e)||Sn.test(e)||Cn.test(e)||wn.test(e)}function An(e){return!!(Tn.test(e)||En.test(e)||Dn.test(e)&&!On.test(e))}function jn(e){let t=[];for(let n=0;n<e.length;n++)if(e[n]===`$`&&!(n>0&&e[n-1]===`\\`)){if(n+1<e.length&&e[n+1]===`$`){n++;continue}n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)}return t}function Mn(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
`)}function er(e,t){return{contextElement:e.view.dom,getBoundingClientRect:()=>{try{let n=e.view.coordsAtPos(t.to),r=Math.max(1,n.bottom-n.top);return new DOMRect(n.right,n.top,1,r)}catch{return e.view.dom.getBoundingClientRect()}}}}function tr({editor:e,selection:r,composing:i,draft:a,onStart:o,onDraftChange:c,onCancel:l,onAdd:u}){let{t:d}=S(),f=b(),{refs:p,floatingStyles:m}=He({placement:`right-start`,strategy:`fixed`,middleware:[Be(8),ze({fallbackPlacements:[`left-start`,`bottom-start`]}),Ve({padding:12})],whileElementsMounted:Re}),h=j(()=>er(e,r),[e,r]);return A(()=>{p.setPositionReference(h)},[h,p]),t(Le,{root:f,children:t(`div`,{ref:p.setFloating,style:m,className:`pointer-events-auto z-100`,children:i?n(`div`,{role:`dialog`,"aria-label":d(`agent.commentOnSelection`),className:`w-80 max-w-[calc(100vw-1.5rem)] space-y-2 rounded-lg border border-mixer-muted/25 bg-popover p-3 text-popover-foreground shadow-lg`,children:[n(`div`,{className:`line-clamp-2 text-xs text-muted`,children:[t(`span`,{className:`font-medium text-foreground`,children:d(`agent.commentingOn`)}),` `,n(`span`,{className:`italic`,children:[`“`,r.quote,`”`]})]}),t(_,{value:a,onChange:e=>c(e.target.value),placeholder:d(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),l();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u())}}),n(`div`,{className:`flex justify-end gap-2`,children:[t(s,{variant:`outline`,size:`sm`,onClick:l,children:d(`store.cancelEdit`)}),t(s,{size:`sm`,onClick:u,disabled:!a.trim(),children:d(`agent.addComment`)})]})]}):t(v,{description:d(`agent.commentOnSelection`),asChild:!0,children:t(s,{variant:`secondary`,size:`sm`,onMouseDown:Z,onClick:o,"aria-label":d(`agent.commentOnSelection`),className:`size-9 rounded-full p-0 shadow-md`,children:t(V,{className:`size-4`})})})})})}function Q({icon:e,label:n,active:r=!1,disabled:i=!1,onClick:a}){return t(s,{variant:`ghost`,size:`sm`,"aria-label":n,title:n,"aria-pressed":r,disabled:i,onMouseDown:Z,onClick:a,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,r&&`bg-muted text-foreground`),children:t(e,{className:`size-4`})})}function nr(){return t(`div`,{className:`mx-0.5 h-5 w-px shrink-0 bg-mixer-muted/30`,"aria-hidden":!0})}function rr({onSend:e,hasUnsentChanges:r,isSending:i,disabled:a}){let{t:o}=S();return n(s,{variant:r?`primary`:`ghost`,size:`sm`,className:y(`h-8 gap-1.5`,!r&&`text-muted`),onMouseDown:Z,onClick:()=>void e(),disabled:a||!r||i,children:[i?t(g,{size:`sm`}):t(he,{className:`size-3.5`}),o(`agent.sendChangesToAgent`)]})}function ir({editor:r,className:i,editable:a=!0,onSendComment:o,onSendChangesToAgent:f,hasUnsentChanges:p=!1,isSendingChanges:m=!1,sendChangesDisabled:h=!1,toolbarStatus:g}){let{t:_}=S(),v=x();Xn(r);let[b,C]=N(!1),[w,T]=N(``),[E,D]=N(null),[k,ee]=N(null),[j,P]=N([]),[te,F]=N(!1),[re,ae]=N(!1),oe=M(null);A(()=>{if(!r||!o)return;let e=()=>{let e=Qn(r);ee(e),e&&(oe.current=e)};return e(),r.on(`selectionUpdate`,e),r.on(`transaction`,e),()=>{r.off(`selectionUpdate`,e),r.off(`transaction`,e)}},[r,o]);let L=O(()=>{let e=oe.current;if(!e){v({status:`info`,title:_(`agent.selectTextToComment`),duration:2500});return}D(e),T(``),C(!0)},[_,v]),se=O(()=>{C(!1),D(null),T(``)},[]),R=O(()=>{let e=w.trim();!E||!e||(P(t=>[...t,{id:Zn(),...E,comment:e}]),C(!1),D(null),T(``),F(!0))},[w,E]),le=O(e=>{P(t=>t.filter(t=>t.id!==e))},[]),de=O(async()=>{if(!(!o||j.length===0||re)){ae(!0);try{await o($n(j)),P([]),F(!1)}finally{ae(!1)}}},[re,o,j]);if(!r)return null;let B=[1,2,3].find(e=>r.isActive(`heading`,{level:e})),fe=_(B===1?`richText.heading1`:B===2?`richText.heading2`:B===3?`richText.heading3`:`richText.paragraph`),V=r.isActive(`table`),pe=E??k;return n(e,{children:[n(`div`,{role:`toolbar`,"aria-label":_(`richText.blockStyle`),className:y(`flex min-h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-b border-mixer-muted/25 px-1.5 py-1`,i),children:[t(Q,{icon:ye,label:_(`richText.undo`),disabled:!a||!Yn(r).focus().undo().run(),onClick:()=>X(r).focus().undo().run()}),t(Q,{icon:U,label:_(`richText.redo`),disabled:!a||!Yn(r).focus().redo().run(),onClick:()=>X(r).focus().redo().run()}),t(nr,{}),n(c,{children:[t(d,{asChild:!0,children:n(s,{variant:`ghost`,size:`sm`,disabled:!a,onMouseDown:Z,className:`h-8 shrink-0 gap-1 px-2 text-xs font-medium text-foreground hover:bg-muted/60`,children:[fe,t(ie,{className:`size-3 opacity-60`})]})}),n(l,{align:`start`,children:[t(u,{onClick:()=>X(r).focus().setParagraph().run(),children:_(`richText.paragraph`)}),t(u,{onClick:()=>X(r).focus().setHeading({level:1}).run(),children:_(`richText.heading1`)}),t(u,{onClick:()=>X(r).focus().setHeading({level:2}).run(),children:_(`richText.heading2`)}),t(u,{onClick:()=>X(r).focus().setHeading({level:3}).run(),children:_(`richText.heading3`)})]})]}),t(nr,{}),t(Q,{icon:ne,label:_(`richText.bold`),active:r.isActive(`bold`),disabled:!a,onClick:()=>X(r).focus().toggleBold().run()}),t(Q,{icon:ce,label:_(`richText.italic`),active:r.isActive(`italic`),disabled:!a,onClick:()=>X(r).focus().toggleItalic().run()}),t(Q,{icon:_e,label:_(`richText.strike`),active:r.isActive(`strike`),disabled:!a,onClick:()=>X(r).focus().toggleStrike().run()}),t(Q,{icon:I,label:_(`richText.inlineCode`),active:r.isActive(`code`),disabled:!a,onClick:()=>X(r).focus().toggleCode().run()}),t(nr,{}),t(Q,{icon:ue,label:_(`richText.bulletList`),active:r.isActive(`bulletList`),disabled:!a,onClick:()=>X(r).focus().toggleBulletList().run()}),t(Q,{icon:z,label:_(`richText.orderedList`),active:r.isActive(`orderedList`),disabled:!a,onClick:()=>X(r).focus().toggleOrderedList().run()}),t(Q,{icon:H,label:_(`richText.blockquote`),active:r.isActive(`blockquote`),disabled:!a,onClick:()=>X(r).focus().toggleBlockquote().run()}),t(Q,{icon:ge,label:_(`richText.codeBlock`),active:r.isActive(`codeBlock`),disabled:!a,onClick:()=>X(r).focus().toggleCodeBlock().run()}),t(nr,{}),t(Q,{icon:me,label:_(`richText.horizontalRule`),disabled:!a,onClick:()=>X(r).focus().setHorizontalRule().run()}),n(c,{children:[t(d,{asChild:!0,children:t(s,{variant:`ghost`,size:`sm`,disabled:!a,"aria-label":_(`richText.tableActions`),title:_(V?`richText.tableActions`:`richText.table`),onMouseDown:Z,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,V&&`bg-muted`),children:t(ve,{className:`size-4`})})}),t(l,{align:`start`,children:V?n(e,{children:[t(u,{onClick:()=>X(r).focus().addRowBefore().run(),children:_(`richText.addRowAbove`)}),t(u,{onClick:()=>X(r).focus().addRowAfter().run(),children:_(`richText.addRowBelow`)}),t(u,{onClick:()=>X(r).focus().deleteRow().run(),children:_(`richText.deleteRow`)}),t(u,{onClick:()=>X(r).focus().addColumnBefore().run(),children:_(`richText.addColumnLeft`)}),t(u,{onClick:()=>X(r).focus().addColumnAfter().run(),children:_(`richText.addColumnRight`)}),t(u,{onClick:()=>X(r).focus().deleteColumn().run(),children:_(`richText.deleteColumn`)}),t(u,{onClick:()=>X(r).focus().deleteTable().run(),children:_(`richText.deleteTable`)})]}):t(u,{onClick:()=>X(r).focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:_(`richText.table`)})})]}),o||f?n(`div`,{className:`ms-auto flex shrink-0 items-center gap-1 ps-1`,children:[j.length>0?n(e,{children:[n(s,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs text-muted`,onClick:()=>F(e=>!e),children:[_(`agent.comments`),` (`,j.length,`)`]}),n(s,{size:`sm`,className:`h-8`,onClick:()=>void de(),disabled:re,children:[t(he,{className:`me-1 size-4`}),_(`agent.sendToAgent`)]})]}):null,f?n(e,{children:[g,t(rr,{onSend:f,hasUnsentChanges:p,isSending:m,disabled:h})]}):null]}):null]}),o&&pe?t(tr,{editor:r,selection:pe,composing:b,draft:w,onStart:L,onDraftChange:T,onCancel:se,onAdd:R}):null,te&&j.length>0?t(`ul`,{className:`max-h-48 shrink-0 space-y-1.5 overflow-y-auto border-b border-mixer-muted/15 px-3 py-2`,children:j.map(e=>n(`li`,{className:`flex items-start gap-2 rounded-md border border-mixer-muted/20 bg-muted/10 px-2 py-1.5`,children:[n(`div`,{className:`min-w-0 flex-1`,children:[n(`div`,{className:`truncate text-[11px] italic text-muted`,children:[`“`,e.quote,`”`]}),t(`div`,{className:`whitespace-pre-wrap text-xs text-foreground`,children:e.comment})]}),t(s,{variant:`ghost`,size:`sm`,"aria-label":_(`agent.deleteComment`),title:_(`agent.deleteComment`),className:`size-6 shrink-0 p-0 text-muted`,onClick:()=>le(e.id),children:t(be,{className:`size-3.5`})})]},e.id))}):null]})}const ar=Vt();function or({code:e,language:n}){let r=Ke(),i=n?r?.getComponent(n):void 0,a=n?ar[n]:void 0,o=n?.startsWith(`expand:`)?zt:i??a;return o?t(o,{code:e,language:n}):null}function sr({src:e,alt:n,title:r}){let{artifactRunId:i}=G();return r?t(Kt,{src:e,alt:n,caption:r,artifactRunId:i}):t(Jt,{src:e,alt:n,artifactRunId:i})}function cr({href:e,title:n,children:r}){let{artifactRunId:i}=G();return t(en,{href:e,artifactRunId:i,children:t(`span`,{title:n,children:r})})}function lr({raw:e}){let{artifactRunId:n}=G();return t(Y,{artifactRunId:n,children:e})}const $={codeBlock:or,image:sr,link:cr,opaqueBlock:lr};function ur({artifactRunId:e,...n}){return t(We,{artifactRunId:e,MarkdownRenderer:Y,children:t(a,{...n,...$})})}function dr({artifactRunId:e,className:i,contentClassName:a,editorClassName:o,onEditor:s,...c}){let[l,u]=N(null),d=O(e=>{u(e),s?.(e)},[s]);return t(We,{artifactRunId:e,MarkdownRenderer:Y,children:n(`div`,{className:y(`overflow-hidden rounded-md border border-mixer-muted/30 bg-background`,i),children:[t(ir,{editor:l,editable:c.editable!==!1}),t(r,{...c,...$,onEditor:d,contentClassName:y(`max-h-80 overflow-auto`,a),editorClassName:y(`vprose prose-sm min-h-24 max-w-none px-3 py-2 outline-none`,o)})]})})}function fr({artifactRunId:e,className:r,contentClassName:a,editorClassName:c,onEditor:l,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g=!1,isSendingChanges:v=!1,sendChangesDisabled:b=!1,toolbarStatus:x,...C}){let{t:w}=S(),[T,E]=N(null),D=O(e=>{E(e),l?.(e)},[l]),[k,A]=N(()=>o(C.value)===`lossy`?`choose`:`rich-text`);return n(We,{artifactRunId:e,MarkdownRenderer:Y,children:[(k===`choose`?`source`:k)===`rich-text`?n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[t(ir,{editor:T,editable:C.editable!==!1,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g,isSendingChanges:v,sendChangesDisabled:b,toolbarStatus:x}),t(i,{...C,...$,onEditor:D,ariaLabel:C.ariaLabel??w(`richText.documentEditor`),className:`flex min-h-0 flex-1 flex-col`,contentClassName:y(`min-h-0 flex-1 overflow-auto`,a),editorClassName:y(`vprose prose-sm mx-auto min-h-full w-full max-w-5xl px-6 py-5 outline-none`,c)})]}):n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[d?n(`div`,{className:`flex min-h-10 shrink-0 items-center justify-end gap-1 border-b border-mixer-muted/25 px-1.5 py-1`,children:[x,t(rr,{onSend:d,hasUnsentChanges:g,isSending:v,disabled:b})]}):null,t(_,{value:C.value,onChange:e=>C.onChange?.(e.target.value),onFocus:()=>C.onFocusChange?.(!0),onBlur:()=>C.onFocusChange?.(!1),disabled:C.editable===!1,"aria-label":w(`richText.markdownSourceEditor`),className:y(`vertesia-markdown-document-editor-content min-h-0 flex-1 resize-none rounded-none`,`border-0 px-6 py-5 font-mono text-sm leading-6 outline-none focus-visible:ring-0`,a,c)})]}),n(f,{isOpen:k===`choose`,onClose:()=>A(`source`),className:`sm:max-w-lg`,disableCloseOnClickOutside:!0,children:[t(h,{children:w(`richText.sourceCompatibilityWarningTitle`)}),t(p,{children:t(`p`,{className:`text-sm text-muted`,children:w(`richText.sourceCompatibilityWarningDescription`)})}),n(m,{align:`right`,children:[t(s,{variant:`outline`,onClick:()=>A(`source`),children:w(`richText.editMarkdownSource`)}),t(s,{variant:`secondary`,onClick:()=>A(`rich-text`),children:w(`richText.continueRichText`)})]})]})]})}export{dr as VertesiaMarkdownComponentEditor,fr as VertesiaMarkdownDocumentEditor,ur as VertesiaMarkdownRichTextEditor,$ as vertesiaRichTextRenderers};
|
|
1
|
+
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{MarkdownComponentEditor as r,MarkdownDocumentEditor as i,MarkdownRichTextEditor as a,getMarkdownCompatibility as o}from"@vertesia/rich-text";import{Button as s,DropdownMenu as c,DropdownMenuContent as l,DropdownMenuItem as u,DropdownMenuTrigger as d,Modal as f,ModalBody as p,ModalFooter as m,ModalTitle as h,Spinner as g,Textarea as _,VTooltip as v,cn as y,usePortalContainer as b,useToast as x}from"@vertesia/ui/core";import{useUITranslation as S}from"@vertesia/ui/i18n";import*as C from"react";import w,{Suspense as T,createContext as E,createElement as D,forwardRef as O,lazy as k,memo as A,useCallback as j,useContext as M,useEffect as N,useId as ee,useMemo as P,useRef as F,useState as I}from"react";import{DismissableLayer as te,useDismissableLayerSurface as ne}from"@radix-ui/react-dismissable-layer";import{FocusScope as re}from"@radix-ui/react-focus-scope";import*as ie from"react-dom";import{useFocusGuards as ae}from"@radix-ui/react-focus-guards";import{RemoveScroll as oe}from"react-remove-scroll";import{hideOthers as se}from"aria-hidden";import{useUserSession as ce}from"@vertesia/ui/session";import le from"papaparse";import{clsx as ue}from"clsx";import{twMerge as de}from"tailwind-merge";import{FusionFragmentHandler as fe,FusionFragmentProvider as pe}from"@vertesia/fusion-ux";import me from"dompurify";import{FloatingPortal as he,autoUpdate as ge,flip as _e,offset as ve,shift as ye,useFloating as be}from"@floating-ui/react";var xe=Object.create,Se=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,we=Object.getOwnPropertyNames,Te=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty,De=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},Oe=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),ke=(e,t)=>{let n={};for(var r in e)Se(n,r,{get:e[r],enumerable:!0});return t||Se(n,Symbol.toStringTag,{value:`Module`}),n},Ae=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=we(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ee.call(e,s)&&s!==n&&Se(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ce(t,s))||r.enumerable});return e},je=(e,t,n)=>(n=e==null?{}:xe(Te(e)),Ae(t||!e||!e.__esModule||!Ee.call(e,`default`)?Se(n,`default`,{value:e,enumerable:!0}):n,e)),Me=e=>Ee.call(e,`module.exports`)?e[`module.exports`]:Ae(Se({},`__esModule`,{value:!0}),e);const Ne=w.createContext({});function Pe({children:e,artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}){let o=P(()=>({artifactRunId:n,onProposalSelect:r,onProposalSubmit:i,MarkdownRenderer:a}),[n,r,i,a]);return t(Ne.Provider,{value:o,children:e})}function Fe(){return w.useContext(Ne)}const Ie=E(null);function Le(){return M(Ie)}var Re=Object.defineProperty,ze=(e,t)=>Re(e,`name`,{value:t,configurable:!0}),Be=!!(typeof window<`u`&&window.document&&window.document.createElement);function Ve(e,t,{checkForDefaultPrevented:n=!0}={}){return ze(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ze(Ve,`composeEventHandlers`);function He(e){if(!Be)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ze(He,`getOwnerWindow`);function Ue(e){if(!Be)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ze(Ue,`getOwnerDocument`);function We(e,t=!1){let{activeElement:n}=Ue(e);if(!n?.nodeName)return null;if(Ge(n)&&n.contentDocument)return We(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Ue(n).getElementById(e);if(t)return t}}return n}ze(We,`getActiveElement`);function Ge(e){return e.tagName===`IFRAME`}ze(Ge,`isFrame`);var Ke=Object.defineProperty,qe=(e,t)=>Ke(e,`name`,{value:t,configurable:!0});function Je(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qe(Je,`setRef`);function Ye(...e){return t=>{let n=!1,r=e.map(e=>{let r=Je(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():Je(e[t],null)}}}}qe(Ye,`composeRefs`);function Xe(...e){return C.useCallback(Ye(...e),e)}qe(Xe,`useComposedRefs`);var Ze=Object.defineProperty,Qe=(e,t)=>Ze(e,`name`,{value:t,configurable:!0});function $e(e,n){let r=C.createContext(n);r.displayName=e+`Context`;let i=Qe(e=>{let{children:n,...i}=e,a=C.useMemo(()=>i,Object.values(i));return t(r.Provider,{value:a,children:n})},`Provider`);i.displayName=e+`Provider`;function a(t,i={}){let{optional:a=!1}=i,o=C.useContext(r);if(o)return o;if(n!==void 0)return n;if(!a)throw Error(`\`${t}\` must be used within \`${e}\``)}return Qe(a,`useContext`),[i,a]}Qe($e,`createContext`);function et(e,n=[]){let r=[];function i(n,i){let a=C.createContext(i);a.displayName=n+`Context`;let o=r.length;r=[...r,i];let s=Qe(n=>{let{scope:r,children:i,...s}=n,c=r?.[e]?.[o]||a,l=C.useMemo(()=>s,Object.values(s));return t(c.Provider,{value:l,children:i})},`Provider`);s.displayName=n+`Provider`;function c(t,r,s={}){let{optional:c=!1}=s,l=r?.[e]?.[o]||a,u=C.useContext(l);if(u)return u;if(i!==void 0)return i;if(!c)throw Error(`\`${t}\` must be used within \`${n}\``)}return Qe(c,`useContext`),[s,c]}Qe(i,`createContext`);let a=Qe(()=>{let t=r.map(e=>C.createContext(e));return Qe(function(n){let r=n?.[e]||t;return C.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return a.scopeName=e,[i,tt(a,...n)]}Qe(et,`createContextScope`);function tt(...e){let t=e[0];if(e.length===1)return t;let n=Qe(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Qe(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Qe(tt,`composeContextScopes`);var nt=globalThis?.document?C.useLayoutEffect:()=>{},rt=Object.defineProperty,it=(e,t)=>rt(e,`name`,{value:t,configurable:!0}),at=C.useId||(()=>void 0),ot=0;function st(e){let[t,n]=C.useState(at());return nt(()=>{e||n(e=>e??String(ot++))},[e]),e||(t?`radix-${t}`:``)}it(st,`useId`);var ct=Object.defineProperty,lt=(e,t)=>ct(e,`name`,{value:t,configurable:!0}),ut=C.useEffectEvent,dt=C.useInsertionEffect;function ft(e){if(typeof ut==`function`)return ut(e);let t=C.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof dt==`function`?dt(()=>{t.current=e}):nt(()=>{t.current=e}),C.useMemo(()=>((...e)=>t.current?.(...e)),[])}lt(ft,`useEffectEvent`);var pt=Object.defineProperty,mt=(e,t)=>pt(e,`name`,{value:t,configurable:!0}),ht=C.useInsertionEffect||nt;function gt({prop:e,defaultProp:t,onChange:n=mt(()=>{},`onChange`),caller:r}){let[i,a,o]=_t({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,C.useCallback(t=>{if(s){let n=vt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}mt(gt,`useControllableState`);function _t({defaultProp:e,onChange:t}){let[n,r]=C.useState(e),i=C.useRef(n),a=C.useRef(t);return ht(()=>{a.current=t},[t]),C.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}mt(_t,`useUncontrolledState`);function vt(e){return typeof e==`function`}mt(vt,`isFunction`);var yt=Symbol(`RADIX:SYNC_STATE`);function bt(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=ft(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=C.useReducer((t,n)=>{if(n.type===yt)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=C.useRef(p);C.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=C.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return C.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:yt,state:i})},[i,d.state,c]),[h,f]}mt(bt,`useControllableStateReducer`);var xt=Object.defineProperty,St=(e,t)=>xt(e,`name`,{value:t,configurable:!0});function Ct(e){let t=C.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];jt(r)&&typeof Ft==`function`&&(r=Ft(r._payload)),C.Children.forEach(r,e=>{if(kt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;jt(n)&&typeof Ft==`function`&&(n=Ft(n._payload)),a=Et(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=C.cloneElement(a,void 0,s):!o&&C.Children.count(r)===1&&C.isValidElement(r)&&(a=r);let c=a?Ot(a):void 0,l=Xe(n,c);if(!a){if(r||r===0)throw Error(o?Pt(e):Nt(e));return r}let u=Dt(i,a.props??{});return a.type!==C.Fragment&&(u.ref=n?l:c),C.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}St(Ct,`createSlot`);var wt=Symbol.for(`radix.slottable`);function Tt(e){let t=St(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=wt,t}St(Tt,`createSlottable`);var Et=St((e,t)=>{if(`child`in e.props){let t=e.props.child;return C.isValidElement(t)?C.cloneElement(t,void 0,e.props.children(t.props.children)):null}return C.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Dt(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}}St(Dt,`mergeProps`);function Ot(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)}St(Ot,`getElementRef`);function kt(e){return C.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===wt}St(kt,`isSlottable`);var At=Symbol.for(`react.lazy`);function jt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===At&&`_payload`in e&&Mt(e._payload)}St(jt,`isLazyComponent`);function Mt(e){return typeof e==`object`&&!!e&&`then`in e}St(Mt,`isPromiseLike`);var Nt=St(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Pt=St(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ft=C.use,It=Object.defineProperty,Lt=(e,t)=>It(e,`name`,{value:t,configurable:!0}),Rt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=Ct(`Primitive.${n}`),i=C.forwardRef((e,i)=>{let{asChild:a,...o}=e,s=a?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),t(s,{...o,ref:i})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function zt(e,t){e&&ie.flushSync(()=>e.dispatchEvent(t))}Lt(zt,`dispatchDiscreteCustomEvent`);var Bt=Object.defineProperty,Vt=C.forwardRef(((e,t)=>Bt(e,`name`,{value:t,configurable:!0}))(function(e,n){let{container:r,...i}=e,[a,o]=C.useState(!1);nt(()=>o(!0),[]);let s=r||a&&globalThis?.document?.body;return s?ie.createPortal(t(Rt.div,{...i,ref:n}),s):null},`Portal`)),Ht=Object.defineProperty,Ut=(e,t)=>Ht(e,`name`,{value:t,configurable:!0});function Wt(e,t){return C.useReducer((e,n)=>t[e][n]??e,e)}Ut(Wt,`useStateMachine`);var Gt=Ut(e=>{let{present:t,children:n}=e,r=Kt(t),i=typeof n==`function`?n({present:r.isPresent}):C.Children.only(n),a=Jt(r.ref,Xt(i));return typeof n==`function`||r.isPresent?C.cloneElement(i,{ref:a}):null},`Presence`);function Kt(e){let[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),a=C.useRef(`none`),o=C.useRef(void 0),[s,c]=Wt(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return C.useEffect(()=>{s===`mounted`?(a.current=o.current??Yt(r.current),o.current=void 0):a.current=`none`},[s]),nt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Yt(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),nt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ut(a=>{let o=Yt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ut(e=>{e.target===t&&(a.current=Yt(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:C.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Yt(t)}else r.current=null;n(e)},[])}}Ut(Kt,`usePresence`);function qt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ut(qt,`setRef`);function Jt(...e){let t=C.useRef(e);return t.current=e,C.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=qt(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():qt(n[e],null)}}},[])}Ut(Jt,`useStableComposedRefs`);function Yt(e){return e?.animationName||`none`}Ut(Yt,`getAnimationName`);function Xt(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)}Ut(Xt,`getElementRef`);var Zt=Object.defineProperty,Qt=(e,t)=>Zt(e,`name`,{value:t,configurable:!0}),$t=`Dialog`,[en,tn]=et($t),[nn,rn]=en($t),an=Qt(e=>{let{__scopeDialog:n,children:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=C.useRef(null),l=C.useRef(null),[u,d]=gt({prop:i,defaultProp:a??!1,onChange:o,caller:$t}),[f,p]=C.useState(0),[m,h]=C.useState(0);return t(nn,{scope:n,triggerRef:c,contentRef:l,contentId:st(),titleId:st(),descriptionId:st(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:u,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})},`Dialog`),on=`DialogPortal`,[sn,cn]=en(on,{forceMount:void 0}),ln=Qt(e=>{let{__scopeDialog:n,forceMount:r,children:i,container:a}=e,o=rn(on,n);return t(sn,{scope:n,forceMount:r,children:C.Children.map(i,e=>t(Gt,{present:r||o.open,children:t(Vt,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),un=`DialogOverlay`,dn=C.forwardRef(Qt(function(e,n){let r=cn(un,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=rn(un,e.__scopeDialog);return o.modal?t(Gt,{present:i||o.open,children:t(pn,{...a,ref:n})}):null},`DialogOverlay`)),fn=Ct(`DialogOverlay.RemoveScroll`),pn=C.forwardRef(Qt(function(e,n){let{__scopeDialog:r,...i}=e,a=rn(un,r),o=Xe(n,ne());return t(oe,{as:fn,allowPinchZoom:!0,shards:[a.contentRef],children:t(Rt.div,{"data-state":Tn(a.open),...i,ref:o,style:{pointerEvents:`auto`,...i.style}})})},`DialogOverlayImpl`)),mn=`DialogContent`,hn=C.forwardRef(Qt(function(e,n){let r=cn(mn,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=rn(mn,e.__scopeDialog);return t(Gt,{present:i||o.open,children:o.modal?t(gn,{...a,ref:n}):t(_n,{...a,ref:n})})},`DialogContent`)),gn=C.forwardRef(Qt(function(e,n){let r=rn(mn,e.__scopeDialog),i=C.useRef(null),a=Xe(n,r.contentRef,i);return C.useEffect(()=>{let e=i.current;if(e)return se(e)},[]),t(vn,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Ve(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ve(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Ve(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),_n=C.forwardRef(Qt(function(e,n){let r=rn(mn,e.__scopeDialog),i=C.useRef(!1),a=C.useRef(!1);return t(vn,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||r.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,t.detail.originalEvent.type===`pointerdown`&&(a.current=!0));let n=t.target;r.triggerRef.current?.contains(n)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&a.current&&t.preventDefault()}})},`DialogContentNonModal`)),vn=C.forwardRef(Qt(function(n,r){let{__scopeDialog:i,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,...c}=n,l=rn(mn,i);return ae(),t(e,{children:t(re,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:s,children:t(te,{role:`dialog`,id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Tn(l.open),...c,ref:r,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},`DialogContentImpl`)),yn=`DialogTitle`,bn=C.forwardRef(Qt(function(e,n){let{__scopeDialog:r,...i}=e,a=rn(yn,r),{setTitleCount:o}=a;return nt(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Rt.h2,{id:a.titleId,...i,ref:n})},`DialogTitle`)),xn=`DialogDescription`,Sn=C.forwardRef(Qt(function(e,n){let{__scopeDialog:r,...i}=e,a=rn(xn,r),{setDescriptionCount:o}=a;return nt(()=>(o(e=>e+1),()=>o(e=>e-1)),[o]),t(Rt.p,{id:a.descriptionId,...i,ref:n})},`DialogDescription`)),Cn=`DialogClose`,wn=C.forwardRef(Qt(function(e,n){let{__scopeDialog:r,...i}=e,a=rn(Cn,r);return t(Rt.button,{type:`button`,...i,ref:n,onClick:Ve(e.onClick,()=>a.onOpenChange(!1))})},`DialogClose`));function Tn(e){return e?`open`:`closed`}Qt(Tn,`getState`);
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v1.31.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
const En=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Dn=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),On=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),kn=e=>{
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v1.31.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @license lucide-react v1.31.0 - ISC
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the ISC license.
|
|
19
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* @license lucide-react v1.31.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
let t=On(e);return t.charAt(0).toUpperCase()+t.slice(1)};
|
|
28
|
+
/**
|
|
29
|
+
* @license lucide-react v1.31.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/
|
|
34
|
+
var An={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};
|
|
35
|
+
/**
|
|
36
|
+
* @license lucide-react v1.31.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
const jn=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Mn=E({}),Nn=()=>M(Mn),Pn=O(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{
|
|
42
|
+
/**
|
|
43
|
+
* @license lucide-react v1.31.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* @license lucide-react v1.31.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*/
|
|
54
|
+
let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Nn()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return D(`svg`,{ref:c,...An,width:t??l??An.width,height:t??l??An.height,stroke:e??f,strokeWidth:m,className:En(`lucide`,p,i),...!a&&!jn(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>D(e,t)),...Array.isArray(a)?a:[a]])}),L=(e,t)=>{
|
|
55
|
+
/**
|
|
56
|
+
* @license lucide-react v1.31.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/
|
|
61
|
+
let n=O(({className:n,...r},i)=>D(Pn,{ref:i,iconNode:t,className:En(`lucide-${Dn(kn(e))}`,`lucide-${e}`,n),...r}));return n.displayName=kn(e),n},Fn=L(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),In=L(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),Ln=L(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Rn=L(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),zn=L(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Bn=L(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Vn=L(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Hn=L(`file-text`,[[`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 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Un=L(`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`}]]),Wn=L(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Gn=L(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Kn=L(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),qn=L(`list-ordered`,[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]),Jn=L(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Yn=L(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Xn=L(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),Zn=L(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Qn=L(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),$n=L(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),er=L(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),tr=L(`quote`,[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]),nr=L(`redo-2`,[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]]),rr=L(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),ir=L(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),ar=L(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),or=L(`table`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]),sr=L(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),cr=L(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]])
|
|
62
|
+
/**
|
|
63
|
+
* @license lucide-react v1.31.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* @license lucide-react v1.31.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* @license lucide-react v1.31.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* @license lucide-react v1.31.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* @license lucide-react v1.31.0 - ISC
|
|
88
|
+
*
|
|
89
|
+
* This source code is licensed under the ISC license.
|
|
90
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
+
*/
|
|
92
|
+
/**
|
|
93
|
+
* @license lucide-react v1.31.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/
|
|
98
|
+
/**
|
|
99
|
+
* @license lucide-react v1.31.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/
|
|
104
|
+
/**
|
|
105
|
+
* @license lucide-react v1.31.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/
|
|
110
|
+
/**
|
|
111
|
+
* @license lucide-react v1.31.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/
|
|
116
|
+
/**
|
|
117
|
+
* @license lucide-react v1.31.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/
|
|
122
|
+
/**
|
|
123
|
+
* @license lucide-react v1.31.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
* @license lucide-react v1.31.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* @license lucide-react v1.31.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/
|
|
140
|
+
/**
|
|
141
|
+
* @license lucide-react v1.31.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/
|
|
146
|
+
/**
|
|
147
|
+
* @license lucide-react v1.31.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/
|
|
152
|
+
/**
|
|
153
|
+
* @license lucide-react v1.31.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/
|
|
158
|
+
/**
|
|
159
|
+
* @license lucide-react v1.31.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/
|
|
164
|
+
/**
|
|
165
|
+
* @license lucide-react v1.31.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/
|
|
170
|
+
/**
|
|
171
|
+
* @license lucide-react v1.31.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/
|
|
176
|
+
/**
|
|
177
|
+
* @license lucide-react v1.31.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/
|
|
182
|
+
/**
|
|
183
|
+
* @license lucide-react v1.31.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/
|
|
188
|
+
/**
|
|
189
|
+
* @license lucide-react v1.31.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/
|
|
194
|
+
/**
|
|
195
|
+
* @license lucide-react v1.31.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/
|
|
200
|
+
/**
|
|
201
|
+
* @license lucide-react v1.31.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/
|
|
206
|
+
/**
|
|
207
|
+
* @license lucide-react v1.31.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/
|
|
212
|
+
/**
|
|
213
|
+
* @license lucide-react v1.31.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/
|
|
218
|
+
/**
|
|
219
|
+
* @license lucide-react v1.31.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/
|
|
224
|
+
/**
|
|
225
|
+
* @license lucide-react v1.31.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/
|
|
230
|
+
;function lr(...e){return de(ue(e))}const ur=E(null);function dr(){return M(ur)}function fr(e){return e.startsWith(`agents/`)||e.startsWith(`documents/`)}function pr(e,t,n=`inline`){return`artifact:${e}:${t}:${n}`}function mr(e){return`file:${e}`}const hr=k(()=>import(`react-vega`).then(({VegaEmbed:e})=>({default:e})));function gr({error:e,chartTitle:r}){return t(`div`,{className:`flex items-center justify-center h-full bg-red-50 dark:bg-red-950 rounded-md p-4`,children:n(`div`,{className:`text-center`,children:[n(`p`,{className:`text-sm font-medium text-red-600 dark:text-red-400`,children:[`Cannot render `,r||`Vega-Lite`,` chart`]}),t(`p`,{className:`text-xs text-red-500 dark:text-red-500 mt-1 max-w-xs truncate`,children:e})]})})}function _r(){return t(`output`,{className:`flex items-center justify-center w-full h-full`,children:t(Yn,{className:`w-5 h-5 animate-spin text-gray-500 dark:text-gray-400`})})}function vr({isOpen:e,onClose:r,title:i,description:a,children:o}){let{t:c}=S();return t(an,{open:e,onOpenChange:e=>!e&&r(),children:n(ln,{children:[t(dn,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm transition-all duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),n(hn,{className:`fixed inset-2 sm:inset-4 z-50 flex flex-col bg-white dark:bg-gray-900 rounded-xl shadow-2xl transition-all duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-98 data-[state=open]:zoom-in-98 data-[state=closed]:slide-out-to-bottom-2 data-[state=open]:slide-in-from-bottom-2`,onEscapeKeyDown:r,children:[t(wn,{asChild:!0,children:t(s,{variant:`unstyled`,onClick:r,className:`absolute top-3 end-3 z-10 p-2 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors duration-150 shadow-sm`,"aria-label":c(`agent.closeFullscreen`),children:t(cr,{className:`w-5 h-5 text-gray-600 dark:text-gray-300`})})}),t(`div`,{className:`flex-1 overflow-auto p-4 sm:p-6 animate-in fade-in-0 duration-500 delay-150`,children:o}),t(`div`,{className:`flex items-center justify-between px-4 sm:px-6 py-3 border-t border-gray-200 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-800/50 rounded-b-xl`,children:n(`div`,{className:`flex flex-col`,children:[t(bn,{className:`text-base font-semibold text-gray-900 dark:text-gray-100`,children:i||c(`agent.dashboard`)}),a&&t(Sn,{className:`text-sm text-gray-500 dark:text-gray-400 mt-0.5`,children:a})]})})]})]})})}function yr(e,t){if(t===`chart`)return 280;let n=1;if(e.vconcat)n=Array.isArray(e.vconcat)?e.vconcat.length:1;else if(e.concat){let t=e.columns||2,r=Array.isArray(e.concat)?e.concat.length:1;n=Math.ceil(r/t)}else e.facet&&(n=2);return Math.max(500,n*280+40)}const br={categorical:[`#6366f1`,`#8b5cf6`,`#ec4899`,`#f43f5e`,`#f97316`,`#eab308`,`#22c55e`,`#14b8a6`,`#06b6d4`,`#3b82f6`],blues:[`#dbeafe`,`#93c5fd`,`#3b82f6`,`#1d4ed8`,`#1e3a8a`],purples:[`#f3e8ff`,`#c4b5fd`,`#8b5cf6`,`#6d28d9`,`#4c1d95`],greens:[`#dcfce7`,`#86efac`,`#22c55e`,`#15803d`,`#14532d`],diverging:[`#ef4444`,`#fca5a5`,`#fef3c7`,`#86efac`,`#22c55e`]};function xr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Sr(e){return xr(e)}function Cr(e){let t=JSON.parse(JSON.stringify(e)),n=[`vconcat`,`hconcat`,`concat`];if(!n.some(e=>Array.isArray(t[e])))return t;let r=[];if(Array.isArray(t.params))for(let e of t.params)e&&typeof e==`object`&&e.name&&e.select&&r.push({name:e.name,param:e});if(r.length===0)return t;for(let{name:e,param:i}of r){let r=i.select?.fields||[],a=i.select?.bind===`legend`,o=null;for(let e of n)if(Array.isArray(t[e])){o=t[e];break}if(!o||o.length===0)continue;let s=0;for(let e=0;e<o.length;e++){let t=o[e];if(Tr(t,r)||a&&Er(t,r)){s=e;break}}let c=o[s];c.params||=[],c.params.push(i),t.params=(t.params??[]).filter(t=>t.name!==e)}return Array.isArray(t.params)&&t.params.length===0&&delete t.params,t}function wr(e,t){if(!t||Object.keys(t).length===0)return e;let n=JSON.parse(JSON.stringify(e)),r=e=>{for(let n of e)n.name&&n.name in t&&(n.value=t[n.name])};Array.isArray(n.params)&&r(n.params);let i=e=>{if(Array.isArray(e)){for(let t of e)if(Array.isArray(t.params)&&r(t.params),t.vconcat&&i(t.vconcat),t.hconcat&&i(t.hconcat),t.concat&&i(t.concat),Array.isArray(t.layer))for(let e of t.layer)Array.isArray(e.params)&&r(e.params)}};if(n.vconcat&&i(n.vconcat),n.hconcat&&i(n.hconcat),n.concat&&i(n.concat),Array.isArray(n.layer))for(let e of n.layer)e&&Array.isArray(e.params)&&r(e.params);return n}function Tr(e,t){if(!e?.encoding)return!1;for(let n of t)for(let t of Object.values(e.encoding))if(t.field===n)return!0;if(Array.isArray(e.layer)){for(let n of e.layer)if(Tr(n,t))return!0}return!1}function Er(e,t){if(!e)return!1;let n=e=>{if(!e)return!1;let n=e.color?.field;return!!n&&t.includes(n)};if(n(e.encoding))return!0;if(Array.isArray(e.layer)){for(let t of e.layer)if(n(t.encoding))return!0}return!1}function Dr(e,t=[]){let n=[];if(!e||typeof e!=`object`)return n;if(e.data&&typeof e.data==`object`){let r=e.data.url;typeof r==`string`&&r.startsWith(`artifact:`)&&n.push({path:[...t,`data`],artifactPath:r.replace(/^artifact:/,``).trim()})}for(let r of[`layer`,`vconcat`,`hconcat`,`concat`,`spec`,`repeat`,`facet`])if(r in e){let i=e[r];Array.isArray(i)?i.forEach((e,i)=>{Sr(e)&&n.push(...Dr(e,[...t,r,String(i)]))}):Sr(i)&&n.push(...Dr(i,[...t,r]))}return n}function Or(e,t){let n=JSON.parse(JSON.stringify(e));for(let[e,r]of t){let t=e.split(`.`),i=n;for(let e=0;e<t.length-1;e++){let n=i[t[e]];if(!xr(n))break;i=n}let a=t[t.length-1],o=i[a];xr(o)&&(delete o.url,o.values=r)}return n}function kr(e){let t={background:`transparent`,view:{stroke:`transparent`},range:{category:br.categorical,diverging:br.diverging,heatmap:br.purples,ramp:br.blues},mark:{tooltip:!0},bar:{tooltip:!0,cornerRadiusTopLeft:4,cornerRadiusTopRight:4},line:{tooltip:!0,strokeWidth:2.5,strokeCap:`round`},point:{tooltip:!0,size:60,filled:!0},area:{tooltip:!0,fillOpacity:.7,line:!0},rect:{tooltip:!0,cornerRadius:2},arc:{tooltip:!0,cornerRadius:4},circle:{tooltip:!0,size:80}};return e?{...t,axis:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,gridColor:`#3f3f46`,domainColor:`#52525b`,tickColor:`#52525b`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#a1a1aa`,titleColor:`#e4e4e7`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#fafafa`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}:{...t,axis:{labelColor:`#71717a`,titleColor:`#3f3f46`,gridColor:`#e4e4e7`,domainColor:`#d4d4d8`,tickColor:`#d4d4d8`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,titleFontWeight:500},legend:{labelColor:`#71717a`,titleColor:`#3f3f46`,labelFont:`Inter, system-ui, sans-serif`,titleFont:`Inter, system-ui, sans-serif`,labelFontSize:11,titleFontSize:12,symbolSize:100},title:{color:`#18181b`,font:`Inter, system-ui, sans-serif`,fontSize:14,fontWeight:600}}}const Ar=A(function({spec:r,artifactRunId:i}){let{t:a}=S(),{title:o,description:c,options:l}=r,u=r.spec,[d,f]=I(!1),[p,m]=I(!1),[h,g]=I(null),[_,v]=I(!1),y=F(null),b=F(null),x=F(null),{client:C}=ce(),w=dr(),E=F(C);E.current=C;let D=F(w);D.current=w;let[O,k]=I(null),[A,M]=I(!1),[ee,te]=I(null),ne=l?.mode||`chart`,re=ne===`dashboard`,ie=l?.enableFullscreen??re,ae=l?.height||yr(u,ne);N(()=>{let e=Dr(u);if(e.length===0){k(u),M(!1),te(null);return}i?console.info(`[VegaLiteChart] resolving artifacts with runId:`,i,e.map(e=>e.artifactPath)):console.warn(`[VegaLiteChart] artifact references found but artifactRunId is missing!`,{references:e.map(e=>e.artifactPath),artifactRunId:i});let t=!1;return M(!0),te(null),(async()=>{let n=new Map,r=E.current,a=D.current;for(let o of e)try{let e=o.path.join(`.`),t;if(i&&!fr(o.artifactPath)){let e=pr(i,o.artifactPath,`inline`);t=a?await a.getOrFetch(e,async()=>(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url):(await r.files.getArtifactDownloadUrl(i,o.artifactPath,`inline`)).url}else{let e=mr(o.artifactPath);t=a?await a.getOrFetch(e,async()=>(await r.files.getDownloadUrl(o.artifactPath)).url):(await r.files.getDownloadUrl(o.artifactPath)).url}let s=await fetch(t);if(!s.ok)throw Error(`Failed to fetch artifact data: ${s.statusText}`);let c=o.artifactPath.toLowerCase().endsWith(`.csv`),l;if(c){let e=await s.text();l=le.parse(e,{header:!0,skipEmptyLines:!0,dynamicTyping:!0}).data}else{let e=await s.json();l=Array.isArray(e)?e:[e]}n.set(e,l)}catch(e){console.error(`Failed to resolve artifact: ${o.artifactPath}`,e),t||te(`Failed to load data from artifact: ${o.artifactPath}`);return}if(!t){let e=Or(u,n);k(e),M(!1)}})(),()=>{t=!0}},[u,i]);let[oe,se]=I(!1),ue=F(!1);N(()=>{let e=()=>{let e=document.documentElement.classList.contains(`dark`);e!==ue.current&&(ue.current=e,se(e))};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),()=>t.disconnect()},[]);let[de,fe]=I(0),pe=F(0);N(()=>{if(!x.current)return;let e,t=new ResizeObserver(t=>{clearTimeout(e),e=setTimeout(()=>{let e=t[0]?.contentRect.width;e&&e!==pe.current&&(pe.current=e,fe(e))},100)});t.observe(x.current);let n=x.current.clientWidth;return pe.current=n,fe(n),()=>{clearTimeout(e),t.disconnect()}},[]);let me=P(()=>Dr(u).length>0,[u]),he=P(()=>{if(me&&!O)return null;let e=O||u;return e?(l?.parameterValues&&(e=wr(e,l.parameterValues)),Cr(e)):null},[O,u,me,l?.parameterValues]),ge=j((e,t)=>{if(!e||typeof e!=`object`)return e;if(e.hconcat&&Array.isArray(e.hconcat)){let n=e.hconcat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,hconcat:e.hconcat.map(e=>ge(e,i))}}if(e.vconcat&&Array.isArray(e.vconcat))return{...e,vconcat:e.vconcat.map(e=>ge(e,t))};if(e.concat&&Array.isArray(e.concat)){let n=e.columns??e.concat.length,r=(e.spacing??10)*(n-1),i=Math.floor((t-r)/n);return{...e,concat:e.concat.map(e=>ge(e,i))}}let n=e.width;return n===`container`||typeof n==`number`&&n>t?{...e,width:t}:e},[]),_e=j((e,t=!1)=>{if(!he)return null;let n=kr(oe),r=t?typeof window<`u`?Math.min(window.innerWidth-80,1400):1200:de>0?de-24:500,i=`vconcat`in he||`hconcat`in he||`concat`in he,a=i?{type:`pad`,contains:`padding`}:{type:`fit`,contains:`padding`},s=he;i&&r&&(s=ge(he,r));let c=s.width,l=i?void 0:c===`container`?r:c??r,{width:u,...d}=s;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,...!i&&l?{width:l}:{},height:t?void 0:e,autosize:a,...i?s:d,...o&&!he.title?{title:o}:{},config:{...n,...he.config}}},[he,o,oe,de,ge]),ve=j(async()=>{let e=_?b.current:y.current;if(!(!e||p))try{(await e.toCanvas(2)).toBlob(async e=>{e&&(await navigator.clipboard.write([new ClipboardItem({"image/png":e})]),m(!0),setTimeout(()=>m(!1),2e3))},`image/png`)}catch(e){console.error(`Failed to copy chart:`,e)}},[p,_]),ye=j(async()=>{let e=_?b.current:y.current;if(!(!e||d)){f(!0);try{let t=await e.toImageURL(`png`,2),n=document.createElement(`a`);n.download=`${o||`chart`}.png`,n.href=t,n.click()}catch(e){console.error(`Failed to export chart:`,e)}finally{f(!1)}}},[o,d,_]),be=j(e=>{y.current=e,g(null)},[]),xe=j(e=>{b.current=e},[]),Se=j(e=>{console.error(`Vega-Lite rendering error:`,e),g(e instanceof Error?e.message:`Unknown error`)},[]),Ce=j(()=>{v(e=>!e)},[]);N(()=>{g(null)},[u]);let we=({className:e})=>n(`div`,{className:lr(`flex items-center gap-2`,e),children:[n(s,{variant:`unstyled`,onClick:ve,disabled:p,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 flex items-center gap-1`,title:a(`agent.copyToClipboard`),children:[t(p?Ln:Bn,{className:`w-3 h-3`}),a(p?`agent.copied`:`agent.copy`)]}),n(s,{variant:`unstyled`,onClick:ye,disabled:d,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1`,title:a(`agent.exportAsPng`),children:[t(Vn,{className:`w-3 h-3`}),a(d?`agent.exporting`:`agent.export`)]}),ie&&n(s,{variant:`unstyled`,onClick:Ce,className:`text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 cursor-pointer transition-colors flex items-center gap-1`,title:a(_?`agent.exitFullscreen`:`agent.fullscreen`),children:[t(_?$n:Xn,{className:`w-3 h-3`}),a(_?`agent.exit`:`agent.fullscreen`)]})]});if(A||me&&!O)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{className:`flex items-center justify-center bg-gray-50 dark:bg-gray-800 rounded`,style:{width:`100%`,height:ae},children:n(`div`,{className:`flex items-center gap-2 text-gray-500 dark:text-gray-400`,children:[t(Yn,{className:`w-5 h-5 animate-spin`}),t(`span`,{className:`text-sm`,children:`Loading data from artifacts...`})]})})]})});if(ee)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(gr,{error:ee,chartTitle:o})})]})});if(h)return t(`div`,{className:`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[t(`div`,{className:`flex items-center justify-between`,children:t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||`Chart`})}),t(`div`,{style:{width:`100%`,height:ae},children:t(gr,{error:h,chartTitle:o})})]})});let Te=_e(ae),Ee=_e(0,!0);return Te?(typeof window<`u`&&localStorage.getItem(`DEBUG_VEGA_RENDERS`)&&console.log(`VegaLite rendering with spec:`,{title:o,hasData:!!Te.data?.values,dataLength:Te.data?.values?.length}),n(e,{children:[t(`div`,{className:lr(`bg-white dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 shadow-sm`,re&&`border-2`),children:n(`div`,{className:`flex flex-col gap-2 p-3`,children:[n(`div`,{className:`flex items-center justify-between`,children:[n(`div`,{className:`flex items-center gap-2`,children:[t(`span`,{className:`font-medium text-sm text-gray-900 dark:text-gray-100`,children:o||(re?`Dashboard`:`Chart`)}),re&&t(`span`,{className:`text-xs px-2 py-0.5 rounded-full bg-indigo-100 dark:bg-indigo-900 text-indigo-700 dark:text-indigo-300`,children:`Interactive`})]}),t(we,{})]}),c&&t(`span`,{className:`text-xs text-gray-500 dark:text-gray-400`,children:c}),t(`div`,{ref:x,className:`bg-white dark:bg-gray-900 rounded overflow-hidden`,style:{width:`100%`,height:ae,minWidth:0},children:t(T,{fallback:t(_r,{}),children:t(hr,{spec:Te,onEmbed:e=>be(e.view),onError:Se,options:{renderer:l?.renderer||`canvas`,actions:!1}})})})]})}),n(vr,{isOpen:_,onClose:()=>v(!1),title:o||(re?`Dashboard`:`Chart`),description:c,children:[t(`div`,{className:`w-full h-full min-h-[calc(100vh-200px)]`,children:Ee&&t(T,{fallback:t(_r,{}),children:t(hr,{spec:Ee,onEmbed:e=>xe(e.view),onError:Se,options:{renderer:l?.renderer||`canvas`,actions:!1}})})}),t(`div`,{className:`absolute bottom-6 end-6`,children:t(we,{className:`bg-white dark:bg-gray-800 rounded-lg shadow-lg p-2 border border-gray-200 dark:border-gray-700`})})]})]})):null},(e,t)=>JSON.stringify(e.spec)===JSON.stringify(t.spec)&&e.artifactRunId===t.artifactRunId),jr={chart:{icon:In,label:`chart`,defaultHeight:200},mermaid:{icon:Un,label:`diagram`,defaultHeight:150},proposal:{icon:Qn,label:`options`,defaultHeight:100},code:{icon:zn,label:`code`,defaultHeight:80},image:{icon:Wn,label:`image`,defaultHeight:150},link:{icon:Kn,label:`link`,defaultHeight:24},expand:{icon:Vn,label:`content`,defaultHeight:100},table:{icon:or,label:`table`,defaultHeight:150},markdown:{icon:Hn,label:`content`,defaultHeight:100},"fusion-fragment":{icon:zn,label:`fragment`,defaultHeight:150}};function R({type:e,error:r,onRetry:i,message:a,height:o}){let c=jr[e],l=o??c.defaultHeight,u=e===`link`;if(r)return n(`div`,{className:`flex items-center gap-2 rounded border border-destructive/30 bg-destructive/5 text-destructive ${u?`inline-flex px-2 py-1 text-sm`:`p-4`}`,style:u?void 0:{minHeight:l},children:[n(`span`,{className:`text-destructive`,children:[`Failed to load `,c.label]}),i&&t(s,{variant:`unstyled`,onClick:i,className:`ms-2 rounded bg-destructive/10 px-2 py-1 text-xs hover:bg-destructive/20 transition-colors text-destructive`,children:`Retry`})]});let d=c.icon;return u?n(`span`,{className:`inline-flex items-center gap-1 text-muted animate-pulse`,children:[t(d,{className:`h-3 w-3`}),t(`span`,{children:a||`Loading ${c.label}...`})]}):n(`div`,{className:`flex flex-col items-center justify-center gap-3 rounded border border-border bg-muted/30 animate-pulse`,style:{minHeight:l},children:[t(d,{className:`h-8 w-8 text-muted`}),t(`span`,{className:`text-sm text-muted`,children:a||`Loading ${c.label}...`}),t(`div`,{className:`flex gap-1`,children:[...[,,,]].map((e,n)=>t(`div`,{className:`h-2 w-2 rounded-full bg-muted animate-bounce`,style:{animationDelay:`${n*150}ms`}},`dot-${n}`))})]})}var Mr=class extends w.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`CodeBlock rendering error (${this.props.type}):`,e,t),this.props.onError?.(e)}handleRetry=()=>{this.setState({hasError:!1,error:void 0})};render(){if(this.state.hasError){let{type:e,fallbackCode:r}=this.props;return n(`div`,{className:`space-y-2`,children:[t(R,{type:e,error:this.state.error?.message||`Rendering failed`,onRetry:this.handleRetry}),r&&n(`details`,{className:`text-sm`,children:[t(`summary`,{className:`cursor-pointer text-muted hover:text-foreground`,children:`Show raw content`}),t(`pre`,{className:`mt-2 overflow-x-auto rounded bg-muted/50 p-2 text-xs`,children:t(`code`,{children:r})})]})]})}return this.props.children}};function Nr(e,t,n){let r=t.split(`.`).pop()?.toLowerCase();if(r===`svg`)return`mockup`;if([`png`,`jpg`,`jpeg`,`gif`,`webp`].includes(r||``))return`image`;if(r===`md`)return`markdown`;if(r===`csv`)return`table`;if(n===`json`&&typeof e==`object`&&e){let t=e;if(typeof t.$schema==`string`&&t.$schema.includes(`vega`)||t.library===`vega-lite`&&`spec`in t)return`vega-lite`;if(`template`in t&&`data`in t)return`fusion-fragment`;if(Array.isArray(e)&&e.length>0&&typeof e[0]==`object`)return`table`}return`code`}function Pr(e){if(typeof e!=`object`||!e)return null;let t=e;return t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`&&t.spec!==null?t:typeof t.$schema==`string`&&t.$schema.includes(`vega`)?{library:`vega-lite`,spec:t}:null}function Fr({content:e}){let{headers:r,rows:i}=P(()=>{if(!Array.isArray(e)||e.length===0)return{headers:[],rows:[]};let t=e[0];if(typeof t!=`object`||!t)return{headers:[],rows:[]};let n=Object.keys(t);return{headers:n,rows:e.map(e=>n.map(t=>{let n=e[t];return n==null?``:typeof n==`object`?JSON.stringify(n):String(n)}))}},[e]);return r.length===0?t(R,{type:`table`,error:`No table data found`}):n(`div`,{className:`overflow-x-auto`,children:[n(`table`,{className:`min-w-full text-sm border-collapse`,children:[t(`thead`,{children:t(`tr`,{className:`border-b`,children:r.map(e=>t(`th`,{className:`px-3 py-2 text-start font-medium text-muted`,children:e},e))})}),t(`tbody`,{children:i.slice(0,100).map((e,n)=>t(`tr`,{className:`border-b border-muted/20`,children:e.map((e,n)=>t(`td`,{className:`px-3 py-2`,children:e},`cell-${n}`))},`row-${n}`))})]}),i.length>100&&n(`div`,{className:`text-sm text-muted py-2`,children:[`Showing 100 of `,i.length,` rows`]})]})}function Ir({content:e,path:n}){let r=n.split(`.`).pop()?.toLowerCase()||``,i=typeof e==`string`?e:JSON.stringify(e,null,2);return t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{className:`language-${r}`,children:i})})}function Lr(e){return me.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`use`],FORBID_TAGS:[`foreignObject`]})}function Rr(e){return e.replace(/<svg([^>]*)>/i,(e,t)=>{let n=t;if(!/viewBox/i.test(n)){let e=/\swidth\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n),t=/\sheight\s*=\s*["']?(\d+(?:\.\d+)?)/i.exec(n);e&&t&&(n+=` viewBox="0 0 ${e[1]} ${t[1]}"`)}return n=n.replace(/\swidth\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``).replace(/\sheight\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i,``),/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}function zr({content:e}){let n=P(()=>{let t=typeof e==`string`?e.trim():``;return t?Rr(Lr(t)):null},[e]);return n?t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}}):t(R,{type:`expand`,error:`Empty mockup`})}function Br({content:e,path:n}){let r=typeof e==`string`?e:``,i=n.split(`/`).pop()||`Artifact image`;return t(`img`,{src:r,alt:i,className:`max-w-full h-auto rounded`,loading:`lazy`})}function Vr({content:e,renderType:n,path:r,runId:i,contentType:a}){let{MarkdownRenderer:o}=Fe();switch(P(()=>n===`auto`?Nr(e,r,a):n,[e,r,a,n])){case`chart`:{let n=Pr(e);return n?t(Mr,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ar,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Only Vega-Lite charts are supported. Recharts rendering has been retired.`})}case`vega-lite`:{let n=Pr(e);return n?t(Mr,{type:`chart`,fallbackCode:JSON.stringify(e,null,2),children:t(Ar,{spec:n,artifactRunId:i})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}case`fusion-fragment`:{let n=e;return console.log(`[ArtifactContentRenderer] fusion-fragment:`,{hasTemplate:!!n.template,hasData:!!n.data,runId:i,hasVegaLiteChart:!!Ar}),n.template&&n.data?t(Mr,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(pe,{data:n.data,ChartComponent:Ar,artifactRunId:i,children:t(fe,{code:JSON.stringify(n.template),data:n.data})})}):t(Mr,{type:`fusion-fragment`,fallbackCode:JSON.stringify(e,null,2),children:t(fe,{code:JSON.stringify(e)})})}case`table`:return t(Mr,{type:`table`,fallbackCode:JSON.stringify(e,null,2),children:t(Fr,{content:e})});case`markdown`:{let n=typeof e==`string`?e:String(e);return t(Mr,{type:`markdown`,fallbackCode:n,children:o?t(o,{artifactRunId:i,children:n}):t(`pre`,{className:`overflow-x-auto p-3 bg-muted/10 rounded text-sm`,children:t(`code`,{children:n})})})}case`mockup`:return t(Mr,{type:`expand`,fallbackCode:typeof e==`string`?e:r,children:t(zr,{content:e})});case`image`:return t(Mr,{type:`image`,fallbackCode:r,children:t(Br,{content:e,path:r})});default:return t(Ir,{content:e,path:r})}}const Hr=`Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;function Ur(e){let t=e.trim(),n=``,r=!1,i=!1;for(let e=0;e<t.length;e++){let a=t[e],o=e>0?t[e-1]:``;if(a===`"`&&!i&&o!==`\\`){r=!r,n+=a;continue}if(a===`'`&&!r&&o!==`\\`){i=!i,n+=a;continue}if((r||i)&&a===`\\`){let r=e;for(;t[r]===`\\`;)r++;if(t[r]===`n`){n+=`<br/>`,e=r;continue}}n+=a}return n}function Wr(e){return e.replace(/<svg([^<>]*)>/i,(e,t)=>{let n=t.replace(/\swidth="[^"]*"/i,``).replace(/\sheight="[^"]*"/i,``);return/style="/i.test(n)?n=n.replace(/style="([^"]*)"/i,(e,t)=>`style="${t};width:100%;height:auto;display:block;max-width:100%;"`):n+=` style="width:100%;height:auto;display:block;max-width:100%;"`,/preserveAspectRatio=/i.test(n)||(n+=` preserveAspectRatio="xMidYMid meet"`),`<svg${n}>`})}let Gr;function Kr(){return Gr||=import(`mermaid`).then(({default:e})=>(e.initialize({startOnLoad:!1,theme:`default`,securityLevel:`loose`,fontFamily:Hr,suppressErrorRendering:!0,flowchart:{htmlLabels:!0,useMaxWidth:!0,nodeSpacing:40,rankSpacing:50,padding:12},sequence:{useMaxWidth:!0},themeVariables:{fontFamily:Hr}}),e)),Gr}function qr({code:e,className:n}){let r=F(null),[i,a]=I(null),[o,s]=I(null),c=ee().replace(/:/g,`_`);return N(()=>{let t=!1;return(async()=>{if(!e.trim()){a(null),s(null);return}try{s(null);let n=`mermaid-${c}-${Date.now()}`,r=Ur(e),{svg:i}=await(await Kr()).render(n,r),o=Wr(i);t||a(o)}catch(e){if(!t){let t=e instanceof Error?e.message:`Failed to render mermaid diagram`;s(t),a(null)}}})(),()=>{t=!0}},[e,c]),o?null:i?t(`div`,{ref:r,className:`my-4 w-full overflow-x-auto [&_svg]:mx-auto [&_svg]:w-full [&_svg]:h-auto [&_svg]:max-w-full ${n||``}`,dangerouslySetInnerHTML:{__html:i}}):t(`div`,{className:`my-4 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg animate-pulse ${n||``}`,children:t(`div`,{className:`h-32 bg-gray-200 dark:bg-gray-700 rounded`})})}function Jr(e){switch(e.split(`.`).pop()?.toLowerCase()){case`json`:return`json`;case`md`:case`txt`:case`csv`:case`yaml`:case`yml`:return`text`;case`png`:case`jpg`:case`jpeg`:case`gif`:case`webp`:case`pdf`:return`binary`;default:return`text`}}function Yr({runId:e,path:t,parseJson:n=!0}){let{client:r}=ce(),i=dr(),a=F(r);a.current=r;let o=F(i);o.current=i;let[s,c]=I({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l=j(async()=>{if(!e){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No run ID provided`,contentType:void 0});return}if(!t){c({data:void 0,rawContent:void 0,isLoading:!1,error:`No artifact path provided`,contentType:void 0});return}c(e=>({...e,isLoading:!0,error:void 0}));let r=a.current,i=o.current,s=Jr(t);try{let a=pr(e,t,`inline`),o;o=i?await i.getOrFetch(a,async()=>(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url):(await r.files.getArtifactDownloadUrl(e,t,`inline`)).url;let l=await fetch(o);if(!l.ok)throw Error(`Failed to fetch artifact: ${l.status} ${l.statusText}`);if(s===`binary`){c({data:o,rawContent:void 0,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)});return}let u=await l.text(),d;if(n&&s===`json`)try{d=JSON.parse(u)}catch{d=u}else d=u;c({data:d,rawContent:u,isLoading:!1,error:void 0,contentType:s,etag:l.headers.get(`etag`)?.replace(/^"(.*)"$/,`$1`)})}catch(e){let n=e instanceof Error?e.message:`Failed to fetch artifact`;console.error(`Failed to fetch artifact content:`,t,e),c({data:void 0,rawContent:void 0,isLoading:!1,error:n,contentType:s})}},[e,t,n]);N(()=>{l()},[l]);let u=j(()=>{c({data:void 0,rawContent:void 0,isLoading:!0,error:void 0,contentType:void 0}),l()},[l]);return{data:s.data,rawContent:s.rawContent,isLoading:s.isLoading,error:s.error,contentType:s.contentType,etag:s.etag,retry:u}}function Xr(e){let t=e.trim();if(t.length<2)return!0;if(!t.startsWith(`{`))return!1;try{return JSON.parse(t),!1}catch(e){let n=e instanceof Error?e.message:``,r=[`unexpected end`,`unterminated string`,`expected`,`unexpected token`],i=n.toLowerCase();if(r.some(e=>i.includes(e))){let e=0,n=0,r=!1,i=!1;for(let a of t){if(i){i=!1;continue}if(a===`\\`){i=!0;continue}if(a===`"`){r=!r;continue}r||(a===`{`?e++:a===`}`?e--:a===`[`?n++:a===`]`&&n--)}return e>0||n>0||r}return!1}}function Zr(e){try{let t=e.trim(),n=t.indexOf(`{`),r=t.lastIndexOf(`}`);return n!==-1&&r>n&&(t=t.slice(n,r+1)),JSON.parse(t)}catch{return null}}function Qr(e){let t=typeof e.$schema==`string`&&e.$schema.includes(`vega`),n=e.library===`vega-lite`&&`spec`in e;return t||n?`vega-lite`:null}function $r({code:e}){let{artifactRunId:n}=Fe();n||console.warn(`[VegaLiteCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Xr(e),[e]),i=P(()=>{if(r)return null;let t=Zr(e);return t?{library:`vega-lite`,spec:t}:null},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(Mr,{type:`chart`,fallbackCode:e,children:t(Ar,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite specification`})}function ei({code:e}){let{artifactRunId:n}=Fe();n||console.warn(`[ChartCodeBlockHandler] artifactRunId is missing from CodeBlockContext`);let r=P(()=>Xr(e),[e]),i=P(()=>{if(r)return null;let t=Zr(e);return!t||!Qr(t)?null:t.library===`vega-lite`&&`spec`in t&&typeof t.spec==`object`?t:{library:`vega-lite`,spec:t}},[e,r]);return r?t(R,{type:`chart`,message:`Loading chart...`}):i?t(Mr,{type:`chart`,fallbackCode:e,children:t(Ar,{spec:i,artifactRunId:n})}):t(R,{type:`chart`,error:`Invalid Vega-Lite chart specification`})}function ti({code:e}){let n=e.trim();return n?t(Mr,{type:`mermaid`,fallbackCode:e,children:t(qr,{code:n})}):t(R,{type:`mermaid`,error:`Empty diagram`})}function ni({code:e}){let n=P(()=>{let t=e.trim();return t?Rr(Lr(t)):null},[e]);return n?t(Mr,{type:`code`,fallbackCode:e,children:t(`div`,{style:{margin:`16px 0`,width:`100%`,overflowX:`auto`},dangerouslySetInnerHTML:{__html:n}})}):t(R,{type:`code`,error:`Empty mockup`})}function ri({code:e,language:n}){let{artifactRunId:r}=Fe(),i=e.trim(),a=P(()=>{if(!n?.includes(`:`))return`auto`;let e=n.split(`:`)[1];return[`chart`,`vega-lite`,`table`,`markdown`,`fusion-fragment`,`mockup`,`code`,`image`,`auto`].includes(e)?e:`auto`},[n]),{data:o,isLoading:s,error:c,contentType:l}=Yr({runId:r,path:i});return r?s?t(R,{type:`expand`,message:`Loading ${i}...`}):c?t(R,{type:`expand`,error:`Failed to load artifact: ${c}`}):o===void 0?t(R,{type:`expand`,error:`No content found in artifact`}):t(Vr,{content:o,renderType:a,path:i,runId:r,contentType:l}):t(R,{type:`expand`,error:`No artifact run ID available`})}function ii(e){return e?.startsWith(`expand`)??!1}function ai(){return{chart:ei,"vega-lite":$r,vegalite:$r,mermaid:ti,mockup:ni,svg:ni}}const oi=new Set([`store`,`document`,`collection`,`interaction`,`prompt`,`agent`,`workflow`,`process`,`run`]);function si(e){return e.trim().replace(/^\/+/,``)}function ci(e){if(e.startsWith(`artifact:`))return{scheme:`artifact`,path:e.slice(9).trim()};if(e.startsWith(`image:`))return{scheme:`image`,path:e.slice(6).trim()};let t=e.indexOf(`:`);if(t>0){let n=e.slice(0,t);if(oi.has(n))return{scheme:n,path:si(e.slice(t+1))}}return{scheme:`standard`,path:e}}function li({rawUrl:e,artifactRunId:t,disposition:n=`inline`}){let{client:r}=ce(),i=dr(),a=F(r);a.current=r;let o=F(i);o.current=i;let{scheme:s,path:c}=ci(e),[l,u]=I(()=>{if(s===`standard`)return{url:e,isLoading:!1,error:void 0};if(i&&(s===`artifact`||s===`image`)){let e;e=s===`artifact`&&t&&!fr(c)?pr(t,c,n):mr(c);let r=i.getUrl(e);if(r)return{url:r,isLoading:!1,error:void 0}}return{url:void 0,isLoading:!0,error:void 0}}),d=j(async()=>{if(s===`standard`)return;if(s!==`artifact`&&s!==`image`){u({url:void 0,isLoading:!1,error:`Unknown scheme: ${s}`});return}u(e=>({...e,isLoading:!0,error:void 0}));let e=a.current,r=o.current;try{let i;if(s===`artifact`){if(t&&!fr(c)){let a=pr(t,c,n);i=r?await r.getOrFetch(a,async()=>(await e.files.getArtifactDownloadUrl(t,c,n)).url):(await e.files.getArtifactDownloadUrl(t,c,n)).url}else{let t=mr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}}else{let t=mr(c);i=r?await r.getOrFetch(t,async()=>(await e.files.getDownloadUrl(c)).url):(await e.files.getDownloadUrl(c)).url}u({url:i,isLoading:!1,error:void 0})}catch(e){let t=e instanceof Error?e.message:`Failed to resolve URL`;console.error(`Failed to resolve URL:`,c,e),u({url:void 0,isLoading:!1,error:t})}},[s,c,t,n]);N(()=>{if(l.url&&!l.error)return;let e=!1;return e||(async()=>{await d()})(),()=>{e=!0}},[d,l.url,l.error]);let f=j(()=>{u({url:void 0,isLoading:!0,error:void 0}),d()},[d]);return{url:l.url,isLoading:l.isLoading,error:l.error,scheme:s,retry:f}}function ui({src:e,alt:r,caption:i,className:a,artifactRunId:o}){let s=e||``,{scheme:c}=ci(s);return c===`standard`?n(`figure`,{className:`my-4`,children:[t(`img`,{src:e,alt:r,className:a}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):t(di,{rawSrc:s,alt:r,caption:i,artifactRunId:o,className:a})}function di({rawSrc:e,alt:r,caption:i,artifactRunId:a,className:o}){let{url:s,isLoading:c,error:l,retry:u}=li({rawUrl:e,artifactRunId:a,disposition:`inline`});return c?t(R,{type:`image`,message:r?`Loading ${r}...`:void 0}):l?t(R,{type:`image`,error:l,onRetry:u}):s?n(`figure`,{className:`my-4`,children:[t(`img`,{src:s,alt:r,className:o}),t(`figcaption`,{className:`mt-2 text-sm text-muted text-center italic`,children:i})]}):null}function fi({node:e,src:n,alt:r,className:i,artifactRunId:a,ExistingImg:o,...s}){let c=n||``,{scheme:l}=ci(c);return l===`standard`?typeof o==`function`?t(o,{node:e,src:n,alt:r,...s}):t(`img`,{src:n,alt:r,className:i,...s}):t(pi,{rawSrc:c,alt:r,artifactRunId:a,className:i,rest:s})}function pi({rawSrc:e,alt:n,artifactRunId:r,className:i,rest:a}){let{url:o,isLoading:s,error:c,retry:l}=li({rawUrl:e,artifactRunId:r,disposition:`inline`});return s?t(R,{type:`image`,message:n?`Loading ${n}...`:void 0}):c?t(R,{type:`image`,error:c,onRetry:l}):o?t(`img`,{src:o,alt:n,className:i,...a}):null}const mi=E(()=>({kind:`none`}));mi.Provider;function hi(){return M(mi)}const gi={store:`document`,document:`document`,collection:`collection`,interaction:`interaction`,prompt:`prompt`,agent:`agent`,workflow:`workflow`,process:`process`,run:`interaction_run`};function _i(e){let t=e.indexOf(`:`);if(t<=0)return;let n=e.slice(0,t);if(!Object.hasOwn(gi,n))return;let r=e.slice(t+1).trim().replace(/^\/+/,``);if(r)return{type:gi[n],id:r}}function vi({node:e,href:n,children:r,className:i,artifactRunId:a,onArtifactOpen:o,ExistingLink:s,...c}){let l=n||``,u=_i(l);if(u)return t(yi,{resource:u,rawHref:l,artifactRunId:a,className:i,ExistingLink:s,rest:c,children:r});let{scheme:d,path:f}=ci(l);return d===`standard`?typeof s==`function`?t(s,{node:e,href:n,className:i,...c,children:r}):t(`a`,{href:n,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:r}):t(bi,{rawHref:l,artifactRunId:a,artifactPath:d===`artifact`?f:void 0,onArtifactOpen:o,className:i,rest:c,children:r})}function yi({resource:e,rawHref:n,artifactRunId:r,className:i,children:a,ExistingLink:o,rest:c}){let l=hi()(e,{workflowRunId:r,source:`markdown`,rawHref:n});return l.kind===`navigate`?typeof o==`function`?t(o,{href:l.href,className:i,...c,children:a}):t(`a`,{href:l.href,...c,className:i,target:`_blank`,rel:`noopener noreferrer`,children:a}):l.kind===`activate`?t(s,{variant:`link`,size:`none`,className:i,onClick:l.onActivate,children:a}):t(`span`,{className:i,children:a})}function bi({rawHref:e,artifactRunId:n,artifactPath:r,onArtifactOpen:i,className:a,children:o,rest:s}){let{url:c,isLoading:l,error:u,retry:d}=li({rawUrl:e,artifactRunId:n,disposition:`attachment`});return l?t(`span`,{className:`inline-flex items-center gap-1 text-muted`,children:t(R,{type:`link`})}):u?t(`span`,{className:`inline-flex items-center gap-1`,children:t(R,{type:`link`,error:u,onRetry:d})}):t(`a`,{href:c||`#`,...s,className:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>{r&&/\.md$/i.test(r)&&i&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&e.button===0&&(e.preventDefault(),i(r))},children:o})}function xi(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}const Si=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ci=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wi={};function Ti(e,t){return((t||wi).jsx?Ci:Si).test(e)}const Ei=/[ \t\n\f\r]/g;function Di(e){return typeof e==`object`?e.type===`text`&&Oi(e.value):Oi(e)}function Oi(e){return e.replace(Ei,``)===``}var ki=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ki.prototype.normal={},ki.prototype.property={},ki.prototype.space=void 0;function Ai(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ki(n,r,t)}function ji(e){return e.toLowerCase()}var z=class{constructor(e,t){this.attribute=t,this.property=e}};z.prototype.attribute=``,z.prototype.booleanish=!1,z.prototype.boolean=!1,z.prototype.commaOrSpaceSeparated=!1,z.prototype.commaSeparated=!1,z.prototype.defined=!1,z.prototype.mustUseProperty=!1,z.prototype.number=!1,z.prototype.overloadedBoolean=!1,z.prototype.property=``,z.prototype.spaceSeparated=!1,z.prototype.space=void 0;var Mi=ke({boolean:()=>B,booleanish:()=>V,commaOrSpaceSeparated:()=>Ii,commaSeparated:()=>Fi,number:()=>H,overloadedBoolean:()=>Pi,spaceSeparated:()=>U});let Ni=0;const B=Li(),V=Li(),Pi=Li(),H=Li(),U=Li(),Fi=Li(),Ii=Li();function Li(){return 2**++Ni}const Ri=Object.keys(Mi);var zi=class extends z{constructor(e,t,n,r){let i=-1;if(super(e,t),Bi(this,`space`,r),typeof n==`number`)for(;++i<Ri.length;){let e=Ri[i];Bi(this,Ri[i],(n&Mi[e])===Mi[e])}}};zi.prototype.defined=!0;function Bi(e,t,n){n&&(e[t]=n)}function Vi(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new zi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ji(r)]=r,n[ji(a.attribute)]=r}return new ki(t,n,e.space)}const Hi=Vi({properties:{ariaActiveDescendant:null,ariaAtomic:V,ariaAutoComplete:null,ariaBusy:V,ariaChecked:V,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:U,ariaCurrent:null,ariaDescribedBy:U,ariaDetails:null,ariaDisabled:V,ariaDropEffect:U,ariaErrorMessage:null,ariaExpanded:V,ariaFlowTo:U,ariaGrabbed:V,ariaHasPopup:null,ariaHidden:V,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:U,ariaLevel:H,ariaLive:null,ariaModal:V,ariaMultiLine:V,ariaMultiSelectable:V,ariaOrientation:null,ariaOwns:U,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:V,ariaReadOnly:V,ariaRelevant:null,ariaRequired:V,ariaRoleDescription:U,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:V,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ui(e,t){return t in e?e[t]:t}function Wi(e,t){return Ui(e,t.toLowerCase())}const Gi=Vi({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Fi,acceptCharset:U,accessKey:U,action:null,allow:null,allowFullScreen:B,allowPaymentRequest:B,allowUserMedia:B,alt:null,as:null,async:B,autoCapitalize:null,autoComplete:U,autoFocus:B,autoPlay:B,blocking:U,capture:null,charSet:null,checked:B,cite:null,className:U,cols:H,colSpan:null,content:null,contentEditable:V,controls:B,controlsList:U,coords:H|Fi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:B,defer:B,dir:null,dirName:null,disabled:B,download:Pi,draggable:V,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:B,formTarget:null,headers:U,height:H,hidden:Pi,high:H,href:null,hrefLang:null,htmlFor:U,httpEquiv:U,id:null,imageSizes:null,imageSrcSet:null,inert:B,inputMode:null,integrity:null,is:null,isMap:B,itemId:null,itemProp:U,itemRef:U,itemScope:B,itemType:U,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:B,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:B,muted:B,name:null,nonce:null,noModule:B,noValidate:B,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:B,optimum:H,pattern:null,ping:U,placeholder:null,playsInline:B,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:B,referrerPolicy:null,rel:U,required:B,reversed:B,rows:H,rowSpan:H,sandbox:U,scope:null,scoped:B,seamless:B,selected:B,shadowRootClonable:B,shadowRootDelegatesFocus:B,shadowRootMode:null,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:V,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:B,useMap:null,value:V,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:U,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:B,declare:B,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:B,noHref:B,noShade:B,noWrap:B,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:V,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:B,disableRemotePlayback:B,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:Wi}),Ki=Vi({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Ii,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:U,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:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:B,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,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:Fi,g2:Fi,glyphName:Fi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:Ii,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,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:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:U,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ii,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ii,rev:Ii,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ii,requiredFeatures:Ii,requiredFonts:Ii,requiredFormats:Ii,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:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:Ii,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ii,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ii,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ui}),qi=Vi({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()}}),Ji=Vi({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Wi}),Yi=Vi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Xi={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`},Zi=/[A-Z]/g,Qi=/-[a-z]/g,$i=/^data[-\w.:]+$/i;function ea(e,t){let n=ji(t),r=t,i=z;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&$i.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Qi,na);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Qi.test(e)){let n=e.replace(Zi,ta);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=zi}return new i(r,t)}function ta(e){return`-`+e.toLowerCase()}function na(e){return e.charAt(1).toUpperCase()}const ra=Ai([Hi,Gi,qi,Ji,Yi],`html`),ia=Ai([Hi,Ki,qi,Ji,Yi],`svg`);function aa(e){return e.join(` `).trim()}function oa(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(la);t&&(n+=t.length);var i=e.lastIndexOf(ga);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(ua)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(_a==e.charAt(0)&&va==e.charAt(1)){for(var n=2;ya!=e.charAt(n)&&(va!=e.charAt(n)||_a!=e.charAt(n+1));)++n;if(n+=2,ya===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:ba,comment:o})}}function f(){var e=a(),t=c(da);if(t){if(d(),!c(fa))return s(`property missing ':'`);var n=c(pa),r=e({type:xa,property:sa(t[0].replace(ca,ya)),value:n?sa(n[0].replace(ca,ya)):ya});return c(ma),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function sa(e){return e?e.replace(ha,ya):ya}var ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa=De((()=>{ca=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,la=/\n/g,ua=/^\s*/,da=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,fa=/^:\s*/,pa=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ma=/^[;\s]*/,ha=/^\s+|\s+$/g,ga=`
|
|
231
|
+
`,_a=`/`,va=`*`,ya=``,ba=`comment`,xa=`declaration`})),Ca=ke({default:()=>wa});function wa(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=oa(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Ta=De((()=>{Sa()})),Ea=Oe((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))}})),Da=Oe(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})((Ta(),Me(Ca))),r=Ea();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}));const Oa=Aa(`end`),ka=Aa(`start`);function Aa(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 ja(e){let t=ka(e),n=Oa(e);if(t&&n)return{start:t,end:n}}function Ma(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Pa(e.position):`start`in e||`end`in e?Pa(e):`line`in e||`column`in e?Na(e):``}function Na(e){return Fa(e&&e.line)+`:`+Fa(e&&e.column)}function Pa(e){return Na(e&&e.start)+`-`+Na(e&&e.end)}function Fa(e){return e&&typeof e==`number`?e:1}var W=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=Ma(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}};W.prototype.file=``,W.prototype.name=``,W.prototype.reason=``,W.prototype.message=``,W.prototype.stack=``,W.prototype.column=void 0,W.prototype.line=void 0,W.prototype.ancestors=void 0,W.prototype.cause=void 0,W.prototype.fatal=void 0,W.prototype.place=void 0,W.prototype.ruleId=void 0,W.prototype.source=void 0;var Ia=je(Da(),1);const La={}.hasOwnProperty,Ra=new Map,za=/[A-Z]/g,Ba=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Va=new Set([`td`,`th`]);function Ha(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=$a(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=Qa(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`?ia:ra,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ua(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ua(e,t,n){if(t.type===`element`)return Wa(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ga(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return qa(e,t,n);if(t.type===`mdxjsEsm`)return Ka(e,t);if(t.type===`root`)return Ja(e,t,n);if(t.type===`text`)return Ya(e,t)}function Wa(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=ia,e.schema=i),e.ancestors.push(t);let a=ao(e,t.tagName,!1),o=eo(e,t),s=no(e,t);return Ba.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Di(e)})),Xa(e,o,a,t),Za(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ga(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)}oo(e,t.position)}function Ka(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oo(e,t.position)}function qa(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=ia,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ao(e,t.name,!0),o=to(e,t),s=no(e,t);return Xa(e,o,a,t),Za(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ja(e,t,n){let r={};return Za(r,no(e,t)),e.create(t,e.Fragment,r,n)}function Ya(e,t){return t.value}function Xa(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Za(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Qa(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 $a(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ka(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 eo(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&La.call(t.properties,i)){let a=ro(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Va.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 to(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 oo(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 oo(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function no(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ra;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=Ua(e,a,o);s!==void 0&&n.push(s)}return n}function ro(e,t,n){let r=ea(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xi(n):aa(n)),r.property===`style`){let t=typeof n==`object`?n:io(e,String(n));return e.stylePropertyNameCase===`css`&&(t=so(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Xi[r.property]||r.property:r.attribute,n]}}function io(e,t){try{return(0,Ia.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new W("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function ao(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=Ti(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=Ti(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return La.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);oo(e)}function oo(e,t){let n=new W("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=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function so(e){let t={},n;for(n in e)La.call(e,n)&&(t[co(n)]=e[n]);return t}function co(e){let t=e.replace(za,lo);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function lo(e){return`-`+e.toLowerCase()}const uo={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`]},fo={};function po(e,t){let n=t||fo;return mo(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function mo(e,t,n){if(go(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 ho(e.children,t,n)}return Array.isArray(e)?ho(e,t,n):``}function ho(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=mo(e[i],t,n);return r.join(``)}function go(e){return!!(e&&typeof e==`object`)}const _o=document.createElement(`i`);function vo(e){let t=`&`+e+`;`;_o.innerHTML=t;let n=_o.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function G(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 yo(e,t){return e.length>0?(G(e,e.length,0,t),e):t}const bo={}.hasOwnProperty;function xo(e){let t={},n=-1;for(;++n<e.length;)So(t,e[n]);return t}function So(e,t){let n;for(n in t){let r=(bo.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){bo.call(r,a)||(r[a]=[]);let e=i[a];Co(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Co(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);G(e,0,0,r)}function wo(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)}function To(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}const K=No(/[A-Za-z]/),q=No(/[\dA-Za-z]/),Eo=No(/[#-'*+\--9=?A-Z^-~]/);function Do(e){return e!==null&&(e<32||e===127)}const Oo=No(/\d/),ko=No(/[\dA-Fa-f]/),Ao=No(/[!-/:-@[-`{-~]/);function J(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function X(e){return e===-2||e===-1||e===32}const jo=No(/\p{P}|\p{S}/u),Mo=No(/\s/);function No(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Po(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&q(e.charCodeAt(n+1))&&q(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)}function Z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return X(r)?(e.enter(n),s(r)):t(r)}function s(r){return X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Fo={tokenize:Io};function Io(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`),Z(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 J(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const Lo={tokenize:zo},Ro={tokenize:Bo};function zo(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 G(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(Ro,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(Ro,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 J(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++;G(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 Bo(e,t,n){return Z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Vo(e){if(e===null||Y(e)||Mo(e))return 1;if(jo(e))return 2}function Ho(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}const Uo={name:`attention`,resolveAll:Wo,tokenize:Go};function Wo(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};Ko(d,-c),Ko(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=yo(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=yo(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=yo(l,Ho(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=yo(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=yo(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,G(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 Go(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Vo(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=Vo(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 Ko(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const qo={name:`autolink`,tokenize:Jo};function Jo(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 K(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||q(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||q(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||Do(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Eo(t)?(e.consume(t),l):n(t)}function u(e){return q(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||q(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}const Yo={partial:!0,tokenize:Xo};function Xo(e,t,n){return r;function r(t){return X(t)?Z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||J(e)?t(e):n(e)}}const Zo={continuation:{tokenize:$o},exit:es,name:`blockQuote`,tokenize:Qo};function Qo(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 X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function $o(e,t,n){let r=this;return i;function i(t){return X(t)?Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Zo,t,n)(r)}}function es(e){e.exit(`blockQuote`)}const ts={name:`characterEscape`,tokenize:ns};function ns(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 Ao(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const rs={name:`characterReference`,tokenize:is};function is(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=q,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=ko,u):(e.enter(`characterReferenceValue`),a=7,o=Oo,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===q&&!vo(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)}}const as={partial:!0,tokenize:cs},os={concrete:!0,name:`codeFenced`,tokenize:ss};function ss(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`),X(t)?Z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||J(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(as,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||J(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||J(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&&X(t)?Z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||J(t)?e.check(as,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||J(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`),X(t)?Z(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`),X(t)?Z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||J(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function cs(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)}}const ls={name:`codeIndented`,tokenize:ds},us={partial:!0,tokenize:fs};function ds(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Z(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):J(t)?e.attempt(us,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||J(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function fs(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Z(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):J(e)?i(e):n(e)}}const ps={name:`codeText`,previous:hs,resolve:ms,tokenize:gs};function ms(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 hs(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function gs(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)):J(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||J(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 _s=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&&vs(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),vs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vs(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);vs(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);vs(this.left,t.reverse())}}}};function vs(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 ys(e){let t={},n=-1,r,i,a,o,s,c,l,u=new _s(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,bs(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 G(e,0,1/0,u.slice(0)),!l}function bs(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}const xs={resolve:Cs,tokenize:ws},Ss={partial:!0,tokenize:Ts};function Cs(e){return ys(e),e}function ws(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):J(t)?e.check(Ss,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 Ts(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,a,`linePrefix`)}function a(i){if(i===null||J(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 Es(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||Do(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||J(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||Y(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||Do(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 Ds(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):J(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||J(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Os(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):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||J(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 ks(e,t){let n;return r;function r(i){return J(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):X(i)?Z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const As={name:`definition`,tokenize:Ms},js={partial:!0,tokenize:Ns};function Ms(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ds.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=To(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 Y(t)?ks(e,l)(t):l(t)}function l(t){return Es(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(js,d,d)(t)}function d(t){return X(t)?Z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||J(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ns(e,t,n){return r;function r(t){return Y(t)?ks(e,i)(t):n(t)}function i(t){return Os(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return X(t)?Z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||J(e)?t(e):n(e)}}const Ps={name:`hardBreakEscape`,tokenize:Fs};function Fs(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return J(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Is={name:`headingAtx`,resolve:Ls,tokenize:Rs};function Ls(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`},G(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Rs(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||Y(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||J(n)?(e.exit(`atxHeading`),t(n)):X(n)?Z(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||Y(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const zs=`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(`.`),Bs=[`pre`,`script`,`style`,`textarea`],Vs={concrete:!0,name:`htmlFlow`,resolveTo:Ws,tokenize:Gs},Hs={partial:!0,tokenize:qs},Us={partial:!0,tokenize:Ks};function Ws(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 Gs(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:F):K(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):K(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return K(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Y(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Bs.includes(l)?(i=1,r.interrupt?t(s):O(s)):zs.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||q(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||K(t)?(e.consume(t),b):X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):X(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):X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||J(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||Y(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||J(t)?O(t):X(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),I):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),P):J(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Hs,te,k)(t)):t===null||J(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Us,A,te)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||J(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return Bs.includes(n)?(e.consume(t),I):O(t)}return K(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function P(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),I):t===45&&i===2?(e.consume(t),F):O(t)}function I(t){return t===null||J(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),I)}function te(n){return e.exit(`htmlFlow`),t(n)}}function Ks(e,t,n){let r=this;return i;function i(t){return J(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 qs(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Yo,t,n)}}const Js={name:`htmlText`,tokenize:Ys};function Ys(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):K(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):K(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):J(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(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):J(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):J(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):J(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return K(t)?(e.consume(t),S):n(t)}function S(t){return t===45||q(t)?(e.consume(t),S):C(t)}function C(t){return J(t)?(o=C,N(t)):X(t)?(e.consume(t),C):M(t)}function w(t){return t===45||q(t)?(e.consume(t),w):t===47||t===62||Y(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||K(t)?(e.consume(t),E):J(t)?(o=T,N(t)):X(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||q(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):J(t)?(o=D,N(t)):X(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):J(t)?(o=O,N(t)):X(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):J(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Y(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||Y(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return X(t)?Z(e,P,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):P(t)}function P(t){return e.enter(`htmlTextData`),o(t)}}const Xs={name:`labelEnd`,resolveAll:ec,resolveTo:tc,tokenize:nc},Zs={tokenize:rc},Qs={tokenize:ic},$s={tokenize:ac};function ec(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&&G(e,0,e.length,n),e}function tc(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=yo(s,e.slice(a+1,a+r+3)),s=yo(s,[[`enter`,u,t]]),s=yo(s,Ho(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=yo(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=yo(s,e.slice(o+1)),s=yo(s,[[`exit`,c,t]]),G(e,a,e.length,s),e}function nc(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(To(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(Zs,u,o?u:d)(t):t===91?e.attempt(Qs,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt($s,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function rc(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 Y(t)?ks(e,a)(t):a(t)}function a(t){return t===41?u(t):Es(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Y(t)?ks(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Os(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Y(t)?ks(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 ic(e,t,n){let r=this;return i;function i(t){return Ds.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(To(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ac(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)}}const oc={name:`labelStartImage`,resolveAll:Xs.resolveAll,tokenize:sc};function sc(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)}}const cc={name:`labelStartLink`,resolveAll:Xs.resolveAll,tokenize:lc};function lc(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)}}const uc={name:`lineEnding`,tokenize:dc};function dc(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Z(e,t,`linePrefix`)}}const fc={name:`thematicBreak`,tokenize:pc};function pc(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||J(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),X(t)?Z(e,s,`whitespace`)(t):s(t))}}const mc={continuation:{tokenize:vc},exit:bc,name:`list`,tokenize:_c},hc={partial:!0,tokenize:xc},gc={partial:!0,tokenize:yc};function _c(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:Oo(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(fc,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 Oo(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(Yo,r.interrupt?n:u,e.attempt(hc,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return X(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 vc(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Yo,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!X(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(gc,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(mc,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function yc(e,t,n){let r=this;return Z(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 bc(e){e.exit(this.containerState.type)}function xc(e,t,n){let r=this;return Z(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!X(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const Sc={name:`setextUnderline`,resolveTo:Cc,tokenize:wc};function Cc(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 wc(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`),X(t)?Z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||J(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const Tc={tokenize:Ec};function Ec(e){let t=this,n=e.attempt(Yo,r,e.attempt(this.parser.constructs.flowInitial,i,Z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xs,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}}const Dc={resolveAll:jc()},Oc=Ac(`string`),kc=Ac(`text`);function Ac(e){return{resolveAll:jc(e===`text`?Mc: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 jc(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 Mc(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 Nc=ke({attentionMarkers:()=>Vc,contentInitial:()=>Fc,disable:()=>Hc,document:()=>Pc,flow:()=>Lc,flowInitial:()=>Ic,insideSpan:()=>Bc,string:()=>Rc,text:()=>zc});const Pc={42:mc,43:mc,45:mc,48:mc,49:mc,50:mc,51:mc,52:mc,53:mc,54:mc,55:mc,56:mc,57:mc,62:Zo},Fc={91:As},Ic={[-2]:ls,[-1]:ls,32:ls},Lc={35:Is,42:fc,45:[Sc,fc],60:Vs,61:Sc,95:fc,96:os,126:os},Rc={38:rs,92:ts},zc={[-5]:uc,[-4]:uc,[-3]:uc,33:oc,38:rs,42:Uo,60:[qo,Js],91:cc,92:[Ps,ts],93:Xs,95:Uo,96:ps},Bc={null:[Uo,Dc]},Vc={null:[42,95]},Hc={null:[]};function Uc(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=yo(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ho(a,l.events,l),l.events):[]}function f(e,t){return Gc(p(e),t)}function p(e){return Wc(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){J(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&&G(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 Wc(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 Gc(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=`
|
|
232
|
+
`;break;case-3:o=`\r
|
|
233
|
+
`;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 Kc(e){let t={constructs:xo([Nc,...(e||{}).extensions||[]]),content:n(Fo),defined:[],document:n(Lo),flow:n(Tc),lazy:{},string:n(Oc),text:n(kc)};return t;function n(e){return n;function n(n){return Uc(t,e,n)}}}function qc(e){for(;!ys(e););return e}const Jc=/[\0\t\n\r]/g;function Yc(){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(Jc.lastIndex=u,c=Jc.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}}const Xc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Zc(e){return e.replace(Xc,Qc)}function Qc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return wo(n.slice(t?2:1),t?16:10)}return vo(n)||e}const $c={}.hasOwnProperty;function el(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),tl(n)(qc(Kc(n).document().write(Yc()(e,t,!0))))}function tl(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:P,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:F,resourceTitleString:I,resource:te,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};rl(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]];$c.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]||al).call(a,void 0,e[0])}for(r.position={start:nl(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nl(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:nl(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]||al).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ma({start:e.start,end:e.end})+`): it’s not open`);n.position.end=nl(e.end)}function u(){return po(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=To(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=Ce(),n.position={start:nl(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=nl(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=nl(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 O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){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 N(){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 ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Zc(t),n.identifier=To(t).toLowerCase()}function P(){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 F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function te(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=To(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=wo(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=vo(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=nl(e.end)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function nl(e){return{line:e.line,column:e.column,offset:e.offset}}function rl(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?rl(e,r):il(e,r)}}function il(e,t){let n;for(n in t)if($c.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 al(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ma({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ma({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ma({start:t.start,end:t.end})+`) is still open`)}function ol(e){let t=this;t.parser=n;function n(n){return el(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function sl(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 cl(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
234
|
+
`}]}function ll(e,t){let n=t.value?t.value+`
|
|
235
|
+
`:``,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 ul(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dl(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fl(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Po(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 pl(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 ml(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hl(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 gl(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hl(e,t);let i={src:Po(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 _l(e,t){let n={src:Po(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 vl(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 yl(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hl(e,t);let i={href:Po(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 bl(e,t){let n={href:Po(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 xl(e,t,n){let r=e.all(t),i=n?Sl(n):Cl(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:`
|
|
236
|
+
`}),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:`
|
|
237
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Sl(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Cl(n[r])}return t}function Cl(e){return e.spread??e.children.length>1}function wl(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 Tl(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function El(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Dl(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ol(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=ka(t.children[1]),o=Oa(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 kl(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 Al(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jl(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Ml(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Ml(t.slice(i),i>0,!1)),a.join(``)}function Ml(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Nl(e,t){let n={type:`text`,value:jl(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Pl(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Fl={blockquote:sl,break:cl,code:ll,delete:ul,emphasis:dl,footnoteReference:fl,heading:pl,html:ml,imageReference:gl,image:_l,inlineCode:vl,linkReference:yl,link:bl,listItem:xl,list:wl,paragraph:Tl,root:El,strong:Dl,table:Ol,tableCell:Al,tableRow:kl,text:Nl,thematicBreak:Pl,toml:Il,yaml:Il,definition:Il,footnoteDefinition:Il};function Il(){}const Ll=typeof self==`object`?self:globalThis,Rl=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Ll[e](t)},zl=(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 Ll[e]==`function`?Rl(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(Rl(a,o),i)};return r},Bl=e=>zl(new Map,e)(0),{toString:Vl}={},{keys:Hl}=Object,Ul=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Vl.call(e).slice(8,-1);switch(n){case`Array`:return[1,``];case`Object`:return[2,``];case`Date`:return[3,``];case`RegExp`:return[4,``];case`Map`:return[5,``];case`Set`:return[6,``];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Wl=([e,t])=>e===0&&(t===`function`||t===`symbol`),Gl=(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]=Ul(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 Hl(r))(e||!Wl(Ul(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?``: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||!(Wl(Ul(n))||Wl(Ul(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Wl(Ul(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Kl=(e,{json:t,lossy:n}={})=>{let r=[];return Gl(!(t||n),!!t,new Map,r)(e),r};var ql=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Bl(Kl(e,t)):structuredClone(e):(e,t)=>Bl(Kl(e,t));function Jl(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 Yl(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Xl(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Jl,r=e.options.footnoteBackLabel||Yl,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=Po(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:{...ql(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
238
|
+
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
239
|
+
`}]}}const Zl=(function(e){if(e==null)return nu;if(typeof e==`function`)return tu(e);if(typeof e==`object`)return Array.isArray(e)?Ql(e):$l(e);if(typeof e==`string`)return eu(e);throw Error(`Expected function, string, or object as test`)});function Ql(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Zl(e[n]);return tu(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function $l(e){let t=e;return tu(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function eu(e){return tu(t);function t(t){return t&&t.type===e}}function tu(e){return t;function t(t,n,r){return!!(ru(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function nu(){return!0}function ru(e){return typeof e==`object`&&!!e&&`type`in e}function iu(e){return e}const au=[];function ou(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Zl(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 (`+iu(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=au,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=su(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 su(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?au:[e]}function cu(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),ou(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)}}const lu={}.hasOwnProperty,uu={};function du(e,t){let n=t||uu,r=new Map,i=new Map,a={all:s,applyData:pu,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Fl,...n.handlers},one:o,options:n,patch:fu,wrap:hu};return cu(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(lu.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=ql(n);return r.children=a.all(e),r}return ql(e)}return(a.options.unknownHandler||mu)(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=gu(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=gu(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function fu(e,t){e.position&&(t.position=ja(e))}function pu(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,ql(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function mu(e,t){let n=t.data||{},r=`value`in t&&!(lu.call(n,`hProperties`)||lu.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 hu(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
240
|
+
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
241
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
242
|
+
`}),n}function gu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _u(e,t){let n=du(e,t),r=n.one(e,void 0),i=Xl(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
243
|
+
`},i)),a}function vu(e,t){return e&&`run`in e?async function(n,r){let i=_u(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _u(n,{file:r,...e||t})}}function yu(e){if(e)throw e}var bu=Oe(((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 xu(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 Su(){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?Cu(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 Cu(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)}}const wu={basename:Tu,dirname:Eu,extname:Du,join:Ou,sep:`/`};function Tu(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);ju(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 Eu(e){if(ju(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 Du(e){ju(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 Ou(...e){let t=-1,n;for(;++t<e.length;)ju(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:ku(n)}function ku(e){ju(e);let t=e.codePointAt(0)===47,n=Au(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Au(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 ju(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}const Mu={cwd:Nu};function Nu(){return`/`}function Pu(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Fu(e){if(typeof e==`string`)e=new URL(e);else if(!Pu(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 Iu(e)}function Iu(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)}const Lu=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var Ru=class{constructor(e){let t;t=e?Pu(e)?{path:e}:typeof e==`string`||Hu(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Mu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Lu.length;){let e=Lu[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)Lu.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?wu.basename(this.path):void 0}set basename(e){Bu(e,`basename`),zu(e,`basename`),this.path=wu.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?wu.dirname(this.path):void 0}set dirname(e){Vu(this.basename,`dirname`),this.path=wu.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?wu.extname(this.path):void 0}set extname(e){if(zu(e,`extname`),Vu(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=wu.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Pu(e)&&(e=Fu(e)),Bu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?wu.basename(this.path,this.extname):void 0}set stem(e){Bu(e,`stem`),zu(e,`stem`),this.path=wu.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 W(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 zu(e,t){if(e&&e.includes(wu.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+wu.sep+"`")}function Bu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Vu(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Hu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Uu=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var Wu=je(bu(),1);const Gu={}.hasOwnProperty,Ku=new class e extends Uu{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=Su()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Wu.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Yu(`data`,this.frozen),this.namespace[e]=t,this):Gu.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Yu(`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=Qu(e),n=this.parser||this.Parser;return qu(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),qu(`process`,this.parser||this.Parser),Ju(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Qu(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);ed(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(),qu(`processSync`,this.parser||this.Parser),Ju(`processSync`,this.compiler||this.Compiler),this.process(e,r),Zu(`processSync`,`process`,t),n;function r(e,r){t=!0,yu(e),n=r}}run(e,t,n){Xu(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=Qu(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),Zu(`runSync`,`run`,n),r;function i(e,t){yu(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Qu(t),r=this.compiler||this.Compiler;return Ju(`stringify`,r),Xu(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Yu(`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,Wu.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];xu(o)&&xu(r)&&(r=(0,Wu.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function qu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Ju(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Yu(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 Xu(e){if(!xu(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Zu(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Qu(e){return $u(e)?e:new Ru(e)}function $u(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function ed(e){return typeof e==`string`||td(e)}function td(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const nd=[],rd={allowDangerousHtml:!0},id=/^(https?|ircs?|mailto|xmpp)$/i,ad=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function od(e){let t=sd(e),n=cd(e);return ld(t.runSync(t.parse(n),n),e)}function sd(e){let t=e.rehypePlugins||nd,n=e.remarkPlugins||nd,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rd}:rd;return Ku().use(ol).use(n).use(vu,r).use(t)}function cd(e){let t=e.children||``,n=new Ru;return typeof t==`string`?n.value=t:``+t,n}function ld(r,i){let a=i.allowedElements,o=i.allowElement,s=i.components,c=i.disallowedElements,l=i.skipHtml,u=i.unwrapDisallowed,d=i.urlTransform||ud;for(let e of ad)Object.hasOwn(i,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return cu(r,f),Ha(r,{Fragment:e,components:s,ignoreInvalidStyle:!0,jsx:t,jsxs:n,passKeys:!0,passNode:!0});function f(e,t,n){if(e.type===`raw`&&n&&typeof t==`number`)return l?n.children.splice(t,1):n.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in uo)if(Object.hasOwn(uo,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=uo[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=d(String(n||``),t,e))}}if(e.type===`element`){let r=a?!a.includes(e.tagName):c?c.includes(e.tagName):!1;if(!r&&o&&typeof t==`number`&&(r=!o(e,t,n)),r&&n&&typeof t==`number`)return u&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}}function ud(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||id.test(e.slice(0,t))?e:``}const dd={enter:{defList:fd,defListTerm:md,defListDescription:gd},exit:{defList:pd,defListTerm:hd,defListDescription:_d}};function fd(e){this.enter({type:`defList`,children:[]},e)}function pd(e){this.exit(e)}function md(e){this.enter({type:`defListTerm`,children:[]},e)}function hd(e){this.exit(e)}function gd(e){this.enter({type:`defListDescription`,spread:!!e._loose,children:[]},e)}function _d(e){this.exit(e)}const vd={join:[(e,t,n,r)=>{if(n.type===`defList`)return e.type===`defListDescription`&&t.type===`defListTerm`||`spread`in t&&t.spread?1:0}],unsafe:[{character:`:`,atBreak:!0,after:`(?:[ \r
|
|
244
|
+
])`}],handlers:{defList:(e,t,n,r)=>{let i=n.enter(`defList`),a=n.containerFlow(e,r);return i(),a},defListTerm:(e,t,n,r)=>{let i=n.enter(`defListTerm`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:`
|
|
245
|
+
`,after:`
|
|
246
|
+
`});return a(),i(),o},defListDescription:(e,t,n,r)=>{let i=n.enter(`defListDescription`),a=n.indentLines(n.containerFlow(e,r),o);return i(),a;function o(e,t,n){return t?n?``:` `.repeat(4)+e:n?`:`+` `.repeat(3):`:`+` `.repeat(3)+e}}}};function yd(e,t,n){let r={type:String(e)};return n==null&&(typeof t==`string`||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r}const Q={defList:`defList`,defListTerm:`defListTerm`,defListDescriptionMarker:`defListDescriptionMarker`,defListDescriptionPrefix:`defListDescriptionPrefix`,defListDescriptionPrefixWhitespace:`defListDescriptionPrefixWhitespace`,defListDescription:`defListDescription`};function bd(e){let t=e._tokenizer.events,n,r,i;for(let e=t.length-1;e>=0;e--){let a=t[e];if(a[1].type===`paragraph`){if(a[0]===`exit`)r=e;else{n=e,i=a[1].start.offset;for(let n=e-1;n>=0;n--){let e=t[n];if(e[1].type!==`content`){if(e[1].type===`linePrefix`){i=e[1].start.offset;break}break}}break}}}return n!=null&&r!=null&&i!=null?{flowEvents:t,paragraph:{enterIndex:n,exitIndex:r,startOffset:i}}:{flowEvents:t}}function xd(e){let t=e._tokenizer.events,n=[],r=[],i=[],a=[],o,s,c,l,u=[],d=[];for(let f=t.length-1;f>=0;f--){let p=t[f],m=p[1];if(m.start.offset>=e.end.offset){a.push(f);continue}switch(m.type){case`paragraph`:o==null&&p[0]===`enter`?o=f:s==null&&p[0]===`exit`&&(s=f);break;case`content`:p[0]===`enter`?c=f:p[0]===`exit`&&(l=f);break;default:e.start.offset<=m.start.offset&&m.end.offset<=e.end.offset?(m.type===`chunkText`&&(m.previous&&m.previous.start.offset<e.start.offset&&(m.previous.next=void 0,m.previous=void 0),m.next&&e.end.offset<m.next.end.offset&&(m.next.previous=void 0,m.next=void 0)),o==null&&s==null?r.unshift(p):o==null&&s!=null?i.unshift(p):n.unshift(p),a.push(f)):(o==null&&s!=null&&u.unshift(p),c==null&&l!=null&&d.unshift(p))}if(m.end.offset<=e.start.offset)break}s!=null&&(u.length>=1?t[s][1].end=Object.assign({},u[u.length-1][1].end):o!=null&&a.push(o,s)),l!=null&&(d.length>=1?t[l][1].end=Object.assign({},d[d.length-1][1].end):c!=null&&a.push(c,l)),a.sort((e,t)=>t-e);for(let e of a)G(t,e,1,[]);return{leadingChildEvents:n,termChildEvents:i,trailingChildEvents:r}}function Sd(e,t,n){let r=e[t][1];r.previous!=null&&(r.previous.next=void 0,r.previous=void 0);let i=xd(r),a=e[n][2],o=[];if(i.termChildEvents.length>0){let e={type:Q.defListTerm,start:Object.assign({},r.start),end:Object.assign({},r.end)};o.push([`enter`,e,a]),o.push(...i.leadingChildEvents),o.push(...i.termChildEvents),o.push(...i.trailingChildEvents),o.push([`exit`,e,a])}else o.push(...i.leadingChildEvents),o.push(...i.trailingChildEvents);return G(e,n,1,[]),G(e,t,1,o),e}const Cd=new Set([`linePrefix`,`blockQuotePrefix`,`blockQuoteMarker`,`blockQuotePrefixWhitespace`]),wd={name:`defList`,tokenize:Nd,continuation:{tokenize:Pd},resolveAll:Od,exit:Ld},Td={tokenize:Id,partial:!0},Ed={tokenize:Fd,partial:!0},Dd={document:{58:wd,null:[]}};function Od(e,t){let n=0;for(;n<e.length;){let r=e[n];r[0]===`enter`&&r[1].type===Q.defList&&(n+=kd(n,e,t)),n++}let r=[];for(n=0;n<e.length;){let t=e[n];if(t[0]===`enter`&&t[1].type===Q.defList&&r.push(t[1]),t[0]===`exit`&&t[1].type===Q.defList){let i=!1,a=1;for(;n+a<e.length;){let t=e[n+a];if(t[0]===`enter`&&t[1].type===Q.defList){i=!0;break}if(!Cd.has(t[1].type))break;a++}i?(t[1].end=Object.assign({},e[n+a][1].end),G(e,n,a+1,[]),n-=a):t[1]=r.pop()}n++}return e}function kd(e,t,n){let r=0,i,a=!0,o=e+1;for(o+=jd(e,t);o<t.length;){let l=t[o];if(l[0]===`enter`&&l[1].type===Q.defList&&(o+=kd(o,t,n)),l[0]===`exit`&&l[1].type===Q.defList){o+=c(o,t),i=void 0,r=o-e;break}if(l[0]===`exit`&&l[1].type===Q.defListDescriptionPrefix&&(a||(o+=c(o,t),i=void 0),o+=s(o,t,l[1]._loose),a=!1),l[0]===`enter`&&l[1].type===Q.defListDescriptionPrefix){if(t[o-1][1].type===`lineEndingBlank`)l[1]._loose=!0;else if(t[o-1][1].type===`chunkFlow`){let e=t[o-1][1]._tokenizer.events;e[e.length-1][1].type===`lineEndingBlank`&&(l[1]._loose=!0)}}o++}return r;function s(e,t,r){return i={type:Q.defListDescription,start:Object.assign({},t[e+1][1].start),end:Object.assign({},t[e+1][1].end),_loose:r},G(t,e+1,0,[[`enter`,i,n]]),1}function c(e,t){return i.end=Object.assign({},t[e-1][1].end),G(t,e,0,[[`exit`,i,n]]),1}}function Ad(e,t,n,r){let i=e[t][2],a=bd(e[t][1]).paragraph;if(a==null){let t=e[n],r={type:Q.defListTerm,start:Object.assign({},t[1].start),end:Object.assign({},t[1].start)};return G(e,n,0,[[`enter`,r,i],[`exit`,r,i]]),n}let o=e[t][2].parser.lazy,s=0,c;for(let n=t;n>=0;n--){let t=e[n];if(t[1].type!==`chunkFlow`){s=n+1;break}if(t[1].start.offset<a.startOffset){s=n+1;break}if(t[0]===`exit`){if(r&&!o[t[1].start.line]){s=n+1;break}c=n}else Sd(e,n,c),c=void 0}return s}function jd(e,t){let n,r,i;for(let a=e-1;a>=0;a--)if(!Cd.has(t[a][1].type)){if(a===e-1&&t[a][1].type===`blockQuote`&&t[a][0]===`exit`){i=a,r=t[a];continue}t[a][1].type===`chunkFlow`&&(n=a);break}let a=t[e];G(t,e,1,[]),i!=null&&G(t,i,1,[]);let o=Ad(t,n,e,r!=null);return i!=null&&(r[1].end=Object.assign({},t[o-1][1].end),G(t,o,0,[r]),o+=1),a[1].start=Object.assign({},t[o][1].start),G(t,o,0,[a]),o-e}function Md(e){if(e.length<=1)return!1;let t=e[e.length-1][2].parser.lazy,n=!1,r,i;for(let t=e.length-1;t>=0;t--){let a=e[t];if(!Cd.has(a[1].type)){if(t===e.length-1&&a[1].type===`blockQuote`&&a[0]===`exit`){n=!0;continue}if(a[1].type===`chunkFlow`)a[0]===`enter`&&(i??=a[1]._tokenizer?.events,r=a);else break}}if(i!=null&&r!=null){let e=0;for(let a=i.length-1;a>=0;a--){let o=i[a],s=o[1];if(s.start.offset<r[1].start.offset)break;if(o[0]===`enter`&&s.type===`lineEndingBlank`){if(e>=1)break;e++}if(s.type!==`lineEnding`&&s.type!==`linePrefix`&&s.type!==`lineEndingBlank`&&s.type!==`content`)return n&&!t[s.end.line]?!1:s.type===`paragraph`||s.type===`chunkContent`||s.type===`tableHead`||s.type===`tableRow`}}return!1}function Nd(e,t,n){let r=this;r.containerState??={};let i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0;if(r.containerState.type==null){if(Md(r.events))e.enter(Q.defList,{_container:!0}),r.containerState.type=Q.defList;else return n}return o;function o(t){return t===58?(e.enter(Q.defListDescriptionPrefix,{_loose:r.containerState?.lastBlankLine}),r.containerState.lastBlankLine=void 0,e.enter(Q.defListDescriptionMarker),e.consume(t),e.exit(Q.defListDescriptionMarker),e.check(Yo,s,e.attempt(Td,l,c))):n(t)}function s(e){return r.containerState.initialBlankLine=!0,a++,l(e)}function c(t){return X(t)?(e.enter(Q.defListDescriptionPrefixWhitespace),e.consume(t),e.exit(Q.defListDescriptionPrefixWhitespace),l):n(t)}function l(n){return r.containerState.size=a+r.sliceSerialize(e.exit(Q.defListDescriptionPrefix),!0).length,t(n)}}function Pd(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Yo,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines??r.containerState.initialBlankLine,r.containerState.lastBlankLine=!0,Z(e,t,`linePrefix`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines??!X(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,r.containerState.lastBlankLine=void 0,e.attempt(Ed,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Z(e,e.attempt(wd,t,n),`linePrefix`,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Fd(e,t,n){let r=this;return Z(e,i,`linePrefix`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`linePrefix`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Id(e,t,n){let r=this;return Z(e,i,Q.defListDescriptionPrefixWhitespace,r.parser.constructs.disable.null!=null&&r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!X(e)&&i&&i[1].type===Q.defListDescriptionPrefixWhitespace?t(e):n(e)}}function Ld(e){e.exit(Q.defList)}const Rd=(e,t,n)=>{let r=e.all(t),i=[];for(let e=0;e<r.length;e++)i.push(yd(`text`,`
|
|
247
|
+
`)),i.push(r[e]);r.length>0&&i.push(yd(`text`,`
|
|
248
|
+
`));let a={type:`element`,tagName:`dl`,children:i,properties:{}};return e.patch(t,a),a},zd=(e,t,n)=>{let r={type:`element`,tagName:`dt`,properties:{},children:e.all(t)};return e.patch(t,r),r},Bd=(e,t,n)=>{let r=[],i=e.all(t);for(let e=0;e<i.length;e++){let n=i[e];(t.spread||e!==0||n.type!==`element`||n.tagName!==`p`)&&r.push(yd(`text`,`
|
|
249
|
+
`)),!t.spread&&n.type===`element`&&n.tagName===`p`?r.push(...n.children):r.push(n)}let a=r[r.length-1];a&&(t.spread||!(`tagName`in a)||a.tagName!==`p`)&&r.push(yd(`text`,`
|
|
250
|
+
`));let o={type:`element`,tagName:`dd`,properties:{},children:r};return e.patch(t,o),o},Vd={[Q.defList]:Rd,[Q.defListTerm]:zd,[Q.defListDescription]:Bd},Hd=Zl([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Ud(){let e=this.data(),t=e.micromarkExtensions??=[],n=e.fromMarkdownExtensions??=[],r=e.toMarkdownExtensions??=[];t.push(Dd),n.push(dd),r.push(vd)}function Wd(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}const Gd=`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(`.`),Kd={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function qd(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Jd(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Yd(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Xd(e){return Yd(e)||qd(e)}const Zd=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Qd(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Xd:u===`decimal`?qd:Jd;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Gd.includes(y)&&(_=y,v=vo(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&vo(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1)){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Xd(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if($d(e))h(7,S),C=`�`;else if(e in Kd)h(6,S),C=Kd[e];else{let t=``;ef(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Zd[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function $d(e){return e>=55296&&e<=57343||e>1114111}function ef(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const tf=/["&'<>`]/g,nf=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,rf=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,af=/[|\\{}()[\]^$+*?.]/g,of=new WeakMap;function sf(e,t){if(e=e.replace(t.subset?cf(t.subset):tf,r),t.subset||t.escapeOnly)return e;return e.replace(nf,n).replace(rf,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 cf(e){let t=of.get(e);return t||(t=lf(e),of.set(e,t)),t}function lf(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(af,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function uf(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function df(e,t){return sf(e,Object.assign({format:uf},t))}const ff={}.hasOwnProperty,pf={},mf=/^[^\t\n\r "#'.<=>`}]+$/,hf=/^[^\t\n\r "'<=>`}]+$/;function gf(){return{canContainEols:[`textDirective`],enter:{directiveContainer:vf,directiveContainerAttributes:Tf,directiveContainerLabel:Cf,directiveLeaf:yf,directiveLeafAttributes:Tf,directiveText:bf,directiveTextAttributes:Tf},exit:{directiveContainer:jf,directiveContainerAttributeClassValue:Df,directiveContainerAttributeIdValue:Ef,directiveContainerAttributeName:kf,directiveContainerAttributeValue:Of,directiveContainerAttributes:Af,directiveContainerLabel:wf,directiveContainerName:Sf,directiveLeaf:jf,directiveLeafAttributeClassValue:Df,directiveLeafAttributeIdValue:Ef,directiveLeafAttributeName:kf,directiveLeafAttributeValue:Of,directiveLeafAttributes:Af,directiveLeafName:Sf,directiveText:jf,directiveTextAttributeClassValue:Df,directiveTextAttributeIdValue:Ef,directiveTextAttributeName:kf,directiveTextAttributeValue:Of,directiveTextAttributes:Af,directiveTextName:Sf}}}function _f(e){let t=e||pf;if(t.quote!==`"`&&t.quote!==`'`&&t.quote!==null&&t.quote!==void 0)throw Error("Invalid quote `"+t.quote+"`, expected `'` or `\"`");return n.peek=Mf,{handlers:{containerDirective:n,leafDirective:n,textDirective:n},unsafe:[{character:`\r`,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{character:`
|
|
251
|
+
`,inConstruct:[`leafDirectiveLabel`,`containerDirectiveLabel`]},{before:`[^:]`,character:`:`,after:`[A-Za-z]`,inConstruct:[`phrasing`]},{atBreak:!0,character:`:`,after:`:`}]};function n(e,t,n,i){let a=n.createTracker(i),o=Pf(e),s=n.enter(e.type),c=a.move(o+(e.name||``)),l;if(e.type===`containerDirective`){let t=(e.children||[])[0];l=Nf(t)?t:void 0}else l=e;if(l&&l.children&&l.children.length>0){let t=n.enter(`label`),r=`${e.type}Label`,i=n.enter(r);c+=a.move(`[`),c+=a.move(n.containerPhrasing(l,{...a.current(),before:c,after:`]`})),c+=a.move(`]`),i(),t()}if(c+=a.move(r(e,n)),e.type===`containerDirective`){let t=(e.children||[])[0],r=e;Nf(t)&&(r=Object.assign({},e,{children:e.children.slice(1)})),r&&r.children&&r.children.length>0&&(c+=a.move(`
|
|
252
|
+
`),c+=a.move(n.containerFlow(r,a.current()))),c+=a.move(`
|
|
253
|
+
`+o)}return s(),c}function r(e,n){let r=e.attributes||{},a=[],o,s,c,l;for(l in r)if(ff.call(r,l)&&r[l]!==void 0&&r[l]!==null){let u=String(r[l]);if(l===`id`)c=t.preferShortcut!==!1&&mf.test(u)?`#`+u:i(`id`,u,e,n);else if(l===`class`){let r=u.split(/[\t\n\r ]+/g),a=[],c=[],l=-1;for(;++l<r.length;)(t.preferShortcut!==!1&&mf.test(r[l])?c:a).push(r[l]);o=a.length>0?i(`class`,a.join(` `),e,n):``,s=c.length>0?`.`+c.join(`.`):``}else a.push(i(l,u,e,n))}return o&&a.unshift(o),s&&a.unshift(s),c&&a.unshift(c),a.length>0?`{`+a.join(` `)+`}`:``}function i(e,n,r,i){if(t.collapseEmptyAttributes!==!1&&!n)return e;if(t.preferUnquoted&&hf.test(n))return e+`=`+n;let a=t.quote||i.options.quote||`"`,o=a===`"`?`'`:`"`,s=t.quoteSmart&&Wd(n,a)>Wd(n,o)?o:a,c=r.type===`textDirective`?[s]:[s,`
|
|
254
|
+
`,`\r`];return e+`=`+s+df(n,{subset:c})+s}}function vf(e){xf.call(this,`containerDirective`,e)}function yf(e){xf.call(this,`leafDirective`,e)}function bf(e){xf.call(this,`textDirective`,e)}function xf(e,t){this.enter({type:e,name:``,attributes:{},children:[]},t)}function Sf(e){let t=this.stack[this.stack.length-1];t.type===`containerDirective`||t.type===`leafDirective`||t.type,t.name=this.sliceSerialize(e)}function Cf(e){this.enter({type:`paragraph`,data:{directiveLabel:!0},children:[]},e)}function wf(e){this.exit(e)}function Tf(){this.data.directiveAttributes=[],this.buffer()}function Ef(e){this.data.directiveAttributes.push([`id`,Qd(this.sliceSerialize(e),{attribute:!0})])}function Df(e){this.data.directiveAttributes.push([`class`,Qd(this.sliceSerialize(e),{attribute:!0})])}function Of(e){let t=this.data.directiveAttributes;t[t.length-1][1]=Qd(this.sliceSerialize(e),{attribute:!0})}function kf(e){this.data.directiveAttributes.push([this.sliceSerialize(e),``])}function Af(){let e=this.data.directiveAttributes,t={},n=-1;for(;++n<e.length;){let r=e[n];r[0]===`class`&&t.class?t.class+=` `+r[1]:t[r[0]]=r[1]}this.data.directiveAttributes=void 0,this.resume();let r=this.stack[this.stack.length-1];r.type===`containerDirective`||r.type===`leafDirective`||r.type,r.attributes=t}function jf(e){this.exit(e)}function Mf(){return`:`}function Nf(e){return!!(e&&e.type===`paragraph`&&e.data&&e.data.directiveLabel)}function Pf(e){let t=0;return e.type===`containerDirective`?(ou(e,function(e,n){if(e.type===`containerDirective`){let e=n.length,r=0;for(;e--;)n[e].type===`containerDirective`&&r++;r>t&&(t=r)}}),t+=3):t=e.type===`leafDirective`?2:1,`:`.repeat(t)}function Ff(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){let h,g;return _;function _(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),v}function v(t){return t===35?(h=o,y(t)):t===46?(h=s,y(t)):m&&X(t)?Z(e,v,`whitespace`)(t):!m&&Y(t)?ks(e,v)(t):t===null||J(t)||Mo(t)||jo(t)&&t!==45&&t!==95?A(t):(e.enter(a),e.enter(c),e.consume(t),S)}function y(t){let n=h+`Marker`;return e.enter(a),e.enter(h),e.enter(n),e.consume(t),e.exit(n),b}function b(t){if(t===null||t===34||t===35||t===39||t===46||t===60||t===61||t===62||t===96||t===125||Y(t))return n(t);let r=h+`Value`;return e.enter(r),e.consume(t),x}function x(t){if(t===null||t===34||t===39||t===60||t===61||t===62||t===96)return n(t);if(t===35||t===46||t===125||Y(t)){let n=h+`Value`;return e.exit(n),e.exit(h),e.exit(a),v(t)}return e.consume(t),x}function S(t){return t===null||J(t)||Mo(t)||jo(t)&&t!==45&&t!==46&&t!==58&&t!==95?(e.exit(c),m&&X(t)?Z(e,C,`whitespace`)(t):!m&&Y(t)?ks(e,C)(t):C(t)):(e.consume(t),S)}function C(t){return t===61?(e.enter(l),e.consume(t),e.exit(l),w):(e.exit(a),v(t))}function w(t){return t===null||t===60||t===61||t===62||t===96||t===125||m&&J(t)?n(t):t===34||t===39?(e.enter(u),e.enter(f),e.consume(t),e.exit(f),g=t,E):m&&X(t)?Z(e,w,`whitespace`)(t):!m&&Y(t)?ks(e,w)(t):(e.enter(d),e.enter(p),e.consume(t),g=void 0,T)}function T(t){return t===null||t===34||t===39||t===60||t===61||t===62||t===96?n(t):t===125||Y(t)?(e.exit(p),e.exit(d),e.exit(a),v(t)):(e.consume(t),T)}function E(t){return t===g?(e.enter(f),e.consume(t),e.exit(f),e.exit(u),e.exit(a),k):(e.enter(d),D(t))}function D(t){return t===g?(e.exit(d),E(t)):t===null?n(t):J(t)?m?n(t):ks(e,D)(t):(e.enter(p),e.consume(t),O)}function O(t){return t===g||t===null||J(t)?(e.exit(p),D(t)):(e.consume(t),O)}function k(e){return e===125||Y(e)?v(e):A(e)}function A(a){return a===125?(e.enter(i),e.consume(a),e.exit(i),e.exit(r),t):n(a)}}function If(e,t,n,r,i,a,o){let s=0,c=0,l;return u;function u(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),d}function d(n){return n===93?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),f(n))}function f(t){if(t===93&&!c)return h(t);let n=e.enter(`chunkText`,{_contentTypeTextTrailing:!0,contentType:`text`,previous:l});return l&&(l.next=n),l=n,p(t)}function p(t){return t===null||s>999||t===91&&++c>32?n(t):t===93&&!c--?(e.exit(`chunkText`),h(t)):J(t)?o?n(t):(e.consume(t),e.exit(`chunkText`),f):(e.consume(t),t===92?m:p)}function m(t){return t===91||t===92||t===93?(e.consume(t),s++,p):p(t)}function h(n){return e.exit(a),e.enter(i),e.consume(n),e.exit(i),e.exit(r),t}}function Lf(e,t,n,r){let i=this;return a;function a(t){return t===null||J(t)||jo(t)||Mo(t)?n(t):(e.enter(r),e.consume(t),o)}function o(a){return a===null||J(a)||Mo(a)||jo(a)&&a!==45&&a!==95?(e.exit(r),i.previous===45||i.previous===95?n(a):t(a)):(e.consume(a),o)}}const Rf={tokenize:Hf,concrete:!0},zf={tokenize:Uf,partial:!0},Bf={tokenize:Wf,partial:!0},Vf={tokenize:Gf,partial:!0};function Hf(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,s;return c;function c(t){return e.enter(`directiveContainer`),e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),l(t)}function l(t){return t===58?(e.consume(t),o++,l):o<3?n(t):(e.exit(`directiveContainerSequence`),Lf.call(r,e,u,n,`directiveContainerName`)(t))}function u(t){return t===91?e.attempt(zf,d,d)(t):d(t)}function d(t){return t===123?e.attempt(Bf,f,f)(t):f(t)}function f(t){return Z(e,p,`whitespace`)(t)}function p(i){return e.exit(`directiveContainerFence`),i===null?C(i):J(i)?r.interrupt?t(i):e.attempt(Vf,m,C)(i):n(i)}function m(t){return t===null?C(t):J(t)?e.check(Vf,y,C)(t):(e.enter(`directiveContainerContent`),h(t))}function h(t){return e.attempt({tokenize:w,partial:!0},S,a?Z(e,g,`linePrefix`,a+1):g)(t)}function g(t){return t===null?S(t):J(t)?e.check(Vf,v,S)(t):v(t)}function _(t){if(t===null){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}return J(t)?e.check(Vf,b,x)(t):(e.consume(t),_)}function v(t){let n=e.enter(`chunkDocument`,{contentType:`document`,previous:s});return s&&(s.next=n),s=n,_(t)}function y(t){return e.enter(`directiveContainerContent`),h(t)}function b(t){e.consume(t);let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,h}function x(t){let n=e.exit(`chunkDocument`);return r.parser.lazy[n.start.line]=!1,S(t)}function S(t){return e.exit(`directiveContainerContent`),C(t)}function C(n){return e.exit(`directiveContainer`),t(n)}function w(e,t,n){let i=0;return Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`directiveContainerFence`),e.enter(`directiveContainerSequence`),s(t)}function s(t){return t===58?(e.consume(t),i++,s):i<o?n(t):(e.exit(`directiveContainerSequence`),Z(e,c,`whitespace`)(t))}function c(r){return r===null||J(r)?(e.exit(`directiveContainerFence`),t(r)):n(r)}}}function Uf(e,t,n){return If(e,t,n,`directiveContainerLabel`,`directiveContainerLabelMarker`,`directiveContainerLabelString`,!0)}function Wf(e,t,n){return Ff(e,t,n,`directiveContainerAttributes`,`directiveContainerAttributesMarker`,`directiveContainerAttribute`,`directiveContainerAttributeId`,`directiveContainerAttributeClass`,`directiveContainerAttributeName`,`directiveContainerAttributeInitializerMarker`,`directiveContainerAttributeValueLiteral`,`directiveContainerAttributeValue`,`directiveContainerAttributeValueMarker`,`directiveContainerAttributeValueData`,!0)}function Gf(e,t,n){let r=this;return i;function i(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Kf={tokenize:Yf},qf={tokenize:Xf,partial:!0},Jf={tokenize:Zf,partial:!0};function Yf(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveLeaf`),e.enter(`directiveLeafSequence`),e.consume(t),a}function a(t){return t===58?(e.consume(t),e.exit(`directiveLeafSequence`),Lf.call(r,e,o,n,`directiveLeafName`)):n(t)}function o(t){return t===91?e.attempt(qf,s,s)(t):s(t)}function s(t){return t===123?e.attempt(Jf,c,c)(t):c(t)}function c(t){return Z(e,l,`whitespace`)(t)}function l(r){return r===null||J(r)?(e.exit(`directiveLeaf`),t(r)):n(r)}}function Xf(e,t,n){return If(e,t,n,`directiveLeafLabel`,`directiveLeafLabelMarker`,`directiveLeafLabelString`,!0)}function Zf(e,t,n){return Ff(e,t,n,`directiveLeafAttributes`,`directiveLeafAttributesMarker`,`directiveLeafAttribute`,`directiveLeafAttributeId`,`directiveLeafAttributeClass`,`directiveLeafAttributeName`,`directiveLeafAttributeInitializerMarker`,`directiveLeafAttributeValueLiteral`,`directiveLeafAttributeValue`,`directiveLeafAttributeValueMarker`,`directiveLeafAttributeValueData`,!0)}const Qf={tokenize:np,previous:tp},$f={tokenize:rp,partial:!0},ep={tokenize:ip,partial:!0};function tp(e){return e!==58||this.events[this.events.length-1][1].type===`characterEscape`}function np(e,t,n){let r=this;return i;function i(t){return e.enter(`directiveText`),e.enter(`directiveTextMarker`),e.consume(t),e.exit(`directiveTextMarker`),Lf.call(r,e,a,n,`directiveTextName`)}function a(t){return t===58?n(t):t===91?e.attempt($f,o,o)(t):o(t)}function o(t){return t===123?e.attempt(ep,s,s)(t):s(t)}function s(n){return e.exit(`directiveText`),t(n)}}function rp(e,t,n){return If(e,t,n,`directiveTextLabel`,`directiveTextLabelMarker`,`directiveTextLabelString`)}function ip(e,t,n){return Ff(e,t,n,`directiveTextAttributes`,`directiveTextAttributesMarker`,`directiveTextAttribute`,`directiveTextAttributeId`,`directiveTextAttributeClass`,`directiveTextAttributeName`,`directiveTextAttributeInitializerMarker`,`directiveTextAttributeValueLiteral`,`directiveTextAttributeValue`,`directiveTextAttributeValueMarker`,`directiveTextAttributeValueData`)}function ap(){return{text:{58:Qf},flow:{58:[Rf,Kf]}}}function op(){let e=this.data(),t=e.micromarkExtensions||=[],n=e.fromMarkdownExtensions||=[],r=e.toMarkdownExtensions||=[];t.push(ap()),n.push(gf()),r.push(_f())}function sp(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function cp(e,t,n){let r=Zl((n||{}).ignore||[]),i=lp(t),a=-1;for(;++a<i.length;)ou(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 lp(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([up(e[0]),dp(e[1])])}return t}function up(e){return typeof e==`string`?new RegExp(sp(e),`g`):e}function dp(e){return typeof e==`function`?e:function(){return e}}const fp=`phrasing`,pp=[`autolink`,`link`,`image`,`label`];function mp(){return{transforms:[Sp],enter:{literalAutolink:gp,literalAutolinkEmail:_p,literalAutolinkHttp:_p,literalAutolinkWww:_p},exit:{literalAutolink:xp,literalAutolinkEmail:bp,literalAutolinkHttp:vp,literalAutolinkWww:yp}}}function hp(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:fp,notInConstruct:pp},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:fp,notInConstruct:pp},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:fp,notInConstruct:pp}]}}function gp(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function _p(e){this.config.enter.autolinkProtocol.call(this,e)}function vp(e){this.config.exit.autolinkProtocol.call(this,e)}function yp(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 bp(e){this.config.exit.autolinkEmail.call(this,e)}function xp(e){this.exit(e)}function Sp(e){cp(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Cp],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,wp]],{ignore:[`link`,`linkReference`]})}function Cp(e,t,n,r,i){let a=``;if(!Dp(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Tp(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 wp(e,t,n,r){return!Dp(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Tp(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=Wd(e,`(`),a=Wd(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 Dp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Mo(n)||jo(n))&&(!t||n!==47)}Lp.peek=Ip;function Op(){this.buffer()}function kp(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Ap(){this.buffer()}function jp(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Mp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=To(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Np(e){this.exit(e)}function Pp(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=To(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Fp(e){this.exit(e)}function Ip(){return`[`}function Lp(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 Rp(){return{enter:{gfmFootnoteCallString:Op,gfmFootnoteCall:kp,gfmFootnoteDefinitionLabelString:Ap,gfmFootnoteDefinition:jp},exit:{gfmFootnoteCallString:Mp,gfmFootnoteCall:Np,gfmFootnoteDefinitionLabelString:Pp,gfmFootnoteDefinition:Fp}}}function zp(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Lp},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?`
|
|
255
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Vp:Bp))),s(),o}}function Bp(e,t,n){return t===0?e:Vp(e,t,n)}function Vp(e,t,n){return(n?``:` `)+e}const Hp=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];qp.peek=Jp;function Up(){return{canContainEols:[`delete`],enter:{strikethrough:Gp},exit:{strikethrough:Kp}}}function Wp(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Hp}],handlers:{delete:qp}}}function Gp(e){this.enter({type:`delete`,children:[]},e)}function Kp(e){this.exit(e)}function qp(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 Jp(){return`~`}function Yp(e){return e.length}function Xp(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Yp,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=Zp(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]=Qp(r[d]);else{let e=Qp(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(`
|
|
256
|
+
`)}function Zp(e){return e==null?``:String(e)}function Qp(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 $p(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()),em);return i(),o}function em(e,t,n){return`>`+(n?``:` `)+e}function tm(e,t){return nm(e,t.inConstruct,!0)&&!nm(e,t.notInConstruct,!1)}function nm(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 rm(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
257
|
+
`&&tm(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
|
|
258
|
+
`}function im(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 am(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 om(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function sm(e,t,n,r){let i=om(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(am(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,cm);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(im(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:`
|
|
259
|
+
`,encode:["`"],...s.current()})),t()}return u+=s.move(`
|
|
260
|
+
`),a&&(u+=s.move(a+`
|
|
261
|
+
`)),u+=s.move(c),l(),u}function cm(e,t,n){return(n?``:` `)+e}function lm(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function um(e,t,n,r){let i=lm(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?` `:`
|
|
262
|
+
`,...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 dm(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function fm(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function pm(e,t,n){let r=Vo(e),i=Vo(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}}mm.peek=hm;function mm(e,t,n,r){let i=dm(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=pm(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=fm(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=pm(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+fm(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function hm(e,t,n){return n.options.emphasis||`*`}function gm(e,t){let n=!1;return cu(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)&&po(e)&&(t.options.setext||n))}function _m(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(gm(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
263
|
+
`,after:`
|
|
264
|
+
`});return r(),t(),o+`
|
|
265
|
+
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
266
|
+
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
267
|
+
`,...a.current()});return/^[\t ]/.test(l)&&(l=fm(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}vm.peek=ym;function vm(e){return e.value||``}function ym(){return`<`}bm.peek=xm;function bm(e,t,n,r){let i=lm(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 xm(){return`!`}Sm.peek=Cm;function Sm(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 Cm(){return`!`}wm.peek=Tm;function wm(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 Tm(){return"`"}function Em(e,t){let n=po(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))}Dm.peek=Om;function Dm(e,t,n,r){let i=lm(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Em(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 Om(e,t,n){return Em(e,n)?`<`:`[`}km.peek=Am;function km(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 Am(){return`[`}function jm(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 Mm(e){let t=jm(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 Nm(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Pm(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 Fm(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Nm(n):jm(n),s=e.ordered?o===`.`?`)`:`.`:Mm(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),Pm(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 Im(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 Lm(e,t,n,r){let i=Im(n),a=n.bulletCurrent||jm(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 Rm(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function zm(e,t,n,r){return(e.children.some(function(e){return Hd(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Bm(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Vm.peek=Hm;function Vm(e,t,n,r){let i=Bm(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=pm(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=fm(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=pm(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+fm(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Hm(e,t,n){return n.options.strong||`*`}function Um(e,t,n,r){return n.safe(e.value,r)}function Wm(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 Gm(e,t,n){let r=(Pm(n)+(n.options.ruleSpaces?` `:``)).repeat(Wm(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Km={blockquote:$p,break:rm,code:sm,definition:um,emphasis:mm,hardBreak:rm,heading:_m,html:vm,image:bm,imageReference:Sm,inlineCode:wm,link:Dm,linkReference:km,list:Fm,listItem:Lm,paragraph:Rm,root:zm,strong:Vm,text:Um,thematicBreak:Gm};function qm(){return{enter:{table:Jm,tableData:Qm,tableHeader:Qm,tableRow:Xm},exit:{codeText:$m,table:Ym,tableData:Zm,tableHeader:Zm,tableRow:Zm}}}function Jm(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 Ym(e){this.exit(e),this.data.inTable=void 0}function Xm(e){this.enter({type:`tableRow`,children:[]},e)}function Zm(e){this.exit(e)}function Qm(e){this.enter({type:`tableCell`,children:[]},e)}function $m(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,eh));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function eh(e,t){return t===`|`?t:e}function th(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
268
|
+
`,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(`
|
|
269
|
+
`))}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 Xp(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=Km.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function nh(){return{exit:{taskListCheckValueChecked:ih,taskListCheckValueUnchecked:ih,paragraph:ah}}}function rh(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:oh}}}function ih(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function ah(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 oh(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=Km.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 sh(){return[mp(),Rp(),Up(),qm(),nh()]}function ch(e){return{extensions:[hp(),zp(e),Wp(),th(e),rh()]}}const lh={tokenize:Ch,partial:!0},uh={tokenize:wh,partial:!0},dh={tokenize:Th,partial:!0},fh={tokenize:Eh,partial:!0},ph={tokenize:Dh,partial:!0},mh={name:`wwwAutolink`,tokenize:xh,previous:Oh},hh={name:`protocolAutolink`,tokenize:Sh,previous:kh},gh={name:`emailAutolink`,tokenize:bh,previous:Ah},_h={};function vh(){return{text:_h}}let yh=48;for(;yh<123;)_h[yh]=gh,yh++,yh===58?yh=65:yh===91&&(yh=97);_h[43]=gh,_h[45]=gh,_h[46]=gh,_h[95]=gh,_h[72]=[gh,hh],_h[104]=[gh,hh],_h[87]=[gh,mh],_h[119]=[gh,mh];function bh(e,t,n){let r=this,i,a;return o;function o(t){return!jh(t)||!Ah.call(r,r.previous)||Mh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return jh(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(ph,u,l)(t):t===45||t===95||q(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&&K(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function xh(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Oh.call(r,r.previous)||Mh(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(lh,e.attempt(uh,e.attempt(dh,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Sh(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&kh.call(r,r.previous)&&!Mh(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(K(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||Do(t)||Y(t)||Mo(t)||jo(t)?n(t):e.attempt(uh,e.attempt(dh,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Ch(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 wh(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(fh,c,s)(t):t===null||Y(t)||Mo(t)||t!==45&&jo(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 Th(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(fh,t,a)(o):o===null||Y(o)||Mo(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Eh(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||Y(o)||Mo(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Y(e)||Mo(e)?t(e):r(e)}function a(e){return K(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):K(t)?(e.consume(t),o):n(t)}}function Dh(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return q(e)?n(e):t(e)}}function Oh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Y(e)}function kh(e){return!K(e)}function Ah(e){return!(e===47||jh(e))}function jh(e){return e===43||e===45||e===46||e===95||q(e)}function Mh(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}const Nh={tokenize:Vh,partial:!0};function Ph(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Rh,continuation:{tokenize:zh},exit:Bh}},text:{91:{name:`gfmFootnoteCall`,tokenize:Lh},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Fh,resolveTo:Ih}}}}function Fh(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=To(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 Ih(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 Lh(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||Y(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(To(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Y(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 Rh(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||Y(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=To(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Y(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),Z(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function zh(e,t,n){return e.check(Yo,t,e.attempt(Nh,t,n))}function Bh(e){e.exit(`gfmFootnoteDefinition`)}function Vh(e,t,n){let r=this;return Z(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 Hh(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&&G(o,o.length,0,Ho(s,e.slice(r+1,n),t)),G(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),G(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=Vo(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=Vo(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Uh=class{constructor(){this.map=[]}add(e,t,n){Wh(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 Wh(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 Gh(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 Kh(){return{flow:{null:{name:`table`,tokenize:qh,resolveAll:Jh}}}}function qh(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):J(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):X(t)?Z(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||Y(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,X(t)?Z(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 X(t)?Z(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||J(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 X(t)?Z(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||J(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||J(n)?(e.exit(`tableRow`),t(n)):X(n)?Z(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Y(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 Jh(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 Uh;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Xh(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=Yh(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=Yh(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=Yh(f,t,o,i,n,d)):(o[0]=o[1],d=Yh(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Xh(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=Gh(t.events,n))}return e}function Yh(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Zh(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Zh(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=Zh(t.events,n[2]),a=Zh(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({},Zh(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Xh(e,t,n,r,i){let a=[],o=Zh(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 Zh(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const Qh={name:`tasklistCheck`,tokenize:eg};function $h(){return{text:{91:Qh}}}function eg(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 Y(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 J(r)?t(r):X(r)?e.check({tokenize:tg},t,n)(r):n(r)}}function tg(e,t,n){return Z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function ng(e){return xo([vh(),Ph(),Hh(e),Kh(),$h()])}const rg={};function ig(e){let t=this,n=e||rg,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ng(n)),a.push(sh()),o.push(ch(n))}const ag=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,og=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,sg=({legacyTitle:e=!1,tagName:t=`div`,classNames:n=``}={})=>r=>{cu(r,`blockquote`,(r,i,a)=>{let o=``,s=``,c=!0,l=r.children.map(t=>{if(c&&t.type===`paragraph`){let n=t.children[0],r=n.type===`text`?n.value:``,i=e?og:ag,a=r.match(i);if(a&&(c=!1,o=a[1].toLocaleLowerCase(),s=e&&a[2]||o.toLocaleUpperCase(),r.includes(`
|
|
270
|
+
`)&&(t.children[0]={type:`text`,value:r.replace(i,``).replace(/^\n+/,``)}),!r.includes(`
|
|
271
|
+
`))){let e=[];t.children.forEach((t,n)=>{n!=0&&(n!=1||t.type!==`break`)&&e.push(t)}),t.children=[...e]}}return t});o&&(r.data={hName:t,hProperties:{className:[`markdown-alert`,`markdown-alert-${o}`,...n.split(` `).filter(e=>e.length)],dir:`auto`}},l.unshift({type:`paragraph`,children:[cg(o),{type:`text`,value:s.replace(/^\//,``)}],data:{hProperties:{className:`markdown-alert-title`,dir:`auto`}}})),r.children=[...l]})};function cg(e){return{type:`emphasis`,data:{hName:`svg`,hProperties:{className:[`octicon`],viewBox:`0 0 16 16`,width:`16`,height:`16`,ariaHidden:`true`}},children:[{type:`emphasis`,data:{hName:`path`,hProperties:{d:lg[e]??``}},children:[]}]}}const lg={note:`M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`,tip:`M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z`,important:`M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,warning:`M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z`,caution:`M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z`};function ug(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function dg(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
272
|
+
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(im(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
|
273
|
+
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
|
|
274
|
+
`),i&&(c+=a.move(i+`
|
|
275
|
+
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}const fg={tokenize:mg,concrete:!0,name:`mathFlow`},pg={tokenize:hg,partial:!0};function mg(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){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Z(e,l,`whitespace`)(t))}function l(t){return t===null||J(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||J(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(pg,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Z(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):J(t)?e.attempt(pg,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||J(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Z(e,c,`whitespace`)(t))}function c(r){return r===null||J(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function hg(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function gg(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:_g,previous:vg,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):J(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||J(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function _g(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===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,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=`mathTextData`,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 vg(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function yg(e){return{flow:{36:fg},text:{36:gg(e)}}}const bg={};function xg(e){let t=this,n=e||bg,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yg(n)),a.push(ug()),o.push(dg(n))}const Sg=(function(e){if(e==null)return Dg;if(typeof e==`string`)return Tg(e);if(typeof e==`object`)return Array.isArray(e)?Cg(e):wg(e);if(typeof e==`function`)return Eg(e);throw Error(`Expected function, string, or object as test`)});function Cg(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Sg(e[n]);return Eg(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].call(this,...e))return!0;return!1}}function wg(e){return Eg(t);function t(t){let n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function Tg(e){return Eg(t);function t(t){return t&&t.type===e}}function Eg(e){return t;function t(t,...n){return!!(t&&typeof t==`object`&&`type`in t&&e.call(this,t,...n))}}function Dg(){return!0}function Og(e){return e}const kg=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null);let i=Sg(t),a=r?-1:1;o(e,void 0,[])();function o(e,s,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 (`+Og(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=[],u,d,f;if((!t||i(e,s,c[c.length-1]||null))&&(l=Ag(n(e,c)),l[0]===!1))return l;if(e.children&&l[0]!==`skip`)for(d=(r?e.children.length:-1)+a,f=c.concat(e);d>-1&&d<e.children.length;){if(u=o(e.children[d],d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+a}return l}}});function Ag(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:[e]}const jg=(function(e,t,n,r){typeof t==`function`&&typeof n!=`function`&&(r=n,n=t,t=null),kg(e,t,i,r);function i(e,t){let r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}});function Mg(){return e=>{jg(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\^/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`superscript`,data:{hName:`sup`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)}),jg(e,[`text`],(e,t,n)=>{if(e.type!==`text`)return;let{value:r}=e,i=r.split(/\~/);if(i.length===1||i.length%2==0)return;let a=i.map((e,t)=>t%2==0?{type:`text`,value:e}:{type:`subscript`,data:{hName:`sub`},children:[{type:`text`,value:e}]});n.children.splice(t,1,...a)})}}const Ng=[`artifact:`,`image:`,`store:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`],Pg=/(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g,Fg=/`[^`\n]*`/g,Ig=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,Lg=/\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;function Rg(e){return Ng.some(t=>e.startsWith(t))}function zg(e){let t=e.trim();if(t.startsWith(`<`)){let n=t.indexOf(`>`);if(n>0&&Rg(t.slice(1,n).trim()))return e}let n=t.match(Lg)?.index??-1,r=(n>=0?t.slice(0,n):t).trim(),i=n>=0?t.slice(n):``;return Rg(r)?`<${r}>${i}`:e}function Bg(e){return e.replace(Pg,(e,t,n,r)=>`${t}${zg(n)}${r}`)}function Vg(e){let t=``,n=0;for(let r of e.matchAll(Fg))t+=Bg(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=Bg(e.slice(n)),t}function Hg(e){if(!e||!Ng.some(t=>e.includes(t)))return e;let t=``,n=0;for(let r of e.matchAll(Ig))t+=Vg(e.slice(n,r.index)),t+=r[0],n=r.index+r[0].length;return t+=Vg(e.slice(n)),t}const Ug=/^([ \t]*):::([^\n]*?):::[ \t]*$/gm,Wg=/^\w+/;function Gg(e){return e?.includes(`:::`)?e.replace(Ug,(e,t,n)=>{let r=n.trim(),i=Wg.exec(r);if(!i)return e;let a=i[0],o=r.slice(a.length).trim();return o?`${t}:::${a}\n${t}${o}\n${t}:::`:`${t}::${a}`}):e}const Kg=/(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g,qg=/`[^`\n]*`/g,Jg=/\\\$/g,Yg=/\\[^\s]/,Xg=/[{}]/,Zg=/[_^][\w{]/,Qg=/^[a-zA-Z]$/,$g=/^[a-zA-Z]\s*=/,e_=/^\s/,t_=/\s$/,n_=/[+*/-]$/,r_=/\^[+-]$/;function i_(e){return Yg.test(e)||Xg.test(e)||Zg.test(e)||Qg.test(e)||$g.test(e)}function a_(e){return!!(e_.test(e)||t_.test(e)||n_.test(e)&&!r_.test(e))}function o_(e){let t=[];for(let n=0;n<e.length;n++)if(e[n]===`$`&&!(n>0&&e[n-1]===`\\`)){if(n+1<e.length&&e[n+1]===`$`){n++;continue}n>0&&e[n-1]===`$`&&(n<2||e[n-2]!==`\\`)||t.push(n)}return t}function s_(e,t,n){let r=e.slice(t+1,n);return r.length===0||r.includes(`
|
|
276
|
+
`)?null:r}function c_(e){let t=o_(e);if(t.length<2)return e;let n=new Set,r=new Set,i=Array(t.length-1);for(let n=0;n<t.length-1;n++)i[n]=s_(e,t[n],t[n+1]);let a=[];for(let e=0;e<t.length-1;e++){if(n.has(e))continue;let r=i[e];r!==null&&i_(r)&&(n.add(e),n.add(e+1),a.push([t[e],t[e+1]]))}let o=0;for(;o<t.length;){if(n.has(o)){o++;continue}let e=o+1;for(;e<t.length&&n.has(e);)e++;if(e>=t.length)break;if(e>o+1){r.add(t[o]),o++;continue}let a=i[o];if(a===null){o++;continue}a_(a)&&(r.add(t[o]),r.add(t[e])),n.add(o),n.add(e),o=e+1}for(let e=0;e<t.length;e++)n.has(e)||e+1<t.length&&n.has(e+1)&&r.add(t[e]);if(r.size===0&&a.length===0)return e;let s=[],c=0,l=Array.from(r).sort((e,t)=>e-t),u=0,d=0;for(;u<l.length||d<a.length;){let t=u<l.length?l[u]:1/0;if(t<(d<a.length?a[d][0]:1/0))t>c&&s.push(e.slice(c,t)),s.push(`\\$`),c=t+1,u++;else{let[t,n]=a[d];t>c&&s.push(e.slice(c,t));let r=e.slice(t,n+1);for(s.push(r.replace(Jg,`\\text{\\textdollar}`)),c=n+1;u<l.length&&l[u]<=n;)u++;d++}}return c<e.length&&s.push(e.slice(c)),s.join(``)}function l_(e){let t=[],n=0;for(let r of e.matchAll(qg))t.push(c_(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(c_(e.slice(n))),t.join(``)}function u_(e){if(!e?.includes(`$`))return e;let t=[],n=0;for(let r of e.matchAll(Kg))t.push(l_(e.slice(n,r.index))),t.push(r[0]),n=r.index+r[0].length;return t.push(l_(e.slice(n))),t.join(``)}const d_={note:`md-callout-info`,tip:`md-callout-info`,warning:`md-callout-attention`,important:`md-callout-attention`,caution:`md-callout-destructive`},f_={note:`Note`,tip:`Tip`,warning:`Warning`,important:`Important`,caution:`Caution`};function p_(){return e=>{cu(e,e=>{if(e.type!==`containerDirective`&&e.type!==`leafDirective`&&e.type!==`textDirective`)return;let t=e;t.data||={};let n=t.data,r=t.attributes||{},i=t.name;if(i===`pagebreak`){n.hName=`hr`,n.hProperties={className:`md-pagebreak`};return}if(i===`columns`){n.hName=`div`,n.hProperties={className:`md-columns`};return}if(i===`column`){n.hName=`div`;let e={className:`md-column`};r.width&&(e.style=`flex-basis:${r.width};flex-grow:0;flex-shrink:0`),n.hProperties=e;return}if(i in d_){n.hName=`div`,n.hProperties={className:`md-callout ${d_[i]}`,"data-callout-type":i};let e=f_[i];if(e&&t.children){let n={type:`paragraph`,data:{hName:`p`,hProperties:{className:`md-callout-title`}},children:[{type:`text`,value:e}]};t.children.unshift(n)}return}n.hName=`div`,n.hProperties={className:`md-${i}`,...Object.fromEntries(Object.entries(r).filter(([e])=>e!==`class`))},r.class&&(n.hProperties.className+=` ${r.class}`)})}}const m_=/(?:^|[^\\])\$/,h_=[];let g_,__;function v_(){return __||=import(`rehype-katex`).then(({default:e})=>(g_=e,e)),__}function y_(e){let t=w.useMemo(()=>m_.test(e),[e]),[n,r]=w.useState(()=>g_);return w.useEffect(()=>{if(!t||n)return;let e=!1;return v_().then(t=>{e||r(()=>t)}).catch(e=>{console.error(`Failed to load KaTeX; math will render unstyled`,e)}),()=>{e=!0}},[t,n]),w.useMemo(()=>n?[n]:h_,[n])}const b_=[`artifact:`,`image:`,`store:`,`document:`,`document://`,`collection:`,`interaction:`,`prompt:`,`agent:`,`workflow:`,`process:`,`run:`];function x_(e){return b_.some(t=>e.startsWith(t))?e:ud(e)}function S_(){return e=>{cu(e,`html`,(e,t,n)=>{let r=e,i=n;if(typeof r.value==`string`&&/<!--[\s\S]*?-->/.test(r.value)&&i?.children&&typeof t==`number`)return i.children.splice(t,1),[`skip`,t]})}}const C_=ai();function w_({children:e,components:n,remarkPlugins:r=[],removeComments:i=!0,artifactRunId:a,onArtifactOpen:o,className:s,codeClassName:c,inlineCodeClassName:l,linkClassName:u,imageClassName:d,onProposalSelect:f,onProposalSubmit:p,preserveSourcePositions:m=!1}){let h=Le(),g=w.useMemo(()=>m?e:Gg(Hg(u_(e))),[e,m]),_=w.useMemo(()=>{let e=[ig,op,p_,sg,Ud,Mg,xg,...r];return i&&e.push(S_),e},[r,i]),v=y_(g),y=w.useMemo(()=>({handlers:{...Vd}}),[]),b=w.useMemo(()=>{let e=n||{},r=e.code,i=e.a,s=e.img,f=({node:e,className:n,children:i,...a})=>{let o=/language-([\w-]+)/.exec(n||``),s=!o,u=o?o[1]:``;if(!s&&u){if(h){let e=h.getComponent(u);if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}if(ii(u)){let e=String(i||``).trim();return t(ri,{code:e,language:u})}let e=C_[u];if(e){let n=String(i||``).trim();return t(e,{code:n,language:u})}}return typeof r==`function`?t(r,{node:e,className:n,...a,children:i}):t(`code`,{...a,className:s?`px-1.5 py-0.5 rounded ${l||``}`:` ${c||``}`,children:i})},p=e=>{let{node:n,href:r,children:s,...c}=e;return t(vi,{node:n,href:r,className:u,artifactRunId:a,onArtifactOpen:o,ExistingLink:typeof i==`function`?i:void 0,...c,children:s})},m=e=>{let{node:n,src:r,alt:i,title:o,...c}=e;return o?t(ui,{src:r,alt:i,caption:o,className:d,artifactRunId:a}):t(fi,{node:n,src:r,alt:i,className:d,artifactRunId:a,ExistingImg:typeof s==`function`?s:void 0,...c})};return{...e,code:f,a:p,img:m}},[n,a,o,h,c,l,u,d]),x=t(Pe,{artifactRunId:a,onProposalSelect:f,onProposalSubmit:p,MarkdownRenderer:w_,children:t(od,{remarkPlugins:_,rehypePlugins:v,remarkRehypeOptions:y,components:b,urlTransform:x_,children:g})});return s?t(`div`,{className:`md-content ${s}`,children:x}):t(`div`,{className:`md-content`,children:x})}const $=e=>e.chain(),T_=e=>e.can().chain();function E_(e){let[,t]=I(0);N(()=>{if(!e)return;let n=()=>t(e=>e+1);return e.on(`transaction`,n),e.on(`selectionUpdate`,n),()=>{e.off(`transaction`,n),e.off(`selectionUpdate`,n)}},[e])}const D_=e=>e.preventDefault();function O_(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`c-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function k_(e){let{from:t,to:n}=e.state.selection;if(t>=n)return null;let r=e.state.doc.textBetween(t,n,`
|
|
277
|
+
`,` `).trim();if(!r)return null;let i=e.state.doc.resolve(t),a=`paragraph`;for(let e=i.depth;e>=0;e--){let t=i.node(e).type.name;if(t===`heading`){a=`heading`;break}if(t===`codeBlock`||t===`vertesiaCodeBlock`){a=`code block`;break}if(t===`blockquote`){a=`quote`;break}if(t===`listItem`||t===`taskItem`){a=`list item`;break}if(t===`table`){a=`table`;break}}return{blockLabel:a,quote:r,from:t,to:n}}function A_(e){let t=e.length,n=e.map((e,t)=>`${t+1}. On the ${e.blockLabel} “${e.quote}”:\n ${e.comment}`);return[`I've left ${t} comment${t===1?``:`s`} on the document:`,``,...n,``,`Please revise the document to address each comment, preserving everything else.`].join(`
|
|
278
|
+
`)}function j_(e,t){return{contextElement:e.view.dom,getBoundingClientRect:()=>{try{let n=e.view.coordsAtPos(t.to),r=Math.max(1,n.bottom-n.top);return new DOMRect(n.right,n.top,1,r)}catch{return e.view.dom.getBoundingClientRect()}}}}function M_({editor:e,selection:r,composing:i,draft:a,onStart:o,onDraftChange:c,onCancel:l,onAdd:u}){let{t:d}=S(),f=b(),{refs:p,floatingStyles:m}=be({placement:`right-start`,strategy:`fixed`,middleware:[ve(8),_e({fallbackPlacements:[`left-start`,`bottom-start`]}),ye({padding:12})],whileElementsMounted:ge}),h=P(()=>j_(e,r),[e,r]);return N(()=>{p.setPositionReference(h)},[h,p]),t(he,{root:f,children:t(`div`,{ref:p.setFloating,style:m,className:`pointer-events-auto z-100`,children:i?n(`div`,{role:`dialog`,"aria-label":d(`agent.commentOnSelection`),className:`w-80 max-w-[calc(100vw-1.5rem)] space-y-2 rounded-lg border border-mixer-muted/25 bg-popover p-3 text-popover-foreground shadow-lg`,children:[n(`div`,{className:`line-clamp-2 text-xs text-muted`,children:[t(`span`,{className:`font-medium text-foreground`,children:d(`agent.commentingOn`)}),` `,n(`span`,{className:`italic`,children:[`“`,r.quote,`”`]})]}),t(_,{value:a,onChange:e=>c(e.target.value),placeholder:d(`agent.commentOnSelectionPlaceholder`),rows:3,autoFocus:!0,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),l();return}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),u())}}),n(`div`,{className:`flex justify-end gap-2`,children:[t(s,{variant:`outline`,size:`sm`,onClick:l,children:d(`store.cancelEdit`)}),t(s,{size:`sm`,onClick:u,disabled:!a.trim(),children:d(`agent.addComment`)})]})]}):t(v,{description:d(`agent.commentOnSelection`),asChild:!0,children:t(s,{variant:`secondary`,size:`sm`,onMouseDown:D_,onClick:o,"aria-label":d(`agent.commentOnSelection`),className:`size-9 rounded-full p-0 shadow-md`,children:t(Zn,{className:`size-4`})})})})})}function N_({icon:e,label:n,active:r=!1,disabled:i=!1,onClick:a}){return t(s,{variant:`ghost`,size:`sm`,"aria-label":n,title:n,"aria-pressed":r,disabled:i,onMouseDown:D_,onClick:a,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,r&&`bg-muted text-foreground`),children:t(e,{className:`size-4`})})}function P_(){return t(`div`,{className:`mx-0.5 h-5 w-px shrink-0 bg-mixer-muted/30`,"aria-hidden":!0})}function F_({onSend:e,hasUnsentChanges:r,isSending:i,disabled:a}){let{t:o}=S();return n(s,{variant:r?`primary`:`ghost`,size:`sm`,className:y(`h-8 gap-1.5`,!r&&`text-muted`),onMouseDown:D_,onClick:()=>void e(),disabled:a||!r||i,children:[i?t(g,{size:`sm`}):t(rr,{className:`size-3.5`}),o(`agent.sendChangesToAgent`)]})}function I_({editor:r,className:i,editable:a=!0,onSendComment:o,onSendChangesToAgent:f,hasUnsentChanges:p=!1,isSendingChanges:m=!1,sendChangesDisabled:h=!1,toolbarStatus:g}){let{t:_}=S(),v=x();E_(r);let[b,C]=I(!1),[w,T]=I(``),[E,D]=I(null),[O,k]=I(null),[A,M]=I([]),[ee,P]=I(!1),[te,ne]=I(!1),re=F(null);N(()=>{if(!r||!o)return;let e=()=>{let e=k_(r);k(e),e&&(re.current=e)};return e(),r.on(`selectionUpdate`,e),r.on(`transaction`,e),()=>{r.off(`selectionUpdate`,e),r.off(`transaction`,e)}},[r,o]);let ie=j(()=>{let e=re.current;if(!e){v({status:`info`,title:_(`agent.selectTextToComment`),duration:2500});return}D(e),T(``),C(!0)},[_,v]),ae=j(()=>{C(!1),D(null),T(``)},[]),oe=j(()=>{let e=w.trim();!E||!e||(M(t=>[...t,{id:O_(),...E,comment:e}]),C(!1),D(null),T(``),P(!0))},[w,E]),se=j(e=>{M(t=>t.filter(t=>t.id!==e))},[]),ce=j(async()=>{if(!(!o||A.length===0||te)){ne(!0);try{await o(A_(A)),M([]),P(!1)}finally{ne(!1)}}},[te,o,A]);if(!r)return null;let le=[1,2,3].find(e=>r.isActive(`heading`,{level:e})),ue=_(le===1?`richText.heading1`:le===2?`richText.heading2`:le===3?`richText.heading3`:`richText.paragraph`),de=r.isActive(`table`),fe=E??O;return n(e,{children:[n(`div`,{role:`toolbar`,"aria-label":_(`richText.blockStyle`),className:y(`flex min-h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-b border-mixer-muted/25 px-1.5 py-1`,i),children:[t(N_,{icon:sr,label:_(`richText.undo`),disabled:!a||!T_(r).focus().undo().run(),onClick:()=>$(r).focus().undo().run()}),t(N_,{icon:nr,label:_(`richText.redo`),disabled:!a||!T_(r).focus().redo().run(),onClick:()=>$(r).focus().redo().run()}),t(P_,{}),n(c,{children:[t(d,{asChild:!0,children:n(s,{variant:`ghost`,size:`sm`,disabled:!a,onMouseDown:D_,className:`h-8 shrink-0 gap-1 px-2 text-xs font-medium text-foreground hover:bg-muted/60`,children:[ue,t(Rn,{className:`size-3 opacity-60`})]})}),n(l,{align:`start`,children:[t(u,{onClick:()=>$(r).focus().setParagraph().run(),children:_(`richText.paragraph`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:1}).run(),children:_(`richText.heading1`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:2}).run(),children:_(`richText.heading2`)}),t(u,{onClick:()=>$(r).focus().setHeading({level:3}).run(),children:_(`richText.heading3`)})]})]}),t(P_,{}),t(N_,{icon:Fn,label:_(`richText.bold`),active:r.isActive(`bold`),disabled:!a,onClick:()=>$(r).focus().toggleBold().run()}),t(N_,{icon:Gn,label:_(`richText.italic`),active:r.isActive(`italic`),disabled:!a,onClick:()=>$(r).focus().toggleItalic().run()}),t(N_,{icon:ar,label:_(`richText.strike`),active:r.isActive(`strike`),disabled:!a,onClick:()=>$(r).focus().toggleStrike().run()}),t(N_,{icon:zn,label:_(`richText.inlineCode`),active:r.isActive(`code`),disabled:!a,onClick:()=>$(r).focus().toggleCode().run()}),t(P_,{}),t(N_,{icon:Jn,label:_(`richText.bulletList`),active:r.isActive(`bulletList`),disabled:!a,onClick:()=>$(r).focus().toggleBulletList().run()}),t(N_,{icon:qn,label:_(`richText.orderedList`),active:r.isActive(`orderedList`),disabled:!a,onClick:()=>$(r).focus().toggleOrderedList().run()}),t(N_,{icon:tr,label:_(`richText.blockquote`),active:r.isActive(`blockquote`),disabled:!a,onClick:()=>$(r).focus().toggleBlockquote().run()}),t(N_,{icon:ir,label:_(`richText.codeBlock`),active:r.isActive(`codeBlock`),disabled:!a,onClick:()=>$(r).focus().toggleCodeBlock().run()}),t(P_,{}),t(N_,{icon:er,label:_(`richText.horizontalRule`),disabled:!a,onClick:()=>$(r).focus().setHorizontalRule().run()}),n(c,{children:[t(d,{asChild:!0,children:t(s,{variant:`ghost`,size:`sm`,disabled:!a,"aria-label":_(`richText.tableActions`),title:_(de?`richText.tableActions`:`richText.table`),onMouseDown:D_,className:y(`size-8 shrink-0 rounded-md p-0 text-foreground hover:bg-muted/60`,de&&`bg-muted`),children:t(or,{className:`size-4`})})}),t(l,{align:`start`,children:de?n(e,{children:[t(u,{onClick:()=>$(r).focus().addRowBefore().run(),children:_(`richText.addRowAbove`)}),t(u,{onClick:()=>$(r).focus().addRowAfter().run(),children:_(`richText.addRowBelow`)}),t(u,{onClick:()=>$(r).focus().deleteRow().run(),children:_(`richText.deleteRow`)}),t(u,{onClick:()=>$(r).focus().addColumnBefore().run(),children:_(`richText.addColumnLeft`)}),t(u,{onClick:()=>$(r).focus().addColumnAfter().run(),children:_(`richText.addColumnRight`)}),t(u,{onClick:()=>$(r).focus().deleteColumn().run(),children:_(`richText.deleteColumn`)}),t(u,{onClick:()=>$(r).focus().deleteTable().run(),children:_(`richText.deleteTable`)})]}):t(u,{onClick:()=>$(r).focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:_(`richText.table`)})})]}),o||f?n(`div`,{className:`ms-auto flex shrink-0 items-center gap-1 ps-1`,children:[A.length>0?n(e,{children:[n(s,{variant:`ghost`,size:`sm`,className:`h-8 px-2 text-xs text-muted`,onClick:()=>P(e=>!e),children:[_(`agent.comments`),` (`,A.length,`)`]}),n(s,{size:`sm`,className:`h-8`,onClick:()=>void ce(),disabled:te,children:[t(rr,{className:`me-1 size-4`}),_(`agent.sendToAgent`)]})]}):null,f?n(e,{children:[g,t(F_,{onSend:f,hasUnsentChanges:p,isSending:m,disabled:h})]}):null]}):null]}),o&&fe?t(M_,{editor:r,selection:fe,composing:b,draft:w,onStart:ie,onDraftChange:T,onCancel:ae,onAdd:oe}):null,ee&&A.length>0?t(`ul`,{className:`max-h-48 shrink-0 space-y-1.5 overflow-y-auto border-b border-mixer-muted/15 px-3 py-2`,children:A.map(e=>n(`li`,{className:`flex items-start gap-2 rounded-md border border-mixer-muted/20 bg-muted/10 px-2 py-1.5`,children:[n(`div`,{className:`min-w-0 flex-1`,children:[n(`div`,{className:`truncate text-[11px] italic text-muted`,children:[`“`,e.quote,`”`]}),t(`div`,{className:`whitespace-pre-wrap text-xs text-foreground`,children:e.comment})]}),t(s,{variant:`ghost`,size:`sm`,"aria-label":_(`agent.deleteComment`),title:_(`agent.deleteComment`),className:`size-6 shrink-0 p-0 text-muted`,onClick:()=>se(e.id),children:t(cr,{className:`size-3.5`})})]},e.id))}):null]})}const L_=ai();function R_({code:e,language:n}){let r=Le(),i=n?r?.getComponent(n):void 0,a=n?L_[n]:void 0,o=n?.startsWith(`expand:`)?ri:i??a;return o?t(o,{code:e,language:n}):null}function z_({src:e,alt:n,title:r}){let{artifactRunId:i}=Fe();return r?t(ui,{src:e,alt:n,caption:r,artifactRunId:i}):t(fi,{src:e,alt:n,artifactRunId:i})}function B_({href:e,title:n,children:r}){let{artifactRunId:i}=Fe();return t(vi,{href:e,artifactRunId:i,children:t(`span`,{title:n,children:r})})}function V_({raw:e}){let{artifactRunId:n}=Fe();return t(w_,{artifactRunId:n,children:e})}const H_={codeBlock:R_,image:z_,link:B_,opaqueBlock:V_};function U_({artifactRunId:e,...n}){return t(Pe,{artifactRunId:e,MarkdownRenderer:w_,children:t(a,{...n,...H_})})}function W_({artifactRunId:e,className:i,contentClassName:a,editorClassName:o,onEditor:s,...c}){let[l,u]=I(null),d=j(e=>{u(e),s?.(e)},[s]);return t(Pe,{artifactRunId:e,MarkdownRenderer:w_,children:n(`div`,{className:y(`overflow-hidden rounded-md border border-mixer-muted/30 bg-background`,i),children:[t(I_,{editor:l,editable:c.editable!==!1}),t(r,{...c,...H_,onEditor:d,contentClassName:y(`max-h-80 overflow-auto`,a),editorClassName:y(`vprose prose-sm min-h-24 max-w-none px-3 py-2 outline-none`,o)})]})})}function G_({artifactRunId:e,className:r,contentClassName:a,editorClassName:c,onEditor:l,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g=!1,isSendingChanges:v=!1,sendChangesDisabled:b=!1,toolbarStatus:x,...C}){let{t:w}=S(),[T,E]=I(null),D=j(e=>{E(e),l?.(e)},[l]),[O,k]=I(()=>o(C.value)===`lossy`?`choose`:`rich-text`);return n(Pe,{artifactRunId:e,MarkdownRenderer:w_,children:[(O===`choose`?`source`:O)===`rich-text`?n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[t(I_,{editor:T,editable:C.editable!==!1,onSendComment:u,onSendChangesToAgent:d,hasUnsentChanges:g,isSendingChanges:v,sendChangesDisabled:b,toolbarStatus:x}),t(i,{...C,...H_,onEditor:D,ariaLabel:C.ariaLabel??w(`richText.documentEditor`),className:`flex min-h-0 flex-1 flex-col`,contentClassName:y(`min-h-0 flex-1 overflow-auto`,a),editorClassName:y(`vprose prose-sm mx-auto min-h-full w-full max-w-5xl px-6 py-5 outline-none`,c)})]}):n(`div`,{className:y(`flex h-full min-h-0 flex-col bg-background`,r),children:[d?n(`div`,{className:`flex min-h-10 shrink-0 items-center justify-end gap-1 border-b border-mixer-muted/25 px-1.5 py-1`,children:[x,t(F_,{onSend:d,hasUnsentChanges:g,isSending:v,disabled:b})]}):null,t(_,{value:C.value,onChange:e=>C.onChange?.(e.target.value),onFocus:()=>C.onFocusChange?.(!0),onBlur:()=>C.onFocusChange?.(!1),disabled:C.editable===!1,"aria-label":w(`richText.markdownSourceEditor`),className:y(`vertesia-markdown-document-editor-content min-h-0 flex-1 resize-none rounded-none`,`border-0 px-6 py-5 font-mono text-sm leading-6 outline-none focus-visible:ring-0`,a,c)})]}),n(f,{isOpen:O===`choose`,onClose:()=>k(`source`),className:`sm:max-w-lg`,disableCloseOnClickOutside:!0,children:[t(h,{children:w(`richText.sourceCompatibilityWarningTitle`)}),t(p,{children:t(`p`,{className:`text-sm text-muted`,children:w(`richText.sourceCompatibilityWarningDescription`)})}),n(m,{align:`right`,children:[t(s,{variant:`outline`,onClick:()=>k(`source`),children:w(`richText.editMarkdownSource`)}),t(s,{variant:`secondary`,onClick:()=>k(`rich-text`),children:w(`richText.continueRichText`)})]})]})]})}export{W_ as VertesiaMarkdownComponentEditor,G_ as VertesiaMarkdownDocumentEditor,U_ as VertesiaMarkdownRichTextEditor,H_ as vertesiaRichTextRenderers};
|
|
5
279
|
//# sourceMappingURL=vertesia-ui-rich-text.js.map
|