import{r as registerInstance,h,H as Host}from"./index-6191c26c.js";var XCopy=function(){function t(t){registerInstance(this,t);this.content=undefined}t.prototype.copyContent=function(){if(!navigator.clipboard){this.fallbackCopyTextToClipboard();return}navigator.clipboard.writeText(this.content).then((function(){}),(function(t){console.warn(t)}))};t.prototype.fallbackCopyTextToClipboard=function(){var t=document.createElement("textarea");t.value=this.content;t.style.top="0";t.style.left="0";t.style.position="fixed";document.body.appendChild(t);t.focus();t.select();if(navigator.clipboard){navigator.clipboard.writeText(this.content).catch((function(t){console.warn("Clipboard write failed",t)}))}else{console.warn("Clipboard API not supported")}document.body.removeChild(t)};t.prototype.render=function(){return h(Host,{key:"7dbd8d41982f60cc65609aef27901080eb4e4efa",onClick:this.copyContent},h("slot",{key:"aceeb5f0819540433bc2a3f2dc08e0124de37c77"}))};return t}();export{XCopy as x_copy};