import{r as registerInstance,h,H as Host}from"./index-da72c774.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();try{document.execCommand("copy")}catch(t){console.warn(t)}document.body.removeChild(t)};t.prototype.render=function(){return h(Host,{key:"4878b251d70673186652db1a139dfaa42484e0fe",onClick:this.copyContent},h("slot",{key:"ec847c0c6ed3e915df80d3bf12976f150053b228"}))};return t}();export{XCopy as x_copy};