import{h as e,defineComponent as t,ref as a,onMounted as i,onBeforeUnmount as s}from"vue";import{usePageFrontmatter as r}from"@vuepress/client";import{IconBase as l}from"@mr-hope/vuepress-shared/lib/client";const n=()=>e(l,{name:"loading"},(()=>["0s","-0.333s","-0.667s"].map((t=>e("circle",{cx:50,cy:50,r:0,fill:"none",stroke:"currentColor",strokeWidth:"2"},[e("animate",{attributeName:"r",repeatCount:"indefinite",dur:"1s",values:"0;40",keyTimes:"0;1",keySplines:"0 0.2 0.8 1",calcMode:"spline",begin:t}),e("animate",{attributeName:"opacity",repeatCount:"indefinite",dur:"1s",values:"1;0",keyTimes:"0;1",keySplines:"0.2 0 0.8 1",calcMode:"spline",begin:t})])))));var o=t({name:"PresentationViewer",props:{id:{type:String,required:!0},theme:{type:String,default:"auto"}},setup(t){const l=r(),o=a(""),u=a(!1),m=a(),p=a();let d;return i((()=>{if(p.value){o.value=decodeURIComponent(m.value?.dataset.code||""),p.value.setAttribute("id",t.id),p.value.setAttribute("data-theme",t.theme);const e=[new Promise((e=>setTimeout(e,MARKDOWN_ENHANCE_DELAY))),import("reveal.js/dist/reveal.esm.js")];e.push(import("reveal.js/plugin/markdown/markdown.esm.js")),REVEAL_PLUGIN_HIGHLIGHT&&e.push(import("reveal.js/plugin/highlight/highlight.esm.js")),REVEAL_PLUGIN_MATH&&e.push(import("reveal.js/plugin/math/math.esm.js")),REVEAL_PLUGIN_SEARCH&&e.push(import("reveal.js/plugin/search/search.esm.js")),REVEAL_PLUGIN_NOTES&&e.push(import("reveal.js/plugin/notes/notes.esm.js")),REVEAL_PLUGIN_ZOOM&&e.push(import("reveal.js/plugin/zoom/zoom.esm.js")),Promise.all(e).then((([,e,...t])=>{d=new e.default(p.value,{plugins:t.map((e=>e.default))}),d.initialize({backgroundTransition:"slide",hash:"Slide"===l.value.layout,mouseWheel:"Slide"===l.value.layout,transition:"slide",slideNumber:!0,...REVEAL_CONFIG,...l.value.reveal||{},embedded:"Slide"!==l.value.layout}).then((()=>{u.value=!1,d.configure({backgroundTransition:"slide"})}))}))}})),s((()=>{d?.removeEventListeners(),d?.unloadSlide(p.value)})),()=>e("div",{ref:m,class:{"md-enhance-presentation":!0,loading:u.value}},[u.value?e(n):null,e("div",{ref:p,class:["reveal","reveal-viewport"]},e("div",{class:"slides",style:{display:u.value?"none":"block"},innerHTML:`<section data-markdown data-separator="^\\r?\\n---\\r?\\n$" data-separator-vertical="^\\r?\\n--\\r?\\n$"><script type="text/template">${o.value}<\/script></section>`}))])}});export{o as default};
//# sourceMappingURL=Presentation.js.map
