import{usePageFrontmatter as v}from"@vuepress/client";import{defineComponent as f,ref as n,onMounted as g,onBeforeUnmount as h,h as r}from"vue";import{atou as y,LoadingIcon as w}from"vuepress-shared/client";import{useReveal as b}from"@temp/md-enhance/reveal";import"../styles/slides/index.scss";import"../styles/slides/theme/fonts/league-gothic/league-gothic.css";import"../styles/slides/theme/fonts/source-sans-pro/source-sans-pro.css";var A=f({name:"Presentation",props:{id:{type:String,required:!0},code:{type:String,required:!0},theme:{type:String,default:"auto"}},setup(i){const a=v(),l=n(""),s=n(!0),u=n();let t=null;const d=async e=>{const m=[new Promise(o=>setTimeout(o,MARKDOWN_ENHANCE_DELAY)),...b()],[,p,...c]=await Promise.all(m);t=new p.default(e,{plugins:c.map(({default:o})=>o)}),await t.initialize({backgroundTransition:"slide",hash:a.value.layout==="Slide",mouseWheel:a.value.layout==="Slide",transition:"slide",slideNumber:!0,...REVEAL_CONFIG,...a.value.reveal||{},embedded:a.value.layout!=="Slide"}),t.configure({backgroundTransition:"slide"})};return g(()=>{const e=u.value;e&&(l.value=y(i.code),e.setAttribute("id",i.id),e.setAttribute("data-theme",i.theme),d(e).then(()=>{s.value=!1}))}),h(()=>{t==null||t.destroy()}),()=>r("div",{class:"presentation-wrapper"},[r("div",{ref:u,class:["reveal","reveal-viewport"]},r("div",{class:"slides",innerHTML:`<section data-markdown data-separator="^\\r?\\n---\\r?\\n$" data-separator-vertical="^\\r?\\n--\\r?\\n$"><script type="text/template">${l.value}<\/script></section>`})),s.value?r(w,{class:"reveal-loading",height:400}):null])}});export{A as default};
//# sourceMappingURL=Presentation.js.map
