From 9fb9e14d06fb2b8a64b3d185e90c95609c78e439 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Sun, 15 Feb 2026 01:01:51 -0500 Subject: [PATCH] Finished minimization for BM windows --- dist/BlueMarble-For-GreasyFork.user.css | 101 ++++ dist/BlueMarble-For-GreasyFork.user.js | 301 +++-------- dist/BlueMarble-Standalone.user.js | 4 +- dist/BlueMarble.user.css | 2 +- dist/BlueMarble.user.js | 4 +- docs/README.md | 2 +- package-lock.json | 4 +- package.json | 2 +- src/BlueMarble.meta.js | 2 +- src/Overlay.js | 4 +- src/main.js | 636 +++++++++++++----------- src/overlay.css | 144 ++++++ src/templateManager.js | 3 +- 13 files changed, 680 insertions(+), 529 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 9c8bbbd..566bc3f 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -1,4 +1,105 @@ /* src/overlay.css */ +.bm-window { + position: fixed; + background-color: rgba(21, 48, 99, 0.9); + color: white; + padding: 10px; + border-radius: 8px; + z-index: 9000; + transition: all 0.3s ease, transform 0s; + max-width: 300px; + width: auto; + font-family: + "Roboto Mono", + "Courier New", + "Monaco", + "DejaVu Sans Mono", + monospace, + "Arial"; + letter-spacing: 0.05em; +} +.bm-dragbar { + display: flex; + align-items: center; + flex-wrap: nowrap; + justify-content: space-between; + gap: 0.5ch; + background: url('data:image/svg+xml;utf8,') repeat; + cursor: grab; + width: 100%; + height: fit-content; +} +.bm-dragbar.bm-dragging { + cursor: grabbing; +} +.bm-window:has(.bm-dragbar.bm-dragging) { + pointer-events: none; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +.bm-dragbar.bm-dragging { + pointer-events: auto; +} +.bm-favicon { + display: inline-block; + height: 2.5em; + margin-right: 1ch; + vertical-align: middle; +} +.bm-window h1 { + display: inline-block; + font-size: x-large; + font-weight: bold; + vertical-align: middle; +} +.bm-dragbar h1 { + font-size: 1.2em; + margin-left: 0.5ch; + user-select: none; + text-shadow: + 3px 0px rgba(21, 48, 99, 0.5), + -3px 0px rgba(21, 48, 99, 0.5), + 0px 3px rgba(21, 48, 99, 0.5), + 0px -3px rgba(21, 48, 99, 0.5), + 3px 3px rgba(21, 48, 99, 0.5), + -3px 3px rgba(21, 48, 99, 0.5), + 3px -3px rgba(21, 48, 99, 0.5), + -3px -3px rgba(21, 48, 99, 0.5); +} +.bm-container { + margin: 0.5em 0; +} +.bm-window button { + background-color: #144eb9; + border-radius: 1em; + padding: 0 0.75ch; +} +.bm-window button:hover, +.bm-window button:focus-visible { + background-color: #1061e5; +} +.bm-window button:active .bm-window button:disabled { + background-color: #2e97ff; +} +.bm-window button:disabled, +.bm-window button:disabled { + text-decoration: line-through; +} +.bm-button-circle { + border: white 1px solid; + height: 1.5em; + width: 1.5em; + margin-top: 2px; + text-align: center; + line-height: 1em; + padding: 0 !important; +} +.bm-window-content { + overflow: hidden; + transition: height 300ms cubic-bezier(.4, 0, .2, 1); +} #bm-overlay, #bm-overlay-telemetry { position: fixed; diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index b27bf7d..e88bf2b 100644 --- a/dist/BlueMarble-For-GreasyFork.user.js +++ b/dist/BlueMarble-For-GreasyFork.user.js @@ -2,7 +2,7 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.88.95 +// @version 0.88.122 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine @@ -169,6 +169,52 @@ callback(this, small); return this; } + /** Adds a `details` to the overlay. + * This `details` element will have properties shared between all `details` elements in the overlay. + * You can override the shared properties by using a callback. + * @param {Object.} [additionalProperties={}] - The DOM properties of the `details` that are NOT shared between all overlay `details` elements. These should be camelCase. + * @param {function(Overlay, HTMLParagraphElement):void} [callback=()=>{}] - Additional JS modification to the `details`. + * @returns {Overlay} Overlay class instance (this) + * @since 0.88.96 + * @example + * // Assume all
elements have a shared class (e.g. {'className': 'bar'}) + * overlay.addDetails({'id': 'foo'}).buildOverlay(document.body); + * // Output: + * // (Assume already exists in the webpage) + * + *
+ * + */ + addDetails(additionalProperties = {}, callback = () => { + }) { + const properties = {}; + const details = __privateMethod(this, _Overlay_instances, createElement_fn).call(this, "details", properties, additionalProperties); + callback(this, details); + return this; + } + /** Adds a `summary` to the overlay. + * This `summary` element will have properties shared between all `summary` elements in the overlay. + * You can override the shared properties by using a callback. + * @param {Object.} [additionalProperties={}] - The DOM properties of the `summary` that are NOT shared between all overlay `summary` elements. These should be camelCase. + * @param {function(Overlay, HTMLParagraphElement):void} [callback=()=>{}] - Additional JS modification to the `summary`. + * @returns {Overlay} Overlay class instance (this) + * @since 0.88.96 + * @example + * // Assume all elements have a shared class (e.g. {'className': 'bar'}) + * overlay.addSummary({'id': 'foo', 'textContent': 'Foobar.'}).buildOverlay(document.body); + * // Output: + * // (Assume already exists in the webpage) + * + * Foobar. + * + */ + addSummary(additionalProperties = {}, callback = () => { + }) { + const properties = {}; + const summary = __privateMethod(this, _Overlay_instances, createElement_fn).call(this, "summary", properties, additionalProperties); + callback(this, summary); + return this; + } /** Adds a `img` to the overlay. * This `img` element will have properties shared between all `img` elements in the overlay. * You can override the shared properties by using a callback. @@ -619,10 +665,10 @@ this.currentParent = element; } for (const [property, value] of Object.entries(properties)) { - element[property] = value; + element[property != "class" ? property : "className"] = value; } for (const [property, value] of Object.entries(additionalProperties)) { - element[property] = value; + element[property != "class" ? property : "className"] = value; } return element; }; @@ -1112,6 +1158,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); const matchingTileBlobs = matchingTiles.map((tile) => { const coords2 = tile.split(","); return { + instance: template, bitmap: template.chunked[tile], chunked32: template.chunked32?.[tile], tileCoords: [coords2[0], coords2[1]], @@ -1154,11 +1201,10 @@ Version: ${this.version}`); for (const template of templatesToDraw) { console.log(`Template:`); console.log(template); + let templateBeforeFilter32 = template.chunked32; const coordXtoDrawAt = Number(template.pixelCoords[0]) * this.drawMult; const coordYtoDrawAt = Number(template.pixelCoords[1]) * this.drawMult; context.drawImage(template.bitmap, coordXtoDrawAt, coordYtoDrawAt); - let templateBeforeFilter32 = template.chunked32; - console.log("TemplateBeforeFilter32: ", templateBeforeFilter32); if (!templateBeforeFilter32) { const templateBeforeFilter = context.getImageData(coordXtoDrawAt, coordYtoDrawAt, template.bitmap.width, template.bitmap.height); templateBeforeFilter32 = new Uint32Array(templateBeforeFilter.data.buffer); @@ -1175,6 +1221,7 @@ Version: ${this.version}`); } console.log(`Finished calculating correct pixels for the tile ${tileCoords} in ${(Date.now() - timer) / 1e3} seconds! There are ${pixelsCorrectTotal} correct pixels.`); + template.instance.pixelCount["correct"] = pixelsCorrect; } return await canvas.convertToBlob({ type: "image/png" }); } @@ -1645,225 +1692,37 @@ Time Since Blink: ${String(Math.floor(elapsed / 6e4)).padStart(2, "0")}:${String observer.observe(document.body, { childList: true, subtree: true }); } function buildOverlayMain() { - let isMinimized = false; - overlayMain.addDiv({ "id": "bm-overlay", "style": "top: 10px; right: 75px;" }).addDiv({ "id": "bm-contain-header" }).addDiv({ "id": "bm-bar-drag" }).buildElement().addImg( - { "alt": "Blue Marble Icon - Click to minimize/maximize", "src": "https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png", "style": "cursor: pointer;" }, - (instance, img) => { - img.addEventListener("click", () => { - isMinimized = !isMinimized; - const overlay = document.querySelector("#bm-overlay"); - const header = document.querySelector("#bm-contain-header"); - const dragBar = document.querySelector("#bm-bar-drag"); - const coordsContainer = document.querySelector("#bm-contain-coords"); - const coordsButton = document.querySelector("#bm-button-coords"); - const createButton = document.querySelector("#bm-button-create"); - const enableButton = document.querySelector("#bm-button-enable"); - const disableButton = document.querySelector("#bm-button-disable"); - const coordInputs = document.querySelectorAll("#bm-contain-coords input"); - if (!isMinimized) { - overlay.style.width = "auto"; - overlay.style.maxWidth = "300px"; - overlay.style.minWidth = "200px"; - overlay.style.padding = "10px"; - } - const elementsToToggle = [ - "#bm-overlay h1", - // Main title "Blue Marble" - "#bm-contain-userinfo", - // User information section (username, droplets, level) - "#bm-overlay hr", - // Visual separator lines - "#bm-contain-automation > *:not(#bm-contain-coords)", - // Automation section excluding coordinates - "#bm-input-file-template", - // Template file upload interface - "#bm-contain-buttons-action", - // Action buttons container - `#${instance.outputStatusId}` - // Status log textarea for user feedback - ]; - elementsToToggle.forEach((selector) => { - const elements = document.querySelectorAll(selector); - elements.forEach((element) => { - element.style.display = isMinimized ? "none" : ""; - }); + overlayMain.addDiv({ "class": "bm-window", "style": "top: 10px; right: 75px;" }).addDiv({ "class": "bm-dragbar" }).addDiv().addButton({ "class": "bm-button-circle", "textContent": "\u25BC" }, (instance, button) => { + button.onclick = () => { + const window2 = button.closest(".bm-window"); + const dragbar = button.closest(".bm-dragbar"); + const header = window2.querySelector("h1"); + const windowContent = window2.querySelector(".bm-window-content"); + if (button.textContent == "\u25BC") { + const dragbarHeader1 = header.cloneNode(true); + button.parentNode.appendChild(dragbarHeader1); + windowContent.style.height = windowContent.scrollHeight + "px"; + window2.style.width = window2.scrollWidth + "px"; + windowContent.style.height = "0"; + windowContent.addEventListener("transitionend", function handler() { + windowContent.style.display = "none"; + windowContent.removeEventListener("transitionend", handler); + }); + } else { + const dragbarHeader1 = dragbar.querySelector("h1"); + dragbarHeader1.remove(); + windowContent.style.display = ""; + windowContent.style.height = "0"; + window2.style.width = ""; + windowContent.style.height = windowContent.scrollHeight + "px"; + windowContent.addEventListener("transitionend", function handler() { + windowContent.style.height = ""; + windowContent.removeEventListener("transitionend", handler); }); - if (isMinimized) { - if (coordsContainer) { - coordsContainer.style.display = "none"; - } - if (coordsButton) { - coordsButton.style.display = "none"; - } - if (createButton) { - createButton.style.display = "none"; - } - if (enableButton) { - enableButton.style.display = "none"; - } - if (disableButton) { - disableButton.style.display = "none"; - } - coordInputs.forEach((input) => { - input.style.display = "none"; - }); - overlay.style.width = "60px"; - overlay.style.height = "76px"; - overlay.style.maxWidth = "60px"; - overlay.style.minWidth = "60px"; - overlay.style.padding = "8px"; - img.style.marginLeft = "3px"; - header.style.textAlign = "center"; - header.style.margin = "0"; - header.style.marginBottom = "0"; - if (dragBar) { - dragBar.style.display = ""; - dragBar.style.marginBottom = "0.25em"; - } - } else { - if (coordsContainer) { - coordsContainer.style.display = ""; - coordsContainer.style.flexDirection = ""; - coordsContainer.style.justifyContent = ""; - coordsContainer.style.alignItems = ""; - coordsContainer.style.gap = ""; - coordsContainer.style.textAlign = ""; - coordsContainer.style.margin = ""; - } - if (coordsButton) { - coordsButton.style.display = ""; - } - if (createButton) { - createButton.style.display = ""; - createButton.style.marginTop = ""; - } - if (enableButton) { - enableButton.style.display = ""; - enableButton.style.marginTop = ""; - } - if (disableButton) { - disableButton.style.display = ""; - disableButton.style.marginTop = ""; - } - coordInputs.forEach((input) => { - input.style.display = ""; - }); - img.style.marginLeft = ""; - overlay.style.padding = "10px"; - header.style.textAlign = ""; - header.style.margin = ""; - header.style.marginBottom = ""; - if (dragBar) { - dragBar.style.marginBottom = "0.5em"; - } - overlay.style.width = ""; - overlay.style.height = ""; - } - img.alt = isMinimized ? "Blue Marble Icon - Minimized (Click to maximize)" : "Blue Marble Icon - Maximized (Click to minimize)"; - }); - } - ).buildElement().addHeader(1, { "textContent": name }).buildElement().buildElement().addHr().buildElement().addDiv({ "id": "bm-contain-userinfo" }).addP({ "id": "bm-user-droplets", "textContent": "Droplets:" }).buildElement().addP({ "id": "bm-user-nextlevel", "textContent": "Next level in..." }).buildElement().buildElement().addHr().buildElement().addDiv({ "id": "bm-contain-automation" }).addDiv({ "id": "bm-contain-coords" }).addButton( - { "id": "bm-button-coords", "className": "bm-help", "style": "margin-top: 0;", "innerHTML": '' }, - (instance, button) => { - button.onclick = () => { - const coords2 = instance.apiManager?.coordsTilePixel; - if (!coords2?.[0]) { - instance.handleDisplayError("Coordinates are malformed! Did you try clicking on the canvas first?"); - return; - } - instance.updateInnerHTML("bm-input-tx", coords2?.[0] || ""); - instance.updateInnerHTML("bm-input-ty", coords2?.[1] || ""); - instance.updateInnerHTML("bm-input-px", coords2?.[2] || ""); - instance.updateInnerHTML("bm-input-py", coords2?.[3] || ""); - }; - } - ).buildElement().addInput({ "type": "number", "id": "bm-input-tx", "placeholder": "Tl X", "min": 0, "max": 2047, "step": 1, "required": true }, (instance, input) => { - input.addEventListener("paste", (event) => { - let splitText = (event.clipboardData || window.clipboardData).getData("text").split(" ").filter((n) => n).map(Number).filter((n) => !isNaN(n)); - if (splitText.length !== 4) { - return; } - let coords2 = selectAllCoordinateInputs(document); - for (let i = 0; i < coords2.length; i++) { - coords2[i].value = splitText[i]; - } - event.preventDefault(); - }); - const handler = () => persistCoords(); - input.addEventListener("input", handler); - input.addEventListener("change", handler); - }).buildElement().addInput({ "type": "number", "id": "bm-input-ty", "placeholder": "Tl Y", "min": 0, "max": 2047, "step": 1, "required": true }, (instance, input) => { - const handler = () => persistCoords(); - input.addEventListener("input", handler); - input.addEventListener("change", handler); - }).buildElement().addInput({ "type": "number", "id": "bm-input-px", "placeholder": "Px X", "min": 0, "max": 2047, "step": 1, "required": true }, (instance, input) => { - const handler = () => persistCoords(); - input.addEventListener("input", handler); - input.addEventListener("change", handler); - }).buildElement().addInput({ "type": "number", "id": "bm-input-py", "placeholder": "Px Y", "min": 0, "max": 2047, "step": 1, "required": true }, (instance, input) => { - const handler = () => persistCoords(); - input.addEventListener("input", handler); - input.addEventListener("change", handler); - }).buildElement().buildElement().addInputFile({ "id": "bm-input-file-template", "textContent": "Upload Template", "accept": "image/png, image/jpeg, image/webp, image/bmp, image/gif" }).buildElement().addDiv({ "id": "bm-contain-buttons-template" }).addButton({ "id": "bm-button-enable", "textContent": "Enable" }, (instance, button) => { - button.onclick = () => { - instance.apiManager?.templateManager?.setTemplatesShouldBeDrawn(true); - instance.handleDisplayStatus(`Enabled templates!`); + button.textContent = button.textContent == "\u25BC" ? "\u25B6" : "\u25BC"; }; - }).buildElement().addButton({ "id": "bm-button-create", "textContent": "Create" }, (instance, button) => { - button.onclick = () => { - const input = document.querySelector("#bm-input-file-template"); - const coordTlX = document.querySelector("#bm-input-tx"); - if (!coordTlX.checkValidity()) { - coordTlX.reportValidity(); - instance.handleDisplayError("Coordinates are malformed! Did you try clicking on the canvas first?"); - return; - } - const coordTlY = document.querySelector("#bm-input-ty"); - if (!coordTlY.checkValidity()) { - coordTlY.reportValidity(); - instance.handleDisplayError("Coordinates are malformed! Did you try clicking on the canvas first?"); - return; - } - const coordPxX = document.querySelector("#bm-input-px"); - if (!coordPxX.checkValidity()) { - coordPxX.reportValidity(); - instance.handleDisplayError("Coordinates are malformed! Did you try clicking on the canvas first?"); - return; - } - const coordPxY = document.querySelector("#bm-input-py"); - if (!coordPxY.checkValidity()) { - coordPxY.reportValidity(); - instance.handleDisplayError("Coordinates are malformed! Did you try clicking on the canvas first?"); - return; - } - if (!input?.files[0]) { - instance.handleDisplayError(`No file selected!`); - return; - } - templateManager.createTemplate(input.files[0], input.files[0]?.name.replace(/\.[^/.]+$/, ""), [Number(coordTlX.value), Number(coordTlY.value), Number(coordPxX.value), Number(coordPxY.value)]); - instance.handleDisplayStatus(`Drew to canvas!`); - }; - }).buildElement().addButton({ "id": "bm-button-disable", "textContent": "Disable" }, (instance, button) => { - button.onclick = () => { - instance.apiManager?.templateManager?.setTemplatesShouldBeDrawn(false); - instance.handleDisplayStatus(`Disabled templates!`); - }; - }).buildElement().buildElement().addTextarea({ "id": overlayMain.outputStatusId, "placeholder": `Status: Sleeping... -Version: ${version}`, "readOnly": true }).buildElement().addDiv({ "id": "bm-contain-buttons-action" }).addDiv().addButton( - { "id": "bm-button-convert", "className": "bm-help", "innerHTML": "\u{1F3A8}", "title": "Template Color Converter" }, - (instance, button) => { - button.addEventListener("click", () => { - window.open("https://pepoafonso.github.io/color_converter_wplace/", "_blank", "noopener noreferrer"); - }); - } - ).buildElement().addButton( - { "id": "bm-button-website", "className": "bm-help", "innerHTML": "\u{1F310}", "title": "Official Blue Marble Website" }, - (instance, button) => { - button.addEventListener("click", () => { - window.open("https://bluemarble.lol/", "_blank", "noopener noreferrer"); - }); - } - ).buildElement().buildElement().addSmall({ "textContent": "Made by SwingTheVine", "style": "margin-top: auto;" }).buildElement().buildElement().buildElement().buildOverlay(document.body); + }).buildElement().buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container" }).addImg({ "class": "bm-favicon", "src": "https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png" }).buildElement().addHeader(1, { "textContent": name }).buildElement().buildElement().addHr().buildElement().buildElement().buildOverlay(document.body); } function buildTelemetryOverlay(overlay) { overlay.addDiv({ "id": "bm-overlay-telemetry", style: "top: 0px; left: 0px; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; z-index: 9999;" }).addDiv({ "id": "bm-contain-all-telemetry", style: "display: flex; flex-direction: column; align-items: center;" }).addDiv({ "id": "bm-contain-header-telemetry", style: "margin-top: 10%;" }).addHeader(1, { "textContent": `${name} Telemetry` }).buildElement().buildElement().addDiv({ "id": "bm-contain-telemetry", style: "max-width: 50%; overflow-y: auto; max-height: 80vh;" }).addHr().buildElement().addBr().buildElement().addDiv({ "style": "width: fit-content; margin: auto; text-align: center;" }).addButton({ "id": "bm-button-telemetry-more", "textContent": "More Information" }, (instance, button) => { diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index fda65a8..921c408 100644 --- a/dist/BlueMarble-Standalone.user.js +++ b/dist/BlueMarble-Standalone.user.js @@ -2,7 +2,7 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.88.95 +// @version 0.88.122 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine @@ -27,4 +27,4 @@ // License --> https://www.mozilla.org/en-US/MPL/2.0/ // Donate --> https://ko-fi.com/swingthevine -(()=>{var e,t,n=e=>{throw TypeError(e)},i=(e,t,i)=>t.has(e)?n("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),o=(e,t,i)=>(((e,t)=>{t.has(e)||n("Cannot access private method")})(e,t),i),s=class{constructor(t,n){i(this,e),this.name=t,this.version=n,this.t=null,this.i="bm-o",this.o=null,this.l=null,this.m=[]}u(e){this.t=e}h(){return this.m.length>0&&(this.l=this.m.pop()),this}p(e){e?.appendChild(this.o),this.o=null,this.l=null,this.m=[]}v(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"div",{},n)),this}S(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"p",{},n)),this}$(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"small",{},n)),this}M(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"img",{},n)),this}T(n,i={},s=()=>{}){return s(this,o(this,e,t).call(this,"h"+n,{},i)),this}D(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"hr",{},n)),this}k(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"br",{},n)),this}O(n={},i=()=>{}){const s=o(this,e,t).call(this,"label",{textContent:n.textContent??""});delete n.textContent;const r=o(this,e,t).call(this,"input",{type:"checkbox"},n);return s.insertBefore(r,s.firstChild),this.h(),i(this,s,r),this}C(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"button",{},n)),this}N(n={},i=()=>{}){const s=n.title??n.textContent??"Help: No info";delete n.textContent,n.title=`Help: ${s}`;const r={textContent:"?",className:"bm-D",onclick:()=>{this.B(this.i,s)}};return i(this,o(this,e,t).call(this,"button",r,n)),this}I(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"input",{},n)),this}L(n={},i=()=>{}){const s=n.textContent??"";delete n.textContent;const r=o(this,e,t).call(this,"div"),a=o(this,e,t).call(this,"input",{type:"file",style:"display: none !important; visibility: hidden !important; position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; opacity: 0 !important;"},n);this.h();const l=o(this,e,t).call(this,"button",{textContent:s});return this.h(),this.h(),a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),l.addEventListener("click",()=>{a.click()}),a.addEventListener("change",()=>{l.style.maxWidth=`${l.offsetWidth}px`,a.files.length>0?l.textContent=a.files[0].name:l.textContent=s}),i(this,r,a,l),this}P(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"textarea",{},n)),this}B(e,t,n=!1){const i=document.getElementById(e.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=t:n?i.textContent=t:i.innerHTML=t)}G(e,t){let n,i=!1,o=0,s=null,r=0,a=0,l=0,m=0;if(e=document.querySelector("#"==e?.[0]?e:"#"+e),t=document.querySelector("#"==t?.[0]?t:"#"+t),!e||!t)return void this.W(`Can not drag! ${e?"":"moveMe"} ${e||t?"":"and "}${t?"":"iMoveThings "}was not found!`);const c=()=>{if(i){const t=Math.abs(r-l),n=Math.abs(a-m);(t>.5||n>.5)&&(r=l,a=m,e.style.transform=`translate(${r}px, ${a}px)`,e.style.left="0px",e.style.top="0px",e.style.right=""),s=requestAnimationFrame(c)}};let u=null;const d=(d,h)=>{i=!0,u=e.getBoundingClientRect(),n=d-u.left,o=h-u.top;const p=window.getComputedStyle(e).transform;if(p&&"none"!==p){const e=new DOMMatrix(p);r=e.m41,a=e.m42}else r=u.left,a=u.top;l=r,m=a,document.body.style.userSelect="none",t.classList.add("dragging"),s&&cancelAnimationFrame(s),c()},h=()=>{i=!1,s&&(cancelAnimationFrame(s),s=null),document.body.style.userSelect="",t.classList.remove("dragging")};t.addEventListener("mousedown",function(e){e.preventDefault(),d(e.clientX,e.clientY)}),t.addEventListener("touchstart",function(e){const t=e?.touches?.[0];t&&(d(t.clientX,t.clientY),e.preventDefault())},{passive:!1}),document.addEventListener("mousemove",function(e){i&&u&&(l=e.clientX-n,m=e.clientY-o)},{passive:!0}),document.addEventListener("touchmove",function(e){if(i&&u){const t=e?.touches?.[0];if(!t)return;l=t.clientX-n,m=t.clientY-o,e.preventDefault()}},{passive:!1}),document.addEventListener("mouseup",h),document.addEventListener("touchend",h),document.addEventListener("touchcancel",h)}_(e){(0,console.info)(`${this.name}: ${e}`),this.B(this.i,"Status: "+e,!0)}W(e){(0,console.error)(`${this.name}: ${e}`),this.B(this.i,"Error: "+e,!0)}};function r(...e){(0,console.error)(...e)}function a(e,t){if(0===e)return t[0];let n="";const i=t.length;for(;e>0;)n=t[e%i]+n,e=Math.floor(e/i);return n}function l(e){let t="";for(let n=0;n>>24==0?0:o.get(t)??-2;const r=s.get(i);s.set(i,r?r+1:1)}return console.log(s),s},d=new WeakSet,h=async function(){GM.setValue("bmTemplates",JSON.stringify(this.K))},p=async function(e){console.log("Parsing BlueMarble...");const t=e.templates;if(console.log(`BlueMarble length: ${Object.keys(t).length}`),Object.keys(t).length>0)for(const e in t){const n=e,i=t[e];if(console.log(`Template Key: ${n}`),t.hasOwnProperty(e)){const e=n.split(" "),t=Number(e?.[0]),o=e?.[1]||"0",s=i.name||`Template ${t||""}`,r={total:i.pixels.total,colors:new Map(Object.entries(i.pixels.colors).map(([e,t])=>[Number(e),t]))},a=i.tiles,l={},c={},u=this.j*this.Z;for(const e in a)if(console.log(e),a.hasOwnProperty(e)){const t=m(a[e]),n=new Blob([t],{type:"image/png"}),i=await createImageBitmap(n);l[e]=i;const o=new OffscreenCanvas(u,u).getContext("2d");o.drawImage(i,0,0);const s=o.getImageData(0,0,i.width,i.height);c[e]=new Uint32Array(s.data.buffer)}const d=new v({displayName:s,U:t||this.ee?.length||0,A:o||""});d.R=r,d.X=l,d.J=c,this.ee.push(d),console.log(this.ee),console.log("^^^ This ^^^")}}},b=function(e,t,n){const i=this.Z,o=this.j*i,s=n[0],r=n[1],a=n[2],l=n[3],m=this.te,{palette:c,q:u}=this.ne,d=new Map;for(let n=1;n>>24&255)<=m||(i>>>24&255)<=m)continue;const h=u.get(i)??-2,p=u.get(c)??-2;if(h!=p)continue;const b=d.get(p);d.set(p,b?b+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),d},g=new WeakSet,f=async function(e=navigator.userAgent){return(e=e||"").includes("OPR/")||e.includes("Opera")?"Opera":e.includes("Edg/")?"Edge":e.includes("Vivaldi")?"Vivaldi":e.includes("YaBrowser")?"Yandex":e.includes("Kiwi")?"Kiwi":e.includes("Brave")?"Brave":e.includes("Firefox/")?"Firefox":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"},w=function(e=navigator.userAgent){return/Windows NT 11/i.test(e=e||"")?"Windows 11":/Windows NT 10/i.test(e)?"Windows 10":/Windows NT 6\.3/i.test(e)?"Windows 8.1":/Windows NT 6\.2/i.test(e)?"Windows 8":/Windows NT 6\.1/i.test(e)?"Windows 7":/Windows NT 6\.0/i.test(e)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(e)?"Windows XP":/Mac OS X 10[_\.]15/i.test(e)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(e)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(e)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(e)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(e)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(e)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(e)?"macOS":/Android/i.test(e)?"Android":/iPhone|iPad|iPod/i.test(e)?"iOS":/Linux/i.test(e)?"Linux":"Unknown"};var x=GM_info.script.name.toString(),S=GM_info.script.version.toString();!function(e){const t=document.createElement("script");t.setAttribute("bm-E",x),t.setAttribute("bm-B","color: cornflowerblue;"),t.textContent=`(${e})();`,document.documentElement?.appendChild(t),t.remove()}(()=>{const e=document.currentScript,t=e?.getAttribute("bm-E")||"Blue Marble",n=e?.getAttribute("bm-B")||"",i=new Map;window.addEventListener("message",e=>{const{source:o,endpoint:s,blobID:r,blobData:a,blink:l}=e.data,m=Date.now()-l;if(console.groupCollapsed(`%c${t}%c: ${i.size} Recieved IMAGE message about blob "${r}"`,n,""),console.log(`Blob fetch took %c${String(Math.floor(m/6e4)).padStart(2,"0")}:${String(Math.floor(m/1e3)%60).padStart(2,"0")}.${String(m%1e3).padStart(3,"0")}%c MM:SS.mmm`,n,""),console.log(i),console.groupEnd(),"blue-marble"==o&&r&&a&&!s){const e=i.get(r);"function"==typeof e?e(a):function(...e){(0,console.warn)(...e)}(`%c${t}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,n,"",r),i.delete(r)}});const o=window.fetch;window.fetch=async function(...e){const s=await o.apply(this,e),r=s.clone(),a=(e[0]instanceof Request?e[0]?.url:e[0])||"ignore",l=r.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${t}%c: Sending JSON message about endpoint "${a}"`,n,""),r.json().then(e=>{window.postMessage({source:"blue-marble",endpoint:a,jsonData:e},"*")}).catch(e=>{console.error(`%c${t}%c: Failed to parse JSON: `,n,"",e)});else if(l.includes("image/")&&!a.includes("openfreemap")&&!a.includes("maps")){const e=Date.now(),o=await r.blob();return console.log(`%c${t}%c: ${i.size} Sending IMAGE message about endpoint "${a}"`,n,""),new Promise(s=>{const l=crypto.randomUUID();i.set(l,e=>{s(new Response(e,{headers:r.headers,status:r.status,statusText:r.statusText})),console.log(`%c${t}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:a,blobID:l,blobData:o,blink:e})}).catch(o=>{const s=Date.now();console.error(`%c${t}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${t}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${a}\nThere are ${i.size} blobs processing...\nBlink: ${e.toLocaleString()}\nTime Since Blink: ${String(Math.floor(s/6e4)).padStart(2,"0")}:${String(Math.floor(s/1e3)%60).padStart(2,"0")}.${String(s%1e3).padStart(3,"0")} MM:SS.mmm`),console.error("Exception stack:",o),console.groupEnd()})}return s}});var $=`#bm-A,#bm-d{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;will-change:transform;backface-visibility:hidden;-webkit-backface-visibility:hidden;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}#bm-f,#bm-A hr,#bm-d hr,#bm-c,#bm-6{transition:opacity .2s ease,height .2s ease}div#bm-A,div#bm-d{font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}#bm-z,#bm-z-telemetry{margin-bottom:.5em;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:1em}#bm-z.dragging,#bm-z-telemetry.dragging{cursor:grabbing}#bm-A:has(#bm-z.dragging),#bm-d:has(#bm-z-telemetry.dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#bm-z.dragging,#bm-z-telemetry.dragging{pointer-events:auto}#bm-j,#bm-1{margin-bottom:.5em}#bm-j[style*="text-align: center"],#bm-1[style*="text-align: center"]{display:flex;flex-direction:column;align-items:center;justify-content:center}#bm-A[style*="padding: 5px"],#bm-d[style*="padding: 5px"]{width:auto!important;max-width:300px;min-width:200px}#bm-A img{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle;transition:opacity .2s ease}#bm-j[style*="text-align: center"] img{display:block;margin:0 auto}#bm-z,#bm-z-telemetry{transition:margin-bottom .2s ease}#bm-A h1,#bm-d h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}#bm-c input[type=checkbox]{vertical-align:middle;margin-right:.5ch}#bm-c label{margin-right:.5ch}.bm-D{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}#bm-q{vertical-align:middle}#bm-q svg{width:50%;margin:0 auto;fill:#111}#bm-f{margin-bottom:.5em}div:has(>#bm-button-teleport){display:flex;gap:.5ch}#bm-button-favorite svg,#bm-button-template svg{height:1em;margin:2px auto 0;text-align:center;line-height:1em;vertical-align:bottom}#bm-k input[type=number]{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}#bm-k input[type=number]::-webkit-outer-spin-button,#bm-k input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#bm-4{display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;gap:1ch}div:has(>#bm-a)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#bm-a,input[type=file][id*=template]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}#bm-o{font-size:small;background-color:#0003;padding:0 .5ch;height:3.75em;width:100%}#bm-6{display:flex;justify-content:space-between}div#bm-6 button#bm-D{margin-right:2px}#bm-A small{font-size:x-small;color:#d3d3d3}#bm-f,#bm-c,#bm-k,#bm-4,div:has(>#bm-a),#bm-o{margin-top:.5em}#bm-A button,#bm-d button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}#bm-A button:hover,#bm-A button:focus-visible,#bm-d button:hover,#bm-d button:focus-visible{background-color:#1061e5}#bm-A button:active,#bm-d button:active #bm-A button:disabled,#bm-d button:disabled{background-color:#2e97ff}#bm-A button:disabled,#bm-d button:disabled{text-decoration:line-through}`;GM_addStyle($);var M,T="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9TVEFUSACEThEICoGbAPoCC4NKAAE2AiQDg0oEIAWEWAeEYQwHGzdHsxERbBwIgEaWFUXpovSC/zKBG0OsPsALHwg+NI1SpzSGCOqReFjIyBOMluTO77d+stdLxT8578xk8qTZE3w1OkJLH/HCf/x+7dyZJ38RsxRVsnqjLjUQIiGSyJtptC9XNc3uBUH3jMC+IPGCwECyDmFX89mpyks+JIiJf6k8fvmlMgTb7HBGzQZtEAQxQERakSoRUQFtQsyY02nPpbWwNnW6NDZla5z75dci42ORHwuCaq3Kmj0ET+QQ1DlUpAkssLsnhSTshycLrNy5f+5lOA2/t5MLU2NQJiJXK72oo8DYDLlCiWoygX9gnU3olU+HAod+kuJDaft726r09zRd1TAn9LLCnq5xKpWLhSaRJcnn8ZuWTyMNYzBiVQejdkbvEPRyKpF4LBYhK8yasmcmQbLRBuGlm12eTnaqQZyfDdP1Mk2XIjkorrf+MzbbQxeN55AxRP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CAQOfnUkt38If1yYQhc=)format('woff2');}";T.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(T)):((M=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",M.rel="preload",M.as="style",M.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(M)),new class{constructor(){this.ie=null,this.oe=null,this.se="#bm-h"}re(e){return this.oe=e,this.ie=new MutationObserver(e=>{for(const t of e)for(const e of t.addedNodes)e instanceof HTMLElement&&e.matches?.(this.se)}),this}ae(){return this.ie}observe(e,t=!1,n=!1){e.observe(this.oe,{childList:t,subtree:n})}};var D=new s(x,S),k=(new s(x,S),new class{constructor(e,t,n){i(this,d),this.name=e,this.version=t,this.o=n,this.le="1.0.0",this.me=null,this.ce="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.j=1e3,this.Z=3,this.te=3,this.ne=function(e){const t=y;t.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),t.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of t){if(0==i.id||-2==i.id)continue;const t=i.rgb[0],o=i.rgb[1],s=i.rgb[2];for(let r=-e;r<=e;r++)for(let a=-e;a<=e;a++)for(let l=-e;l<=e;l++){const e=t+r,m=o+a,c=s+l;if(e<0||e>255||m<0||m>255||c<0||c>255)continue;const u=(255<<24|c<<16|m<<8|e)>>>0;n.has(u)||n.set(u,i.id)}}return{palette:t,q:n}}(this.te),this.ue=null,this.de="",this.ee=[],this.K=null,this.he=!0,this.pe=null}async be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.le,templates:{}}}async ge(e,t,n){this.K||(this.K=await this.be(),console.log("Creating JSON...")),this.o._(`Creating template at ${n.join(", ")}...`);const i=new v({displayName:t,U:0,A:a(this.me||0,this.ce),file:e,coords:n}),{V:s,H:r}=await i.Y(this.j,this.ne);i.X=s;const l={total:i.R.total,colors:Object.fromEntries(i.R.colors)};this.K.templates[`${i.U} ${i.A}`]={name:i.displayName,coords:n.join(", "),enabled:!0,pixels:l,tiles:r},this.ee=[],this.ee.push(i),this.o._(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.K.templates).length),console.log(this.K),console.log(this.ee),console.log(JSON.stringify(this.K)),await o(this,d,h).call(this)}fe(){}async we(){this.K||(this.K=await this.be(),console.log("Creating JSON..."))}async ye(e,t){if(!this.he)return e;const n=this.j*this.Z;t=t[0].toString().padStart(4,"0")+","+t[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${t}"`);const i=this.ee;console.log(i),i.sort((e,t)=>e.U-t.U),console.log(i);const s=i.map(e=>{const n=Object.keys(e.X).filter(e=>e.startsWith(t));if(0===n.length)return null;const i=n.map(t=>{const n=t.split(",");return{ve:e.X[t],J:e.J?.[t],xe:[n[0],n[1]],Se:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(s);const r=s?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.o._(`Sleeping\nVersion: ${this.version}`),e;{const e=i.filter(e=>Object.keys(e.X).filter(e=>e.startsWith(t)).length>0).reduce((e,t)=>e+(t.R.total||0),0),n=(new Intl.NumberFormat).format(e);this.o._(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${n}`)}const a=await createImageBitmap(e),l=new OffscreenCanvas(n,n),m=l.getContext("2d");m.imageSmoothingEnabled=!1,m.beginPath(),m.rect(0,0,n,n),m.clip(),m.clearRect(0,0,n,n),m.drawImage(a,0,0,n,n);const c=m.getImageData(0,0,n,n),u=new Uint32Array(c.data.buffer);for(const e of s){console.log("Template:"),console.log(e);const n=Number(e.Se[0])*this.Z,i=Number(e.Se[1])*this.Z;m.drawImage(e.ve,n,i);let s=e.J;if(console.log("TemplateBeforeFilter32: ",s),!s){const t=m.getImageData(n,i,e.ve.width,e.ve.height);s=new Uint32Array(t.data.buffer)}const r=Date.now(),a=o(this,d,b).call(this,u,s,[n,i,e.ve.width,e.ve.height]);let l=0;const c=0;for(const[e,t]of a)e!=c&&(l+=t);console.log(`Finished calculating correct pixels for the tile ${t} in ${(Date.now()-r)/1e3} seconds!\nThere are ${l} correct pixels.`)}return await l.convertToBlob({type:"image/png"})}$e(e){console.log("Importing JSON..."),console.log(e),"BlueMarble"==e?.whoami&&o(this,d,p).call(this,e)}Me(e){this.he=e}}(x,S,D)),O=new class{constructor(e){i(this,g),this.Te=e,this.De=!1,this.ke=[],this.Oe=[]}Ce(e){window.addEventListener("message",async t=>{const n=t.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(e=>e&&isNaN(Number(e))).filter(e=>e&&!e.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(i.status&&"2"!=i.status?.toString()[0])return void e.W("You are not logged in!\nCould not fetch userdata.");const t=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);console.log(i.id),(i.id||0===i.id)&&console.log(a(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Te.me=i.id,e.B("bm-p",`Droplets: ${(new Intl.NumberFormat).format(i.droplets)}`),e.B("bm-i",`Next level in ${(new Intl.NumberFormat).format(t)} pixel${1==t?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(e=>e&&!isNaN(Number(e))),l=new URLSearchParams(n.endpoint.split("?")[1]),m=[l.get("x"),l.get("y")];if(this.ke.length&&(!o.length||!m.length))return void e.W("Coordinates are malformed!\nDid you try clicking the canvas first?");this.ke=[...o,...m];const c=(s=o,r=m,[parseInt(s[0])%4*1e3+parseInt(r[0]),parseInt(s[1])%4*1e3+parseInt(r[1])]),u=document.querySelectorAll("span");for(const e of u)if(e.textContent.trim().includes(`${c[0]}, ${c[1]}`)){let t=document.querySelector("#bm-h");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${m[0]}, Px Y: ${m[1]})`;t?t.textContent=n:(t=document.createElement("span"),t.id="bm-h",t.textContent=n,t.style="margin-left: calc(var(--spacing)*3); font-size: small;",e.parentNode.parentNode.insertAdjacentElement("afterend",t))}break;case"tiles":let d=n.endpoint.split("/");d=[parseInt(d[d.length-2]),parseInt(d[d.length-1].replace(".png",""))];const h=n.blobID,p=n.blobData,b=Date.now(),g=await this.Te.ye(p,d);console.log(`Finished loading the tile in ${(Date.now()-b)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:h,blobData:g,blink:n.blink});break;case"robots":this.De="false"==i.userscript?.toString().toLowerCase();break}var s,r})}async Ne(e){console.log("Sending heartbeat to telemetry server...");let t=GM_getValue("bmUserSettings","{}");if(t=JSON.parse(t),!t||!t.telemetry||!t.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await o(this,g,f).call(this,n),s=o(this,g,w).call(this,n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:t.uuid,version:e,browser:i,os:s}),onload:e=>{200!==e.status&&r("Failed to send heartbeat:",e.statusText)},onerror:e=>{r("Error sending heartbeat:",e)}})}}(k);D.u(O);var C=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(C),k.$e(C);var N=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(N),console.log(Object.keys(N).length),0==Object.keys(N).length){const e=crypto.randomUUID();console.log(e),GM.setValue("bmUserSettings",JSON.stringify({uuid:e}))}if(setInterval(()=>O.Ne(S),18e5),console.log(`Telemetry is ${!(null==N?.telemetry)}`),null==N?.telemetry||N?.telemetry>1){const e=new s(x,S);e.u(O),e.v({id:"bm-d",style:"top: 0px; left: 0px; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; z-index: 9999;"}).v({id:"bm-7",style:"display: flex; flex-direction: column; align-items: center;"}).v({id:"bm-1",style:"margin-top: 10%;"}).T(1,{textContent:`${x} Telemetry`}).h().h().v({id:"bm-e",style:"max-width: 50%; overflow-y: auto; max-height: 80vh;"}).D().h().k().h().v({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-8",textContent:"More Information"},(e,t)=>{t.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).h().h().k().h().v({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-5",textContent:"Enable Telemetry",style:"margin-right: 2ch;"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=1,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).h().C({id:"bm-2",textContent:"Disable Telemetry"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=0,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).h().h().k().h().S({textContent:"We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the 'Disable' button, but keeping it on helps us improve features and reliability faster. Thank you for supporting the Blue Marble!"}).h().S({textContent:'You can disable telemetry by pressing the "Disable" button below.'}).h().h().h().p(document.body)}!function(){let e=!1;D.v({id:"bm-A",style:"top: 10px; right: 75px;"}).v({id:"bm-j"}).v({id:"bm-z"}).h().M({alt:"Blue Marble Icon - Click to minimize/maximize",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJ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FS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC",style:"cursor: pointer;"},(t,n)=>{n.addEventListener("click",()=>{e=!e;const i=document.querySelector("#bm-A"),o=document.querySelector("#bm-j"),s=document.querySelector("#bm-z"),r=document.querySelector("#bm-k"),a=document.querySelector("#bm-q"),l=document.querySelector("#bm-r"),m=document.querySelector("#bm-s"),c=document.querySelector("#bm-l"),u=document.querySelectorAll("#bm-k input");e||(i.style.width="auto",i.style.maxWidth="300px",i.style.minWidth="200px",i.style.padding="10px"),["#bm-A h1","#bm-f","#bm-A hr","#bm-c > *:not(#bm-k)","#bm-a","#bm-6",`#${t.i}`].forEach(t=>{document.querySelectorAll(t).forEach(t=>{t.style.display=e?"none":""})}),e?(r&&(r.style.display="none"),a&&(a.style.display="none"),l&&(l.style.display="none"),m&&(m.style.display="none"),c&&(c.style.display="none"),u.forEach(e=>{e.style.display="none"}),i.style.width="60px",i.style.height="76px",i.style.maxWidth="60px",i.style.minWidth="60px",i.style.padding="8px",n.style.marginLeft="3px",o.style.textAlign="center",o.style.margin="0",o.style.marginBottom="0",s&&(s.style.display="",s.style.marginBottom="0.25em")):(r&&(r.style.display="",r.style.flexDirection="",r.style.justifyContent="",r.style.alignItems="",r.style.gap="",r.style.textAlign="",r.style.margin=""),a&&(a.style.display=""),l&&(l.style.display="",l.style.marginTop=""),m&&(m.style.display="",m.style.marginTop=""),c&&(c.style.display="",c.style.marginTop=""),u.forEach(e=>{e.style.display=""}),n.style.marginLeft="",i.style.padding="10px",o.style.textAlign="",o.style.margin="",o.style.marginBottom="",s&&(s.style.marginBottom="0.5em"),i.style.width="",i.style.height=""),n.alt=e?"Blue Marble Icon - Minimized (Click to maximize)":"Blue Marble Icon - Maximized (Click to minimize)"})}).h().T(1,{textContent:x}).h().h().D().h().v({id:"bm-f"}).S({id:"bm-p",textContent:"Droplets:"}).h().S({id:"bm-i",textContent:"Next level in..."}).h().h().D().h().v({id:"bm-c"}).v({id:"bm-k"}).C({id:"bm-q",className:"bm-D",style:"margin-top: 0;",innerHTML:''},(e,t)=>{t.onclick=()=>{const t=e.t?.ke;t?.[0]?(e.B("bm-v",t?.[0]||""),e.B("bm-w",t?.[1]||""),e.B("bm-x",t?.[2]||""),e.B("bm-y",t?.[3]||"")):e.W("Coordinates are malformed! Did you try clicking on the canvas first?")}}).h().I({type:"number",id:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(e,t)=>{t.addEventListener("paste",e=>{let t=(e.clipboardData||window.clipboardData).getData("text").split(" ").filter(e=>e).map(Number).filter(e=>!isNaN(e));if(4!==t.length)return;let n=selectAllCoordinateInputs(document);for(let e=0;epersistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().I({type:"number",id:"bm-w",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(e,t)=>{const n=()=>persistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().I({type:"number",id:"bm-x",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(e,t)=>{const n=()=>persistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().I({type:"number",id:"bm-y",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(e,t)=>{const n=()=>persistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().h().L({id:"bm-a",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).h().v({id:"bm-4"}).C({id:"bm-s",textContent:"Enable"},(e,t)=>{t.onclick=()=>{e.t?.Te?.Me(!0),e._("Enabled templates!")}}).h().C({id:"bm-r",textContent:"Create"},(e,t)=>{t.onclick=()=>{const t=document.querySelector("#bm-a"),n=document.querySelector("#bm-v");if(!n.checkValidity())return n.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-w");if(!i.checkValidity())return i.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-x");if(!o.checkValidity())return o.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-y");if(!s.checkValidity())return s.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");t?.files[0]?(k.ge(t.files[0],t.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(o.value),Number(s.value)]),e._("Drew to canvas!")):e.W("No file selected!")}}).h().C({id:"bm-l",textContent:"Disable"},(e,t)=>{t.onclick=()=>{e.t?.Te?.Me(!1),e._("Disabled templates!")}}).h().h().P({id:D.i,placeholder:`Status: Sleeping...\nVersion: ${S}`,readOnly:!0}).h().v({id:"bm-6"}).v().C({id:"bm-m",className:"bm-D",innerHTML:"🎨",title:"Template Color Converter"},(e,t)=>{t.addEventListener("click",()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")})}).h().C({id:"bm-n",className:"bm-D",innerHTML:"🌐",title:"Official Blue Marble Website"},(e,t)=>{t.addEventListener("click",()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")})}).h().h().$({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).h().h().h().p(document.body)}(),D.G("#bm-A","#bm-z"),O.Ce(D),new MutationObserver((e,t)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-t");if(!i){i=document.createElement("button"),i.id="bm-t",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const e=this.parentNode.parentNode.parentNode.parentNode,t="Move ↑"==this.textContent;e.parentNode.className=e.parentNode.className.replace(t?"bottom":"top",t?"top":"bottom"),e.style.borderTopLeftRadius=t?"0px":"var(--radius-box)",e.style.borderTopRightRadius=t?"0px":"var(--radius-box)",e.style.borderBottomLeftRadius=t?"var(--radius-box)":"0px",e.style.borderBottomRightRadius=t?"var(--radius-box)":"0px",this.textContent=t?"Move ↓":"Move ↑"};const e=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");e.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),function(...e){(0,console.log)(...e)}(`%c${x}%c (${S}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var e,t,n=e=>{throw TypeError(e)},i=(e,t,i)=>t.has(e)?n("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),s=(e,t,i)=>(((e,t)=>{t.has(e)||n("Cannot access private method")})(e,t),i),o=class{constructor(t,n){i(this,e),this.name=t,this.version=n,this.t=null,this.i="bm-o",this.o=null,this.l=null,this.m=[]}h(e){this.t=e}u(){return this.m.length>0&&(this.l=this.m.pop()),this}p(e){e?.appendChild(this.o),this.o=null,this.l=null,this.m=[]}S(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"div",{},n)),this}$(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"p",{},n)),this}v(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"small",{},n)),this}M(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"details",{},n)),this}T(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"summary",{},n)),this}O(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"img",{},n)),this}D(n,i={},o=()=>{}){return o(this,s(this,e,t).call(this,"h"+n,{},i)),this}k(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"hr",{},n)),this}B(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"br",{},n)),this}N(n={},i=()=>{}){const o=s(this,e,t).call(this,"label",{textContent:n.textContent??""});delete n.textContent;const a=s(this,e,t).call(this,"input",{type:"checkbox"},n);return o.insertBefore(a,o.firstChild),this.u(),i(this,o,a),this}C(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"button",{},n)),this}I(n={},i=()=>{}){const o=n.title??n.textContent??"Help: No info";delete n.textContent,n.title=`Help: ${o}`;const a={textContent:"?",className:"bm-D",onclick:()=>{this.L(this.i,o)}};return i(this,s(this,e,t).call(this,"button",a,n)),this}G(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"input",{},n)),this}P(n={},i=()=>{}){const o=n.textContent??"";delete n.textContent;const a=s(this,e,t).call(this,"div"),r=s(this,e,t).call(this,"input",{type:"file",style:"display: none !important; visibility: hidden !important; position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; opacity: 0 !important;"},n);this.u();const l=s(this,e,t).call(this,"button",{textContent:o});return this.u(),this.u(),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),l.addEventListener("click",()=>{r.click()}),r.addEventListener("change",()=>{l.style.maxWidth=`${l.offsetWidth}px`,r.files.length>0?l.textContent=r.files[0].name:l.textContent=o}),i(this,a,r,l),this}W(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"textarea",{},n)),this}L(e,t,n=!1){const i=document.getElementById(e.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=t:n?i.textContent=t:i.innerHTML=t)}U(e,t){let n,i=!1,s=0,o=null,a=0,r=0,l=0,c=0;if(e=document.querySelector("#"==e?.[0]?e:"#"+e),t=document.querySelector("#"==t?.[0]?t:"#"+t),!e||!t)return void this._(`Can not drag! ${e?"":"moveMe"} ${e||t?"":"and "}${t?"":"iMoveThings "}was not found!`);const m=()=>{if(i){const t=Math.abs(a-l),n=Math.abs(r-c);(t>.5||n>.5)&&(a=l,r=c,e.style.transform=`translate(${a}px, ${r}px)`,e.style.left="0px",e.style.top="0px",e.style.right=""),o=requestAnimationFrame(m)}};let h=null;const u=(u,d)=>{i=!0,h=e.getBoundingClientRect(),n=u-h.left,s=d-h.top;const p=window.getComputedStyle(e).transform;if(p&&"none"!==p){const e=new DOMMatrix(p);a=e.m41,r=e.m42}else a=h.left,r=h.top;l=a,c=r,document.body.style.userSelect="none",t.classList.add("dragging"),o&&cancelAnimationFrame(o),m()},d=()=>{i=!1,o&&(cancelAnimationFrame(o),o=null),document.body.style.userSelect="",t.classList.remove("dragging")};t.addEventListener("mousedown",function(e){e.preventDefault(),u(e.clientX,e.clientY)}),t.addEventListener("touchstart",function(e){const t=e?.touches?.[0];t&&(u(t.clientX,t.clientY),e.preventDefault())},{passive:!1}),document.addEventListener("mousemove",function(e){i&&h&&(l=e.clientX-n,c=e.clientY-s)},{passive:!0}),document.addEventListener("touchmove",function(e){if(i&&h){const t=e?.touches?.[0];if(!t)return;l=t.clientX-n,c=t.clientY-s,e.preventDefault()}},{passive:!1}),document.addEventListener("mouseup",d),document.addEventListener("touchend",d),document.addEventListener("touchcancel",d)}A(e){(0,console.info)(`${this.name}: ${e}`),this.L(this.i,"Status: "+e,!0)}_(e){(0,console.error)(`${this.name}: ${e}`),this.L(this.i,"Error: "+e,!0)}};function a(...e){(0,console.error)(...e)}function r(e,t){if(0===e)return t[0];let n="";const i=t.length;for(;e>0;)n=t[e%i]+n,e=Math.floor(e/i);return n}function l(e){let t="";for(let n=0;n>>24==0?0:s.get(t)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o},u=new WeakSet,d=async function(){GM.setValue("bmTemplates",JSON.stringify(this.ee))},p=async function(e){console.log("Parsing BlueMarble...");const t=e.templates;if(console.log(`BlueMarble length: ${Object.keys(t).length}`),Object.keys(t).length>0)for(const e in t){const n=e,i=t[e];if(console.log(`Template Key: ${n}`),t.hasOwnProperty(e)){const e=n.split(" "),t=Number(e?.[0]),s=e?.[1]||"0",o=i.name||`Template ${t||""}`,a={total:i.pixels.total,colors:new Map(Object.entries(i.pixels.colors).map(([e,t])=>[Number(e),t]))},r=i.tiles,l={},m={},h=this.F*this.te;for(const e in r)if(console.log(e),r.hasOwnProperty(e)){const t=c(r[e]),n=new Blob([t],{type:"image/png"}),i=await createImageBitmap(n);l[e]=i;const s=new OffscreenCanvas(h,h).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);m[e]=new Uint32Array(o.data.buffer)}const u=new S({displayName:o,J:t||this.ne?.length||0,X:s||""});u.Y=a,u.j=l,u.R=m,this.ne.push(u),console.log(this.ne),console.log("^^^ This ^^^")}}},b=function(e,t,n){const i=this.te,s=this.F*i,o=n[0],a=n[1],r=n[2],l=n[3],c=this.ie,{palette:m,Z:h}=this.se,u=new Map;for(let n=1;n>>24&255)<=c||(i>>>24&255)<=c)continue;const d=h.get(i)??-2,p=h.get(m)??-2;if(d!=p)continue;const b=u.get(p);u.set(p,b?b+1:1)}return console.log("List of template pixels that match the tile:"),console.log(u),u},g=new WeakSet,f=async function(e=navigator.userAgent){return(e=e||"").includes("OPR/")||e.includes("Opera")?"Opera":e.includes("Edg/")?"Edge":e.includes("Vivaldi")?"Vivaldi":e.includes("YaBrowser")?"Yandex":e.includes("Kiwi")?"Kiwi":e.includes("Brave")?"Brave":e.includes("Firefox/")?"Firefox":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"},w=function(e=navigator.userAgent){return/Windows NT 11/i.test(e=e||"")?"Windows 11":/Windows NT 10/i.test(e)?"Windows 10":/Windows NT 6\.3/i.test(e)?"Windows 8.1":/Windows NT 6\.2/i.test(e)?"Windows 8":/Windows NT 6\.1/i.test(e)?"Windows 7":/Windows NT 6\.0/i.test(e)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(e)?"Windows XP":/Mac OS X 10[_\.]15/i.test(e)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(e)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(e)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(e)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(e)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(e)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(e)?"macOS":/Android/i.test(e)?"Android":/iPhone|iPad|iPod/i.test(e)?"iOS":/Linux/i.test(e)?"Linux":"Unknown"};var $=GM_info.script.name.toString(),v=GM_info.script.version.toString();!function(e){const t=document.createElement("script");t.setAttribute("bm-E",$),t.setAttribute("bm-B","color: cornflowerblue;"),t.textContent=`(${e})();`,document.documentElement?.appendChild(t),t.remove()}(()=>{const e=document.currentScript,t=e?.getAttribute("bm-E")||"Blue Marble",n=e?.getAttribute("bm-B")||"",i=new Map;window.addEventListener("message",e=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=e.data,c=Date.now()-l;if(console.groupCollapsed(`%c${t}%c: ${i.size} Recieved IMAGE message about blob "${a}"`,n,""),console.log(`Blob fetch took %c${String(Math.floor(c/6e4)).padStart(2,"0")}:${String(Math.floor(c/1e3)%60).padStart(2,"0")}.${String(c%1e3).padStart(3,"0")}%c MM:SS.mmm`,n,""),console.log(i),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const e=i.get(a);"function"==typeof e?e(r):function(...e){(0,console.warn)(...e)}(`%c${t}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,n,"",a),i.delete(a)}});const s=window.fetch;window.fetch=async function(...e){const o=await s.apply(this,e),a=o.clone(),r=(e[0]instanceof Request?e[0]?.url:e[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${t}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(e=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:e},"*")}).catch(e=>{console.error(`%c${t}%c: Failed to parse JSON: `,n,"",e)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const e=Date.now(),s=await a.blob();return console.log(`%c${t}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,e=>{o(new Response(e,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${t}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:e})}).catch(s=>{const o=Date.now();console.error(`%c${t}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${t}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${e.toLocaleString()}\nTime Since Blink: ${String(Math.floor(o/6e4)).padStart(2,"0")}:${String(Math.floor(o/1e3)%60).padStart(2,"0")}.${String(o%1e3).padStart(3,"0")} MM:SS.mmm`),console.error("Exception stack:",s),console.groupEnd()})}return o}});var M=`.bm-_{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-X{display:flex;align-items:center;flex-wrap:nowrap;justify-content:space-between;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-X.bm-dragging{cursor:grabbing}.bm-_:has(.bm-X.bm-dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-X.bm-dragging{pointer-events:auto}.bm-Y{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-_ h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-X h1{font-size:1.2em;margin-left:.5ch;user-select:none;text-shadow:3px 0px rgba(21,48,99,.5),-3px 0px rgba(21,48,99,.5),0px 3px rgba(21,48,99,.5),0px -3px rgba(21,48,99,.5),3px 3px rgba(21,48,99,.5),-3px 3px rgba(21,48,99,.5),3px -3px rgba(21,48,99,.5),-3px -3px rgba(21,48,99,.5)}.bm-V{margin:.5em 0}.bm-_ button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-_ button:hover,.bm-_ button:focus-visible{background-color:#1061e5}.bm-_ button:active .bm-_ button:disabled{background-color:#2e97ff}.bm-_ button:disabled{text-decoration:line-through}.bm-T{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-Q{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}#bm-A,#bm-d{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;will-change:transform;backface-visibility:hidden;-webkit-backface-visibility:hidden;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}#bm-f,#bm-A hr,#bm-d hr,#bm-c,#bm-6{transition:opacity .2s ease,height .2s ease}div#bm-A,div#bm-d{font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}#bm-z,#bm-z-telemetry{margin-bottom:.5em;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:1em}#bm-z.dragging,#bm-z-telemetry.dragging{cursor:grabbing}#bm-A:has(#bm-z.dragging),#bm-d:has(#bm-z-telemetry.dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#bm-z.dragging,#bm-z-telemetry.dragging{pointer-events:auto}#bm-j,#bm-1{margin-bottom:.5em}#bm-j[style*="text-align: center"],#bm-1[style*="text-align: center"]{display:flex;flex-direction:column;align-items:center;justify-content:center}#bm-A[style*="padding: 5px"],#bm-d[style*="padding: 5px"]{width:auto!important;max-width:300px;min-width:200px}#bm-A img{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle;transition:opacity .2s ease}#bm-j[style*="text-align: center"] img{display:block;margin:0 auto}#bm-z,#bm-z-telemetry{transition:margin-bottom .2s ease}#bm-A h1,#bm-d h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}#bm-c input[type=checkbox]{vertical-align:middle;margin-right:.5ch}#bm-c label{margin-right:.5ch}.bm-D{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}#bm-q{vertical-align:middle}#bm-q svg{width:50%;margin:0 auto;fill:#111}#bm-f{margin-bottom:.5em}div:has(>#bm-button-teleport){display:flex;gap:.5ch}#bm-button-favorite svg,#bm-button-template svg{height:1em;margin:2px auto 0;text-align:center;line-height:1em;vertical-align:bottom}#bm-k input[type=number]{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}#bm-k input[type=number]::-webkit-outer-spin-button,#bm-k input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#bm-4{display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;gap:1ch}div:has(>#bm-a)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#bm-a,input[type=file][id*=template]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}#bm-o{font-size:small;background-color:#0003;padding:0 .5ch;height:3.75em;width:100%}#bm-6{display:flex;justify-content:space-between}div#bm-6 button#bm-D{margin-right:2px}#bm-A small{font-size:x-small;color:#d3d3d3}#bm-f,#bm-c,#bm-k,#bm-4,div:has(>#bm-a),#bm-o{margin-top:.5em}#bm-A button,#bm-d button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}#bm-A button:hover,#bm-A button:focus-visible,#bm-d button:hover,#bm-d button:focus-visible{background-color:#1061e5}#bm-A button:active,#bm-d button:active #bm-A button:disabled,#bm-d button:disabled{background-color:#2e97ff}#bm-A button:disabled,#bm-d button:disabled{text-decoration:line-through}`;GM_addStyle(M);var x,T="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9TVEFUSACEThEICoGbAPoCC4NKAAE2AiQDg0oEIAWEWAeEYQwHGzdHsxERbBwIgEaWFUXpovSC/zKBG0OsPsALHwg+NI1SpzSGCOqReFjIyBO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cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";T.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(T)):((x=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",x.rel="preload",x.as="style",x.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(x)),new class{constructor(){this.oe=null,this.ae=null,this.re="#bm-h"}le(e){return this.ae=e,this.oe=new MutationObserver(e=>{for(const t of e)for(const e of t.addedNodes)e instanceof HTMLElement&&e.matches?.(this.re)}),this}ce(){return this.oe}observe(e,t=!1,n=!1){e.observe(this.ae,{childList:t,subtree:n})}};var O=new o($,v),D=(new o($,v),new class{constructor(e,t,n){i(this,u),this.name=e,this.version=t,this.o=n,this.me="1.0.0",this.he=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.F=1e3,this.te=3,this.ie=3,this.se=function(e){const t=y;t.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),t.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of t){if(0==i.id||-2==i.id)continue;const t=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-e;a<=e;a++)for(let r=-e;r<=e;r++)for(let l=-e;l<=e;l++){const e=t+a,c=s+r,m=o+l;if(e<0||e>255||c<0||c>255||m<0||m>255)continue;const h=(255<<24|m<<16|c<<8|e)>>>0;n.has(h)||n.set(h,i.id)}}return{palette:t,Z:n}}(this.ie),this.de=null,this.pe="",this.ne=[],this.ee=null,this.be=!0,this.ge=null}async fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.me,templates:{}}}async we(e,t,n){this.ee||(this.ee=await this.fe(),console.log("Creating JSON...")),this.o.A(`Creating template at ${n.join(", ")}...`);const i=new S({displayName:t,J:0,X:r(this.he||0,this.ue),file:e,coords:n}),{q:o,K:a}=await i.V(this.F,this.se);i.j=o;const l={total:i.Y.total,colors:Object.fromEntries(i.Y.colors)};this.ee.templates[`${i.J} ${i.X}`]={name:i.displayName,coords:n.join(", "),enabled:!0,pixels:l,tiles:a},this.ne=[],this.ne.push(i),this.o.A(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.ee.templates).length),console.log(this.ee),console.log(this.ne),console.log(JSON.stringify(this.ee)),await s(this,u,d).call(this)}ye(){}async Se(){this.ee||(this.ee=await this.fe(),console.log("Creating JSON..."))}async $e(e,t){if(!this.be)return e;const n=this.F*this.te;t=t[0].toString().padStart(4,"0")+","+t[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${t}"`);const i=this.ne;console.log(i),i.sort((e,t)=>e.J-t.J),console.log(i);const o=i.map(e=>{const n=Object.keys(e.j).filter(e=>e.startsWith(t));if(0===n.length)return null;const i=n.map(t=>{const n=t.split(",");return{ve:e,Me:e.j[t],R:e.R?.[t],xe:[n[0],n[1]],Te:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(o);const a=o?.length||0;if(console.log(`templateCount = ${a}`),!(a>0))return this.o.A(`Sleeping\nVersion: ${this.version}`),e;{const e=i.filter(e=>Object.keys(e.j).filter(e=>e.startsWith(t)).length>0).reduce((e,t)=>e+(t.Y.total||0),0),n=(new Intl.NumberFormat).format(e);this.o.A(`Displaying ${a} template${1==a?"":"s"}.\nTotal pixels: ${n}`)}const r=await createImageBitmap(e),l=new OffscreenCanvas(n,n),c=l.getContext("2d");c.imageSmoothingEnabled=!1,c.beginPath(),c.rect(0,0,n,n),c.clip(),c.clearRect(0,0,n,n),c.drawImage(r,0,0,n,n);const m=c.getImageData(0,0,n,n),h=new Uint32Array(m.data.buffer);for(const e of o){console.log("Template:"),console.log(e);let n=e.R;const i=Number(e.Te[0])*this.te,o=Number(e.Te[1])*this.te;if(c.drawImage(e.Me,i,o),!n){const t=c.getImageData(i,o,e.Me.width,e.Me.height);n=new Uint32Array(t.data.buffer)}const a=Date.now(),r=s(this,u,b).call(this,h,n,[i,o,e.Me.width,e.Me.height]);let l=0;const m=0;for(const[e,t]of r)e!=m&&(l+=t);console.log(`Finished calculating correct pixels for the tile ${t} in ${(Date.now()-a)/1e3} seconds!\nThere are ${l} correct pixels.`),e.ve.Y.correct=r}return await l.convertToBlob({type:"image/png"})}Oe(e){console.log("Importing JSON..."),console.log(e),"BlueMarble"==e?.whoami&&s(this,u,p).call(this,e)}De(e){this.be=e}}($,v,O)),k=new class{constructor(e){i(this,g),this.ke=e,this.Be=!1,this.Ne=[],this.Ce=[]}Ie(e){window.addEventListener("message",async t=>{const n=t.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const s=n.endpoint?.split("?")[0].split("/").filter(e=>e&&isNaN(Number(e))).filter(e=>e&&!e.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",s),s){case"me":if(i.status&&"2"!=i.status?.toString()[0])return void e._("You are not logged in!\nCould not fetch userdata.");const t=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);console.log(i.id),(i.id||0===i.id)&&console.log(r(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.ke.he=i.id,e.L("bm-p",`Droplets: ${(new Intl.NumberFormat).format(i.droplets)}`),e.L("bm-i",`Next level in ${(new Intl.NumberFormat).format(t)} pixel${1==t?"":"s"}`);break;case"pixel":const s=n.endpoint.split("?")[0].split("/").filter(e=>e&&!isNaN(Number(e))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Ne.length&&(!s.length||!c.length))return void e._("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Ne=[...s,...c];const m=(o=s,a=c,[parseInt(o[0])%4*1e3+parseInt(a[0]),parseInt(o[1])%4*1e3+parseInt(a[1])]),h=document.querySelectorAll("span");for(const e of h)if(e.textContent.trim().includes(`${m[0]}, ${m[1]}`)){let t=document.querySelector("#bm-h");const n=`(Tl X: ${s[0]}, Tl Y: ${s[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;t?t.textContent=n:(t=document.createElement("span"),t.id="bm-h",t.textContent=n,t.style="margin-left: calc(var(--spacing)*3); font-size: small;",e.parentNode.parentNode.insertAdjacentElement("afterend",t))}break;case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const d=n.blobID,p=n.blobData,b=Date.now(),g=await this.ke.$e(p,u);console.log(`Finished loading the tile in ${(Date.now()-b)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:d,blobData:g,blink:n.blink});break;case"robots":this.Be="false"==i.userscript?.toString().toLowerCase();break}var o,a})}async Le(e){console.log("Sending heartbeat to telemetry server...");let t=GM_getValue("bmUserSettings","{}");if(t=JSON.parse(t),!t||!t.telemetry||!t.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await s(this,g,f).call(this,n),o=s(this,g,w).call(this,n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:t.uuid,version:e,browser:i,os:o}),onload:e=>{200!==e.status&&a("Failed to send heartbeat:",e.statusText)},onerror:e=>{a("Error sending heartbeat:",e)}})}}(D);O.h(k);var B=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(B),D.Oe(B);var N=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(N),console.log(Object.keys(N).length),0==Object.keys(N).length){const e=crypto.randomUUID();console.log(e),GM.setValue("bmUserSettings",JSON.stringify({uuid:e}))}if(setInterval(()=>k.Le(v),18e5),console.log(`Telemetry is ${!(null==N?.telemetry)}`),null==N?.telemetry||N?.telemetry>1){const e=new o($,v);e.h(k),e.S({id:"bm-d",style:"top: 0px; left: 0px; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; z-index: 9999;"}).S({id:"bm-7",style:"display: flex; flex-direction: column; align-items: center;"}).S({id:"bm-1",style:"margin-top: 10%;"}).D(1,{textContent:`${$} Telemetry`}).u().u().S({id:"bm-e",style:"max-width: 50%; overflow-y: auto; max-height: 80vh;"}).k().u().B().u().S({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-8",textContent:"More Information"},(e,t)=>{t.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).u().u().B().u().S({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-5",textContent:"Enable Telemetry",style:"margin-right: 2ch;"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=1,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).u().C({id:"bm-2",textContent:"Disable Telemetry"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=0,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).u().u().B().u().$({textContent:"We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the 'Disable' button, but keeping it on helps us improve features and reliability faster. Thank you for supporting the Blue Marble!"}).u().$({textContent:'You can disable telemetry by pressing the "Disable" button below.'}).u().u().u().p(document.body)}O.S({class:"bm-_",style:"top: 10px; right: 75px;"}).S({class:"bm-X"}).S().C({class:"bm-T",textContent:"▼"},(e,t)=>{t.onclick=()=>{const e=t.closest(".bm-_"),n=t.closest(".bm-X"),i=e.querySelector("h1"),s=e.querySelector(".bm-Q");if("▼"==t.textContent){const n=i.cloneNode(!0);t.parentNode.appendChild(n),s.style.height=s.scrollHeight+"px",e.style.width=e.scrollWidth+"px",s.style.height="0",s.addEventListener("transitionend",function e(){s.style.display="none",s.removeEventListener("transitionend",e)})}else n.querySelector("h1").remove(),s.style.display="",s.style.height="0",e.style.width="",s.style.height=s.scrollHeight+"px",s.addEventListener("transitionend",function e(){s.style.height="",s.removeEventListener("transitionend",e)});t.textContent="▼"==t.textContent?"▶":"▼"}}).u().u().u().S({class:"bm-Q"}).S({class:"bm-V"}).O({class:"bm-Y",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRP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vj1HQmMrMmfNEUm/x1o63ZKcnS2UdREcn8cG+f1EnQbJzs4RYi2WSPKmoKGdY8HAyMzKZLaNrsbQKqUPlONGLgjoK+xuorDRLAolqAioMffbt1QJloMlFUtKTmpRFQX42pSWlBAf58uhjK9TxKikuxUNmvEUSOHLkKM7CiQ0bNpCansGpM6eIjDjLp58cFq14leXLH+fk16fp7e1l7pwQBvsHSBuyqSg3c+Rfu27HvX0VN7Y2U1ZSK4pVw+dHD7N+/Vr0ej0h8+/H0bFPYisYM2Y8v//DJpxEft95b5squ2ZzKTnZ6WTKUbrl5dfYvHmzzPsBQegqrq5Gurt71ZugsaGR+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"}).u().D(1,{textContent:$}).u().u().k().u().u().p(document.body),O.U("#bm-A","#bm-z"),k.Ie(O),new MutationObserver((e,t)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-t");if(!i){i=document.createElement("button"),i.id="bm-t",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const e=this.parentNode.parentNode.parentNode.parentNode,t="Move ↑"==this.textContent;e.parentNode.className=e.parentNode.className.replace(t?"bottom":"top",t?"top":"bottom"),e.style.borderTopLeftRadius=t?"0px":"var(--radius-box)",e.style.borderTopRightRadius=t?"0px":"var(--radius-box)",e.style.borderBottomLeftRadius=t?"var(--radius-box)":"0px",e.style.borderBottomRightRadius=t?"var(--radius-box)":"0px",this.textContent=t?"Move ↓":"Move ↑"};const e=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");e.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),function(...e){(0,console.log)(...e)}(`%c${$}%c (${v}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 27f7c4a..3835981 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -#bm-A,#bm-d{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;will-change:transform;backface-visibility:hidden;-webkit-backface-visibility:hidden;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}#bm-f,#bm-A hr,#bm-d hr,#bm-c,#bm-6{transition:opacity .2s ease,height .2s ease}div#bm-A,div#bm-d{font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}#bm-z,#bm-z-telemetry{margin-bottom:.5em;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:1em}#bm-z.dragging,#bm-z-telemetry.dragging{cursor:grabbing}#bm-A:has(#bm-z.dragging),#bm-d:has(#bm-z-telemetry.dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#bm-z.dragging,#bm-z-telemetry.dragging{pointer-events:auto}#bm-j,#bm-1{margin-bottom:.5em}#bm-j[style*="text-align: center"],#bm-1[style*="text-align: center"]{display:flex;flex-direction:column;align-items:center;justify-content:center}#bm-A[style*="padding: 5px"],#bm-d[style*="padding: 5px"]{width:auto!important;max-width:300px;min-width:200px}#bm-A img{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle;transition:opacity .2s ease}#bm-j[style*="text-align: center"] img{display:block;margin:0 auto}#bm-z,#bm-z-telemetry{transition:margin-bottom .2s ease}#bm-A h1,#bm-d h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}#bm-c input[type=checkbox]{vertical-align:middle;margin-right:.5ch}#bm-c label{margin-right:.5ch}.bm-D{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}#bm-q{vertical-align:middle}#bm-q svg{width:50%;margin:0 auto;fill:#111}#bm-f{margin-bottom:.5em}div:has(>#bm-button-teleport){display:flex;gap:.5ch}#bm-button-favorite svg,#bm-button-template svg{height:1em;margin:2px auto 0;text-align:center;line-height:1em;vertical-align:bottom}#bm-k input[type=number]{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}#bm-k input[type=number]::-webkit-outer-spin-button,#bm-k input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#bm-4{display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;gap:1ch}div:has(>#bm-a)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#bm-a,input[type=file][id*=template]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}#bm-o{font-size:small;background-color:#0003;padding:0 .5ch;height:3.75em;width:100%}#bm-6{display:flex;justify-content:space-between}div#bm-6 button#bm-D{margin-right:2px}#bm-A small{font-size:x-small;color:#d3d3d3}#bm-f,#bm-c,#bm-k,#bm-4,div:has(>#bm-a),#bm-o{margin-top:.5em}#bm-A button,#bm-d button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}#bm-A button:hover,#bm-A button:focus-visible,#bm-d button:hover,#bm-d button:focus-visible{background-color:#1061e5}#bm-A button:active,#bm-d button:active #bm-A button:disabled,#bm-d button:disabled{background-color:#2e97ff}#bm-A button:disabled,#bm-d button:disabled{text-decoration:line-through} +.bm-_{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-X{display:flex;align-items:center;flex-wrap:nowrap;justify-content:space-between;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-X.bm-dragging{cursor:grabbing}.bm-_:has(.bm-X.bm-dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-X.bm-dragging{pointer-events:auto}.bm-Y{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-_ h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-X h1{font-size:1.2em;margin-left:.5ch;user-select:none;text-shadow:3px 0px rgba(21,48,99,.5),-3px 0px rgba(21,48,99,.5),0px 3px rgba(21,48,99,.5),0px -3px rgba(21,48,99,.5),3px 3px rgba(21,48,99,.5),-3px 3px rgba(21,48,99,.5),3px -3px rgba(21,48,99,.5),-3px -3px rgba(21,48,99,.5)}.bm-V{margin:.5em 0}.bm-_ button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-_ button:hover,.bm-_ button:focus-visible{background-color:#1061e5}.bm-_ button:active .bm-_ button:disabled{background-color:#2e97ff}.bm-_ button:disabled{text-decoration:line-through}.bm-T{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-Q{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}#bm-A,#bm-d{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;max-width:300px;width:auto;will-change:transform;backface-visibility:hidden;-webkit-backface-visibility:hidden;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}#bm-f,#bm-A hr,#bm-d hr,#bm-c,#bm-6{transition:opacity .2s ease,height .2s ease}div#bm-A,div#bm-d{font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}#bm-z,#bm-z-telemetry{margin-bottom:.5em;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:1em}#bm-z.dragging,#bm-z-telemetry.dragging{cursor:grabbing}#bm-A:has(#bm-z.dragging),#bm-d:has(#bm-z-telemetry.dragging){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}#bm-z.dragging,#bm-z-telemetry.dragging{pointer-events:auto}#bm-j,#bm-1{margin-bottom:.5em}#bm-j[style*="text-align: center"],#bm-1[style*="text-align: center"]{display:flex;flex-direction:column;align-items:center;justify-content:center}#bm-A[style*="padding: 5px"],#bm-d[style*="padding: 5px"]{width:auto!important;max-width:300px;min-width:200px}#bm-A img{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle;transition:opacity .2s ease}#bm-j[style*="text-align: center"] img{display:block;margin:0 auto}#bm-z,#bm-z-telemetry{transition:margin-bottom .2s ease}#bm-A h1,#bm-d h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}#bm-c input[type=checkbox]{vertical-align:middle;margin-right:.5ch}#bm-c label{margin-right:.5ch}.bm-D{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}#bm-q{vertical-align:middle}#bm-q svg{width:50%;margin:0 auto;fill:#111}#bm-f{margin-bottom:.5em}div:has(>#bm-button-teleport){display:flex;gap:.5ch}#bm-button-favorite svg,#bm-button-template svg{height:1em;margin:2px auto 0;text-align:center;line-height:1em;vertical-align:bottom}#bm-k input[type=number]{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}#bm-k input[type=number]::-webkit-outer-spin-button,#bm-k input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}#bm-4{display:flex;flex-direction:row;flex-wrap:wrap;align-content:center;justify-content:center;align-items:center;gap:1ch}div:has(>#bm-a)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#bm-a,input[type=file][id*=template]{display:none!important;visibility:hidden!important;position:absolute!important;left:-9999px!important;top:-9999px!important;width:0!important;height:0!important;opacity:0!important;z-index:-9999!important;pointer-events:none!important}#bm-o{font-size:small;background-color:#0003;padding:0 .5ch;height:3.75em;width:100%}#bm-6{display:flex;justify-content:space-between}div#bm-6 button#bm-D{margin-right:2px}#bm-A small{font-size:x-small;color:#d3d3d3}#bm-f,#bm-c,#bm-k,#bm-4,div:has(>#bm-a),#bm-o{margin-top:.5em}#bm-A button,#bm-d button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}#bm-A button:hover,#bm-A button:focus-visible,#bm-d button:hover,#bm-d button:focus-visible{background-color:#1061e5}#bm-A button:active,#bm-d button:active #bm-A button:disabled,#bm-d button:disabled{background-color:#2e97ff}#bm-A button:disabled,#bm-d button:disabled{text-decoration:line-through} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 653669b..feaefd9 100644 --- a/dist/BlueMarble.user.js +++ b/dist/BlueMarble.user.js @@ -2,7 +2,7 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.88.95 +// @version 0.88.122 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine @@ -28,4 +28,4 @@ // License --> https://www.mozilla.org/en-US/MPL/2.0/ // Donate --> https://ko-fi.com/swingthevine -(()=>{var e,t,n=e=>{throw TypeError(e)},i=(e,t,i)=>t.has(e)?n("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),o=(e,t,i)=>(((e,t)=>{t.has(e)||n("Cannot access private method")})(e,t),i),s=class{constructor(t,n){i(this,e),this.name=t,this.version=n,this.t=null,this.i="bm-o",this.o=null,this.l=null,this.m=[]}u(e){this.t=e}h(){return this.m.length>0&&(this.l=this.m.pop()),this}p(e){e?.appendChild(this.o),this.o=null,this.l=null,this.m=[]}v(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"div",{},n)),this}S(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"p",{},n)),this}$(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"small",{},n)),this}M(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"img",{},n)),this}T(n,i={},s=()=>{}){return s(this,o(this,e,t).call(this,"h"+n,{},i)),this}D(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"hr",{},n)),this}k(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"br",{},n)),this}O(n={},i=()=>{}){const s=o(this,e,t).call(this,"label",{textContent:n.textContent??""});delete n.textContent;const r=o(this,e,t).call(this,"input",{type:"checkbox"},n);return s.insertBefore(r,s.firstChild),this.h(),i(this,s,r),this}C(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"button",{},n)),this}N(n={},i=()=>{}){const s=n.title??n.textContent??"Help: No info";delete n.textContent,n.title=`Help: ${s}`;const r={textContent:"?",className:"bm-D",onclick:()=>{this.B(this.i,s)}};return i(this,o(this,e,t).call(this,"button",r,n)),this}I(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"input",{},n)),this}L(n={},i=()=>{}){const s=n.textContent??"";delete n.textContent;const r=o(this,e,t).call(this,"div"),a=o(this,e,t).call(this,"input",{type:"file",style:"display: none !important; visibility: hidden !important; position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; opacity: 0 !important;"},n);this.h();const l=o(this,e,t).call(this,"button",{textContent:s});return this.h(),this.h(),a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),l.addEventListener("click",()=>{a.click()}),a.addEventListener("change",()=>{l.style.maxWidth=`${l.offsetWidth}px`,a.files.length>0?l.textContent=a.files[0].name:l.textContent=s}),i(this,r,a,l),this}P(n={},i=()=>{}){return i(this,o(this,e,t).call(this,"textarea",{},n)),this}B(e,t,n=!1){const i=document.getElementById(e.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=t:n?i.textContent=t:i.innerHTML=t)}G(e,t){let n,i=!1,o=0,s=null,r=0,a=0,l=0,m=0;if(e=document.querySelector("#"==e?.[0]?e:"#"+e),t=document.querySelector("#"==t?.[0]?t:"#"+t),!e||!t)return void this.W(`Can not drag! ${e?"":"moveMe"} ${e||t?"":"and "}${t?"":"iMoveThings "}was not found!`);const c=()=>{if(i){const t=Math.abs(r-l),n=Math.abs(a-m);(t>.5||n>.5)&&(r=l,a=m,e.style.transform=`translate(${r}px, ${a}px)`,e.style.left="0px",e.style.top="0px",e.style.right=""),s=requestAnimationFrame(c)}};let u=null;const d=(d,h)=>{i=!0,u=e.getBoundingClientRect(),n=d-u.left,o=h-u.top;const p=window.getComputedStyle(e).transform;if(p&&"none"!==p){const e=new DOMMatrix(p);r=e.m41,a=e.m42}else r=u.left,a=u.top;l=r,m=a,document.body.style.userSelect="none",t.classList.add("dragging"),s&&cancelAnimationFrame(s),c()},h=()=>{i=!1,s&&(cancelAnimationFrame(s),s=null),document.body.style.userSelect="",t.classList.remove("dragging")};t.addEventListener("mousedown",function(e){e.preventDefault(),d(e.clientX,e.clientY)}),t.addEventListener("touchstart",function(e){const t=e?.touches?.[0];t&&(d(t.clientX,t.clientY),e.preventDefault())},{passive:!1}),document.addEventListener("mousemove",function(e){i&&u&&(l=e.clientX-n,m=e.clientY-o)},{passive:!0}),document.addEventListener("touchmove",function(e){if(i&&u){const t=e?.touches?.[0];if(!t)return;l=t.clientX-n,m=t.clientY-o,e.preventDefault()}},{passive:!1}),document.addEventListener("mouseup",h),document.addEventListener("touchend",h),document.addEventListener("touchcancel",h)}_(e){(0,console.info)(`${this.name}: ${e}`),this.B(this.i,"Status: "+e,!0)}W(e){(0,console.error)(`${this.name}: ${e}`),this.B(this.i,"Error: "+e,!0)}};function r(...e){(0,console.error)(...e)}function a(e,t){if(0===e)return t[0];let n="";const i=t.length;for(;e>0;)n=t[e%i]+n,e=Math.floor(e/i);return n}function l(e){let t="";for(let n=0;n>>24==0?0:o.get(t)??-2;const r=s.get(i);s.set(i,r?r+1:1)}return console.log(s),s},d=new WeakSet,h=async function(){GM.setValue("bmTemplates",JSON.stringify(this.K))},p=async function(e){console.log("Parsing BlueMarble...");const t=e.templates;if(console.log(`BlueMarble length: ${Object.keys(t).length}`),Object.keys(t).length>0)for(const e in t){const n=e,i=t[e];if(console.log(`Template Key: ${n}`),t.hasOwnProperty(e)){const e=n.split(" "),t=Number(e?.[0]),o=e?.[1]||"0",s=i.name||`Template ${t||""}`,r={total:i.pixels.total,colors:new Map(Object.entries(i.pixels.colors).map(([e,t])=>[Number(e),t]))},a=i.tiles,l={},c={},u=this.j*this.Z;for(const e in a)if(console.log(e),a.hasOwnProperty(e)){const t=m(a[e]),n=new Blob([t],{type:"image/png"}),i=await createImageBitmap(n);l[e]=i;const o=new OffscreenCanvas(u,u).getContext("2d");o.drawImage(i,0,0);const s=o.getImageData(0,0,i.width,i.height);c[e]=new Uint32Array(s.data.buffer)}const d=new v({displayName:s,U:t||this.ee?.length||0,A:o||""});d.R=r,d.X=l,d.J=c,this.ee.push(d),console.log(this.ee),console.log("^^^ This ^^^")}}},b=function(e,t,n){const i=this.Z,o=this.j*i,s=n[0],r=n[1],a=n[2],l=n[3],m=this.te,{palette:c,q:u}=this.ne,d=new Map;for(let n=1;n>>24&255)<=m||(i>>>24&255)<=m)continue;const h=u.get(i)??-2,p=u.get(c)??-2;if(h!=p)continue;const b=d.get(p);d.set(p,b?b+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),d},g=new WeakSet,f=async function(e=navigator.userAgent){return(e=e||"").includes("OPR/")||e.includes("Opera")?"Opera":e.includes("Edg/")?"Edge":e.includes("Vivaldi")?"Vivaldi":e.includes("YaBrowser")?"Yandex":e.includes("Kiwi")?"Kiwi":e.includes("Brave")?"Brave":e.includes("Firefox/")?"Firefox":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"},w=function(e=navigator.userAgent){return/Windows NT 11/i.test(e=e||"")?"Windows 11":/Windows NT 10/i.test(e)?"Windows 10":/Windows NT 6\.3/i.test(e)?"Windows 8.1":/Windows NT 6\.2/i.test(e)?"Windows 8":/Windows NT 6\.1/i.test(e)?"Windows 7":/Windows NT 6\.0/i.test(e)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(e)?"Windows XP":/Mac OS X 10[_\.]15/i.test(e)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(e)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(e)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(e)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(e)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(e)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(e)?"macOS":/Android/i.test(e)?"Android":/iPhone|iPad|iPod/i.test(e)?"iOS":/Linux/i.test(e)?"Linux":"Unknown"};var x=GM_info.script.name.toString(),S=GM_info.script.version.toString();!function(e){const t=document.createElement("script");t.setAttribute("bm-E",x),t.setAttribute("bm-B","color: cornflowerblue;"),t.textContent=`(${e})();`,document.documentElement?.appendChild(t),t.remove()}(()=>{const e=document.currentScript,t=e?.getAttribute("bm-E")||"Blue Marble",n=e?.getAttribute("bm-B")||"",i=new Map;window.addEventListener("message",e=>{const{source:o,endpoint:s,blobID:r,blobData:a,blink:l}=e.data,m=Date.now()-l;if(console.groupCollapsed(`%c${t}%c: ${i.size} Recieved IMAGE message about blob "${r}"`,n,""),console.log(`Blob fetch took %c${String(Math.floor(m/6e4)).padStart(2,"0")}:${String(Math.floor(m/1e3)%60).padStart(2,"0")}.${String(m%1e3).padStart(3,"0")}%c MM:SS.mmm`,n,""),console.log(i),console.groupEnd(),"blue-marble"==o&&r&&a&&!s){const e=i.get(r);"function"==typeof e?e(a):function(...e){(0,console.warn)(...e)}(`%c${t}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,n,"",r),i.delete(r)}});const o=window.fetch;window.fetch=async function(...e){const s=await o.apply(this,e),r=s.clone(),a=(e[0]instanceof Request?e[0]?.url:e[0])||"ignore",l=r.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${t}%c: Sending JSON message about endpoint "${a}"`,n,""),r.json().then(e=>{window.postMessage({source:"blue-marble",endpoint:a,jsonData:e},"*")}).catch(e=>{console.error(`%c${t}%c: Failed to parse JSON: `,n,"",e)});else if(l.includes("image/")&&!a.includes("openfreemap")&&!a.includes("maps")){const e=Date.now(),o=await r.blob();return console.log(`%c${t}%c: ${i.size} Sending IMAGE message about endpoint "${a}"`,n,""),new Promise(s=>{const l=crypto.randomUUID();i.set(l,e=>{s(new Response(e,{headers:r.headers,status:r.status,statusText:r.statusText})),console.log(`%c${t}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:a,blobID:l,blobData:o,blink:e})}).catch(o=>{const s=Date.now();console.error(`%c${t}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${t}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${a}\nThere are ${i.size} blobs processing...\nBlink: ${e.toLocaleString()}\nTime Since Blink: ${String(Math.floor(s/6e4)).padStart(2,"0")}:${String(Math.floor(s/1e3)%60).padStart(2,"0")}.${String(s%1e3).padStart(3,"0")} MM:SS.mmm`),console.error("Exception stack:",o),console.groupEnd()})}return s}});var $=GM_getResourceText("CSS-BM-File");GM_addStyle($);var M,T="robotoMonoInjectionPoint";T.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(T)):((M=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",M.rel="preload",M.as="style",M.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(M)),new class{constructor(){this.ie=null,this.oe=null,this.se="#bm-h"}re(e){return this.oe=e,this.ie=new MutationObserver(e=>{for(const t of e)for(const e of t.addedNodes)e instanceof HTMLElement&&e.matches?.(this.se)}),this}ae(){return this.ie}observe(e,t=!1,n=!1){e.observe(this.oe,{childList:t,subtree:n})}};var D=new s(x,S),k=(new s(x,S),new class{constructor(e,t,n){i(this,d),this.name=e,this.version=t,this.o=n,this.le="1.0.0",this.me=null,this.ce="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.j=1e3,this.Z=3,this.te=3,this.ne=function(e){const t=y;t.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),t.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of t){if(0==i.id||-2==i.id)continue;const t=i.rgb[0],o=i.rgb[1],s=i.rgb[2];for(let r=-e;r<=e;r++)for(let a=-e;a<=e;a++)for(let l=-e;l<=e;l++){const e=t+r,m=o+a,c=s+l;if(e<0||e>255||m<0||m>255||c<0||c>255)continue;const u=(255<<24|c<<16|m<<8|e)>>>0;n.has(u)||n.set(u,i.id)}}return{palette:t,q:n}}(this.te),this.ue=null,this.de="",this.ee=[],this.K=null,this.he=!0,this.pe=null}async be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.le,templates:{}}}async ge(e,t,n){this.K||(this.K=await this.be(),console.log("Creating JSON...")),this.o._(`Creating template at ${n.join(", ")}...`);const i=new v({displayName:t,U:0,A:a(this.me||0,this.ce),file:e,coords:n}),{V:s,H:r}=await i.Y(this.j,this.ne);i.X=s;const l={total:i.R.total,colors:Object.fromEntries(i.R.colors)};this.K.templates[`${i.U} ${i.A}`]={name:i.displayName,coords:n.join(", "),enabled:!0,pixels:l,tiles:r},this.ee=[],this.ee.push(i),this.o._(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.K.templates).length),console.log(this.K),console.log(this.ee),console.log(JSON.stringify(this.K)),await o(this,d,h).call(this)}fe(){}async we(){this.K||(this.K=await this.be(),console.log("Creating JSON..."))}async ye(e,t){if(!this.he)return e;const n=this.j*this.Z;t=t[0].toString().padStart(4,"0")+","+t[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${t}"`);const i=this.ee;console.log(i),i.sort((e,t)=>e.U-t.U),console.log(i);const s=i.map(e=>{const n=Object.keys(e.X).filter(e=>e.startsWith(t));if(0===n.length)return null;const i=n.map(t=>{const n=t.split(",");return{ve:e.X[t],J:e.J?.[t],xe:[n[0],n[1]],Se:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(s);const r=s?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.o._(`Sleeping\nVersion: ${this.version}`),e;{const e=i.filter(e=>Object.keys(e.X).filter(e=>e.startsWith(t)).length>0).reduce((e,t)=>e+(t.R.total||0),0),n=(new Intl.NumberFormat).format(e);this.o._(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${n}`)}const a=await createImageBitmap(e),l=new OffscreenCanvas(n,n),m=l.getContext("2d");m.imageSmoothingEnabled=!1,m.beginPath(),m.rect(0,0,n,n),m.clip(),m.clearRect(0,0,n,n),m.drawImage(a,0,0,n,n);const c=m.getImageData(0,0,n,n),u=new Uint32Array(c.data.buffer);for(const e of s){console.log("Template:"),console.log(e);const n=Number(e.Se[0])*this.Z,i=Number(e.Se[1])*this.Z;m.drawImage(e.ve,n,i);let s=e.J;if(console.log("TemplateBeforeFilter32: ",s),!s){const t=m.getImageData(n,i,e.ve.width,e.ve.height);s=new Uint32Array(t.data.buffer)}const r=Date.now(),a=o(this,d,b).call(this,u,s,[n,i,e.ve.width,e.ve.height]);let l=0;const c=0;for(const[e,t]of a)e!=c&&(l+=t);console.log(`Finished calculating correct pixels for the tile ${t} in ${(Date.now()-r)/1e3} seconds!\nThere are ${l} correct pixels.`)}return await l.convertToBlob({type:"image/png"})}$e(e){console.log("Importing JSON..."),console.log(e),"BlueMarble"==e?.whoami&&o(this,d,p).call(this,e)}Me(e){this.he=e}}(x,S,D)),O=new class{constructor(e){i(this,g),this.Te=e,this.De=!1,this.ke=[],this.Oe=[]}Ce(e){window.addEventListener("message",async t=>{const n=t.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(e=>e&&isNaN(Number(e))).filter(e=>e&&!e.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(i.status&&"2"!=i.status?.toString()[0])return void e.W("You are not logged in!\nCould not fetch userdata.");const t=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);console.log(i.id),(i.id||0===i.id)&&console.log(a(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Te.me=i.id,e.B("bm-p",`Droplets: ${(new Intl.NumberFormat).format(i.droplets)}`),e.B("bm-i",`Next level in ${(new Intl.NumberFormat).format(t)} pixel${1==t?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(e=>e&&!isNaN(Number(e))),l=new URLSearchParams(n.endpoint.split("?")[1]),m=[l.get("x"),l.get("y")];if(this.ke.length&&(!o.length||!m.length))return void e.W("Coordinates are malformed!\nDid you try clicking the canvas first?");this.ke=[...o,...m];const c=(s=o,r=m,[parseInt(s[0])%4*1e3+parseInt(r[0]),parseInt(s[1])%4*1e3+parseInt(r[1])]),u=document.querySelectorAll("span");for(const e of u)if(e.textContent.trim().includes(`${c[0]}, ${c[1]}`)){let t=document.querySelector("#bm-h");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${m[0]}, Px Y: ${m[1]})`;t?t.textContent=n:(t=document.createElement("span"),t.id="bm-h",t.textContent=n,t.style="margin-left: calc(var(--spacing)*3); font-size: small;",e.parentNode.parentNode.insertAdjacentElement("afterend",t))}break;case"tiles":let d=n.endpoint.split("/");d=[parseInt(d[d.length-2]),parseInt(d[d.length-1].replace(".png",""))];const h=n.blobID,p=n.blobData,b=Date.now(),g=await this.Te.ye(p,d);console.log(`Finished loading the tile in ${(Date.now()-b)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:h,blobData:g,blink:n.blink});break;case"robots":this.De="false"==i.userscript?.toString().toLowerCase();break}var s,r})}async Ne(e){console.log("Sending heartbeat to telemetry server...");let t=GM_getValue("bmUserSettings","{}");if(t=JSON.parse(t),!t||!t.telemetry||!t.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await o(this,g,f).call(this,n),s=o(this,g,w).call(this,n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:t.uuid,version:e,browser:i,os:s}),onload:e=>{200!==e.status&&r("Failed to send heartbeat:",e.statusText)},onerror:e=>{r("Error sending heartbeat:",e)}})}}(k);D.u(O);var C=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(C),k.$e(C);var N=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(N),console.log(Object.keys(N).length),0==Object.keys(N).length){const e=crypto.randomUUID();console.log(e),GM.setValue("bmUserSettings",JSON.stringify({uuid:e}))}if(setInterval(()=>O.Ne(S),18e5),console.log(`Telemetry is ${!(null==N?.telemetry)}`),null==N?.telemetry||N?.telemetry>1){const e=new s(x,S);e.u(O),e.v({id:"bm-d",style:"top: 0px; left: 0px; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; z-index: 9999;"}).v({id:"bm-7",style:"display: flex; flex-direction: column; align-items: center;"}).v({id:"bm-1",style:"margin-top: 10%;"}).T(1,{textContent:`${x} Telemetry`}).h().h().v({id:"bm-e",style:"max-width: 50%; overflow-y: auto; max-height: 80vh;"}).D().h().k().h().v({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-8",textContent:"More Information"},(e,t)=>{t.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).h().h().k().h().v({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-5",textContent:"Enable Telemetry",style:"margin-right: 2ch;"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=1,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).h().C({id:"bm-2",textContent:"Disable Telemetry"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=0,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).h().h().k().h().S({textContent:"We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the 'Disable' button, but keeping it on helps us improve features and reliability faster. Thank you for supporting the Blue Marble!"}).h().S({textContent:'You can disable telemetry by pressing the "Disable" button below.'}).h().h().h().p(document.body)}!function(){let e=!1;D.v({id:"bm-A",style:"top: 10px; right: 75px;"}).v({id:"bm-j"}).v({id:"bm-z"}).h().M({alt:"Blue Marble Icon - Click to minimize/maximize",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png",style:"cursor: pointer;"},(t,n)=>{n.addEventListener("click",()=>{e=!e;const i=document.querySelector("#bm-A"),o=document.querySelector("#bm-j"),s=document.querySelector("#bm-z"),r=document.querySelector("#bm-k"),a=document.querySelector("#bm-q"),l=document.querySelector("#bm-r"),m=document.querySelector("#bm-s"),c=document.querySelector("#bm-l"),u=document.querySelectorAll("#bm-k input");e||(i.style.width="auto",i.style.maxWidth="300px",i.style.minWidth="200px",i.style.padding="10px"),["#bm-A h1","#bm-f","#bm-A hr","#bm-c > *:not(#bm-k)","#bm-a","#bm-6",`#${t.i}`].forEach(t=>{document.querySelectorAll(t).forEach(t=>{t.style.display=e?"none":""})}),e?(r&&(r.style.display="none"),a&&(a.style.display="none"),l&&(l.style.display="none"),m&&(m.style.display="none"),c&&(c.style.display="none"),u.forEach(e=>{e.style.display="none"}),i.style.width="60px",i.style.height="76px",i.style.maxWidth="60px",i.style.minWidth="60px",i.style.padding="8px",n.style.marginLeft="3px",o.style.textAlign="center",o.style.margin="0",o.style.marginBottom="0",s&&(s.style.display="",s.style.marginBottom="0.25em")):(r&&(r.style.display="",r.style.flexDirection="",r.style.justifyContent="",r.style.alignItems="",r.style.gap="",r.style.textAlign="",r.style.margin=""),a&&(a.style.display=""),l&&(l.style.display="",l.style.marginTop=""),m&&(m.style.display="",m.style.marginTop=""),c&&(c.style.display="",c.style.marginTop=""),u.forEach(e=>{e.style.display=""}),n.style.marginLeft="",i.style.padding="10px",o.style.textAlign="",o.style.margin="",o.style.marginBottom="",s&&(s.style.marginBottom="0.5em"),i.style.width="",i.style.height=""),n.alt=e?"Blue Marble Icon - Minimized (Click to maximize)":"Blue Marble Icon - Maximized (Click to minimize)"})}).h().T(1,{textContent:x}).h().h().D().h().v({id:"bm-f"}).S({id:"bm-p",textContent:"Droplets:"}).h().S({id:"bm-i",textContent:"Next level in..."}).h().h().D().h().v({id:"bm-c"}).v({id:"bm-k"}).C({id:"bm-q",className:"bm-D",style:"margin-top: 0;",innerHTML:''},(e,t)=>{t.onclick=()=>{const t=e.t?.ke;t?.[0]?(e.B("bm-v",t?.[0]||""),e.B("bm-w",t?.[1]||""),e.B("bm-x",t?.[2]||""),e.B("bm-y",t?.[3]||"")):e.W("Coordinates are malformed! Did you try clicking on the canvas first?")}}).h().I({type:"number",id:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(e,t)=>{t.addEventListener("paste",e=>{let t=(e.clipboardData||window.clipboardData).getData("text").split(" ").filter(e=>e).map(Number).filter(e=>!isNaN(e));if(4!==t.length)return;let n=selectAllCoordinateInputs(document);for(let e=0;epersistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().I({type:"number",id:"bm-w",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(e,t)=>{const n=()=>persistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().I({type:"number",id:"bm-x",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(e,t)=>{const n=()=>persistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().I({type:"number",id:"bm-y",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(e,t)=>{const n=()=>persistCoords();t.addEventListener("input",n),t.addEventListener("change",n)}).h().h().L({id:"bm-a",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).h().v({id:"bm-4"}).C({id:"bm-s",textContent:"Enable"},(e,t)=>{t.onclick=()=>{e.t?.Te?.Me(!0),e._("Enabled templates!")}}).h().C({id:"bm-r",textContent:"Create"},(e,t)=>{t.onclick=()=>{const t=document.querySelector("#bm-a"),n=document.querySelector("#bm-v");if(!n.checkValidity())return n.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-w");if(!i.checkValidity())return i.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-x");if(!o.checkValidity())return o.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-y");if(!s.checkValidity())return s.reportValidity(),void e.W("Coordinates are malformed! Did you try clicking on the canvas first?");t?.files[0]?(k.ge(t.files[0],t.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(o.value),Number(s.value)]),e._("Drew to canvas!")):e.W("No file selected!")}}).h().C({id:"bm-l",textContent:"Disable"},(e,t)=>{t.onclick=()=>{e.t?.Te?.Me(!1),e._("Disabled templates!")}}).h().h().P({id:D.i,placeholder:`Status: Sleeping...\nVersion: ${S}`,readOnly:!0}).h().v({id:"bm-6"}).v().C({id:"bm-m",className:"bm-D",innerHTML:"🎨",title:"Template Color Converter"},(e,t)=>{t.addEventListener("click",()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")})}).h().C({id:"bm-n",className:"bm-D",innerHTML:"🌐",title:"Official Blue Marble Website"},(e,t)=>{t.addEventListener("click",()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")})}).h().h().$({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).h().h().h().p(document.body)}(),D.G("#bm-A","#bm-z"),O.Ce(D),new MutationObserver((e,t)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-t");if(!i){i=document.createElement("button"),i.id="bm-t",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const e=this.parentNode.parentNode.parentNode.parentNode,t="Move ↑"==this.textContent;e.parentNode.className=e.parentNode.className.replace(t?"bottom":"top",t?"top":"bottom"),e.style.borderTopLeftRadius=t?"0px":"var(--radius-box)",e.style.borderTopRightRadius=t?"0px":"var(--radius-box)",e.style.borderBottomLeftRadius=t?"var(--radius-box)":"0px",e.style.borderBottomRightRadius=t?"var(--radius-box)":"0px",this.textContent=t?"Move ↓":"Move ↑"};const e=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");e.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),function(...e){(0,console.log)(...e)}(`%c${x}%c (${S}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var e,t,n=e=>{throw TypeError(e)},i=(e,t,i)=>t.has(e)?n("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),s=(e,t,i)=>(((e,t)=>{t.has(e)||n("Cannot access private method")})(e,t),i),o=class{constructor(t,n){i(this,e),this.name=t,this.version=n,this.t=null,this.i="bm-o",this.o=null,this.l=null,this.m=[]}h(e){this.t=e}u(){return this.m.length>0&&(this.l=this.m.pop()),this}p(e){e?.appendChild(this.o),this.o=null,this.l=null,this.m=[]}S(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"div",{},n)),this}$(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"p",{},n)),this}v(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"small",{},n)),this}M(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"details",{},n)),this}T(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"summary",{},n)),this}O(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"img",{},n)),this}D(n,i={},o=()=>{}){return o(this,s(this,e,t).call(this,"h"+n,{},i)),this}k(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"hr",{},n)),this}B(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"br",{},n)),this}N(n={},i=()=>{}){const o=s(this,e,t).call(this,"label",{textContent:n.textContent??""});delete n.textContent;const a=s(this,e,t).call(this,"input",{type:"checkbox"},n);return o.insertBefore(a,o.firstChild),this.u(),i(this,o,a),this}C(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"button",{},n)),this}I(n={},i=()=>{}){const o=n.title??n.textContent??"Help: No info";delete n.textContent,n.title=`Help: ${o}`;const a={textContent:"?",className:"bm-D",onclick:()=>{this.L(this.i,o)}};return i(this,s(this,e,t).call(this,"button",a,n)),this}G(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"input",{},n)),this}P(n={},i=()=>{}){const o=n.textContent??"";delete n.textContent;const a=s(this,e,t).call(this,"div"),r=s(this,e,t).call(this,"input",{type:"file",style:"display: none !important; visibility: hidden !important; position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; opacity: 0 !important;"},n);this.u();const l=s(this,e,t).call(this,"button",{textContent:o});return this.u(),this.u(),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),l.addEventListener("click",()=>{r.click()}),r.addEventListener("change",()=>{l.style.maxWidth=`${l.offsetWidth}px`,r.files.length>0?l.textContent=r.files[0].name:l.textContent=o}),i(this,a,r,l),this}W(n={},i=()=>{}){return i(this,s(this,e,t).call(this,"textarea",{},n)),this}L(e,t,n=!1){const i=document.getElementById(e.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=t:n?i.textContent=t:i.innerHTML=t)}U(e,t){let n,i=!1,s=0,o=null,a=0,r=0,l=0,c=0;if(e=document.querySelector("#"==e?.[0]?e:"#"+e),t=document.querySelector("#"==t?.[0]?t:"#"+t),!e||!t)return void this._(`Can not drag! ${e?"":"moveMe"} ${e||t?"":"and "}${t?"":"iMoveThings "}was not found!`);const m=()=>{if(i){const t=Math.abs(a-l),n=Math.abs(r-c);(t>.5||n>.5)&&(a=l,r=c,e.style.transform=`translate(${a}px, ${r}px)`,e.style.left="0px",e.style.top="0px",e.style.right=""),o=requestAnimationFrame(m)}};let h=null;const u=(u,d)=>{i=!0,h=e.getBoundingClientRect(),n=u-h.left,s=d-h.top;const p=window.getComputedStyle(e).transform;if(p&&"none"!==p){const e=new DOMMatrix(p);a=e.m41,r=e.m42}else a=h.left,r=h.top;l=a,c=r,document.body.style.userSelect="none",t.classList.add("dragging"),o&&cancelAnimationFrame(o),m()},d=()=>{i=!1,o&&(cancelAnimationFrame(o),o=null),document.body.style.userSelect="",t.classList.remove("dragging")};t.addEventListener("mousedown",function(e){e.preventDefault(),u(e.clientX,e.clientY)}),t.addEventListener("touchstart",function(e){const t=e?.touches?.[0];t&&(u(t.clientX,t.clientY),e.preventDefault())},{passive:!1}),document.addEventListener("mousemove",function(e){i&&h&&(l=e.clientX-n,c=e.clientY-s)},{passive:!0}),document.addEventListener("touchmove",function(e){if(i&&h){const t=e?.touches?.[0];if(!t)return;l=t.clientX-n,c=t.clientY-s,e.preventDefault()}},{passive:!1}),document.addEventListener("mouseup",d),document.addEventListener("touchend",d),document.addEventListener("touchcancel",d)}A(e){(0,console.info)(`${this.name}: ${e}`),this.L(this.i,"Status: "+e,!0)}_(e){(0,console.error)(`${this.name}: ${e}`),this.L(this.i,"Error: "+e,!0)}};function a(...e){(0,console.error)(...e)}function r(e,t){if(0===e)return t[0];let n="";const i=t.length;for(;e>0;)n=t[e%i]+n,e=Math.floor(e/i);return n}function l(e){let t="";for(let n=0;n>>24==0?0:s.get(t)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o},u=new WeakSet,d=async function(){GM.setValue("bmTemplates",JSON.stringify(this.ee))},p=async function(e){console.log("Parsing BlueMarble...");const t=e.templates;if(console.log(`BlueMarble length: ${Object.keys(t).length}`),Object.keys(t).length>0)for(const e in t){const n=e,i=t[e];if(console.log(`Template Key: ${n}`),t.hasOwnProperty(e)){const e=n.split(" "),t=Number(e?.[0]),s=e?.[1]||"0",o=i.name||`Template ${t||""}`,a={total:i.pixels.total,colors:new Map(Object.entries(i.pixels.colors).map(([e,t])=>[Number(e),t]))},r=i.tiles,l={},m={},h=this.F*this.te;for(const e in r)if(console.log(e),r.hasOwnProperty(e)){const t=c(r[e]),n=new Blob([t],{type:"image/png"}),i=await createImageBitmap(n);l[e]=i;const s=new OffscreenCanvas(h,h).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);m[e]=new Uint32Array(o.data.buffer)}const u=new S({displayName:o,J:t||this.ne?.length||0,X:s||""});u.Y=a,u.j=l,u.R=m,this.ne.push(u),console.log(this.ne),console.log("^^^ This ^^^")}}},b=function(e,t,n){const i=this.te,s=this.F*i,o=n[0],a=n[1],r=n[2],l=n[3],c=this.ie,{palette:m,Z:h}=this.se,u=new Map;for(let n=1;n>>24&255)<=c||(i>>>24&255)<=c)continue;const d=h.get(i)??-2,p=h.get(m)??-2;if(d!=p)continue;const b=u.get(p);u.set(p,b?b+1:1)}return console.log("List of template pixels that match the tile:"),console.log(u),u},g=new WeakSet,f=async function(e=navigator.userAgent){return(e=e||"").includes("OPR/")||e.includes("Opera")?"Opera":e.includes("Edg/")?"Edge":e.includes("Vivaldi")?"Vivaldi":e.includes("YaBrowser")?"Yandex":e.includes("Kiwi")?"Kiwi":e.includes("Brave")?"Brave":e.includes("Firefox/")?"Firefox":e.includes("Chrome/")?"Chrome":e.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"},w=function(e=navigator.userAgent){return/Windows NT 11/i.test(e=e||"")?"Windows 11":/Windows NT 10/i.test(e)?"Windows 10":/Windows NT 6\.3/i.test(e)?"Windows 8.1":/Windows NT 6\.2/i.test(e)?"Windows 8":/Windows NT 6\.1/i.test(e)?"Windows 7":/Windows NT 6\.0/i.test(e)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(e)?"Windows XP":/Mac OS X 10[_\.]15/i.test(e)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(e)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(e)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(e)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(e)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(e)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(e)?"macOS":/Android/i.test(e)?"Android":/iPhone|iPad|iPod/i.test(e)?"iOS":/Linux/i.test(e)?"Linux":"Unknown"};var $=GM_info.script.name.toString(),v=GM_info.script.version.toString();!function(e){const t=document.createElement("script");t.setAttribute("bm-E",$),t.setAttribute("bm-B","color: cornflowerblue;"),t.textContent=`(${e})();`,document.documentElement?.appendChild(t),t.remove()}(()=>{const e=document.currentScript,t=e?.getAttribute("bm-E")||"Blue Marble",n=e?.getAttribute("bm-B")||"",i=new Map;window.addEventListener("message",e=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=e.data,c=Date.now()-l;if(console.groupCollapsed(`%c${t}%c: ${i.size} Recieved IMAGE message about blob "${a}"`,n,""),console.log(`Blob fetch took %c${String(Math.floor(c/6e4)).padStart(2,"0")}:${String(Math.floor(c/1e3)%60).padStart(2,"0")}.${String(c%1e3).padStart(3,"0")}%c MM:SS.mmm`,n,""),console.log(i),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const e=i.get(a);"function"==typeof e?e(r):function(...e){(0,console.warn)(...e)}(`%c${t}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,n,"",a),i.delete(a)}});const s=window.fetch;window.fetch=async function(...e){const o=await s.apply(this,e),a=o.clone(),r=(e[0]instanceof Request?e[0]?.url:e[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${t}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(e=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:e},"*")}).catch(e=>{console.error(`%c${t}%c: Failed to parse JSON: `,n,"",e)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const e=Date.now(),s=await a.blob();return console.log(`%c${t}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,e=>{o(new Response(e,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${t}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:e})}).catch(s=>{const o=Date.now();console.error(`%c${t}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${t}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${e.toLocaleString()}\nTime Since Blink: ${String(Math.floor(o/6e4)).padStart(2,"0")}:${String(Math.floor(o/1e3)%60).padStart(2,"0")}.${String(o%1e3).padStart(3,"0")} MM:SS.mmm`),console.error("Exception stack:",s),console.groupEnd()})}return o}});var M=GM_getResourceText("CSS-BM-File");GM_addStyle(M);var x,T="robotoMonoInjectionPoint";T.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(T)):((x=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",x.rel="preload",x.as="style",x.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(x)),new class{constructor(){this.oe=null,this.ae=null,this.re="#bm-h"}le(e){return this.ae=e,this.oe=new MutationObserver(e=>{for(const t of e)for(const e of t.addedNodes)e instanceof HTMLElement&&e.matches?.(this.re)}),this}ce(){return this.oe}observe(e,t=!1,n=!1){e.observe(this.ae,{childList:t,subtree:n})}};var O=new o($,v),D=(new o($,v),new class{constructor(e,t,n){i(this,u),this.name=e,this.version=t,this.o=n,this.me="1.0.0",this.he=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.F=1e3,this.te=3,this.ie=3,this.se=function(e){const t=y;t.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),t.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of t){if(0==i.id||-2==i.id)continue;const t=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-e;a<=e;a++)for(let r=-e;r<=e;r++)for(let l=-e;l<=e;l++){const e=t+a,c=s+r,m=o+l;if(e<0||e>255||c<0||c>255||m<0||m>255)continue;const h=(255<<24|m<<16|c<<8|e)>>>0;n.has(h)||n.set(h,i.id)}}return{palette:t,Z:n}}(this.ie),this.de=null,this.pe="",this.ne=[],this.ee=null,this.be=!0,this.ge=null}async fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.me,templates:{}}}async we(e,t,n){this.ee||(this.ee=await this.fe(),console.log("Creating JSON...")),this.o.A(`Creating template at ${n.join(", ")}...`);const i=new S({displayName:t,J:0,X:r(this.he||0,this.ue),file:e,coords:n}),{q:o,K:a}=await i.V(this.F,this.se);i.j=o;const l={total:i.Y.total,colors:Object.fromEntries(i.Y.colors)};this.ee.templates[`${i.J} ${i.X}`]={name:i.displayName,coords:n.join(", "),enabled:!0,pixels:l,tiles:a},this.ne=[],this.ne.push(i),this.o.A(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.ee.templates).length),console.log(this.ee),console.log(this.ne),console.log(JSON.stringify(this.ee)),await s(this,u,d).call(this)}ye(){}async Se(){this.ee||(this.ee=await this.fe(),console.log("Creating JSON..."))}async $e(e,t){if(!this.be)return e;const n=this.F*this.te;t=t[0].toString().padStart(4,"0")+","+t[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${t}"`);const i=this.ne;console.log(i),i.sort((e,t)=>e.J-t.J),console.log(i);const o=i.map(e=>{const n=Object.keys(e.j).filter(e=>e.startsWith(t));if(0===n.length)return null;const i=n.map(t=>{const n=t.split(",");return{ve:e,Me:e.j[t],R:e.R?.[t],xe:[n[0],n[1]],Te:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(o);const a=o?.length||0;if(console.log(`templateCount = ${a}`),!(a>0))return this.o.A(`Sleeping\nVersion: ${this.version}`),e;{const e=i.filter(e=>Object.keys(e.j).filter(e=>e.startsWith(t)).length>0).reduce((e,t)=>e+(t.Y.total||0),0),n=(new Intl.NumberFormat).format(e);this.o.A(`Displaying ${a} template${1==a?"":"s"}.\nTotal pixels: ${n}`)}const r=await createImageBitmap(e),l=new OffscreenCanvas(n,n),c=l.getContext("2d");c.imageSmoothingEnabled=!1,c.beginPath(),c.rect(0,0,n,n),c.clip(),c.clearRect(0,0,n,n),c.drawImage(r,0,0,n,n);const m=c.getImageData(0,0,n,n),h=new Uint32Array(m.data.buffer);for(const e of o){console.log("Template:"),console.log(e);let n=e.R;const i=Number(e.Te[0])*this.te,o=Number(e.Te[1])*this.te;if(c.drawImage(e.Me,i,o),!n){const t=c.getImageData(i,o,e.Me.width,e.Me.height);n=new Uint32Array(t.data.buffer)}const a=Date.now(),r=s(this,u,b).call(this,h,n,[i,o,e.Me.width,e.Me.height]);let l=0;const m=0;for(const[e,t]of r)e!=m&&(l+=t);console.log(`Finished calculating correct pixels for the tile ${t} in ${(Date.now()-a)/1e3} seconds!\nThere are ${l} correct pixels.`),e.ve.Y.correct=r}return await l.convertToBlob({type:"image/png"})}Oe(e){console.log("Importing JSON..."),console.log(e),"BlueMarble"==e?.whoami&&s(this,u,p).call(this,e)}De(e){this.be=e}}($,v,O)),k=new class{constructor(e){i(this,g),this.ke=e,this.Be=!1,this.Ne=[],this.Ce=[]}Ie(e){window.addEventListener("message",async t=>{const n=t.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const s=n.endpoint?.split("?")[0].split("/").filter(e=>e&&isNaN(Number(e))).filter(e=>e&&!e.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",s),s){case"me":if(i.status&&"2"!=i.status?.toString()[0])return void e._("You are not logged in!\nCould not fetch userdata.");const t=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);console.log(i.id),(i.id||0===i.id)&&console.log(r(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.ke.he=i.id,e.L("bm-p",`Droplets: ${(new Intl.NumberFormat).format(i.droplets)}`),e.L("bm-i",`Next level in ${(new Intl.NumberFormat).format(t)} pixel${1==t?"":"s"}`);break;case"pixel":const s=n.endpoint.split("?")[0].split("/").filter(e=>e&&!isNaN(Number(e))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Ne.length&&(!s.length||!c.length))return void e._("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Ne=[...s,...c];const m=(o=s,a=c,[parseInt(o[0])%4*1e3+parseInt(a[0]),parseInt(o[1])%4*1e3+parseInt(a[1])]),h=document.querySelectorAll("span");for(const e of h)if(e.textContent.trim().includes(`${m[0]}, ${m[1]}`)){let t=document.querySelector("#bm-h");const n=`(Tl X: ${s[0]}, Tl Y: ${s[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;t?t.textContent=n:(t=document.createElement("span"),t.id="bm-h",t.textContent=n,t.style="margin-left: calc(var(--spacing)*3); font-size: small;",e.parentNode.parentNode.insertAdjacentElement("afterend",t))}break;case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const d=n.blobID,p=n.blobData,b=Date.now(),g=await this.ke.$e(p,u);console.log(`Finished loading the tile in ${(Date.now()-b)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:d,blobData:g,blink:n.blink});break;case"robots":this.Be="false"==i.userscript?.toString().toLowerCase();break}var o,a})}async Le(e){console.log("Sending heartbeat to telemetry server...");let t=GM_getValue("bmUserSettings","{}");if(t=JSON.parse(t),!t||!t.telemetry||!t.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await s(this,g,f).call(this,n),o=s(this,g,w).call(this,n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:t.uuid,version:e,browser:i,os:o}),onload:e=>{200!==e.status&&a("Failed to send heartbeat:",e.statusText)},onerror:e=>{a("Error sending heartbeat:",e)}})}}(D);O.h(k);var B=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(B),D.Oe(B);var N=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(N),console.log(Object.keys(N).length),0==Object.keys(N).length){const e=crypto.randomUUID();console.log(e),GM.setValue("bmUserSettings",JSON.stringify({uuid:e}))}if(setInterval(()=>k.Le(v),18e5),console.log(`Telemetry is ${!(null==N?.telemetry)}`),null==N?.telemetry||N?.telemetry>1){const e=new o($,v);e.h(k),e.S({id:"bm-d",style:"top: 0px; left: 0px; width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; z-index: 9999;"}).S({id:"bm-7",style:"display: flex; flex-direction: column; align-items: center;"}).S({id:"bm-1",style:"margin-top: 10%;"}).D(1,{textContent:`${$} Telemetry`}).u().u().S({id:"bm-e",style:"max-width: 50%; overflow-y: auto; max-height: 80vh;"}).k().u().B().u().S({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-8",textContent:"More Information"},(e,t)=>{t.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).u().u().B().u().S({style:"width: fit-content; margin: auto; text-align: center;"}).C({id:"bm-5",textContent:"Enable Telemetry",style:"margin-right: 2ch;"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=1,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).u().C({id:"bm-2",textContent:"Disable Telemetry"},(e,t)=>{t.onclick=()=>{const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=0,GM.setValue("bmUserSettings",JSON.stringify(e));const t=document.getElementById("bm-d");t&&(t.style.display="none")}}).u().u().B().u().$({textContent:"We collect anonymous telemetry data such as your browser, OS, and script version to make the experience better for everyone. The data is never shared personally. The data is never sold. You can turn this off by pressing the 'Disable' button, but keeping it on helps us improve features and reliability faster. Thank you for supporting the Blue Marble!"}).u().$({textContent:'You can disable telemetry by pressing the "Disable" button below.'}).u().u().u().p(document.body)}O.S({class:"bm-_",style:"top: 10px; right: 75px;"}).S({class:"bm-X"}).S().C({class:"bm-T",textContent:"▼"},(e,t)=>{t.onclick=()=>{const e=t.closest(".bm-_"),n=t.closest(".bm-X"),i=e.querySelector("h1"),s=e.querySelector(".bm-Q");if("▼"==t.textContent){const n=i.cloneNode(!0);t.parentNode.appendChild(n),s.style.height=s.scrollHeight+"px",e.style.width=e.scrollWidth+"px",s.style.height="0",s.addEventListener("transitionend",function e(){s.style.display="none",s.removeEventListener("transitionend",e)})}else n.querySelector("h1").remove(),s.style.display="",s.style.height="0",e.style.width="",s.style.height=s.scrollHeight+"px",s.addEventListener("transitionend",function e(){s.style.height="",s.removeEventListener("transitionend",e)});t.textContent="▼"==t.textContent?"▶":"▼"}}).u().u().u().S({class:"bm-Q"}).S({class:"bm-V"}).O({class:"bm-Y",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"}).u().D(1,{textContent:$}).u().u().k().u().u().p(document.body),O.U("#bm-A","#bm-z"),k.Ie(O),new MutationObserver((e,t)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-t");if(!i){i=document.createElement("button"),i.id="bm-t",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const e=this.parentNode.parentNode.parentNode.parentNode,t="Move ↑"==this.textContent;e.parentNode.className=e.parentNode.className.replace(t?"bottom":"top",t?"top":"bottom"),e.style.borderTopLeftRadius=t?"0px":"var(--radius-box)",e.style.borderTopRightRadius=t?"0px":"var(--radius-box)",e.style.borderBottomLeftRadius=t?"var(--radius-box)":"0px",e.style.borderBottomRightRadius=t?"var(--radius-box)":"0px",this.textContent=t?"Move ↓":"Move ↑"};const e=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");e.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),function(...e){(0,console.log)(...e)}(`%c${$}%c (${v}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 516a30b..7ecb085 100644 --- a/docs/README.md +++ b/docs/README.md @@ -51,7 +51,7 @@ Contact Me Blue Marble Website WakaTime -Total Patches +Total Patches Total Lines of Code Total Comments Compression diff --git a/package-lock.json b/package-lock.json index 0a18940..423adca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.88.95", + "version": "0.88.122", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.88.95", + "version": "0.88.122", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 3740b83..8aee7ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.88.95", + "version": "0.88.122", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 07aee1e..8516831 100644 --- a/src/BlueMarble.meta.js +++ b/src/BlueMarble.meta.js @@ -2,7 +2,7 @@ // @name Blue Marble // @name:en Blue Marble // @namespace https://github.com/SwingTheVine/ -// @version 0.88.95 +// @version 0.88.122 // @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @description:en A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA. // @author SwingTheVine diff --git a/src/Overlay.js b/src/Overlay.js index 84ec880..f213215 100644 --- a/src/Overlay.js +++ b/src/Overlay.js @@ -73,12 +73,12 @@ export default class Overlay { // For every passed in property (shared by all like-elements), apply the it to the element for (const [property, value] of Object.entries(properties)) { - element[property] = value; + element[(property != 'class') ? property : 'className'] = value; // if the property is 'class', pass in 'className' instead } // For every passed in additional property, apply the it to the element for (const [property, value] of Object.entries(additionalProperties)) { - element[property] = value; + element[(property != 'class') ? property : 'className'] = value; // if the property is 'class', pass in 'className' instead } return element; diff --git a/src/main.js b/src/main.js index de16d49..7690ccd 100644 --- a/src/main.js +++ b/src/main.js @@ -274,343 +274,389 @@ function observeBlack() { */ function buildOverlayMain() { - let isMinimized = false; // Overlay state tracker (false = maximized, true = minimized) + overlayMain.addDiv({'class': 'bm-window', 'style': 'top: 10px; right: 75px;'}) + .addDiv({'class': 'bm-dragbar'}) + .addDiv() + .addButton({'class': 'bm-button-circle', 'textContent': '▼'}, (instance, button) => { + button.onclick = () => { + const window = button.closest('.bm-window'); // Get the window + const dragbar = button.closest('.bm-dragbar'); // Get the dragbar + const header = window.querySelector('h1'); // Get the header + const windowContent = window.querySelector('.bm-window-content'); // Get the window content container + if (button.textContent == '▼') { // If window content is open... + const dragbarHeader1 = header.cloneNode(true); // Makes a copy of the header 1 + button.parentNode.appendChild(dragbarHeader1); // Adds the header to the dragbar + windowContent.style.height = windowContent.scrollHeight + 'px'; + window.style.width = window.scrollWidth + 'px'; // So the width of the window does not change due to the lack of content + windowContent.style.height = '0'; // Set the height to 0px + windowContent.addEventListener('transitionend', function handler() { // Add an event listener to cleanup once the minimize transition is complete + windowContent.style.display = 'none'; // Changes "display" to "none" for screen readers + windowContent.removeEventListener('transitionend', handler); // Removes the event listener + }); + } else { // Else, the window is closed + const dragbarHeader1 = dragbar.querySelector('h1'); // Get the header 1 + dragbarHeader1.remove(); // Removes the dragbar header 1 + windowContent.style.display = ''; // Resets display to default + windowContent.style.height = '0'; // Sets the height to 0 + window.style.width = ''; // Resets the window width to default + windowContent.style.height = windowContent.scrollHeight + 'px'; // Change the height back to normal + windowContent.addEventListener('transitionend', function handler() { // Add an event listener to cleanup once the minimize transition is complete + windowContent.style.height = ''; // Changes the height back to default + windowContent.removeEventListener('transitionend', handler); // Removes the event listener + }); + } + button.textContent = (button.textContent == '▼') ? '▶' : '▼'; // Swap button icon + } + }).buildElement() + .buildElement() + .buildElement() + .addDiv({'class': 'bm-window-content'}) + .addDiv({'class': 'bm-container'}) + .addImg({'class': 'bm-favicon', 'src': 'https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png'}).buildElement() + .addHeader(1, {'textContent': name}).buildElement() + .buildElement() + .addHr() + .buildElement() + .buildElement().buildOverlay(document.body); + + + // let isMinimized = false; // Overlay state tracker (false = maximized, true = minimized) - overlayMain.addDiv({'id': 'bm-overlay', 'style': 'top: 10px; right: 75px;'}) - .addDiv({'id': 'bm-contain-header'}) - .addDiv({'id': 'bm-bar-drag'}).buildElement() - .addImg({'alt': 'Blue Marble Icon - Click to minimize/maximize', 'src': 'https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png', 'style': 'cursor: pointer;'}, - (instance, img) => { - /** Click event handler for overlay minimize/maximize functionality. - * - * Toggles between two distinct UI states: - * 1. MINIMIZED STATE (60×76px): - * - Shows only the Blue Marble icon and drag bar - * - Hides all input fields, buttons, and status information - * - Applies fixed dimensions for consistent appearance - * - Repositions icon with 3px right offset for visual centering - * - * 2. MAXIMIZED STATE (responsive): - * - Restores full functionality with all UI elements - * - Removes fixed dimensions to allow responsive behavior - * - Resets icon positioning to default alignment - * - Shows success message when returning to maximized state - * - * @param {Event} event - The click event object (implicit) - */ - img.addEventListener('click', () => { - isMinimized = !isMinimized; // Toggle the current state + // overlayMain.addDiv({'id': 'bm-overlay', 'style': 'top: 10px; right: 75px;'}) + // .addDiv({'id': 'bm-contain-header'}) + // .addDiv({'id': 'bm-bar-drag'}).buildElement() + // .addImg({'alt': 'Blue Marble Icon - Click to minimize/maximize', 'src': 'https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png', 'style': 'cursor: pointer;'}, + // (instance, img) => { + // /** Click event handler for overlay minimize/maximize functionality. + // * + // * Toggles between two distinct UI states: + // * 1. MINIMIZED STATE (60×76px): + // * - Shows only the Blue Marble icon and drag bar + // * - Hides all input fields, buttons, and status information + // * - Applies fixed dimensions for consistent appearance + // * - Repositions icon with 3px right offset for visual centering + // * + // * 2. MAXIMIZED STATE (responsive): + // * - Restores full functionality with all UI elements + // * - Removes fixed dimensions to allow responsive behavior + // * - Resets icon positioning to default alignment + // * - Shows success message when returning to maximized state + // * + // * @param {Event} event - The click event object (implicit) + // */ + // img.addEventListener('click', () => { + // isMinimized = !isMinimized; // Toggle the current state - const overlay = document.querySelector('#bm-overlay'); - const header = document.querySelector('#bm-contain-header'); - const dragBar = document.querySelector('#bm-bar-drag'); - const coordsContainer = document.querySelector('#bm-contain-coords'); - const coordsButton = document.querySelector('#bm-button-coords'); - const createButton = document.querySelector('#bm-button-create'); - const enableButton = document.querySelector('#bm-button-enable'); - const disableButton = document.querySelector('#bm-button-disable'); - const coordInputs = document.querySelectorAll('#bm-contain-coords input'); + // const overlay = document.querySelector('#bm-overlay'); + // const header = document.querySelector('#bm-contain-header'); + // const dragBar = document.querySelector('#bm-bar-drag'); + // const coordsContainer = document.querySelector('#bm-contain-coords'); + // const coordsButton = document.querySelector('#bm-button-coords'); + // const createButton = document.querySelector('#bm-button-create'); + // const enableButton = document.querySelector('#bm-button-enable'); + // const disableButton = document.querySelector('#bm-button-disable'); + // const coordInputs = document.querySelectorAll('#bm-contain-coords input'); - // Pre-restore original dimensions when switching to maximized state - // This ensures smooth transition and prevents layout issues - if (!isMinimized) { - overlay.style.width = "auto"; - overlay.style.maxWidth = "300px"; - overlay.style.minWidth = "200px"; - overlay.style.padding = "10px"; - } + // // Pre-restore original dimensions when switching to maximized state + // // This ensures smooth transition and prevents layout issues + // if (!isMinimized) { + // overlay.style.width = "auto"; + // overlay.style.maxWidth = "300px"; + // overlay.style.minWidth = "200px"; + // overlay.style.padding = "10px"; + // } - // Define elements that should be hidden/shown during state transitions - // Each element is documented with its purpose for maintainability - const elementsToToggle = [ - '#bm-overlay h1', // Main title "Blue Marble" - '#bm-contain-userinfo', // User information section (username, droplets, level) - '#bm-overlay hr', // Visual separator lines - '#bm-contain-automation > *:not(#bm-contain-coords)', // Automation section excluding coordinates - '#bm-input-file-template', // Template file upload interface - '#bm-contain-buttons-action', // Action buttons container - `#${instance.outputStatusId}`, // Status log textarea for user feedback - ]; + // // Define elements that should be hidden/shown during state transitions + // // Each element is documented with its purpose for maintainability + // const elementsToToggle = [ + // '#bm-overlay h1', // Main title "Blue Marble" + // '#bm-contain-userinfo', // User information section (username, droplets, level) + // '#bm-overlay hr', // Visual separator lines + // '#bm-contain-automation > *:not(#bm-contain-coords)', // Automation section excluding coordinates + // '#bm-input-file-template', // Template file upload interface + // '#bm-contain-buttons-action', // Action buttons container + // `#${instance.outputStatusId}`, // Status log textarea for user feedback + // ]; - // Apply visibility changes to all toggleable elements - elementsToToggle.forEach(selector => { - const elements = document.querySelectorAll(selector); - elements.forEach(element => { - element.style.display = isMinimized ? 'none' : ''; - }); - }); - // Handle coordinate container and button visibility based on state - if (isMinimized) { - // ==================== MINIMIZED STATE CONFIGURATION ==================== - // In minimized state, we hide ALL interactive elements except the icon and drag bar - // This creates a clean, unobtrusive interface that maintains only essential functionality + // // Apply visibility changes to all toggleable elements + // elementsToToggle.forEach(selector => { + // const elements = document.querySelectorAll(selector); + // elements.forEach(element => { + // element.style.display = isMinimized ? 'none' : ''; + // }); + // }); + // // Handle coordinate container and button visibility based on state + // if (isMinimized) { + // // ==================== MINIMIZED STATE CONFIGURATION ==================== + // // In minimized state, we hide ALL interactive elements except the icon and drag bar + // // This creates a clean, unobtrusive interface that maintains only essential functionality - // Hide coordinate input container completely - if (coordsContainer) { - coordsContainer.style.display = 'none'; - } + // // Hide coordinate input container completely + // if (coordsContainer) { + // coordsContainer.style.display = 'none'; + // } - // Hide coordinate button (pin icon) - if (coordsButton) { - coordsButton.style.display = 'none'; - } + // // Hide coordinate button (pin icon) + // if (coordsButton) { + // coordsButton.style.display = 'none'; + // } - // Hide create template button - if (createButton) { - createButton.style.display = 'none'; - } + // // Hide create template button + // if (createButton) { + // createButton.style.display = 'none'; + // } - // Hide enable templates button - if (enableButton) { - enableButton.style.display = 'none'; - } + // // Hide enable templates button + // if (enableButton) { + // enableButton.style.display = 'none'; + // } - // Hide disable templates button - if (disableButton) { - disableButton.style.display = 'none'; - } + // // Hide disable templates button + // if (disableButton) { + // disableButton.style.display = 'none'; + // } - // Hide all coordinate input fields individually (failsafe) - coordInputs.forEach(input => { - input.style.display = 'none'; - }); + // // Hide all coordinate input fields individually (failsafe) + // coordInputs.forEach(input => { + // input.style.display = 'none'; + // }); - // Apply fixed dimensions for consistent minimized appearance - // These dimensions were chosen to accommodate the icon while remaining compact - overlay.style.width = '60px'; // Fixed width for consistency - overlay.style.height = '76px'; // Fixed height (60px + 16px for better proportions) - overlay.style.maxWidth = '60px'; // Prevent expansion - overlay.style.minWidth = '60px'; // Prevent shrinking - overlay.style.padding = '8px'; // Comfortable padding around icon + // // Apply fixed dimensions for consistent minimized appearance + // // These dimensions were chosen to accommodate the icon while remaining compact + // overlay.style.width = '60px'; // Fixed width for consistency + // overlay.style.height = '76px'; // Fixed height (60px + 16px for better proportions) + // overlay.style.maxWidth = '60px'; // Prevent expansion + // overlay.style.minWidth = '60px'; // Prevent shrinking + // overlay.style.padding = '8px'; // Comfortable padding around icon - // Apply icon positioning for better visual centering in minimized state - // The 3px offset compensates for visual weight distribution - img.style.marginLeft = '3px'; + // // Apply icon positioning for better visual centering in minimized state + // // The 3px offset compensates for visual weight distribution + // img.style.marginLeft = '3px'; - // Configure header layout for minimized state - header.style.textAlign = 'center'; - header.style.margin = '0'; - header.style.marginBottom = '0'; + // // Configure header layout for minimized state + // header.style.textAlign = 'center'; + // header.style.margin = '0'; + // header.style.marginBottom = '0'; - // Ensure drag bar remains visible and properly spaced - if (dragBar) { - dragBar.style.display = ''; - dragBar.style.marginBottom = '0.25em'; - } - } else { - // ==================== MAXIMIZED STATE RESTORATION ==================== - // In maximized state, we restore all elements to their default functionality - // This involves clearing all style overrides applied during minimization + // // Ensure drag bar remains visible and properly spaced + // if (dragBar) { + // dragBar.style.display = ''; + // dragBar.style.marginBottom = '0.25em'; + // } + // } else { + // // ==================== MAXIMIZED STATE RESTORATION ==================== + // // In maximized state, we restore all elements to their default functionality + // // This involves clearing all style overrides applied during minimization - // Restore coordinate container to default state - if (coordsContainer) { - coordsContainer.style.display = ''; // Show container - coordsContainer.style.flexDirection = ''; // Reset flex layout - coordsContainer.style.justifyContent = ''; // Reset alignment - coordsContainer.style.alignItems = ''; // Reset alignment - coordsContainer.style.gap = ''; // Reset spacing - coordsContainer.style.textAlign = ''; // Reset text alignment - coordsContainer.style.margin = ''; // Reset margins - } + // // Restore coordinate container to default state + // if (coordsContainer) { + // coordsContainer.style.display = ''; // Show container + // coordsContainer.style.flexDirection = ''; // Reset flex layout + // coordsContainer.style.justifyContent = ''; // Reset alignment + // coordsContainer.style.alignItems = ''; // Reset alignment + // coordsContainer.style.gap = ''; // Reset spacing + // coordsContainer.style.textAlign = ''; // Reset text alignment + // coordsContainer.style.margin = ''; // Reset margins + // } - // Restore coordinate button visibility - if (coordsButton) { - coordsButton.style.display = ''; - } + // // Restore coordinate button visibility + // if (coordsButton) { + // coordsButton.style.display = ''; + // } - // Restore create button visibility and reset positioning - if (createButton) { - createButton.style.display = ''; - createButton.style.marginTop = ''; - } + // // Restore create button visibility and reset positioning + // if (createButton) { + // createButton.style.display = ''; + // createButton.style.marginTop = ''; + // } - // Restore enable button visibility and reset positioning - if (enableButton) { - enableButton.style.display = ''; - enableButton.style.marginTop = ''; - } + // // Restore enable button visibility and reset positioning + // if (enableButton) { + // enableButton.style.display = ''; + // enableButton.style.marginTop = ''; + // } - // Restore disable button visibility and reset positioning - if (disableButton) { - disableButton.style.display = ''; - disableButton.style.marginTop = ''; - } + // // Restore disable button visibility and reset positioning + // if (disableButton) { + // disableButton.style.display = ''; + // disableButton.style.marginTop = ''; + // } - // Restore all coordinate input fields - coordInputs.forEach(input => { - input.style.display = ''; - }); + // // Restore all coordinate input fields + // coordInputs.forEach(input => { + // input.style.display = ''; + // }); - // Reset icon positioning to default (remove minimized state offset) - img.style.marginLeft = ''; + // // Reset icon positioning to default (remove minimized state offset) + // img.style.marginLeft = ''; - // Restore overlay to responsive dimensions - overlay.style.padding = '10px'; + // // Restore overlay to responsive dimensions + // overlay.style.padding = '10px'; - // Reset header styling to defaults - header.style.textAlign = ''; - header.style.margin = ''; - header.style.marginBottom = ''; + // // Reset header styling to defaults + // header.style.textAlign = ''; + // header.style.margin = ''; + // header.style.marginBottom = ''; - // Reset drag bar spacing - if (dragBar) { - dragBar.style.marginBottom = '0.5em'; - } + // // Reset drag bar spacing + // if (dragBar) { + // dragBar.style.marginBottom = '0.5em'; + // } - // Remove all fixed dimensions to allow responsive behavior - // This ensures the overlay can adapt to content changes - overlay.style.width = ''; - overlay.style.height = ''; - } + // // Remove all fixed dimensions to allow responsive behavior + // // This ensures the overlay can adapt to content changes + // overlay.style.width = ''; + // overlay.style.height = ''; + // } - // ==================== ACCESSIBILITY AND USER FEEDBACK ==================== - // Update accessibility information for screen readers and tooltips + // // ==================== ACCESSIBILITY AND USER FEEDBACK ==================== + // // Update accessibility information for screen readers and tooltips - // Update alt text to reflect current state for screen readers and tooltips - img.alt = isMinimized ? - 'Blue Marble Icon - Minimized (Click to maximize)' : - 'Blue Marble Icon - Maximized (Click to minimize)'; + // // Update alt text to reflect current state for screen readers and tooltips + // img.alt = isMinimized ? + // 'Blue Marble Icon - Minimized (Click to maximize)' : + // 'Blue Marble Icon - Maximized (Click to minimize)'; - // No status message needed - state change is visually obvious to users - }); - } - ).buildElement() - .addHeader(1, {'textContent': name}).buildElement() - .buildElement() + // // No status message needed - state change is visually obvious to users + // }); + // } + // ).buildElement() + // .addHeader(1, {'textContent': name}).buildElement() + // .buildElement() - .addHr().buildElement() + // .addHr().buildElement() - .addDiv({'id': 'bm-contain-userinfo'}) - .addP({'id': 'bm-user-droplets', 'textContent': 'Droplets:'}).buildElement() - .addP({'id': 'bm-user-nextlevel', 'textContent': 'Next level in...'}).buildElement() - .buildElement() + // .addDiv({'id': 'bm-contain-userinfo'}) + // .addP({'id': 'bm-user-droplets', 'textContent': 'Droplets:'}).buildElement() + // .addP({'id': 'bm-user-nextlevel', 'textContent': 'Next level in...'}).buildElement() + // .buildElement() - .addHr().buildElement() + // .addHr().buildElement() - .addDiv({'id': 'bm-contain-automation'}) - // .addCheckbox({'id': 'bm-input-stealth', 'textContent': 'Stealth', 'checked': true}).buildElement() - // .addButtonHelp({'title': 'Waits for the website to make requests, instead of sending requests.'}).buildElement() - // .addBr().buildElement() - // .addCheckbox({'id': 'bm-input-possessed', 'textContent': 'Possessed', 'checked': true}).buildElement() - // .addButtonHelp({'title': 'Controls the website as if it were possessed.'}).buildElement() - // .addBr().buildElement() - .addDiv({'id': 'bm-contain-coords'}) - .addButton({'id': 'bm-button-coords', 'className': 'bm-help', 'style': 'margin-top: 0;', 'innerHTML': ''}, - (instance, button) => { - button.onclick = () => { - const coords = instance.apiManager?.coordsTilePixel; // Retrieves the coords from the API manager - if (!coords?.[0]) { - instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); - return; - } - instance.updateInnerHTML('bm-input-tx', coords?.[0] || ''); - instance.updateInnerHTML('bm-input-ty', coords?.[1] || ''); - instance.updateInnerHTML('bm-input-px', coords?.[2] || ''); - instance.updateInnerHTML('bm-input-py', coords?.[3] || ''); - } - } - ).buildElement() - .addInput({'type': 'number', 'id': 'bm-input-tx', 'placeholder': 'Tl X', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { - //if a paste happens on tx, split and format it into other coordinates if possible - input.addEventListener("paste", (event) => { - let splitText = (event.clipboardData || window.clipboardData).getData("text").split(" ").filter(n => n).map(Number).filter(n => !isNaN(n)); //split and filter all Non Numbers + // .addDiv({'id': 'bm-contain-automation'}) + // // .addCheckbox({'id': 'bm-input-stealth', 'textContent': 'Stealth', 'checked': true}).buildElement() + // // .addButtonHelp({'title': 'Waits for the website to make requests, instead of sending requests.'}).buildElement() + // // .addBr().buildElement() + // // .addCheckbox({'id': 'bm-input-possessed', 'textContent': 'Possessed', 'checked': true}).buildElement() + // // .addButtonHelp({'title': 'Controls the website as if it were possessed.'}).buildElement() + // // .addBr().buildElement() + // .addDiv({'id': 'bm-contain-coords'}) + // .addButton({'id': 'bm-button-coords', 'className': 'bm-help', 'style': 'margin-top: 0;', 'innerHTML': ''}, + // (instance, button) => { + // button.onclick = () => { + // const coords = instance.apiManager?.coordsTilePixel; // Retrieves the coords from the API manager + // if (!coords?.[0]) { + // instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); + // return; + // } + // instance.updateInnerHTML('bm-input-tx', coords?.[0] || ''); + // instance.updateInnerHTML('bm-input-ty', coords?.[1] || ''); + // instance.updateInnerHTML('bm-input-px', coords?.[2] || ''); + // instance.updateInnerHTML('bm-input-py', coords?.[3] || ''); + // } + // } + // ).buildElement() + // .addInput({'type': 'number', 'id': 'bm-input-tx', 'placeholder': 'Tl X', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { + // //if a paste happens on tx, split and format it into other coordinates if possible + // input.addEventListener("paste", (event) => { + // let splitText = (event.clipboardData || window.clipboardData).getData("text").split(" ").filter(n => n).map(Number).filter(n => !isNaN(n)); //split and filter all Non Numbers - if (splitText.length !== 4 ) { // If we don't have 4 clean coordinates, end the function. - return; - } + // if (splitText.length !== 4 ) { // If we don't have 4 clean coordinates, end the function. + // return; + // } - let coords = selectAllCoordinateInputs(document); + // let coords = selectAllCoordinateInputs(document); - for (let i = 0; i < coords.length; i++) { - coords[i].value = splitText[i]; //add the split vales - } + // for (let i = 0; i < coords.length; i++) { + // coords[i].value = splitText[i]; //add the split vales + // } - event.preventDefault(); //prevent the pasting of the original paste that would overide the split value - }) - const handler = () => persistCoords(); - input.addEventListener('input', handler); - input.addEventListener('change', handler); - }).buildElement() - .addInput({'type': 'number', 'id': 'bm-input-ty', 'placeholder': 'Tl Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { - const handler = () => persistCoords(); - input.addEventListener('input', handler); - input.addEventListener('change', handler); - }).buildElement() - .addInput({'type': 'number', 'id': 'bm-input-px', 'placeholder': 'Px X', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { - const handler = () => persistCoords(); - input.addEventListener('input', handler); - input.addEventListener('change', handler); - }).buildElement() - .addInput({'type': 'number', 'id': 'bm-input-py', 'placeholder': 'Px Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { - const handler = () => persistCoords(); - input.addEventListener('input', handler); - input.addEventListener('change', handler); - }).buildElement() - .buildElement() - .addInputFile({'id': 'bm-input-file-template', 'textContent': 'Upload Template', 'accept': 'image/png, image/jpeg, image/webp, image/bmp, image/gif'}).buildElement() - .addDiv({'id': 'bm-contain-buttons-template'}) - .addButton({'id': 'bm-button-enable', 'textContent': 'Enable'}, (instance, button) => { - button.onclick = () => { - instance.apiManager?.templateManager?.setTemplatesShouldBeDrawn(true); - instance.handleDisplayStatus(`Enabled templates!`); - } - }).buildElement() - .addButton({'id': 'bm-button-create', 'textContent': 'Create'}, (instance, button) => { - button.onclick = () => { - const input = document.querySelector('#bm-input-file-template'); + // event.preventDefault(); //prevent the pasting of the original paste that would overide the split value + // }) + // const handler = () => persistCoords(); + // input.addEventListener('input', handler); + // input.addEventListener('change', handler); + // }).buildElement() + // .addInput({'type': 'number', 'id': 'bm-input-ty', 'placeholder': 'Tl Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { + // const handler = () => persistCoords(); + // input.addEventListener('input', handler); + // input.addEventListener('change', handler); + // }).buildElement() + // .addInput({'type': 'number', 'id': 'bm-input-px', 'placeholder': 'Px X', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { + // const handler = () => persistCoords(); + // input.addEventListener('input', handler); + // input.addEventListener('change', handler); + // }).buildElement() + // .addInput({'type': 'number', 'id': 'bm-input-py', 'placeholder': 'Px Y', 'min': 0, 'max': 2047, 'step': 1, 'required': true}, (instance, input) => { + // const handler = () => persistCoords(); + // input.addEventListener('input', handler); + // input.addEventListener('change', handler); + // }).buildElement() + // .buildElement() + // .addInputFile({'id': 'bm-input-file-template', 'textContent': 'Upload Template', 'accept': 'image/png, image/jpeg, image/webp, image/bmp, image/gif'}).buildElement() + // .addDiv({'id': 'bm-contain-buttons-template'}) + // .addButton({'id': 'bm-button-enable', 'textContent': 'Enable'}, (instance, button) => { + // button.onclick = () => { + // instance.apiManager?.templateManager?.setTemplatesShouldBeDrawn(true); + // instance.handleDisplayStatus(`Enabled templates!`); + // } + // }).buildElement() + // .addButton({'id': 'bm-button-create', 'textContent': 'Create'}, (instance, button) => { + // button.onclick = () => { + // const input = document.querySelector('#bm-input-file-template'); - const coordTlX = document.querySelector('#bm-input-tx'); - if (!coordTlX.checkValidity()) {coordTlX.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} - const coordTlY = document.querySelector('#bm-input-ty'); - if (!coordTlY.checkValidity()) {coordTlY.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} - const coordPxX = document.querySelector('#bm-input-px'); - if (!coordPxX.checkValidity()) {coordPxX.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} - const coordPxY = document.querySelector('#bm-input-py'); - if (!coordPxY.checkValidity()) {coordPxY.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} + // const coordTlX = document.querySelector('#bm-input-tx'); + // if (!coordTlX.checkValidity()) {coordTlX.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} + // const coordTlY = document.querySelector('#bm-input-ty'); + // if (!coordTlY.checkValidity()) {coordTlY.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} + // const coordPxX = document.querySelector('#bm-input-px'); + // if (!coordPxX.checkValidity()) {coordPxX.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} + // const coordPxY = document.querySelector('#bm-input-py'); + // if (!coordPxY.checkValidity()) {coordPxY.reportValidity(); instance.handleDisplayError('Coordinates are malformed! Did you try clicking on the canvas first?'); return;} - // Kills itself if there is no file - if (!input?.files[0]) {instance.handleDisplayError(`No file selected!`); return;} + // // Kills itself if there is no file + // if (!input?.files[0]) {instance.handleDisplayError(`No file selected!`); return;} - templateManager.createTemplate(input.files[0], input.files[0]?.name.replace(/\.[^/.]+$/, ''), [Number(coordTlX.value), Number(coordTlY.value), Number(coordPxX.value), Number(coordPxY.value)]); + // templateManager.createTemplate(input.files[0], input.files[0]?.name.replace(/\.[^/.]+$/, ''), [Number(coordTlX.value), Number(coordTlY.value), Number(coordPxX.value), Number(coordPxY.value)]); - // console.log(`TCoords: ${apiManager.templateCoordsTilePixel}\nCoords: ${apiManager.coordsTilePixel}`); - // apiManager.templateCoordsTilePixel = apiManager.coordsTilePixel; // Update template coords - // console.log(`TCoords: ${apiManager.templateCoordsTilePixel}\nCoords: ${apiManager.coordsTilePixel}`); - // templateManager.setTemplateImage(input.files[0]); + // // console.log(`TCoords: ${apiManager.templateCoordsTilePixel}\nCoords: ${apiManager.coordsTilePixel}`); + // // apiManager.templateCoordsTilePixel = apiManager.coordsTilePixel; // Update template coords + // // console.log(`TCoords: ${apiManager.templateCoordsTilePixel}\nCoords: ${apiManager.coordsTilePixel}`); + // // templateManager.setTemplateImage(input.files[0]); - instance.handleDisplayStatus(`Drew to canvas!`); - } - }).buildElement() - .addButton({'id': 'bm-button-disable', 'textContent': 'Disable'}, (instance, button) => { - button.onclick = () => { - instance.apiManager?.templateManager?.setTemplatesShouldBeDrawn(false); - instance.handleDisplayStatus(`Disabled templates!`); - } - }).buildElement() - .buildElement() - .addTextarea({'id': overlayMain.outputStatusId, 'placeholder': `Status: Sleeping...\nVersion: ${version}`, 'readOnly': true}).buildElement() - .addDiv({'id': 'bm-contain-buttons-action'}) - .addDiv() - // .addButton({'id': 'bm-button-teleport', 'className': 'bm-help', 'textContent': '✈'}).buildElement() - // .addButton({'id': 'bm-button-favorite', 'className': 'bm-help', 'innerHTML': ''}).buildElement() - // .addButton({'id': 'bm-button-templates', 'className': 'bm-help', 'innerHTML': '🖌'}).buildElement() - .addButton({'id': 'bm-button-convert', 'className': 'bm-help', 'innerHTML': '🎨', 'title': 'Template Color Converter'}, - (instance, button) => { - button.addEventListener('click', () => { - window.open('https://pepoafonso.github.io/color_converter_wplace/', '_blank', 'noopener noreferrer'); - }); - }).buildElement() - .addButton({'id': 'bm-button-website', 'className': 'bm-help', 'innerHTML': '🌐', 'title': 'Official Blue Marble Website'}, - (instance, button) => { - button.addEventListener('click', () => { - window.open('https://bluemarble.lol/', '_blank', 'noopener noreferrer'); - }); - }).buildElement() - .buildElement() - .addSmall({'textContent': 'Made by SwingTheVine', 'style': 'margin-top: auto;'}).buildElement() - .buildElement() - .buildElement() - .buildOverlay(document.body); + // instance.handleDisplayStatus(`Drew to canvas!`); + // } + // }).buildElement() + // .addButton({'id': 'bm-button-disable', 'textContent': 'Disable'}, (instance, button) => { + // button.onclick = () => { + // instance.apiManager?.templateManager?.setTemplatesShouldBeDrawn(false); + // instance.handleDisplayStatus(`Disabled templates!`); + // } + // }).buildElement() + // .buildElement() + // .addTextarea({'id': overlayMain.outputStatusId, 'placeholder': `Status: Sleeping...\nVersion: ${version}`, 'readOnly': true}).buildElement() + // .addDiv({'id': 'bm-contain-buttons-action'}) + // .addDiv() + // // .addButton({'id': 'bm-button-teleport', 'className': 'bm-help', 'textContent': '✈'}).buildElement() + // // .addButton({'id': 'bm-button-favorite', 'className': 'bm-help', 'innerHTML': ''}).buildElement() + // // .addButton({'id': 'bm-button-templates', 'className': 'bm-help', 'innerHTML': '🖌'}).buildElement() + // .addButton({'id': 'bm-button-convert', 'className': 'bm-help', 'innerHTML': '🎨', 'title': 'Template Color Converter'}, + // (instance, button) => { + // button.addEventListener('click', () => { + // window.open('https://pepoafonso.github.io/color_converter_wplace/', '_blank', 'noopener noreferrer'); + // }); + // }).buildElement() + // .addButton({'id': 'bm-button-website', 'className': 'bm-help', 'innerHTML': '🌐', 'title': 'Official Blue Marble Website'}, + // (instance, button) => { + // button.addEventListener('click', () => { + // window.open('https://bluemarble.lol/', '_blank', 'noopener noreferrer'); + // }); + // }).buildElement() + // .buildElement() + // .addSmall({'textContent': 'Made by SwingTheVine', 'style': 'margin-top: auto;'}).buildElement() + // .buildElement() + // .buildElement() + // .buildOverlay(document.body); } function buildTelemetryOverlay(overlay) { diff --git a/src/overlay.css b/src/overlay.css index 14b3673..d0b6315 100644 --- a/src/overlay.css +++ b/src/overlay.css @@ -1,5 +1,149 @@ /* @since 0.5.1 */ + +/* The Blue Marble window(s) */ +.bm-window { + position: fixed; + background-color: rgba(21, 48, 99, 0.9); + color: white; + padding: 10px; + border-radius: 8px; + z-index: 9000; + transition: all 0.3s ease, transform 0s; + max-width: 300px; + width: auto; + /* Font stack is as follows: + * Highest Priority (Roboto Mono) + * Windows fallback (Courier New) + * macOS fallback (Monaco) + * Linux fallback (DejaVu Sans Mono) + * Any possible monospace font (monospace) + * Last resort (Arial) */ + font-family: 'Roboto Mono', 'Courier New', 'Monaco', 'DejaVu Sans Mono', monospace, 'Arial'; + letter-spacing: 0.05em; +} + +/* The drag bar */ +.bm-dragbar { + display: flex; + align-items: center; + flex-wrap: nowrap; + justify-content: space-between; + gap: 0.5ch; + /* For background circles, width & height should be odd, cx & cy should be half of width & height, and r should be less than or equal to cx & cy */ + background: url('data:image/svg+xml;utf8,') repeat; + cursor: grab; + width: 100%; + height: fit-content; +} + +/* When a window is being dragged */ +.bm-dragbar.bm-dragging { + cursor: grabbing; +} + +/* Disable interactions during drag for better performance */ +.bm-window:has(.bm-dragbar.bm-dragging) { + pointer-events: none; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} + +/* Keep drag bar interactive when dragging */ +.bm-dragbar.bm-dragging { + pointer-events: auto; +} + +/* The Blue Marble Favicon */ +.bm-favicon { + display: inline-block; + height: 2.5em; + margin-right: 1ch; + vertical-align: middle; +} + + +/* Header 1 */ +.bm-window h1 { + display: inline-block; + font-size: x-large; + font-weight: bold; + vertical-align: middle; +} + +/* Header 1 when inside dragbar */ +.bm-dragbar h1 { + font-size: 1.2em; + margin-left: 0.5ch; + user-select: none; + text-shadow: + 3px 0px rgba(21, 48, 99, 0.5), + -3px 0px rgba(21, 48, 99, 0.5), + 0px 3px rgba(21, 48, 99, 0.5), + 0px -3px rgba(21, 48, 99, 0.5), + 3px 3px rgba(21, 48, 99, 0.5), + -3px 3px rgba(21, 48, 99, 0.5), + 3px -3px rgba(21, 48, 99, 0.5), + -3px -3px rgba(21, 48, 99, 0.5); +} + +/* Containers for "sections" of elements */ +.bm-container { + margin: 0.5em 0; +} + +/* All window buttons */ +.bm-window button { + background-color: #144eb9; + border-radius: 1em; + padding: 0 0.75ch; +} + +/* All window buttons when hovered/focused */ +.bm-window button:hover, .bm-window button:focus-visible { + background-color: #1061e5; +} + +/* All window buttons when pressed (plus disabled color) */ +.bm-window button:active +.bm-window button:disabled { + background-color: #2e97ff; +} + +/* All window buttons when disabled */ +.bm-window button:disabled, .bm-window button:disabled { + text-decoration: line-through; +} + +/* Icon buttons (single character text content buttons) */ +.bm-button-circle { + border: white 1px solid; + height: 1.5em; + width: 1.5em; + margin-top: 2px; + text-align: center; + line-height: 1em; + padding: 0 !important; /* Overrides the padding in ".bm-window button" */ +} + +/* Window content container */ +.bm-window-content { + overflow: hidden; + transition: height 300ms cubic-bezier(.4, 0, .2, 1); +} + + + + + + + + + + + /* The entire overlay */ #bm-overlay, #bm-overlay-telemetry { position: fixed; diff --git a/src/templateManager.js b/src/templateManager.js index e4c183f..41ba17d 100644 --- a/src/templateManager.js +++ b/src/templateManager.js @@ -213,6 +213,7 @@ export default class TemplateManager { const coords = tile.split(','); // [x, y, x, y] Tile/pixel coordinates return { + instance: template, bitmap: template.chunked[tile], chunked32: template.chunked32?.[tile], tileCoords: [coords[0], coords[1]], @@ -316,7 +317,7 @@ export default class TemplateManager { } console.log(`Finished calculating correct pixels for the tile ${tileCoords} in ${(Date.now() - timer) / 1000} seconds!\nThere are ${pixelsCorrectTotal} correct pixels.`); - template.pixelCount['correct'] = pixelsCorrect; // Adds the correct pixel Map to the template instance + template.instance.pixelCount['correct'] = pixelsCorrect; // Adds the correct pixel Map to the template instance } return await canvas.convertToBlob({ type: 'image/png' });