import{aD as t,aE as e,aF as n,aL as c,aM as s,aN as o}from"./p-BTBbFFOR.js";var l=function(t,e,n,c){var s,o=arguments.length,l=o<3?e:null===c?c=Object.getOwnPropertyDescriptor(e,n):c;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,n,c);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(l=(o<3?s(l):o>3?s(e,n,l):s(e,n))||l);return o>3&&l&&Object.defineProperty(e,n,l),l};class a extends n{connectedCallback(){const t=this.host.tagName,e=a.connectedComponents.get(t);e?e.add(this.host):a.connectedComponents.set(t,new Set([this.host]))}disconnectedCallback(){const t=a.connectedComponents.get(this.host.tagName);if(t&&(t.delete(this.host),0===t.size)){const t=this.getStyleElement();t&&t.remove()}}componentWillLoad(){this.id=`${this.host.tagName}-GLOBAL-STYLE`;let t=this.getStyleElement();t||(t=document.createElement("style"),t.id=this.id,t.innerHTML=c.sanitize("function"==typeof this.style?this.style():this.style,s),o.nonce&&t.setAttribute("nonce",o.nonce),document.head.append(t))}constructor(t){super(),this.style=t}getStyleElement(){return document.head.querySelector(`style#${this.id}`)}}a.connectedComponents=new Map,l([t()],a.prototype,"host",void 0),l([e("connectedCallback")],a.prototype,"connectedCallback",null),l([e("disconnectedCallback")],a.prototype,"disconnectedCallback",null),l([e("componentWillLoad")],a.prototype,"componentWillLoad",null);export{a as C}