(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.index={},t.Vue))})(this,function(t,e){"use strict";const c={innerHTML:{type:String,default:""},cssSheet:{type:String,default:""}},f="G",o=e.defineComponent({name:`${f}ShadowDom`,props:c,setup(n,{slots:d}){const l=e.ref(),i=e.ref(),a=e.ref(),u=()=>{var r;a.value&&(n.innerHTML?a.value.innerHTML=n.innerHTML:(a.value.innerHTML="",d.default&&d.default().forEach(S=>{const s=document.createElement("div");e.render(S,s),a.value.appendChild(s.children[0])})),(r=i.value)==null||r.replaceSync(n.cssSheet),a.value.adoptedStyleSheets=[i.value])};return e.watch([()=>n.innerHTML,()=>n.cssSheet],u),e.onMounted(()=>{i.value=new CSSStyleSheet,l.value&&i.value&&(a.value=l.value.attachShadow({mode:"open"}),u())}),()=>e.createVNode("div",{ref:l},null)}});o.install=function(n,d){n.component(d||o.name,o)};const h={title:"Shadow DOM",category:"布局",status:"100%",install(n){n.component(o.name,o)}};t.ShadowDom=o,t.default=h,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
