import{align as ze}from"@mdit/plugin-align";import{attrs as Ue}from"@mdit/plugin-attrs";import{figure as Ge}from"@mdit/plugin-figure";import{footnote as Ve}from"@mdit/plugin-footnote";import{imgLazyload as We}from"@mdit/plugin-img-lazyload";import{imgMark as Be}from"@mdit/plugin-img-mark";import{imgSize as qe,obsidianImageSize as Ke}from"@mdit/plugin-img-size";import{include as He}from"@mdit/plugin-include";import{katex as Ye}from"@mdit/plugin-katex";import{mark as Qe}from"@mdit/plugin-mark";import{createMathjaxInstance as Xe,mathjax as Ze}from"@mdit/plugin-mathjax";import{stylize as et}from"@mdit/plugin-stylize";import{sub as tt}from"@mdit/plugin-sub";import{sup as nt}from"@mdit/plugin-sup";import{tasklist as ot}from"@mdit/plugin-tasklist";import{getDirname as at,path as j,hash as rt,colors as b,fs as B,logger as q}from"@vuepress/utils";import{useSassPalettePlugin as it}from"vuepress-plugin-sass-palette";import{ensureLeadingSlash as M,utoa as v,Logger as st,ensureEndingSlash as lt,checkInstalled as pt,entries as I,isPlainObject as k,keys as D,endsWith as S,deepAssign as K,fromEntries as F,isString as H,createConverter as mt,isFunction as ct,isArray as dt,isRegExp as ut,isAbsoluteUrl as Y,getRealPath as x,checkVersion as ft,getLocales as gt,detectPackageManager as yt,getBundlerName as ht,noopModule as $t,addViteSsrNoExternal as bt,addCustomElement as A,MATHML_TAGS as Q,addViteOptimizeDepsExclude as E,addViteSsrExternal as P,addViteOptimizeDepsInclude as O,chainWebpack as vt}from"vuepress-shared/node";import{resolveLocalePath as N,isPlainObject as L,isArray as kt}from"@vuepress/shared";import{container as w}from"@mdit/plugin-container";import{demo as Ct}from"@mdit/plugin-demo";import{alert as wt}from"@mdit/plugin-alert";import{load as X}from"js-yaml";import{tab as Z}from"@mdit/plugin-tab";import{uml as ee}from"@mdit/plugin-uml";const te=(e,t={})=>{e.use(wt,{alertNames:["important","note","tip","warning","caution","info"],openRender:(n,r)=>`<div class="hint-container ${n[r].markup}">
`,titleRender:(n,r,o,a)=>{const s=n[r].markup,i=M(a.filePathRelative??""),p=N(t,i);return`<p class="hint-container-title">${t[p]?.[s]||s}</p>
`},closeRender:()=>`</div>
`,deep:!0})},ne=e=>{w(e,{name:"chart",openRender:(t,n)=>{const r=t[n].info.trimStart().slice(5).trim(),o=`chart-${n}`;let a="{}",s="";for(let i=n;i<t.length;i++){const{type:p,content:d,info:u}=t[i];if(p==="container_chart_close")break;d&&(p==="fence"&&(u==="json"?(a=v(d),s="json"):(u==="js"||u==="javascript")&&(a=v(d),s="js")),t[i].type="chart_empty",t[i].hidden=!0)}return`<ChartJS id="${o}" config="${a}" ${r?`title="${encodeURIComponent(r)}" `:""}type="${s}">`},closeRender:()=>"</ChartJS>"})},jt=/\r\n?|\n/g,_=e=>JSON.stringify(e).replace(/'/g,"&#39"),oe=e=>e.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#039;"),ae={useBabel:!1,jsLib:[],cssLib:[],codepenLayout:"left",codepenEditors:"101",babel:"https://unpkg.com/@babel/standalone/babel.min.js",vue:"https://unpkg.com/vue/dist/vue.global.prod.js",react:"https://unpkg.com/react/umd/react.production.min.js",reactDOM:"https://unpkg.com/react-dom/umd/react-dom.production.min.js"},z=e=>t=>w(t,{name:e,openRender:(n,r)=>{const o=n[r].info.trimStart().slice(e.length).trim();let a="";const s={};for(let i=r;i<n.length;i++){const{type:p,content:d,info:u}=n[i],f=u?t.utils.unescapeAll(u).trim().match(/^([^ :[{]+)/)?.[1]||"text":"";if(p===`container_${e}_close`)break;d&&p==="fence"&&(f==="json"?a=v(d):s[f]=d)}return`
<CodeDemo id="code-demo-${r}" type="${e.split("-")[0]}"${o?` title="${encodeURIComponent(o)}"`:""}${a?` config="${a}"`:""} code="${v(JSON.stringify(s))}">
`},closeRender:()=>"</CodeDemo>"}),re=z("normal-demo"),ie=z("vue-demo"),se=z("react-demo"),le=e=>{e.use(Ct,{name:"md-demo",openRender:(t,n)=>`<MdDemo title="${oe(t[n].info)}" id="md-demo-${n}"><template #default>
`,codeRender:(t,n,r,o,a)=>{const s=t[n];return s.type="fence",s.info="md",s.markup="```",s.content=s.content.split(`
`).filter(i=>i[0]!=="@"||!i.match(/^@include-p(?:ush\(.*\)|op)$/)).join(`
`),`</template><template #code>
${a.rules.fence(t,n,r,o,a)}`},closeRender:()=>"</template></MdDemo>"})},pe=e=>{Z(e,{name:"code-tabs",tabsOpenRenderer:({active:t,data:n},r,o)=>{const{meta:a}=r[o],s=n.map(({title:p})=>e.renderInline(p)),i=n.map((p,d)=>{const{id:u=s[d]}=p;return{id:u}});return`<CodeTabs id="${o}" :data='${_(i)}'${t!==-1?` :active="${t}"`:""}${a.id?` tab-id="${a.id}"`:""}>
${s.map((p,d)=>`<template #title${d}="{ value, isActive }">${p}</template>
`).join("")}`},tabsCloseRenderer:()=>`</CodeTabs>
`,tabOpenRenderer:({index:t},n,r)=>{let o=!1;for(let a=r;a<n.length;a++){const{block:s,type:i}=n[a];if(s){if(i==="code-tabs_tab_close")break;if((i==="fence"||i==="import_code")&&!o){o=!0;continue}n[a].type="code_tab_empty",n[a].hidden=!0}}return`<template #tab${t}="{ value, isActive }">
`},tabCloseRenderer:()=>`</template>
`})},Pt=at(import.meta.url),J="vuepress-plugin-md-enhance",$=new st(J),h=lt(j.resolve(Pt,"../client")),xt=(e,t=!0)=>{const n=pt(e,import.meta.url);return t&&!n&&$.error(`Package ${e} is not installed, please install it manually!`),n},Rt=e=>(t,n,r,{filePathRelative:o})=>{const a=t[n],{content:s}=a;let i=null;if(s.trim().startsWith("{"))try{i=JSON.parse(s)}catch{}else try{i=X(s)}catch{}return i?`<${e} v-bind='${_(i)}' />`:($.error(`Invalid ${e} config${o?` found in ${o}`:""}:
${s}
`),"")},me=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...n)=>{const[r,o]=n,{info:a}=r[o],[s,i]=a.split(" ",2);return s==="component"?Rt(i)(...n):t(...n)}},ce=(e,t)=>{const n=e[t],r=`echarts-${t}`,{content:o,info:a}=n,s=a.trim().split(":",2)[1];return`<ECharts id="${r}" config="${v(o)}"${s?` title="${encodeURIComponent(s)}"`:""}></ECharts>`},de=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...n)=>{const[r,o]=n,{info:a}=r[o];return a.split(":",2)[0]==="echarts"?ce(r,o):t(...n)},e.renderer.rules.echarts=ce,w(e,{name:"echarts",openRender:(n,r)=>{const o=n[r].info.trimStart().slice(7).trim(),a=`echarts-${r}`;let s="{}",i=!1;for(let p=r;p<n.length;p++){const{type:d,content:u,info:f}=n[p];if(d==="container_echarts_close")break;u&&(d==="fence"&&(f==="json"?s=u:(f==="js"||f==="javascript")&&(s=u,i=!0)),n[p].type="echarts_empty",n[p].hidden=!0)}return`<ECharts id="${a}" config="${v(s)}"${o?` title="${encodeURIComponent(o)}"`:""}${i?' type="js"':""}>`},closeRender:()=>"</ECharts>"})},ue=(e,t)=>{const n=e[t],r=`flowchart-${t}`,{content:o,info:a}=n;return`<FlowChart id="${r}" code="${v(o)}" preset="${a.trim().split(":",2)[1]||"vue"}"></FlowChart>`},fe=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...n)=>{const[r,o]=n,{info:a}=r[o],s=a.split(":",2)[0];return s==="flow"||s==="flowchart"?ue(r,o):t(...n)},e.renderer.rules.flowchart=ue},ge=(e,t={})=>{["info","note","tip","warning","caution","important"].forEach(n=>{e.use(w,{name:n,openRender:(r,o,a,s)=>{let i=r[o].info.trim().slice(n.length).trim();if(!i){const{filePathRelative:p}=s,d=M(p??""),u=N(t,d);i=t[u]?.[n]}return`<div class="hint-container ${n}">
<p class="hint-container-title">${i||n}</p>
`},closeRender:()=>`</div>
`})}),e.use(n=>w(n,{name:"details",openRender:(r,o,a,s)=>{let i=r[o].info.trim().slice(7).trim();if(!i){const{filePathRelative:p}=s,d=M(p??""),u=N(t,d);i=t[u]?.details}return`<details class="hint-container details"><summary>${i||"Details"}</summary>
`},closeRender:()=>`</details>
`}))},ye="@",It=["file","import","setting"],St=e=>(t,n,r,o)=>{let a=t.bMarks[n]+t.tShift[n],s=t.eMarks[n];if(t.src[a]!==":")return!1;let i=a+1;for(;i<=s&&t.src[i]===":";)i+=1;const p=i-a;if(p<3)return!1;const d=t.src.slice(a,i),u=t.src.slice(i,s),f=u.trimStart().split(" ",2)[0],l=u.trimStart().slice(e.length).trim();if(f.trim()!==e)return!1;if(o)return!0;let m=n,g=!1;for(;m<r&&(m+=1,a=t.bMarks[m]+t.tShift[m],s=t.eMarks[m],!(a<s&&t.sCount[m]<t.blkIndent));)if(t.src[a]===":"&&t.sCount[m]-t.blkIndent<4){for(i=a+1;i<=s&&t.src[i]===":";i++);if(i-a>=p&&(i=t.skipSpaces(i),i>=s)){g=!0;break}}const c=t.parentType,y=t.lineMax;t.parentType=`${e}`,t.lineMax=m-(g?1:0);const C=t.push(`${e}_open`,"template",1);C.markup=d,C.block=!0,C.info=l,C.map=[n,m-(g?1:0)],t.md.block.tokenize(t,n+1,m-(g?1:0));const W=t.push(`${e}_close`,"template",-1);return W.markup=t.src.slice(a,i),W.block=!0,t.parentType=c,t.lineMax=y,t.line=m+(g?1:0),!0},Mt=e=>(t,n,r,o)=>{let a=t.bMarks[n]+t.tShift[n],s=t.eMarks[n];const i=`${ye}${e}`;if(t.src.charAt(a)!=="@")return!1;let p;for(p=0;p<i.length;p++)if(i[p]!==t.src[a+p])return!1;const d=t.src.slice(a,a+p),u=t.src.slice(a+p,s);if(o)return!0;let f=n,l=!1;for(;f<r&&(f+=1,a=t.bMarks[f]+t.tShift[f],s=t.eMarks[f],!(a<s&&t.sCount[f]<t.blkIndent));)if(t.src[a]===ye&&t.sCount[f]<=t.sCount[n]){let C=!0;for(p=0;p<i.length;p++)if(i[p]!==t.src[a+p]){C=!1;break}if(C){l=!0,f-=1;break}}const m=t.parentType,g=t.lineMax;t.parentType=`${e}`,t.lineMax=f;const c=t.push(`${e}_open`,"template",1);c.block=!0,c.markup=d,c.info=u.trim(),c.map=[n,f],t.md.block.tokenize(t,n+1,f);const y=t.push(`${e}_close`,"template",-1);return y.block=!0,y.markup="",t.parentType=m,t.lineMax=g,t.line=f+(l?1:0),!0},he=e=>({key:e.key,title:e.title||"",files:encodeURIComponent(JSON.stringify(e.files)),settings:encodeURIComponent(JSON.stringify(e.settings||{}))}),R=(e,{name:t="playground",component:n="Playground",propsGetter:r=he}={name:"playground",component:"Playground",propsGetter:he})=>{e.block.ruler.before("fence",`${t}`,St(t),{alt:["paragraph","reference","blockquote","list"]}),It.forEach(o=>{e.block.ruler.__rules__.find(({name:a})=>a===`at-${o}`)||e.block.ruler.before("fence",`at-${o}`,Mt(o),{alt:["paragraph","reference","blockquote","list"]})}),e.renderer.rules[`${t}_open`]=(o,a)=>{const{info:s}=o[a],i={key:rt(`playground${a}-${s}`),title:encodeURIComponent(s),settings:{},files:{}};let p=null,d=!1;for(let f=a;f<o.length;f++){const{block:l,type:m,info:g,content:c}=o[f];if(l){if(m===`${t}_close`)break;if(m===`${t}_open`)continue;if(m==="file_open"){if(!g)continue;p=g}else m==="import_open"&&(i.importMap=p=g||"import-map.json");if(m==="setting_open"&&(d=!0),m==="setting_close"&&(d=!1),m==="file_close"||m==="import_close"||m==="setting_close"||!c){o[f].type=`${t}_empty`,o[f].hidden=!0;continue}d?m==="fence"&&g==="json"&&(i.settings=JSON.parse(c.trim())):m==="fence"&&p&&(i.files[p]={ext:g,content:c}),o[f].type=`${t}_empty`,o[f].hidden=!0}}const u=r(i);return`<${n} ${I(u).map(([f,l])=>`${f}="${oe(l)}"`).join(" ")}>
`},e.renderer.rules[`${t}_close`]=()=>`</${n}>
`},Dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",Et=(e,t,n)=>{if(t==null)return"";let r,o,a,s={},i={},p="",d="",u="",f=2,l=3,m=2,g=[],c=0,y=0;for(a=0;a<e.length;a+=1)if(p=e.charAt(a),Object.prototype.hasOwnProperty.call(s,p)||(s[p]=l++,i[p]=!0),d=u+p,Object.prototype.hasOwnProperty.call(s,d))u=d;else{if(Object.prototype.hasOwnProperty.call(i,u)){if(u.charCodeAt(0)<256){for(r=0;r<m;r++)c<<=1,y==t-1?(y=0,g.push(n(c)),c=0):y++;for(o=u.charCodeAt(0),r=0;r<8;r++)c=c<<1|1&o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o>>=1}else{for(o=1,r=0;r<m;r++)c=c<<1|o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o=0;for(o=d.charCodeAt(0),r=0;r<16;r++)c=c<<1|1&o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o>>=1}--f==0&&(f=Math.pow(2,m),m++),delete i[u]}else for(o=s[u],r=0;r<m;r++)c=c<<1|1&o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o>>=1;--f==0&&(f=Math.pow(2,m),m++),s[d]=l++,u=String(p)}if(u!==""){if(Object.prototype.hasOwnProperty.call(i,u)){if(u.charCodeAt(0)<256){for(r=0;r<m;r++)c<<=1,y==t-1?(y=0,g.push(n(c)),c=0):y++;for(o=u.charCodeAt(0),r=0;r<8;r++)c=c<<1|1&o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o>>=1}else{for(o=1,r=0;r<m;r++)c=c<<1|o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o=0;for(o=u.charCodeAt(0),r=0;r<16;r++)c=c<<1|1&o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o>>=1}--f==0&&(f=Math.pow(2,m),m++),delete i[u]}else for(o=s[u],r=0;r<m;r++)c=c<<1|1&o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o>>=1;--f==0&&(f=Math.pow(2,m),m++)}for(o=2,r=0;r<m;r++)c=c<<1|1&o,y==t-1?(y=0,g.push(n(c)),c=0):y++,o>>=1;for(;;){if(c<<=1,y==t-1){g.push(n(c));break}y++}return g.join("")},$e=e=>Et(e,6,t=>Dt.charAt(t)),Ot=[{name:"help",type:"boolean"},{name:"help",type:"boolean"},{name:"watch",type:"boolean"},{name:"preserveWatchOutput",type:"boolean"},{name:"listFiles",type:"boolean"},{name:"explainFiles",type:"boolean"},{name:"listEmittedFiles",type:"boolean"},{name:"pretty",type:"boolean"},{name:"traceResolution",type:"boolean"},{name:"diagnostics",type:"boolean"},{name:"extendedDiagnostics",type:"boolean"},{name:"generateCpuProfile",type:"string"},{name:"generateTrace",type:"string"},{name:"incremental",type:"boolean"},{name:"declaration",type:"boolean"},{name:"declarationMap",type:"boolean"},{name:"emitDeclarationOnly",type:"boolean"},{name:"sourceMap",type:"boolean"},{name:"inlineSourceMap",type:"boolean"},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean"},{name:"locale",type:"string"},{name:"all",type:"boolean"},{name:"version",type:"boolean"},{name:"init",type:"boolean"},{name:"project",type:"string"},{name:"build",type:"boolean"},{name:"showConfig",type:"boolean"},{name:"listFilesOnly",type:"boolean"},{name:"target",type:{es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,es2022:9,esnext:99}},{name:"module",type:{none:0,commonjs:1,amd:2,system:4,umd:3,es6:5,es2015:5,es2020:6,es2022:7,esnext:99,node16:100,nodenext:199}},{name:"lib",type:"list"},{name:"allowJs",type:"boolean"},{name:"checkJs",type:"boolean"},{name:"jsx",type:{preserve:1,"react-native":3,react:2,"react-jsx":4,"react-jsxdev":5}},{name:"outFile",type:"string"},{name:"outDir",type:"string"},{name:"rootDir",type:"string"},{name:"composite",type:"boolean"},{name:"tsBuildInfoFile",type:"string"},{name:"removeComments",type:"boolean"},{name:"noEmit",type:"boolean"},{name:"importHelpers",type:"boolean"},{name:"importsNotUsedAsValues",type:{remove:0,preserve:1,error:2}},{name:"downlevelIteration",type:"boolean"},{name:"isolatedModules",type:"boolean"},{name:"verbatimModuleSyntax",type:"boolean"},{name:"strict",type:"boolean"},{name:"noImplicitAny",type:"boolean"},{name:"strictNullChecks",type:"boolean"},{name:"strictFunctionTypes",type:"boolean"},{name:"strictBindCallApply",type:"boolean"},{name:"strictPropertyInitialization",type:"boolean"},{name:"noImplicitThis",type:"boolean"},{name:"useUnknownInCatchVariables",type:"boolean"},{name:"alwaysStrict",type:"boolean"},{name:"noUnusedLocals",type:"boolean"},{name:"noUnusedParameters",type:"boolean"},{name:"exactOptionalPropertyTypes",type:"boolean"},{name:"noImplicitReturns",type:"boolean"},{name:"noFallthroughCasesInSwitch",type:"boolean"},{name:"noUncheckedIndexedAccess",type:"boolean"},{name:"noImplicitOverride",type:"boolean"},{name:"noPropertyAccessFromIndexSignature",type:"boolean"},{name:"moduleResolution",type:{node10:2,node:2,classic:1,node16:3,nodenext:99,bundler:100}},{name:"baseUrl",type:"string"},{name:"paths",type:"object"},{name:"rootDirs",type:"list"},{name:"typeRoots",type:"list"},{name:"types",type:"list"},{name:"allowSyntheticDefaultImports",type:"boolean"},{name:"esModuleInterop",type:"boolean"},{name:"preserveSymlinks",type:"boolean"},{name:"allowUmdGlobalAccess",type:"boolean"},{name:"moduleSuffixes",type:"list"},{name:"allowImportingTsExtensions",type:"boolean"},{name:"resolvePackageJsonExports",type:"boolean"},{name:"resolvePackageJsonImports",type:"boolean"},{name:"customConditions",type:"list"},{name:"sourceRoot",type:"string"},{name:"mapRoot",type:"string"},{name:"inlineSources",type:"boolean"},{name:"experimentalDecorators",type:"boolean"},{name:"emitDecoratorMetadata",type:"boolean"},{name:"jsxFactory",type:"string"},{name:"jsxFragmentFactory",type:"string"},{name:"jsxImportSource",type:"string"},{name:"resolveJsonModule",type:"boolean"},{name:"allowArbitraryExtensions",type:"boolean"},{name:"out",type:"string"},{name:"reactNamespace",type:"string"},{name:"skipDefaultLibCheck",type:"boolean"},{name:"charset",type:"string"},{name:"emitBOM",type:"boolean"},{name:"newLine",type:{crlf:0,lf:1}},{name:"noErrorTruncation",type:"boolean"},{name:"noLib",type:"boolean"},{name:"noResolve",type:"boolean"},{name:"stripInternal",type:"boolean"},{name:"disableSizeLimit",type:"boolean"},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean"},{name:"disableSolutionSearching",type:"boolean"},{name:"disableReferencedProjectLoad",type:"boolean"},{name:"noImplicitUseStrict",type:"boolean"},{name:"noEmitHelpers",type:"boolean"},{name:"noEmitOnError",type:"boolean"},{name:"preserveConstEnums",type:"boolean"},{name:"declarationDir",type:"string"},{name:"skipLibCheck",type:"boolean"},{name:"allowUnusedLabels",type:"boolean"},{name:"allowUnreachableCode",type:"boolean"},{name:"suppressExcessPropertyErrors",type:"boolean"},{name:"suppressImplicitAnyIndexErrors",type:"boolean"},{name:"forceConsistentCasingInFileNames",type:"boolean"},{name:"maxNodeModuleJsDepth",type:"number"},{name:"noStrictGenericChecks",type:"boolean"},{name:"useDefineForClassFields",type:"boolean"},{name:"preserveValueImports",type:"boolean"},{name:"keyofStringsOnly",type:"boolean"},{name:"plugins",type:"list"},{name:"moduleDetection",type:{auto:2,legacy:1,force:3}},{name:"ignoreDeprecations",type:"string"}],be=(e,t={})=>{const n=`#code/${$e(e)}`,r=I(t).map(([o,a])=>{const s=Ot.find(p=>p.name===o);if(!s||a===null||a===void 0)return"";const{type:i}=s;return k(i)?i[a]?.toString()||"":`${o}=${encodeURIComponent(a)}`}).filter(o=>o.length).join("&");return`${r?`?${r}`:""}${n}`},ve=({service:e="https://www.typescriptlang.org/play",...t}={})=>({name:"playground#ts",propsGetter:({title:n="",files:r,settings:o,key:a})=>{const s=D(r).filter(p=>S(p,".ts"));s.length!==1&&$.error("TS playground only support 1 ts file");const i=`${e}${be(r[s[0]].content,K({},o||{},t))}`;return{key:a,title:n,link:encodeURIComponent(i)}}}),Nt=["html","js","ts","vue","jsx","tsx","json"],ke="https://sfc.vuejs.org/vue.runtime.esm-browser.js",Ce="https://sfc.vuejs.org/server-renderer.esm-browser.js",we=(e={})=>({name:"playground#vue",propsGetter:t=>{const{title:n="",files:r,settings:o,key:a}=t,s={service:"https://sfc.vuejs.org/",dev:!1,ssr:!1,...e,...o},i=F(I(r).filter(([,{ext:p}])=>Nt.includes(p)).map(([p,{content:d}])=>{if(p==="import-map.json"){const u=JSON.parse(d);return[p,JSON.stringify(K({imports:{vue:ke,...s.ssr?{"vue/server-renderer":Ce}:{}}},u),null,2)]}return[p,d]}));return s.ssr&&!i["import-map.json"]&&(i["import-map.json"]=JSON.stringify({imports:{vue:ke,"vue/server-renderer":Ce}},null,2)),{key:a,title:n,link:encodeURIComponent(`${s.service}#${s.dev?"__DEV__":""}${s.ssr?"__SSR__":""}${Buffer.from(JSON.stringify(i)).toString("base64")}`)}}}),U=(e,t,n="&")=>t?`${n}${e}=${$e(t)}`:"",je=(e,t,n,r)=>{const o=`/${U("html",t,"?")}${U("config",r)}${U("css",n)}`;return`${e}${o}`},Pe=({service:e="https://unocss.dev/play"}={})=>({name:"playground#unocss",propsGetter:({title:t="",files:n,key:r})=>{const o=D(n).filter(d=>S(d,".html")),a=D(n).filter(d=>S(d,".css")),s=D(n).filter(d=>S(d,".js")||S(d,".ts"));(o.length>1||a.length>1||s.length>1)&&$.error("UnoCSS playground only support 1 html/css/config file");const i=d=>d.length===1?n[d[0]].content:"",p=je(e,i(o),i(a),i(s));return{key:r,title:t,link:encodeURIComponent(p)}}}),xe=e=>{e.use(R,{name:"kotlin-playground",component:"KotlinPlayground",propsGetter:({title:t="",key:n,files:r,settings:o})=>({title:t,key:n,settings:encodeURIComponent(JSON.stringify(o||{})),files:v(JSON.stringify(I(r).map(([,{content:a}])=>a)))})})},Re=(e,t)=>{const n=e[t],r=`markmap-${t}`,{content:o}=n;return`<MarkMap id="${r}" content="${v(o)}"></MarkMap>`},Ie=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...n)=>{const[r,o]=n,{info:a}=r[o];return a.split(":",2)[0]==="markmap"?Re(r,o):t(...n)},e.renderer.rules.markmap=Re},_t=(e,t)=>`<Mermaid id="mermaid-${t}" code="${v(e[t].content)}"></Mermaid>`,Se=({diagram:e="mermaid",content:t,title:n=""})=>`${n?`---
title: ${n}
---

`:""}${e==="mermaid"?"":`${e}
`}${e==="mermaid"||e==="sankey-beta"?t:t.split(`
`).map(r=>r?`  ${r}`:"").join(`
`)}`,Me=(e,t)=>`<Mermaid id="mermaid-${t}" code="${v(Se(e))}"${e.title?` title="${v(e.title)}"`:""}></Mermaid>`,De={class:"classDiagram",c4c:"C4Context",er:"erDiagram",gantt:"gantt","git-graph":"gitGraph",journey:"journey",mindmap:"mindmap",pie:"pie",quadrant:"quadrantChart",requirement:"requirementDiagram",sankey:"sankey-beta",sequence:"sequenceDiagram",state:"stateDiagram-v2",timeline:"timeline",xy:"xychart-beta"},Ee=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...n)=>{const[r,o]=n,{content:a,info:s}=r[o],i=s.trim();if(i==="mermaid")return Me({content:a},o);const[p,...d]=i.split(" ");return De[p]?Me({diagram:De[p],title:d.join(" "),content:a},o):t(...n)},e.renderer.rules.mermaid=_t},Oe=e=>{e.use(ee,{name:"revealjs",open:"slidestart",close:"slideend",render:(t,n)=>{const r=t[n],o=`revealjs-${n}`,{content:a,info:s}=r;return`<RevealJs id="${o}" code="${v(a)}" theme="${s.trim()||"auto"}"></RevealJs>`}})},Ne=e=>{Z(e,{name:"tabs",tabsOpenRenderer:({active:t,data:n},r,o)=>{const{meta:a}=r[o],s=n.map(({title:p})=>e.renderInline(p)),i=n.map((p,d)=>{const{id:u=s[d]}=p;return{id:u}});return`<Tabs id="${o}" :data='${_(i)}'${t!==-1?` :active="${t}"`:""}${a.id?` tab-id="${a.id}"`:""}>
${s.map((p,d)=>`<template #title${d}="{ value, isActive }">${p}</template>
`).join("")}`},tabsCloseRenderer:()=>`</Tabs>
`,tabOpenRenderer:({index:t})=>`<template #tab${t}="{ value, isActive }">
`,tabCloseRenderer:()=>`</template>
`})},_e=e=>{w(e,{name:"v-pre",openRender:()=>`<div v-pre>
`,closeRender:()=>`</div>
`})},Jt=["html","js","ts","vue","jsx","tsx","json"],Tt=e=>Buffer.from(JSON.stringify(F(I(e).filter(([,{ext:t}])=>Jt.includes(t)).map(([t,{content:n}])=>[t,n])))).toString("base64"),Je=e=>{e.use(R,{name:"vue-playground",component:"VuePlayground",propsGetter:({title:t="",key:n,files:r,settings:o})=>({title:t,key:n,settings:encodeURIComponent(JSON.stringify(o||{})),files:encodeURIComponent(Tt(r))})})},Te={"/en/":{important:"Important",info:"Info",note:"Note",tip:"Tips",warning:"Warning",caution:"Caution",details:"Details"},"/zh/":{important:"重要",info:"相关信息",note:"注",tip:"提示",warning:"注意",caution:"警告",details:"详情"},"/zh-tw/":{important:"重要",info:"相關信息",note:"注",tip:"提示",warning:"注意",caution:"警告",details:"詳情"},"/de/":{important:"Wichtig",info:"Information",note:"Notiz",tip:"Tips",warning:"Warnung",caution:"Gefahr",details:"Details"},"/de-at/":{important:"Wichtig",info:"Information",note:"Note",tip:"Tips",warning:"Notiz",caution:"Warnung",details:"Details"},"/vi/":{important:"Quan trọng",info:"Thông tin",note:"Note",tip:"Tips",warning:"Lưu ý",caution:"Cẩn thận",details:"Chi tiết"},"/uk/":{important:"Важливо",info:"Інформація",note:"Note",tip:"Поради",warning:"Примітка",caution:"Увага",details:"Деталь"},"/ru/":{important:"Важно",info:"Инфо",note:"Заметка",tip:"Совет",warning:"Примечание",caution:"Предупреждение",details:"Подробности"},"/br/":{important:"Importante",info:"Informativo",note:"Note",tip:"Dicas",warning:"Avisos",caution:"Cuidado",details:"Detalhe"},"/pl/":{important:"Ważne",info:"Info",note:"Notatka",tip:"Porady",warning:"Notatka",caution:"Ostrzeżenie",details:"Dane"},"/sk/":{important:"Dôležité",info:"Info",note:"Poznámka",tip:"Tip",warning:"Upozornenie",caution:"Pozor",details:"Podrobnosti"},"/fr/":{important:"Important",info:"Info",note:"Note",tip:"Conseil",warning:"Note",caution:"Avertissement",details:"Details"},"/es/":{important:"Importante",info:"Información",note:"Nota",tip:"Consejos",warning:"Aviso",caution:"Advertencia",details:"Detalles"},"/ja/":{important:"重要",info:"関連情報",note:"注",tip:"ヒント",warning:"注意",caution:"警告",details:"詳細"},"/tr/":{important:"Önemli",info:"Bilgi",note:"Not",tip:"Tavsiye",warning:"Uyarı",caution:"Tehlike",details:"Detay"},"/ko/":{important:"중요",info:"정보",note:"노트",tip:"팁",warning:"경고",caution:"위험",details:"세부사항"},"/fi/":{important:"Tärkeä",info:"Tietoa",note:"Huomautus",tip:"Vinkki",warning:"Varoitus",caution:"Vaara",details:"Yksityiskohdat"},"/hu/":{important:"Fontos",info:"Információ",note:"Megjegyzés",tip:"Tipp",warning:"Figyelem",caution:"Veszély",details:"Részletek"},"/id/":{important:"Penting",info:"Pemberitahuan",note:"Catatan",tip:"Tips",warning:"Penting",caution:"Peringatan",details:"Rincian"},"/nl/":{important:"Belangrijk",info:"Info",note:"Notitie",tip:"Tips",warning:"Notitie",caution:"Waarschuwing",details:"Details"}},Ft=["title","desc","logo","link","color"],At=e=>k(e)&&H(e.title)?F(I(e).filter(t=>Ft.includes(t[0])&&H(t[1]))):null,G=(e,t,n,{filePathRelative:r})=>{const o=e[t],{content:a}=o;let s=null;if(a.trim().startsWith("{"))try{s=JSON.parse(a)}catch(p){$.error("Parsing card as JSON config failed:",p)}else try{s=X(a)}catch(p){$.error("Parsing card as YAML config failed:",p)}const i=At(s);return i?`<VPCard v-bind='${_(i)}' />`:($.error(`Invalid card config${r?` found in ${r}`:""}:
${a}
`),"")},Lt=e=>{e.use(w,{name:"card",openRender:()=>`<div class="vp-card-container">
`});const t=e.renderer.rules.fence;e.renderer.rules.fence=(...n)=>{const[r,o,a,s]=n,{info:i}=r[o];return i==="card"?G(r,o,a,s):i.split(":",2)[0]==="card"?($.warn("Language declaration for card is deprecated, please remove them."),G(r,o,a,s)):t(...n)},e.renderer.rules.card=G},zt=(e,t={})=>{e.use(w,{name:"danger",openRender:(n,r,o,a)=>{let s=n[r].info.trim().slice(6).trim();if(!s){const{filePathRelative:i}=a,p=M(i??""),d=N(t,p);s=t[d]?.caution}return $.warn(`${b.cyan("danger")} hint box is deprecated, please use ${b.cyan("caution")} instead.`),`<div class="hint-container caution">
<p class="hint-container-title">${s||"caution"}</p>
`},closeRender:()=>`</div>
`})},Ut=e=>{const{deprecatedLogger:t,droppedLogger:n}=mt("md-enhance");t({options:e,old:"container",new:"hint"}),t({options:e,old:"codegroup",new:"codetabs"}),t({options:e,old:"lazyload",new:"imgLazyload"}),t({options:e,old:"imageLazyload",new:"imgLazyload"}),t({options:e,old:"imageMark",new:"imgMark"}),t({options:e,old:"imageSize",new:"imgSize"}),t({options:e,old:"mdImport",new:"include"}),t({options:e,old:"tex",new:"katex"}),t({options:e,old:"vpre",new:"vPre"}),t({options:e,old:"imageTitle",new:"figure"}),t({options:e,old:"revealjs",new:"revealJs"}),n({options:e,old:"enableAll",msg:"Please manually enable the features you need."}),n({options:e,old:"lineNumbers",msg:"Please use the built-in lineNumbers option of vuepress instead!"}),n({options:e,old:"imageFix",msg:"This option is no longer needed."}),"linkCheck"in e&&($.warn(`${b.magenta("linkCheck")} is deprecated, please use ${b.magenta("checkLinks")} instead`),e.checkLinks={status:typeof e.linkCheck=="boolean"?e.linkCheck?"always":"never":e.linkCheck}),e.card&&$.error(`${b.magenta("card")} is deprecated, please import  ${b.magenta("VPCard")} from "vuepress-plugin-components" and use it instead.`),L(e.mermaid)&&($.error(`Customizing mermaid with option ${b.magenta("mermaid")} is no longer supported, please import and use ${b.magenta("defineMermaidConfig")} from ${b.magenta("vuepress-plugin-md-enhance/client")} instead.`),e.mermaid=!0),e.presentation&&($.error(`${b.magenta("presentation")} is no longer supported, please use ${b.magenta("revealJs")} instead.`),L(e.presentation)?("plugins"in e.presentation?e.revealJs={plugins:e.presentation.plugins}:e.revealJs=!0,"revealConfig"in e.presentation&&$.error(`Customizing revealJs with option ${b.magenta("presentation.revealConfig")} is no longer supported, please import and use ${b.magenta("defineRevealJsConfig")} from ${b.magenta("vuepress-plugin-md-enhance/client")} instead.`)):kt(e.presentation)&&(e.revealJs={plugins:e.presentation}),delete e.presentation),L(e.vuePlayground)&&($.error(`Customizing @vue/repl with option ${b.magenta("vuePlayground")} is no longer supported, please import and use ${b.magenta("defineVuePlaygroundConfig")} from ${b.magenta("vuepress-plugin-md-enhance/client")} instead.`),e.vuePlayground=!0)},Gt=e=>{e.use(w,{name:"demo",openRender:(t,n)=>{$.warn("demo container is deprecated, you should use normal-demo, react-demo and vue-demo container instead.");const{info:r}=t[n],o=/\[(.*)\]/u.exec(r),a=/^ demo\s*(?:\[.*?\])?\s*(.*)\s*$/u.exec(r);let s="";const i={};for(let p=n;p<t.length;p++){const{type:d,content:u,info:f}=t[p],l=f?e.utils.unescapeAll(f).trim().match(/^([^ :[{]+)/)?.[1]||"text":"";if(d==="container_demo_close")break;u&&d==="fence"&&(l==="json"?s=v(u):i[l]=u)}return`
<CodeDemo id="code-demo-${n}" type="${o?.[1]||"normal"}"${a?` title="${encodeURIComponent(a[1])}"`:""}${s?` config="${s}"`:""} code="${v(JSON.stringify(i))}">
`},closeRender:()=>"</CodeDemo>"})},Vt=e=>{e.use(w,{name:"code-group",openRender:(t,n,r,o)=>($.warn(`Deprecated code-group syntax found${o.filePathRelative?`in ${o.filePathRelative}`:""}, you should use code tabs instead. See https://plugin-md-enhance.vuejs.press/guide/code-tabs.html`),`<CodeGroup>
`),closeRender:()=>`</CodeGroup>
`}),e.use(w,{name:"code-group-item",openRender:(t,n)=>{const{info:r}=t[n],o=r.split(":").pop()==="active";return`<CodeGroupItem title="${o?r.replace(/:active$/,""):r}"${o?" active":""}>
`},closeRender:()=>`</CodeGroupItem>
`})},Wt=[/^\/\/ ?#?((?:end)?region) ([\w*-]+)$/,/^\/\* ?#((?:end)?region) ([\w*-]+) ?\*\/$/,/^#pragma ((?:end)?region) ([\w*-]+)$/,/^<!-- #?((?:end)?region) ([\w*-]+) -->$/,/^#((?:End )Region) ([\w*-]+)$/,/^::#((?:end)region) ([\w*-]+)$/,/^# ?((?:end)?region) ([\w*-]+)$/],Bt=/^@include\(([^)]+(?:\.[a-z0-9]+))(?:#([\w-]+))?(?:\{(\d+)?-(\d+)?\})?\)$/,qt=e=>{const t=e.split(`
`),n=t.reduce((r,o)=>{for(let a=0;a<o.length;a++)if(o[a]!==" "&&o[a]!=="	")return Math.min(a,r);return r},1/0);return n<1/0?t.map(r=>r.slice(n)).join(`
`):e},Fe=(e,t,n,r=!1)=>{const[o,a,s]=t.exec(e.trim())||[];return!!(o&&a&&s===n&&a.match(r?/^[Ee]nd ?[rR]egion$/:/^[rR]egion$/))},Kt=(e,t)=>{let n=null,r=-1;for(const[o,a]of e.entries())if(n===null){for(const s of Wt)if(Fe(a,s,t)){r=o+1,n=s;break}}else if(Fe(a,n,t,!0))return{lineStart:r,lineEnd:o};return null},Ht=(e,{cwd:t,includedFiles:n,resolvedPath:r})=>{const{filePath:o}=e;let a=o;if(!j.isAbsolute(o)){if(!t)return $.error(`[include]: Error when resolving path: ${o}`),`
Error when resolving path
`;a=j.resolve(t,o)}if(n.push(a),!B.existsSync(a))return $.error(`Include: ${a} not found`),`
File not found
`;const s=B.readFileSync(a).toString().replace(jt,`
`).split(`
`);let i=[];if("region"in e){const p=Kt(s,e.region);p&&(i=s.slice(p.lineStart,p.lineEnd))}else{const{lineStart:p,lineEnd:d}=e;i=s.slice(p&&p-1,d)}if(r&&a.endsWith(".md")){const p=j.dirname(a);i.unshift(`@include-push(${p})`),i.push("@include-pop()")}return qt(i.join(`
`).replace(/\n?$/,`
`))},Ae=(e,t,{currentPath:n,cwd:r,includedFiles:o})=>e.split(`
`).map(a=>{if(a.startsWith("@include")){const s=a.match(Bt);if(s){$.warn(`"@include(file)" is deprecated, you should use "<!-- @include: file -->" instead.${n?`
 Found in ${n}.`:""}`);const[,i,p,d,u]=s,f=t.resolvePath(i,r),l=t.resolveImagePath||t.resolveLinkPath,m=Ht({filePath:f,...p?{region:p}:{lineStart:d?Number(d):0,lineEnd:u?Number(u):void 0}},{cwd:r,includedFiles:o,resolvedPath:l});return t.deep&&f.endsWith(".md")?Ae(m,t,{cwd:j.isAbsolute(f)?j.dirname(f):r?j.resolve(r,j.dirname(f)):null,currentPath:n??"",includedFiles:o}):m}}return a}).join(`
`),Yt=e=>t=>{const n=t.env,r=n.includedFiles||(n.includedFiles=[]),o=e.currentPath(n);t.src=Ae(t.src,e,{cwd:o?j.dirname(o):null,currentPath:o,includedFiles:r})},Qt=(e,t)=>{const{currentPath:n,resolvePath:r=i=>i,deep:o=!1,resolveLinkPath:a=!0,resolveImagePath:s=!0}=t||{};if(typeof n!="function"){$.error('[include]: "currentPath" is required');return}e.core.ruler.after("normalize","md_legacy_import",Yt({currentPath:n,resolvePath:r,deep:o,resolveLinkPath:a,resolveImagePath:s}))},Xt=e=>{ee(e,{name:"flowchart",open:"flowstart",close:"flowend",render:(t,n)=>{q.warn('"@flowstart ... @flowend" is deprecated, you should use ```flow ... ``` instead.');const r=t[n],o=`flowchart-${n}`,{content:a,info:s}=r;return`<FlowChart id="${o}" code="${v(a)}" preset="${s.trim()||"vue"}"></FlowChart>`}})},Zt=()=>!1,en=(e,t={})=>{const{status:n="dev",ignore:r=[]}=t.checkLinks||{};return{enabled:n==="always"||e.env.isDev&&n==="dev"||e.env.isBuild&&n==="build"||!1,isIgnoreLink:ct(r)?o=>r(o,e.env.isDev):dt(r)?o=>r.some(a=>ut(a)?a.test(o):a===o):Zt}},Le=(e,t,n)=>{const r=e.filePathRelative||e.path,{pages:o}=t,a=e.links.filter(({raw:i})=>i.match(/.md((?:\?|#).*)?$/)),s=[...a.filter(({raw:i})=>!Y(i)).filter(({relative:i})=>o.every(({filePathRelative:p})=>p!==decodeURI(i))&&!n(i)),...a.filter(({raw:i})=>Y(i)).filter(({absolute:i})=>o.every(({filePathRelative:p})=>!p||`${t.options.base}${p}`!==decodeURI(i)&&!n(i)))].map(({raw:i})=>i);s.length&&q.warn(`Broken links found in ${r}: ${s.join(", ")}`)},{url:T}=import.meta,tn=async(e,t,n,r=!0)=>{const o=new Set,a=new Set,s=new Set;return t.card&&r&&(o.add(`import { hasGlobalComponent } from "${x("vuepress-shared/client",T)}";`),o.add(`import { VPCard } from "${h}compact/index.js";`),a.add('if(!hasGlobalComponent("VPCard", app)) app.component("VPCard", VPCard);')),n.chart&&(o.add(`import ChartJS from "${h}components/ChartJS.js";`),a.add('app.component("ChartJS", ChartJS)')),t.codetabs&&(o.add(`import CodeTabs from "${h}components/CodeTabs.js";`),a.add('app.component("CodeTabs", CodeTabs);'),r&&(o.add(`import { hasGlobalComponent } from "${x("vuepress-shared/client",T)}";`),o.add(`import { CodeGroup, CodeGroupItem } from "${h}compact/index.js";`),a.add('if(!hasGlobalComponent("CodeGroup", app)) app.component("CodeGroup", CodeGroup);'),a.add('if(!hasGlobalComponent("CodeGroupItem", app)) app.component("CodeGroupItem", CodeGroupItem);'))),t.demo&&(o.add(`import CodeDemo from "${h}components/CodeDemo.js";`),o.add(`import MdDemo from "${h}components/MdDemo.js";`),a.add('app.component("CodeDemo", CodeDemo);'),a.add('app.component("MdDemo", MdDemo);')),n.echarts&&(o.add(`import ECharts from "${h}components/ECharts.js";`),o.add(`import { injectEchartsConfig } from "${h}/index.js";`),a.add('app.component("ECharts", ECharts);'),a.add("injectEchartsConfig(app);")),t.figure&&o.add(`import "${h}styles/figure.scss";`),n.flowchart&&(o.add(`import FlowChart from "${h}components/FlowChart.js";`),a.add('app.component("FlowChart", FlowChart);')),n.footnote&&o.add(`import "${h}styles/footnote.scss";`),t.hint&&(o.add(`import { useHint } from "${h}composables/hint.js";`),o.add(`import "${h}styles/hint/index.scss";`),s.add("useHint();")),n.imgMark&&o.add(`import "${h}styles/image-mark.scss"`),n.katex&&(o.add(`import "${x("katex/dist/katex.min.css",T)}";`),o.add(`import "${h}styles/katex.scss";`),k(t.katex)&&t.katex.copy&&(o.add(`import { useKatexCopy } from "${h}composables/katex.js";`),s.add("useKatexCopy();"))),n.kotlinPlayground&&(o.add(`import KotlinPlayground from "${h}components/KotlinPlayground.js";`),o.add(`import { injectKotlinPlaygroundConfig } from "${h}index.js";`),a.add("injectKotlinPlaygroundConfig(app);"),a.add('app.component("KotlinPlayground", KotlinPlayground);')),n.markmap&&(o.add(`import MarkMap from "${h}components/MarkMap.js";`),a.add('app.component("MarkMap", MarkMap);')),n.mathjax&&o.add('import "./mathjax.css";'),n.mermaid&&(o.add(`import Mermaid from "${h}components/Mermaid.js";`),o.add(`import { injectMermaidConfig } from "${h}/index.js";`),a.add("injectMermaidConfig(app);"),a.add('app.component("Mermaid", Mermaid);')),t.playground&&(o.add(`import Playground from "${h}components/Playground.js";`),a.add('app.component("Playground", Playground);')),n.revealJs&&(o.add(`import "${x("reveal.js/dist/reveal.css",T)}";`),o.add(`import RevealJs from "${h}components/RevealJs.js";`),o.add(`import { injectRevealJsConfig } from "${h}index.js";`),a.add("injectRevealJsConfig(app);"),a.add('app.component("RevealJs", RevealJs);')),t.tabs&&(o.add(`import Tabs from "${h}components/Tabs.js";`),a.add('app.component("Tabs", Tabs);')),n.tasklist&&o.add(`import "${h}styles/tasklist.scss";`),n.vuePlayground&&(o.add(`import VuePlayground from "${h}components/VuePlayground.js";`),o.add(`import { injectVuePlaygroundConfig } from "${h}index.js";`),a.add("injectVuePlaygroundConfig(app);"),a.add('app.component("VuePlayground", VuePlayground);')),e.writeTemp("md-enhance/config.js",`import { defineClientConfig } from "@vuepress/client";
${Array.from(o.values()).join(`
`)}

export default defineClientConfig({
  enhance: ({ app }) => {
${Array.from(a.values()).map(i=>`    ${i}`).join(`
`)}
  },
  setup: () => {
${Array.from(s.values()).join(`
`)}
  }
});
`)},nn=`mjx-container {
  overflow-x: auto;
}
`,on=async(e,t)=>{await e.writeTemp("md-enhance/mathjax.css",`${t.outputStyle()}
${nn}`)},{url:V}=import.meta,an=["auto","beige","black","blood","league","moon","night","serif","simple","sky","solarized","white"],rn=async(e,t=[])=>{await e.writeTemp("md-enhance/revealjs-plugins.js",`export const useRevealJs = () => [
  import(/* webpackChunkName: "reveal" */ "${x("reveal.js/dist/reveal.esm.js",V)}"),
  import(/* webpackChunkName: "reveal" */ "${x("reveal.js/plugin/markdown/markdown.esm.js",V)}"),
  ${t.map(n=>`import(/* webpackChunkName: "reveal" */ "${x(`reveal.js/plugin/${n}/${n}.esm.js`,V)}")`).join(`,
`)}];
`)},sn=async(e,t=["auto"])=>{const n=t.filter(r=>an.includes(r));await e.writeTemp("md-enhance/revealjs-theme.scss",`${n.map(r=>`@use "${h}styles/revealjs/theme/${r}.scss";`).join(`
`)}
`)},ln=(e={gfm:!0},t=!0)=>n=>{t&&Ut(e),ft(n,J,"2.0.0-rc.0"),n.env.isDebug&&$.info("Options:",e);const r=(l,m=!1,g=[])=>{const c=l in e?!!e[l]:m&&e.gfm||!1,y=g.every(C=>xt(C,!!e[l]));return c&&y},o=gt({app:n,name:J,default:Te,config:e.locales}),a={alert:r("alert",!0),breaks:r("breaks",!0),chart:r("chart",!1,["chart.js"]),echarts:r("echarts",!1,["echarts"]),flowchart:r("flowchart",!1,["flowchart.ts"]),footnote:r("footnote",!0),imgLazyload:r("imgLazyload"),imgMark:r("imgMark",!0),linkify:r("linkify",!0),katex:r("katex",!1,["katex"]),mathjax:!e.katex&&r("mathjax",!0,["mathjax-full"]),mark:r("mark"),markmap:r("markmap",!1,["markmap-lib","markmap-toolbar","markmap-view"]),mermaid:r("mermaid",!1,["mermaid"]),obsidianImgSize:r("obsidianImgSize"),revealJs:r("revealJs",!1,["reveal.js"]),tasklist:r("tasklist",!0),kotlinPlayground:r("kotlinPlayground",!1,["kotlin-playground"]),vuePlayground:r("vuePlayground",!1,["@vue/repl"])},{enabled:s,isIgnoreLink:i}=en(n,e),p={mathFence:e.gfm??!1,macros:{"\\liiiint":"\\int\\!\\!\\!\\iiint","\\iiiint":"\\int\\!\\!\\!\\!\\iiint","\\idotsint":"\\int\\!\\cdots\\!\\int"},logger:(l,m,g,{filePathRelative:c})=>{l!=="newLineInDisplayMode"&&(l==="unicodeTextInMathMode"?$.warn(`Found unicode character ${g.text} inside tex${c?` in ${b.cyan(c)}`:""}. You should use ${b.magenta(`\\text{${g.text}}`)}`):$.warn(`${m}.${c?`
Found in ${b.cyan(c)}`:""}`))},...k(e.katex)?e.katex:{},vPre:!0},d=a.mathjax?Xe({mathFence:e.gfm??!1,...k(e.mathjax)?e.mathjax:{},vPre:!0}):null,u=k(e.revealJs)?e.revealJs:{};it(n,{id:"hope"});let f=!1;return{name:J,define:()=>({MARKDOWN_ENHANCE_DELAY:e.delay||800,CODE_DEMO_OPTIONS:{...ae,...k(e.demo)?e.demo:{}}}),alias:l=>({"@mermaid":a.mermaid?l.env.isDev&&yt()==="pnpm"&&ht(l)==="vite"?"mermaid/dist/mermaid.esm.min.mjs":"mermaid":$t}),extendsBundlerOptions:(l,m)=>{bt(l,m,["fflate","vuepress-shared"]),a.katex&&p.output!=="html"?A(l,m,Q):a.mathjax&&(A(l,m,/^mjx-/),d?.documentOptions.enableAssistiveMml&&A(l,m,Q)),a.chart&&(E(l,m,"chart.js/auto/auto.mjs"),P(l,m,"chart.js")),a.echarts&&(E(l,m,"echarts"),P(l,m,"echarts")),a.flowchart&&(E(l,m,"flowchart.ts"),P(l,m,"flowchart.ts")),a.markmap&&(O(l,m,["markmap-lib","markmap-toolbar","markmap-view"]),P(l,m,["markmap-lib","markmap-toolbar","markmap-view"])),a.mermaid&&(O(l,m,"mermaid"),P(l,m,"mermaid")),a.revealJs&&(E(l,m,["reveal.js/dist/reveal.esm.js","reveal.js/plugin/markdown/markdown.esm.js",...(u?.plugins||[]).map(g=>`reveal.js/plugin/${g}/${g}.esm.js`)]),P(l,m,"reveal.js")),a.kotlinPlayground&&(O(l,m,"kotlin-playground"),P(l,m,"kotlin-playground")),a.vuePlayground&&(O(l,m,"@vue/repl"),P(l,m,"@vue/repl"),vt(l,m,g=>{g.module.set("exprContextCritical",!1),g.module.set("unknownContextCritical",!1)}))},extendsMarkdown:l=>{if(a.breaks&&(l.options.breaks=!0),a.linkify&&(l.options.linkify=!0),a.alert&&l.use(te,o),a.footnote&&l.use(Ve),a.tasklist&&l.use(ot,[k(e.tasklist)?e.tasklist:{}]),a.imgMark&&l.use(Be,k(e.imgMark)?e.imgMark:{}),e.attrs&&l.use(Ue,k(e.attrs)?e.attrs:{}),e.align&&l.use(ze),e.component&&l.use(me),e.figure&&l.use(Ge),e.hint&&(l.use(ge,o),t&&l.use(zt,o)),e.imgLazyload&&l.use(We),e.imgSize&&l.use(qe),e.mark&&l.use(Qe),e.obsidianImgSize&&l.use(Ke),e.sup&&l.use(nt),e.sub&&l.use(tt),e.card&&t&&l.use(Lt),(e.vPre||t)&&l.use(_e),a.katex?l.use(Ye,p):a.mathjax&&(l.use(Ze,d),l.use(m=>{const g=m.render.bind(m);m.render=(c,y)=>{const C=g(c,y);return d.reset(),C}})),e.include&&(l.use(He,{currentPath:m=>m.filePath,...k(e.include)?e.include:{}}),t&&l.use(Qt,{currentPath:m=>m.filePath})),e.stylize&&l.use(et,{config:e.stylize,localConfigGetter:m=>m.frontmatter?.stylize||null}),e.codetabs&&(l.use(pe),t&&l.use(Vt)),e.tabs&&l.use(Ne),a.flowchart&&(l.use(fe),t&&l.use(Xt)),a.chart&&l.use(ne),a.echarts&&l.use(de),e.demo&&(l.use(le),l.use(re),l.use(ie),l.use(se),t&&l.use(Gt)),a.markmap&&l.use(Ie),a.mermaid&&l.use(Ee),a.revealJs&&l.use(Oe),k(e.playground)){const{presets:m=[],config:g={}}=e.playground;m.forEach(c=>{c==="ts"?l.use(R,ve(g.ts||{})):c==="vue"?l.use(R,we(g.vue||{})):c==="unocss"?l.use(R,Pe(g.unocss||{})):k(c)&&l.use(R,c)})}a.kotlinPlayground&&l.use(xe),a.vuePlayground&&l.use(Je)},extendsPage:(l,m)=>{s&&f&&Le(l,m,i),e.include&&l.deps.push(...l.markdownEnv.includedFiles)},onInitialized:l=>{f=!0,s&&l.pages.forEach(m=>Le(m,l,i))},onPrepared:async l=>{const m=[];a.mathjax&&m.push(on(l,d)),a.revealJs&&m.push(rn(l,u.plugins??[]),sn(l,u?.themes)),await Promise.all(m)},clientConfigFile:l=>tn(l,e,a,t)}};export{ae as CODE_DEMO_DEFAULT_SETTING,te as alert,ne as chart,pe as codeTabs,me as component,de as echarts,fe as flowchart,je as generateUnoURL,Se as getMermaidContent,ve as getTSPlaygroundPreset,be as getURL,Pe as getUnoPlaygroundPreset,we as getVuePlaygroundPreset,ge as hint,xe as kotlinPlayground,Te as markdownEnhanceLocales,Ie as markmap,le as mdDemo,ln as mdEnhancePlugin,Ee as mermaid,re as normalDemo,R as playground,se as reactDemo,Oe as revealJs,Ne as tabs,_e as vPre,ie as vueDemo,Je as vuePlayground};
//# sourceMappingURL=index.js.map
