import{C as p}from"./clipboard-14e41563.js";const l=o=>{const r=(o==null?void 0:o.appendToBody)===void 0?!0:o.appendToBody;return{toClipboard(c,t){return new Promise((i,a)=>{const e=document.createElement("button"),d=new p(e,{text:()=>c,action:()=>"copy",container:t!==void 0?t:document.body});d.on("success",n=>{d.destroy(),i(n)}),d.on("error",n=>{d.destroy(),a(n)}),r&&document.body.appendChild(e),e.click(),r&&document.body.removeChild(e)})}}};export{l as c};
