import{align as Fe}from"@mdit/plugin-align";import{attrs as Le}from"@mdit/plugin-attrs";import{figure as Ue}from"@mdit/plugin-figure";import{footnote as ze}from"@mdit/plugin-footnote";import{imgLazyload as Ge}from"@mdit/plugin-img-lazyload";import{imgMark as Ve}from"@mdit/plugin-img-mark";import{imgSize as Je,obsidianImageSize as We}from"@mdit/plugin-img-size";import{include as Be}from"@mdit/plugin-include";import{katex as qe}from"@mdit/plugin-katex";import{mark as He}from"@mdit/plugin-mark";import{createMathjaxInstance as Ye,mathjax as Ke}from"@mdit/plugin-mathjax";import{stylize as Qe}from"@mdit/plugin-stylize";import{sub as Xe}from"@mdit/plugin-sub";import{sup as Ze}from"@mdit/plugin-sup";import{tasklist as et}from"@mdit/plugin-tasklist";import{getDirname as tt,path as j,hash as nt,logger as K,colors as S,fs as Q}from"@vuepress/utils";import{useSassPalettePlugin as ot}from"vuepress-plugin-sass-palette";import{Logger as rt,ensureEndingSlash as at,isPlainObject as v,isString as X,fromEntries as U,entries as T,utoa as P,ensureLeadingSlash as Z,keys as it,endsWith as st,deepAssign as z,isAbsoluteUrl as ee,checkVersion as lt,getLocales as pt,isArray as ct,detectPackageManager as mt,getBundlerName as te,addViteConfig as dt,addViteSsrNoExternal as ut,addCustomElement as G,MATHML_TAGS as ne,addViteOptimizeDepsExclude as F,addViteSsrExternal as E,addViteOptimizeDepsInclude as oe,addChainWebpack as ft}from"vuepress-shared/node";import{container as R}from"@mdit/plugin-container";import{resolveLocalePath as re}from"@vuepress/shared";import{load as gt}from"js-yaml";import{tab as ae}from"@mdit/plugin-tab";import{uml as ie}from"@mdit/plugin-uml";import{createRequire as yt}from"node:module";const ht=/\r\n?|\n/g,V=n=>JSON.stringify(n).replace(/'/g,"&#39"),bt=n=>n.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#039;"),$t=tt(import.meta.url),L="vuepress-plugin-md-enhance",k=new rt(L),$=at(j.resolve($t,"../client")),vt=["title","desc","logo","link","color"],Ct=n=>v(n)&&X(n.title)?U(T(n).filter(e=>vt.includes(e[0])&&X(e[1]))):null,se=(n,e,r,{filePathRelative:t})=>{const o=n[e],{content:a,info:i}=o,s=i.trim().split(":",2)[1]||"yml";let l=null;if(s==="yaml"||s==="yml")l=gt(a);else if(s==="json")try{l=JSON.parse(a)}catch{}if(!l)return k.error(`Can not parse card config ${s}${t?`, found in ${t}`:""}.`),"";const f=Ct(l);return f?`<VPCard v-bind='${V(f)}' />`:(k.error(`Invalid card config${t?` found in ${t}`:""}:
${a}
`),"")},le=n=>{const e=n.renderer.rules.fence;n.renderer.rules.fence=(...r)=>{const[t,o,a,i]=r,{info:s}=t[o];return s.split(":",2)[0]==="card"?se(t,o,a,i):e(...r)},n.renderer.rules.card=se},pe=n=>{R(n,{name:"chart",openRender:(e,r)=>{const t=e[r].info.trimStart().slice(5).trim(),o=`chart-${r}`;let a="{}",i="";for(let s=r;s<e.length;s++){const{type:l,content:f,info:d}=e[s];if(l==="container_chart_close")break;f&&(l==="fence"&&(d==="json"?(a=P(f),i="json"):(d==="js"||d==="javascript")&&(a=P(f),i="js")),e[s].type="chart_empty",e[s].hidden=!0)}return`<ChartJS id="${o}" config="${a}" ${t?`title="${encodeURIComponent(t)}" `:""}type="${i}">`},closeRender:()=>"</ChartJS>"})},ce={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"},J=n=>e=>R(e,{name:n,openRender:(r,t)=>{var o;const a=r[t].info.trimStart().slice(n.length).trim();let i="";const s={};for(let l=t;l<r.length;l++){const{type:f,content:d,info:c}=r[l],b=c?((o=e.utils.unescapeAll(c).trim().match(/^([^ :[{]+)/))==null?void 0:o[1])||"text":"";if(f===`container_${n}_close`)break;d&&f==="fence"&&(b==="json"?i=P(d):s[b]=d)}return`
<CodeDemo id="code-demo-${t}" type="${n.split("-")[0]}"${a?` title="${encodeURIComponent(a)}"`:""}${i?` config="${i}"`:""} code="${P(JSON.stringify(s))}">
`},closeRender:()=>"</CodeDemo>"}),me=J("normal-demo"),de=J("vue-demo"),ue=J("react-demo"),fe=n=>{ae(n,{name:"code-tabs",tabsOpenRenderer:({active:e,data:r},t,o)=>{const{meta:a}=t[o],i=r.map(({title:s,id:l})=>({title:s,...l?{id:l}:{}}));return`<CodeTabs id="${o}" :data='${V(i)}'${e!==-1?` :active="${e}"`:""}${a.id?` tab-id="${a.id}"`:""}>
`},tabsCloseRenderer:()=>`</CodeTabs>
`,tabOpenRenderer:({index:e},r,t)=>{let o=!1;for(let a=t;a<r.length;a++){const{block:i,type:s}=r[a];if(i){if(s==="code-tabs_tab_close")break;if(s==="fence"&&!o){o=!0;continue}r[a].type="code_tab_empty",r[a].hidden=!0}}return`<template #tab${e}="{ title, value, isActive }">
`},tabCloseRenderer:()=>`</template>
`})},ge=(n,e)=>{const r=n[e],t=`echarts-${e}`,{content:o,info:a}=r,i=a.trim().split(":",2)[1];return`<ECharts id="${t}" config="${P(o)}"${i?` title="${encodeURIComponent(i)}"`:""}></ECharts>`},ye=n=>{const e=n.renderer.rules.fence;n.renderer.rules.fence=(...r)=>{const[t,o]=r,{info:a}=t[o];return a.split(":",2)[0]==="echarts"?ge(t,o):e(...r)},n.renderer.rules.echarts=ge,R(n,{name:"echarts",openRender:(r,t)=>{const o=r[t].info.trimStart().slice(7).trim(),a=`echarts-${t}`;let i="{}",s=!1;for(let l=t;l<r.length;l++){const{type:f,content:d,info:c}=r[l];if(f==="container_echarts_close")break;d&&(f==="fence"&&(c==="json"?i=d:(c==="js"||c==="javascript")&&(i=d,s=!0)),r[l].type="echarts_empty",r[l].hidden=!0)}return`<ECharts id="${a}" config="${P(i)}"${o?` title="${encodeURIComponent(o)}"`:""}${s?' type="js"':""}>`},closeRender:()=>"</ECharts>"})},he=(n,e)=>{const r=n[e],t=`flowchart-${e}`,{content:o,info:a}=r;return`<FlowChart id="${t}" code="${P(o)}" preset="${a.trim().split(":",2)[1]||"vue"}"></FlowChart>`},be=n=>{const e=n.renderer.rules.fence;n.renderer.rules.fence=(...r)=>{const[t,o]=r,{info:a}=t[o],i=a.split(":",2)[0];return i==="flow"||i==="flowchart"?he(t,o):e(...r)},n.renderer.rules.flowchart=he},$e=(n,e={})=>{["info","note","tip","warning","danger"].forEach(r=>{n.use(R,{name:r,openRender:(t,o,a,i)=>{var s;let l=t[o].info.trim().slice(r.length).trim();if(!l){const{filePathRelative:f}=i,d=Z(f??""),c=re(e,d);l=(s=e[c])==null?void 0:s[r]}return`<div class="hint-container ${r}">
<p class="hint-container-title">${l||r}</p>
`},closeRender:()=>`</div>
`})}),n.use(r=>R(r,{name:"details",openRender:(t,o,a,i)=>{var s;let l=t[o].info.trim().slice(7).trim();if(!l){const{filePathRelative:f}=i,d=Z(f??""),c=re(e,d);l=(s=e[c])==null?void 0:s.details}return`<details class="hint-container details"><summary>${l||"Details"}</summary>
`},closeRender:()=>`</details>
`}))},ve=(n,e)=>`<Mermaid id="mermaid-${e}" code="${P(n[e].content)}"></Mermaid>`,x=(n,e,r)=>`<Mermaid id="mermaid-${r}" code="${P(`${n}
${e.split(`
`).map(t=>t?`  ${t}`:"").join(`
`)}`)}"></Mermaid>`,Ce=n=>{const e=n.renderer.rules.fence;n.renderer.rules.fence=(...r)=>{const[t,o]=r,{content:a,info:i}=t[o];return i.trim()==="mermaid"?ve(...r):i.trim()==="sequence"?x("sequenceDiagram",a,o):i.trim()==="class"?x("classDiagram",a,o):i.trim()==="state"?x("stateDiagram-v2",a,o):i.trim()==="er"?x("erDiagram",a,o):i.trim()==="journey"?x("journey",a,o):i.trim()==="gantt"?x("gantt",a,o):i.trim()==="pie"?x("pie",a,o):i.trim()==="git-graph"?x("gitGraph",a,o):i.trim()==="c4c"?x("C4Context",a,o):i.trim()==="mindmap"?x("mindmap",a,o):i.trim()==="timeline"?x("timeline",a,o):e(...r)},n.renderer.rules.mermaid=ve},ke="@",kt=["file","import","setting"],wt=n=>(e,r,t,o)=>{let a=e.bMarks[r]+e.tShift[r],i=e.eMarks[r];if(e.src[a]!==":")return!1;let s=a+1;for(;s<=i&&e.src[s]===":";)s+=1;const l=s-a;if(l<3)return!1;const f=e.src.slice(a,s),d=e.src.slice(s,i),c=d.trimStart().split(" ",2)[0],b=d.trimStart().slice(n.length).trim();if(c.trim()!==n)return!1;if(o)return!0;let u=r,h=!1;for(;u<t&&(u+=1,a=e.bMarks[u]+e.tShift[u],i=e.eMarks[u],!(a<i&&e.sCount[u]<e.blkIndent));)if(e.src[a]===":"&&e.sCount[u]-e.blkIndent<4){for(s=a+1;s<=i&&e.src[s]===":";s++);if(s-a>=l&&(s=e.skipSpaces(s),s>=i)){h=!0;break}}const m=e.parentType,g=e.lineMax;e.parentType=`${n}`,e.lineMax=u-(h?1:0);const O=e.push(`${n}_open`,"template",1);O.markup=f,O.block=!0,O.info=b,O.map=[r,u-(h?1:0)],e.md.block.tokenize(e,r+1,u-(h?1:0));const M=e.push(`${n}_close`,"template",-1);return M.markup=e.src.slice(a,s),M.block=!0,e.parentType=m,e.lineMax=g,e.line=u+(h?1:0),!0},Pt=n=>(e,r,t,o)=>{let a=e.bMarks[r]+e.tShift[r],i=e.eMarks[r];const s=`${ke}${n}`;if(e.src.charAt(a)!=="@")return!1;let l;for(l=0;l<s.length;l++)if(s[l]!==e.src[a+l])return!1;const f=e.src.slice(a,a+l),d=e.src.slice(a+l,i);if(o)return!0;let c=r,b=!1;for(;c<t&&(c+=1,a=e.bMarks[c]+e.tShift[c],i=e.eMarks[c],!(a<i&&e.sCount[c]<e.blkIndent));)if(e.src[a]===ke&&e.sCount[c]<=e.sCount[r]){let O=!0;for(l=0;l<s.length;l++)if(s[l]!==e.src[a+l]){O=!1;break}if(O){b=!0,c-=1;break}}const u=e.parentType,h=e.lineMax;e.parentType=`${n}`,e.lineMax=c;const m=e.push(`${n}_open`,"template",1);m.block=!0,m.markup=f,m.info=d.trim(),m.map=[r,c],e.md.block.tokenize(e,r+1,c);const g=e.push(`${n}_close`,"template",-1);return g.block=!0,g.markup="",e.parentType=u,e.lineMax=h,e.line=c+(b?1:0),!0},N=(n,{name:e="playground",component:r="Playground",propsGetter:t}={name:"playground",component:"Playground",propsGetter:o=>({key:o.key,title:o.title||"",files:encodeURIComponent(JSON.stringify(o.files)),settings:encodeURIComponent(JSON.stringify(o.settings||{}))})})=>{n.block.ruler.before("fence",`${e}`,wt(e),{alt:["paragraph","reference","blockquote","list"]}),kt.forEach(o=>{n.block.ruler.__rules__.find(({name:a})=>a==="marker")||n.block.ruler.before("fence","tab",Pt(o),{alt:["paragraph","reference","blockquote","list"]})}),n.renderer.rules[`${e}_open`]=(o,a)=>{const{info:i}=o[a],s={key:nt(`playground${a}-${i}`),title:encodeURIComponent(i),settings:{},files:{}};let l=null,f=!1;for(let c=a;c<o.length;c++){const{block:b,type:u,info:h,content:m}=o[c];if(b){if(u===`${e}_close`)break;if(u===`${e}_open`)continue;if(u==="file_open"){if(!h)continue;l=h}else u==="import_open"&&(s.importMap=l=h||"import-map.json");if(u==="setting_open"&&(f=!0),u==="setting_close"&&(f=!1),u==="file_close"||u==="import_close"||u==="setting_close"||!m){o[c].type=`${e}_empty`,o[c].hidden=!0;continue}f?u==="fence"&&h==="json"&&(s.settings=JSON.parse(m.trim())):u==="fence"&&l&&(s.files[l]={ext:h,content:m}),o[c].type=`${e}_empty`,o[c].hidden=!0}}const d=t(s);return`<${r} ${T(d).map(([c,b])=>`${c}="${bt(b)}"`).join(" ")}>
`},n.renderer.rules[`${e}_close`]=()=>`</${r}>
`},jt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",xt=(n,e,r)=>{if(n==null)return"";let t,o,a,i={},s={},l="",f="",d="",c=2,b=3,u=2,h=[],m=0,g=0;for(a=0;a<n.length;a+=1)if(l=n.charAt(a),Object.prototype.hasOwnProperty.call(i,l)||(i[l]=b++,s[l]=!0),f=d+l,Object.prototype.hasOwnProperty.call(i,f))d=f;else{if(Object.prototype.hasOwnProperty.call(s,d)){if(d.charCodeAt(0)<256){for(t=0;u>t;t++)m<<=1,g==e-1?(g=0,h.push(r(m)),m=0):g++;for(o=d.charCodeAt(0),t=0;8>t;t++)m=m<<1|1&o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o>>=1}else{for(o=1,t=0;u>t;t++)m=m<<1|o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o=0;for(o=d.charCodeAt(0),t=0;16>t;t++)m=m<<1|1&o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o>>=1}c--,c==0&&(c=Math.pow(2,u),u++),delete s[d]}else for(o=i[d],t=0;u>t;t++)m=m<<1|1&o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o>>=1;c--,c==0&&(c=Math.pow(2,u),u++),i[f]=b++,d=String(l)}if(d!==""){if(Object.prototype.hasOwnProperty.call(s,d)){if(d.charCodeAt(0)<256){for(t=0;u>t;t++)m<<=1,g==e-1?(g=0,h.push(r(m)),m=0):g++;for(o=d.charCodeAt(0),t=0;8>t;t++)m=m<<1|1&o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o>>=1}else{for(o=1,t=0;u>t;t++)m=m<<1|o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o=0;for(o=d.charCodeAt(0),t=0;16>t;t++)m=m<<1|1&o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o>>=1}c--,c==0&&(c=Math.pow(2,u),u++),delete s[d]}else for(o=i[d],t=0;u>t;t++)m=m<<1|1&o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o>>=1;c--,c==0&&(c=Math.pow(2,u),u++)}for(o=2,t=0;u>t;t++)m=m<<1|1&o,g==e-1?(g=0,h.push(r(m)),m=0):g++,o>>=1;for(;;){if(m<<=1,g==e-1){h.push(r(m));break}g++}return h.join("")},Ot=n=>xt(n,6,e=>jt.charAt(e)),It=[{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"}],we=(n,e={})=>{const r=`#code/${Ot(n)}`,t=T(e).map(([o,a])=>{const i=It.find(l=>l.name===o);if(!i||a===null||a===void 0)return"";const{type:s}=i;if(v(s)){const l=s[a];return(l==null?void 0:l.toString())||""}return`${o}=${encodeURIComponent(a)}`}).filter(o=>o.length).join("&");return`${t?`?${t}`:""}${r}`},Pe=({service:n="https://www.typescriptlang.org/play",...e}={})=>({name:"playground#ts",propsGetter:({title:r="",files:t,settings:o,key:a})=>{const i=it(t).filter(l=>st(l,".ts"));i.length!==1&&k.error("TS playground only support 1 ts file");const s=`${n}${we(t[i[0]].content,z({},o||{},e))}`;return{key:a,title:r,link:encodeURIComponent(s)}}}),St=["html","js","ts","vue","jsx","tsx","json"],je="https://sfc.vuejs.org/vue.runtime.esm-browser.js",xe="https://sfc.vuejs.org/server-renderer.esm-browser.js",Oe=(n={})=>({name:"playground#vue",propsGetter:e=>{const{title:r="",files:t,settings:o,key:a}=e,i={service:"https://sfc.vuejs.org/",dev:!1,ssr:!1,...n,...o},s=U(T(t).filter(([,{ext:l}])=>St.includes(l)).map(([l,{content:f}])=>{if(l==="import-map.json"){const d=JSON.parse(f);return[l,JSON.stringify(z({imports:{vue:je,...i.ssr?{"vue/server-renderer":xe}:{}}},d))]}return[l,f]}));return i.ssr&&!s["import-map.json"]&&(s["import-map.json"]=JSON.stringify({imports:{vue:je,"vue/server-renderer":xe}},null,2)),{key:a,title:r,link:encodeURIComponent(`${i.service}#${i.dev?"__DEV__":""}${i.ssr?"__SSR__":""}${Buffer.from(JSON.stringify(s)).toString("base64")}`)}}}),Ie=n=>{n.use(ie,{name:"presentation",open:"slidestart",close:"slideend",render:(e,r)=>{const t=e[r],o=`presentation-${r}`,{content:a,info:i}=t;return`<Presentation id="${o}" code="${P(a)}" theme="${i.trim()||"auto"}"></Presentation>`}})},Se=n=>{ae(n,{name:"tabs",tabsOpenRenderer:({active:e,data:r},t,o)=>{const{meta:a}=t[o],i=r.map(({title:s,id:l})=>({title:s,...l?{id:l}:{}}));return`<Tabs id="${o}" :data='${V(i)}'${e!==-1?` :active="${e}"`:""}${a.id?` tab-id="${a.id}"`:""}>
`},tabsCloseRenderer:()=>`</Tabs>
`,tabOpenRenderer:({index:e})=>`<template #tab${e}="{ title, value, isActive }">
`,tabCloseRenderer:()=>`</template>
`})},Re=n=>{R(n,{name:"v-pre",openRender:()=>`<div v-pre>
`,closeRender:()=>`</div>
`})},W={showCompileOutput:!1,clearConsole:!1,ssr:!1},Rt=["html","js","ts","vue","jsx","tsx","json"],Dt=n=>Buffer.from(JSON.stringify(U(T(n).filter(([,{ext:e}])=>Rt.includes(e)).map(([e,r])=>[e,r.content])))).toString("base64"),De=n=>{n.use(N,{name:"vue-playground",component:"VuePlayground",propsGetter:({title:e="",key:r,files:t,settings:o})=>({title:e,key:r,settings:encodeURIComponent(JSON.stringify(o||{})),files:encodeURIComponent(Dt(t))})})},Ee={"/en/":{info:"Info",note:"Note",tip:"Tips",warning:"Note",danger:"Warning",details:"Details"},"/zh/":{info:"相关信息",note:"注",tip:"提示",warning:"注意",danger:"警告",details:"详情"},"/zh-tw/":{info:"相關信息",note:"注",tip:"提示",warning:"注意",danger:"警告",details:"詳情"},"/de/":{info:"Information",note:"Notiz",tip:"Tips",warning:"Warnung",danger:"Gefahr",details:"Details"},"/de-at/":{info:"Information",note:"Note",tip:"Tips",warning:"Notiz",danger:"Warnung",details:"Details"},"/vi/":{info:"Thông tin",note:"Note",tip:"Tips",warning:"Lưu ý",danger:"Cẩn thận",details:"Chi tiết"},"/uk/":{info:"Інформація",note:"Note",tip:"Поради",warning:"Примітка",danger:"Увага",details:"Деталь"},"/ru/":{info:"Инфо",note:"Заметка",tip:"Совет",warning:"Примечание",danger:"Предупреждение",details:"Подробности"},"/br/":{info:"Informativo",note:"Note",tip:"Dicas",warning:"Avisos",danger:"Cuidado",details:"Detalhe"},"/pl/":{info:"Info",note:"Notatka",tip:"Porady",warning:"Notatka",danger:"Ostrzeżenie",details:"Dane"},"/sk/":{info:"Info",note:"Poznámka",tip:"Tip",warning:"Upozornenie",danger:"Pozor",details:"Podrobnosti"},"/fr/":{info:"Info",note:"Note",tip:"Conseil",warning:"Note",danger:"Avertissement",details:"Details"},"/es/":{info:"Información",note:"Nota",tip:"Consejos",warning:"Aviso",danger:"Advertencia",details:"Detalles"},"/ja/":{info:"関連情報",note:"注",tip:"ヒント",warning:"注意",danger:"警告",details:"詳細"},"/tr/":{info:"Bilgi",note:"Not",tip:"Tavsiye",warning:"Uyarı",danger:"Tehlike",details:"Detay"},"/ko/":{info:"정보",note:"노트",tip:"팁",warning:"경고",danger:"위험",details:"세부사항"},"/fi/":{info:"Tietoa",note:"Huomautus",tip:"Vinkki",warning:"Varoitus",danger:"Vaara",details:"Yksityiskohdat"},"/hu/":{info:"Információ",note:"Megjegyzés",tip:"Tipp",warning:"Figyelem",danger:"Veszély",details:"Részletek"},"/id/":{info:"Pemberitahuan",note:"Catatan",tip:"Tips",warning:"Penting",danger:"Peringatan",details:"Rincian"},"/nl/":{info:"Info",note:"Notitie",tip:"Tips",warning:"Notitie",danger:"Waarschuwing",details:"Details"}},Et=(n,e)=>{const{linkCheck:r="dev"}=e;return typeof r=="boolean"?r:r==="always"||n.env.isDev&&r==="dev"||n.env.isBuild&&r==="build"||!1},Me=(n,e)=>{const r=n.filePathRelative||n.path,{pages:t}=e,o=n.links.filter(({raw:i})=>i.match(/.md((?:\?|#).*)?$/)),a=[...o.filter(({raw:i})=>!ee(i)).filter(({relative:i})=>t.every(({filePathRelative:s})=>s!==decodeURI(i))),...o.filter(({raw:i})=>ee(i)).filter(({absolute:i})=>t.every(({filePathRelative:s})=>!s||`${e.options.base}${s}`!==decodeURI(i)))].map(({raw:i})=>i);a.length&&K.warn(`Broken links found in ${r}: ${a.join(", ")}`)},D=({options:n,deprecatedOption:e,newOption:r,msg:t="",scope:o=""})=>{if(e in n){if(k.warn(`${S.magenta(e)} is ${S.yellow("deprecated")}${o?` in ${o}`:""}, please use "${S.magenta(r)}" instead.${t?`
${t}`:""}`),r.includes(".")){const a=r.split(".");let i=n;a.forEach((s,l)=>{l!==a.length-1?(i[s]=i[s]||{},i=i[s]):i[s]=n[e]})}else n[r]=n[e];delete n[e]}},B=(n,e,r="",t="")=>{e in n&&(k.error(`"${S.magenta(e)}" is ${S.red("removed")}${t?`, please use ${S.magenta(t)} instead.`:" and no longer supported"}${r?`
${r}`:""}`),t||delete n[e])},Mt=n=>{D({options:n,deprecatedOption:"codegroup",newOption:"codetabs"}),D({options:n,deprecatedOption:"lazyload",newOption:"imgLazyload"}),D({options:n,deprecatedOption:"imageLazyload",newOption:"imgLazyload"}),D({options:n,deprecatedOption:"imageMark",newOption:"imgMark"}),D({options:n,deprecatedOption:"imageSize",newOption:"imgSize"}),D({options:n,deprecatedOption:"mdImport",newOption:"include"}),D({options:n,deprecatedOption:"tex",newOption:"katex"}),D({options:n,deprecatedOption:"vpre",newOption:"vPre"}),D({options:n,deprecatedOption:"imageTitle",newOption:"figure"}),B(n,"enableAll"),B(n,"lineNumbers"),B(n,"imageFix")},_t=n=>{n.use(R,{name:"demo",openRender:(e,r)=>{var t;k.warn("demo container is deprecated, you should use normal-demo, react-demo and vue-demo container instead.");const{info:o}=e[r],a=/\[(.*)\]/u.exec(o),i=/^ demo\s*(?:\[.*?\])?\s*(.*)\s*$/u.exec(o);let s="";const l={};for(let f=r;f<e.length;f++){const{type:d,content:c,info:b}=e[f],u=b?((t=n.utils.unescapeAll(b).trim().match(/^([^ :[{]+)/))==null?void 0:t[1])||"text":"";if(d==="container_demo_close")break;c&&d==="fence"&&(u==="json"?s=P(c):l[u]=c)}return`
<CodeDemo id="code-demo-${r}" type="${(a==null?void 0:a[1])||"normal"}"${i?` title="${encodeURIComponent(i[1])}"`:""}${s?` config="${s}"`:""} code="${P(JSON.stringify(l))}">
`},closeRender:()=>"</CodeDemo>"})},Tt=n=>{n.use(R,{name:"code-group",openRender:(e,r,t,o)=>(k.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>
`}),n.use(R,{name:"code-group-item",openRender:(e,r)=>{const{info:t}=e[r],o=t.split(":").pop()==="active";return`<CodeGroupItem title="${o?t.replace(/:active$/,""):t}"${o?" active":""}>
`},closeRender:()=>`</CodeGroupItem>
`})},Nt=[/^\/\/ ?#?((?:end)?region) ([\w*-]+)$/,/^\/\* ?#((?:end)?region) ([\w*-]+) ?\*\/$/,/^#pragma ((?:end)?region) ([\w*-]+)$/,/^<!-- #?((?:end)?region) ([\w*-]+) -->$/,/^#((?:End )Region) ([\w*-]+)$/,/^::#((?:end)region) ([\w*-]+)$/,/^# ?((?:end)?region) ([\w*-]+)$/],At=/^@include\(([^)]+(?:\.[a-z0-9]+))(?:#([\w-]+))?(?:\{(\d+)?-(\d+)?\})?\)$/,Ft=n=>{const e=n.split(`
`),r=e.reduce((t,o)=>{for(let a=0;a<o.length;a++)if(o[a]!==" "&&o[a]!=="	")return Math.min(a,t);return t},1/0);return r<1/0?e.map(t=>t.slice(r)).join(`
`):n},_e=(n,e,r,t=!1)=>{const[o,a,i]=e.exec(n.trim())||[];return!!(o&&a&&i===r&&a.match(t?/^[Ee]nd ?[rR]egion$/:/^[rR]egion$/))},Lt=(n,e)=>{let r=null,t=-1;for(const[o,a]of n.entries())if(r===null){for(const i of Nt)if(_e(a,i,e)){t=o+1,r=i;break}}else if(_e(a,r,e,!0))return{lineStart:t,lineEnd:o};return null},Ut=(n,{cwd:e,includedFiles:r,resolvedPath:t})=>{const{filePath:o}=n;let a=o;if(!j.isAbsolute(o)){if(!e)return k.error(`[include]: Error when resolving path: ${o}`),`
Error when resolving path
`;a=j.resolve(e,o)}if(r.push(a),!Q.existsSync(a))return k.error(`Include: ${a} not found`),`
File not found
`;const i=Q.readFileSync(a).toString().replace(ht,`
`).split(`
`);let s=[];if("region"in n){const l=Lt(i,n.region);l&&(s=i.slice(l.lineStart,l.lineEnd))}else{const{lineStart:l,lineEnd:f}=n;s=i.slice(l&&l-1,f)}if(t&&a.endsWith(".md")){const l=j.dirname(a);s.unshift(`@include-push(${l})`),s.push("@include-pop()")}return Ft(s.join(`
`).replace(/\n?$/,`
`))},Te=(n,e,{currentPath:r,cwd:t,includedFiles:o})=>n.split(`
`).map(a=>{if(a.startsWith("@include")){const i=a.match(At);if(i){k.warn(`"@include(file)" is deprecated, you should use "<!-- @include: file -->" instead.${r?`
 Found in ${r}.`:""}`);const[,s,l,f,d]=i,c=e.resolvePath(s,t),b=e.resolveImagePath||e.resolveLinkPath,u=Ut({filePath:c,...l?{region:l}:{lineStart:f?Number(f):0,lineEnd:d?Number(d):void 0}},{cwd:t,includedFiles:o,resolvedPath:b});return e.deep&&c.endsWith(".md")?Te(u,e,{cwd:j.isAbsolute(c)?j.dirname(c):t?j.resolve(t,j.dirname(c)):null,currentPath:r??"",includedFiles:o}):u}}return a}).join(`
`),zt=n=>e=>{const r=e.env,t=r.includedFiles||(r.includedFiles=[]),o=n.currentPath(r);e.src=Te(e.src,n,{cwd:o?j.dirname(o):null,currentPath:o,includedFiles:t})},Gt=(n,e)=>{const{currentPath:r,resolvePath:t=s=>s,deep:o=!1,resolveLinkPath:a=!0,resolveImagePath:i=!0}=e||{};if(typeof r!="function"){k.error('[include]: "currentPath" is required');return}n.core.ruler.after("normalize","md_legacy_import",zt({currentPath:r,resolvePath:t,deep:o,resolveLinkPath:a,resolveImagePath:i}))},Vt=n=>{ie(n,{name:"flowchart",open:"flowstart",close:"flowend",render:(e,r)=>{K.warn('"@flowstart ... @flowend" is deprecated, you should use ```flow ... ``` instead.');const t=e[r],o=`flowchart-${r}`,{content:a,info:i}=t;return`<FlowChart id="${o}" code="${P(a)}" preset="${i.trim()||"vue"}"></FlowChart>`}})},Ne=yt(import.meta.url),Jt=async(n,e,r=!0)=>{const t=[],o=[],a=(i,s=!1)=>i in e?!!e[i]:s&&"gfm"in e&&e.gfm||!1;return a("card")&&(t.push(`import VPCard from "${$}components/VPCard.js";`),o.push('app.component("VPCard", VPCard)')),a("chart")&&(t.push(`import ChartJS from "${$}components/ChartJS.js";`),o.push('app.component("ChartJS", ChartJS)')),a("codetabs")&&(t.push(`import CodeTabs from "${$}components/CodeTabs.js";`),o.push('app.component("CodeTabs", CodeTabs);'),r&&(t.push(`import { hasGlobalComponent } from "${j.resolve(Ne.resolve("vuepress-shared/client"))}";`,`import { CodeGroup, CodeGroupItem } from "${$}compact/index.js";`),o.push('if(!hasGlobalComponent("CodeGroup", app)) app.component("CodeGroup", CodeGroup);','if(!hasGlobalComponent("CodeGroupItem", app)) app.component("CodeGroupItem", CodeGroupItem);'))),a("container")&&t.push(`import "${$}styles/container/index.scss";`),a("demo")&&(t.push(`import CodeDemo from "${$}components/CodeDemo.js";`),o.push('app.component("CodeDemo", CodeDemo);')),a("echarts")&&(t.push(`import ECharts from "${$}components/ECharts.js";`),o.push('app.component("ECharts", ECharts);')),a("figure",!0)&&t.push(`import "${$}styles/figure.scss";`),a("flowchart")&&(t.push(`import FlowChart from "${$}components/FlowChart.js";`),o.push('app.component("FlowChart", FlowChart);')),a("footnote",!0)&&t.push(`import "${$}styles/footnote.scss";`),a("imgMark",!0)&&t.push(`import "${$}styles/image-mark.scss"`),a("mermaid")&&(t.push(`import Mermaid from "${$}components/Mermaid.js";`),o.push('app.component("Mermaid", Mermaid);')),a("presentation")&&(t.push(`import Presentation from "${$}components/Presentation.js";`),o.push('app.component("Presentation", Presentation);')),a("playground")&&(t.push(`import Playground from "${$}components/Playground.js";`),o.push('app.component("Playground", Playground);')),a("tabs")&&(t.push(`import Tabs from "${$}components/Tabs.js";`),o.push('app.component("Tabs", Tabs);')),a("tasklist",!0)&&t.push(`import "${$}styles/tasklist.scss";`),a("katex")&&t.push(`import "${j.resolve(Ne.resolve("katex/dist/katex.min.css"))}";`,`import "${$}styles/katex.scss";`),a("vuePlayground")&&(t.push('import { defineAsyncComponent } from "vue";'),o.push(`app.component("VuePlayground", defineAsyncComponent(() => import("${$}components/VuePlayground.js")));
    `)),a("mathjax")&&t.push('import "./mathjax.css";'),n.writeTemp("md-enhance/config.js",`import { defineClientConfig } from "@vuepress/client";
${t.join(`
`)}

export default defineClientConfig({
  enhance: ({ app }) => {
${o.map(i=>`    ${i}`).join(`
`)}
  },
});
`)},Wt=`mjx-container {
  overflow-x: auto;
}
`,Bt=async(n,e)=>{await n.writeTemp("md-enhance/mathjax.css",`${e.outputStyle()}
${Wt}`)},qt=async(n,e)=>{const r=["reveal","revealMarkdown",...e.map(t=>`reveal${t[0].toUpperCase()}${t.substring(1)}`)];await n.writeTemp("md-enhance/reveal.js",`import { ${r.join(", ")} } from "${$}reveal/index.js";

export const useReveal = () => [${r.map(t=>`${t}()`).join(", ")}];
`)},Ht=(n={gfm:!0},e=!0)=>r=>{e&&Mt(n),lt(r,L,"2.0.0-beta.61"),r.env.isDebug&&k.info("Options:",n);const t=(p,y=!1)=>p in n?!!n[p]:y&&"gfm"in n&&n.gfm||!1,o=pt({app:r,name:L,default:Ee,config:n.locales}),a=t("chart"),i=t("echarts"),s=t("flowchart"),l=t("footnote",!0),f=t("imgMark",!0),d=t("include"),c=t("tasklist",!0),b=t("mermaid"),u=t("presentation"),h=t("katex"),m=t("mathjax"),g=t("vuePlayground"),O=Et(r,n),M={macros:{"\\liiiint":"\\int\\!\\!\\!\\iiint","\\iiiint":"\\int\\!\\!\\!\\!\\iiint","\\idotsint":"\\int\\!\\cdots\\!\\int"},logger:(p,y,w,{filePathRelative:C})=>{p!=="newLineInDisplayMode"&&(p==="unicodeTextInMathMode"?k.warn(`Found unicode character ${w.text} inside tex${C?` in ${S.cyan(C)}`:""}. You should use ${S.magenta(`\\text{${w.text}}`)}`):k.warn(`${y}.${C?`
Found in ${S.cyan(C)}`:""}`))},...v(n.katex)?n.katex:{}},_=n.mathjax===!1?null:Ye(v(n.mathjax)?n.mathjax:{}),q=v(n.presentation)&&ct(n.presentation.plugins)?n.presentation.plugins:[];ot(r,{id:"hope"});let H=!1;return{name:L,define:()=>({MARKDOWN_ENHANCE_DELAY:n.delay||800,CODE_DEMO_OPTIONS:{...ce,...v(n.demo)?n.demo:{}},MERMAID_OPTIONS:v(n.mermaid)?n.mermaid:{},REVEAL_CONFIG:v(n.presentation)&&v(n.presentation.revealConfig)?n.presentation.revealConfig:{},VUE_PLAYGROUND_OPTIONS:v(n.vuePlayground)?z({},W,n.vuePlayground):W}),alias:p=>({"@mermaid":p.env.isDev&&mt()==="pnpm"&&te(p)==="vite"?"mermaid/dist/mermaid.esm.min.mjs":"mermaid"}),extendsBundlerOptions:(p,y)=>{var w,C,A;if(te(y)==="vite"){const I=(A=(C=(w=p.viteOptions)==null?void 0:w.build)==null?void 0:C.rollupOptions)==null?void 0:A.onwarn;dt(p,y,{build:{rollupOptions:{onwarn(Y,Ae){Y.message.includes("Use of eval")||I==null||I(Y,Ae)}}}})}ut(p,y,["fflate","vuepress-shared"]),h&&M.output!=="html"?G(p,y,ne):m&&(G(p,y,/^mjx-/),_!=null&&_.documentOptions.enableAssistiveMml&&G(p,y,ne)),a&&(F(p,y,"chart.js/auto/auto.mjs"),E(p,y,"chart.js")),i&&(F(p,y,"echarts"),E(p,y,"echarts")),s&&(F(p,y,"flowchart.ts"),E(p,y,"flowchart.ts")),b&&(oe(p,y,"mermaid"),E(p,y,"mermaid")),u&&(F(p,y,["reveal.js/dist/reveal.esm.js","reveal.js/plugin/markdown/markdown.esm.js",...q.map(I=>`reveal.js/plugin/${I}/${I}.esm.js`)]),E(p,y,"reveal.js")),g&&(oe(p,y,"@vue/repl"),E(p,y,"@vue/repl"),ft(p,y,I=>{I.module.set("exprContextCritical",!1),I.module.set("unknownContextCritical",!1)}))},extendsMarkdown:p=>{if(t("gfm")&&(p.options.linkify=!0),t("attrs")&&p.use(Le,v(n.attrs)?n.attrs:{}),t("align")&&p.use(Fe),t("container")&&p.use($e,o),t("imgLazyload")&&p.use(Ge),t("figure")&&p.use(Ue),f&&p.use(Ve,v(n.imgMark)?n.imgMark:{}),t("imgSize")&&p.use(Je),t("obsidianImgSize")&&p.use(We),t("sup")&&p.use(Ze),t("sub")&&p.use(Xe),l&&p.use(ze),t("mark")&&p.use(He),c&&p.use(et,[v(n.tasklist)?n.tasklist:{}]),(t("vPre")||e)&&p.use(Re),h?p.use(qe,M):m&&(p.use(Ke,_),p.use(y=>{const w=y.render.bind(y);y.render=(C,A)=>{const I=w(C,A);return _.reset(),I}})),d&&(p.use(Be,{currentPath:y=>y.filePath,...v(n.include)?n.include:{}}),e&&p.use(Gt,{currentPath:y=>y.filePath})),t("stylize")&&p.use(Qe,{config:n.stylize,localConfigGetter:y=>{var w;return((w=y.frontmatter)==null?void 0:w.stylize)||null}}),t("card")&&p.use(le),t("codetabs")&&(p.use(fe),e&&p.use(Tt)),t("tabs")&&p.use(Se),s&&(p.use(be),e&&p.use(Vt)),a&&p.use(pe),i&&p.use(ye),t("demo")&&(p.use(me),p.use(de),p.use(ue),e&&p.use(_t)),b&&p.use(Ce),u&&p.use(Ie),v(n.playground)){const{presets:y=[],config:w={}}=n.playground;y.forEach(C=>{C==="ts"?p.use(N,Pe(w.ts||{})):C==="vue"?p.use(N,Oe(w.vue||{})):v(C)&&p.use(N,C)})}g&&p.use(De)},extendsPage:(p,y)=>{O&&H&&Me(p,y),d&&p.deps.push(...p.markdownEnv.includedFiles)},onInitialized:p=>{H=!0,O&&p.pages.forEach(y=>Me(y,p))},onPrepared:p=>Promise.all([m?Bt(p,_):Promise.resolve(),qt(p,q)]).then(()=>{}),clientConfigFile:p=>Jt(p,n,e)}};export{ce as CODE_DEMO_DEFAULT_SETTING,W as DEFAULT_VUE_PLAYGROUND_OPTIONS,le as card,pe as chart,fe as codeTabs,ye as echarts,be as flowchart,Pe as getTSPlaygroundPreset,we as getURL,Oe as getVuePlaygroundPreset,$e as hint,Ee as markdownEnhanceLocales,Ht as mdEnhancePlugin,Ce as mermaid,me as normalDemo,N as playground,Ie as presentation,ue as reactDemo,Se as tabs,Re as vPre,de as vueDemo,De as vuePlayground};
//# sourceMappingURL=index.js.map
