(() => {
const setup = () => {
let tbEl = document.querySelector("[data-tauri-decoration-tb]");
if (!tbEl) {
console.log(
"DECORATION: Element with data-tauri-decoration-tb not found. Creating one.",
);
tbEl = document.createElement("div");
tbEl.setAttribute("data-tauri-decoration-tb", "");
tbEl.setAttribute("role", "group");
tbEl.setAttribute("lang", "en");
tbEl.setAttribute("aria-label", "Window controls");
tbEl.style.top = 0;
tbEl.style.left = 0;
tbEl.style.zIndex = 100;
tbEl.style.width = "100%";
tbEl.style.height = "32px";
tbEl.style.display = "flex";
tbEl.style.position = "fixed";
tbEl.style.alignItems = "end";
tbEl.style.justifyContent = "end";
tbEl.style.backgroundColor = "transparent";
const drag = document.createElement("div");
drag.style.width = "100%";
drag.style.height = "100%";
drag.style.background = "transparent";
drag.setAttribute("data-tauri-drag-region", "");
tbEl.appendChild(drag);
document.body.prepend(tbEl);
}
};
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", setup);
} else {
setup();
}
})();