var a=(c,e)=>()=>(e||c((e={exports:{}}).exports,e),e.exports);var n=a((r,t)=>{class i{constructor(){this.copiedTimeout=null,this.init()}init(){document.addEventListener("click",e=>{const o=e.target.closest(".isbn-copy-btn");o&&this.handleCopy(o)}),document.querySelectorAll(".isbn-copy-btn").length}async handleCopy(e){const o=e.dataset.isbn;if(!!o)try{navigator.clipboard&&navigator.clipboard.writeText?await navigator.clipboard.writeText(o):this.copyToClipboardFallback(o),this.showCopySuccess(e)}catch{this.showCopyError(e)}}copyToClipboardFallback(e){const o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.select(),o.setSelectionRange(0,e.length);const s=document.execCommand("copy");if(document.body.removeChild(o),!s)throw new Error("Fallback copy failed")}showCopySuccess(e){this.copiedTimeout&&clearTimeout(this.copiedTimeout),e.classList.add("copied"),this.copiedTimeout=setTimeout(()=>{e.classList.remove("copied")},2e3)}showCopyError(e){e.style.color="#dc3545",setTimeout(()=>{e.style.color=""},2e3)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{new i}):new i;typeof t<"u"&&t.exports&&(t.exports=i)});export default n();