(function () {
  const tokenCopyBtn = document.querySelector("[data-token-copy]");
  if (!tokenCopyBtn) {
    return;
  }

  tokenCopyBtn.addEventListener("click", () => {
    const valueEl = document.querySelector("[data-token-value]");
    if (!valueEl) {
      return;
    }
    window.Warpbox.copyText(valueEl.textContent.trim(), tokenCopyBtn, "Copied");
  });
})();
