import{g as t}from"./p-17d063cf.js";function n(n="",o=!0){return(s,e)=>{"__slots"in s||(s.__slots={}),"slot"in s||(s.__slot=null);const{componentDidLoad:l,disconnectedCallback:a}=s;function c(){const l=t(this),a=function(t,n){const o=n?`slot[name="${n}"]`:"slot:not([name])";return t.shadowRoot?t.shadowRoot.querySelector(o):t.querySelector(o)}(l,n),c=s[e].bind(this,a),i={slot:a,host:l,slotName:n,handler:c};a?(""==n?s.__slot=i:s.__slots[n]=i,a.addEventListener("slotChange",c),o&&c()):console.error("The requested slot was not found")}s.componentDidLoad=function(){return c.apply(this),l&&l.apply(this)},s.disconnectedCallback=function(){return s.__slot&&(s.__slot.slot.removeEventListener("slotChange",s.__slot.handler),s.__slot=null),Object.values(s.__slots).forEach((({slotName:t,slot:n,handler:o})=>{n.removeEventListener("slotChange",o),delete s.__slots[t]})),a&&a.apply(this)}}}export{n as S}