diff --git a/build/build.js b/build/build.js
index 2a95e5f..488e83b 100644
--- a/build/build.js
+++ b/build/build.js
@@ -87,20 +87,22 @@ const resultEsbuildJS = resultEsbuild.outputFiles.find(file => file.path.endsWit
// Obfuscates the JS file
let resultTerser = await terser.minify(resultEsbuildJS.text, {
mangle: {
- //toplevel: true, // Obfuscate top-level class/function names
+ // toplevel: true, // Should globally exposed variables, functions, classes, etc. be obfuscated?
keep_classnames: false, // Should class names be preserved?
keep_fnames: false, // Should function names be preserved?
reserved: [], // List of keywords to preserve
properties: {
// regex: /.*/, // Yes, I am aware I should be using a RegEx. Yes, like you, I am also suprised the userscript still functions
keep_quoted: true, // Should names in quotes be preserved?
- reserved: [] // What properties should be preserved?
+ reserved: ['willReadFrequently'] // What properties should be preserved?
},
},
format: {
comments: 'some' // Save legal comments
},
compress: {
+ // toplevel: true, // Should unused globally exposed variables, functions, classes, etc. be removed if unused *by Blue Marble*?
+ ecma: 2020, // Minimum supported ECMAScript version as release year. Note: versions before 2015 should pass in '5'
dead_code: isGitHub, // Should unreachable code be removed?
drop_console: isGitHub, // Should console code be removed?
drop_debugger: isGitHub, // SHould debugger code be removed?
diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css
index 4e5b223..fe478b3 100644
--- a/dist/BlueMarble-For-GreasyFork.user.css
+++ b/dist/BlueMarble-For-GreasyFork.user.css
@@ -1,109 +1,3 @@
-/* src/WindowFilter.css */
-#bm-window-filter p svg {
- display: inline;
- height: 1em;
- fill: white;
-}
-.bm-filter-flex {
- display: flex;
- flex-direction: row;
- flex-wrap: wrap;
- justify-content: center;
- gap: 1em 3ch;
-}
-.bm-filter-color {
- width: fit-content;
- max-width: 35ch;
- background-color: rgba(21, 48, 99, 0.9);
- border-radius: 1em;
- padding: 0.5em;
- gap: 1ch;
- transition: background-color 0.3s ease;
-}
-.bm-filter-color:hover,
-.bm-filter-color:focus-within {
- background-color: rgba(17, 40, 85, 0.9);
-}
-.bm-filter-container-rgb {
- display: block;
- border: thick double darkslategray;
- width: fit-content;
- height: fit-content;
- padding: 1ch;
-}
-.bm-filter-color[data-id="-2"] .bm-filter-container-rgb {
- background:
- conic-gradient(
- #aa0000 0%,
- #aaaa00 16.6%,
- #00aa00 33.3%,
- #00aaaa 50%,
- #0000aa 66.6%,
- #aa00aa 83.3%,
- #aa0000 100%);
-}
-.bm-filter-color[data-id="-1"] .bm-filter-container-rgb {
- background: url('data:image/svg+xml;utf8,') repeat;
- background-color: transparent !important;
-}
-.bm-filter-color[data-id="-1"] .bm-filter-container-rgb svg {
- fill: white !important;
-}
-.bm-filter-color[data-id="0"] .bm-filter-container-rgb {
- background-color: transparent !important;
-}
-.bm-filter-container-rgb button {
- padding: 0.75em 0.5ch;
-}
-.bm-filter-container-rgb svg {
- width: 4ch;
-}
-.bm-filter-color > .bm-flex-between {
- flex-direction: column;
- align-items: flex-start;
- gap: 0;
-}
-.bm-filter-color small {
- font-size: 0.75em;
-}
-#bm-window-filter .bm-filter-color.bm-color-hide {
- display: none;
-}
-
-/* src/WindowMain.css */
-#bm-window-main {
- max-width: 300px;
-}
-
-/* src/WindowWizard.css */
-#bm-wizard-tlist {
- display: flex;
- flex-direction: column;
- justify-content: flex-start;
- align-items: flex-start;
-}
-#bm-wizard-tlist > .bm-container {
- width: 100%;
- justify-content: flex-start;
- background-color: rgba(21, 48, 99, 0.9);
- border-radius: 1em;
- padding: 0.5em;
- transition: background-color 0.3s ease;
-}
-#bm-wizard-tlist > .bm-container:hover,
-#bm-wizard-tlist > .bm-container:focus-within {
- background-color: rgba(17, 40, 85, 0.9);
-}
-#bm-wizard-tlist .bm-wizard-template-container-image {
- height: 100%;
- font-size: xxx-large;
-}
-#bm-wizard-tlist .bm-wizard-template-container-flavor {
- flex-direction: column;
- align-items: flex-start;
- gap: 0;
-}
-
/* src/confettiManager.css */
div:has(> confetti-piece) {
position: absolute;
@@ -344,6 +238,9 @@ input[type=file] {
height: 5.25em;
width: 100%;
}
+.bm-window a:not(:has(*)) {
+ text-decoration: underline;
+}
.bm-window small {
font-size: x-small;
color: lightgray;
@@ -371,4 +268,110 @@ input[type=file] {
gap: 0.5ch;
}
+/* src/WindowFilter.css */
+#bm-window-filter p svg {
+ display: inline;
+ height: 1em;
+ fill: white;
+}
+.bm-filter-flex {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ justify-content: center;
+ gap: 1em 3ch;
+}
+.bm-filter-color {
+ width: fit-content;
+ max-width: 35ch;
+ background-color: rgba(21, 48, 99, 0.9);
+ border-radius: 1em;
+ padding: 0.5em;
+ gap: 1ch;
+ transition: background-color 0.3s ease;
+}
+.bm-filter-color:hover,
+.bm-filter-color:focus-within {
+ background-color: rgba(17, 40, 85, 0.9);
+}
+.bm-filter-container-rgb {
+ display: block;
+ border: thick double darkslategray;
+ width: fit-content;
+ height: fit-content;
+ padding: 1ch;
+}
+.bm-filter-color[data-id="-2"] .bm-filter-container-rgb {
+ background:
+ conic-gradient(
+ #aa0000 0%,
+ #aaaa00 16.6%,
+ #00aa00 33.3%,
+ #00aaaa 50%,
+ #0000aa 66.6%,
+ #aa00aa 83.3%,
+ #aa0000 100%);
+}
+.bm-filter-color[data-id="-1"] .bm-filter-container-rgb {
+ background: url('data:image/svg+xml;utf8,') repeat;
+ background-color: transparent !important;
+}
+.bm-filter-color[data-id="-1"] .bm-filter-container-rgb svg {
+ fill: white !important;
+}
+.bm-filter-color[data-id="0"] .bm-filter-container-rgb {
+ background-color: transparent !important;
+}
+#bm-window-filter .bm-filter-container-rgb button {
+ padding: 0.75em 0.5ch;
+}
+.bm-filter-container-rgb svg {
+ width: 4ch;
+}
+.bm-filter-color > .bm-flex-between {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 0;
+}
+.bm-filter-color small {
+ font-size: 0.75em;
+}
+#bm-window-filter .bm-filter-color.bm-color-hide {
+ display: none;
+}
+
+/* src/WindowMain.css */
+#bm-window-main {
+ max-width: 300px;
+}
+
+/* src/WindowWizard.css */
+#bm-wizard-tlist {
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+ align-items: flex-start;
+}
+#bm-wizard-tlist > .bm-container {
+ width: 100%;
+ justify-content: flex-start;
+ background-color: rgba(21, 48, 99, 0.9);
+ border-radius: 1em;
+ padding: 0.5em;
+ transition: background-color 0.3s ease;
+}
+#bm-wizard-tlist > .bm-container:hover,
+#bm-wizard-tlist > .bm-container:focus-within {
+ background-color: rgba(17, 40, 85, 0.9);
+}
+#bm-wizard-tlist .bm-wizard-template-container-image {
+ height: 100%;
+ font-size: xxx-large;
+}
+#bm-wizard-tlist .bm-wizard-template-container-flavor {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 0;
+}
+
/* src/main.css */
diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js
index 02b16aa..5d61b2e 100644
--- a/dist/BlueMarble-For-GreasyFork.user.js
+++ b/dist/BlueMarble-For-GreasyFork.user.js
@@ -2,14 +2,14 @@
// @name Blue Marble
// @name:en Blue Marble
// @namespace https://github.com/SwingTheVine/
-// @version 0.90.0
+// @version 0.90.17
// @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
// @license MPL-2.0
// @supportURL https://discord.gg/tpeBPy46hf
// @homepageURL https://bluemarble.lol/
-// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/8921e33df8eb2958601b8a791d28bacc0bf5fa2d/dist/assets/Favicon.png
+// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/ffa17bc9a7c2db10efc201437dbf1637e11a6f61/dist/assets/Favicon.png
// @updateURL https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/BlueMarble-For-GreasyFork.user.js
// @downloadURL https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/BlueMarble-For-GreasyFork.user.js
// @match https://wplace.live/*
@@ -21,7 +21,7 @@
// @grant GM_xmlhttpRequest
// @grant GM.download
// @connect telemetry.thebluecorner.net
-// @resource CSS-BM-File https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/8921e33df8eb2958601b8a791d28bacc0bf5fa2d/dist/BlueMarble-For-GreasyFork.user.css
+// @resource CSS-BM-File https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/ffa17bc9a7c2db10efc201437dbf1637e11a6f61/dist/BlueMarble-For-GreasyFork.user.css
// @antifeature tracking Anonymous opt-in telemetry data
// @noframes
// ==/UserScript==
@@ -2606,6 +2606,62 @@ Did you try clicking the canvas first?`);
};
customElements.define("confetti-piece", BlueMarbleConfettiPiece);
+ // src/WindowCredits.js
+ var WindowCredts = class extends Overlay {
+ /** Constructor for the Credits window
+ * @param {string} name - The name of the userscript
+ * @param {string} version - The version of the userscript
+ * @since 0.90.9
+ * @see {@link Overlay#constructor} for examples
+ */
+ constructor(name2, version2) {
+ super(name2, version2);
+ this.window = null;
+ this.windowID = "bm-window-credits";
+ this.windowParent = document.body;
+ }
+ /** Spawns a Credits window.
+ * If another credits window already exists, we DON'T spawn another!
+ * Parent/child relationships in the DOM structure below are indicated by indentation.
+ * @since 0.90.9
+ */
+ buildWindow() {
+ const ascii = `
+\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
+\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
+\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557
+\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D
+\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
+\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D
+
+\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
+\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
+\u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557
+\u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D
+\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
+\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D
+`;
+ if (document.querySelector(`#${this.windowID}`)) {
+ document.querySelector(`#${this.windowID}`).remove();
+ return;
+ }
+ this.window = this.addDiv({ "id": this.windowID, "class": "bm-window" }, (instance, div) => {
+ }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Credits"', "data-button-status": "expanded" }, (instance, button) => {
+ button.onclick = () => instance.handleMinimization(button);
+ button.ontouchend = () => {
+ button.click();
+ };
+ }).buildElement().addDiv().buildElement().addButton({ "class": "bm-button-circle", "textContent": "\u{1F7AA}", "aria-label": 'Close window "Credits"' }, (instance, button) => {
+ button.onclick = () => {
+ document.querySelector(`#${this.windowID}`)?.remove();
+ };
+ button.ontouchend = () => {
+ button.click();
+ };
+ }).buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Credits" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container bm-scrollable" }).addSpan({ "innerHTML": ascii, "style": "white-space: pre;" }).buildElement().addBr().buildElement().addHr().buildElement().addBr().buildElement().addSpan({ "textContent": '"Blue Marble" userscript is made by SwingTheVine.' }).buildElement().addBr().buildElement().addSpan({ "innerHTML": 'The Blue Marble Website is made by crqch.' }).buildElement().addBr().buildElement().addSpan({ "textContent": `The Blue Marble Website used until ${localizeDate(new Date(1756069320 * 1e3))} was made by Camille Daguin.` }).buildElement().addBr().buildElement().addSpan({ "textContent": 'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)' }).buildElement().addBr().buildElement().addSpan({ "textContent": "Special Thanks:" }).buildElement().addUl().addLi({ "textContent": "Espresso, Meqa, and Robot for moderating SwingTheVine's community." }).buildElement().addLi({ "innerHTML": 'nof, darkness for creating similar userscripts!' }).buildElement().addLi({ "innerHTML": 'Wonda for the Blue Marble banner image!' }).buildElement().addLi({ "innerHTML": 'BullStein, allanf181 for being early beta testers!' }).buildElement().addLi({ "innerHTML": 'guidu_ and Nick-machado for the original "Minimize" Button code!' }).buildElement().addLi({ "innerHTML": 'Nomad and Gustav for the tutorials!' }).buildElement().addLi({ "innerHTML": 'TheBlueCorner for getting me interested in online pixel canvases!' }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent);
+ }
+ };
+
// src/WindowFilter.js
var _WindowFilter_instances, buildColorList_fn, sortColorList_fn, selectColorList_fn;
var WindowFilter = class extends Overlay {
@@ -2959,7 +3015,7 @@ Did you try clicking the canvas first?`);
}).buildElement().addButton({ "textContent": "Filter" }, (instance, button) => {
button.onclick = () => __privateMethod(this, _WindowMain_instances, buildWindowFilter_fn).call(this);
}).buildElement().buildElement().addDiv({ "class": "bm-container" }).addTextarea({ "id": this.outputStatusId, "placeholder": `Status: Sleeping...
-Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().addDiv({ "class": "bm-container bm-flex-between", "style": "margin-bottom: 0;" }).addDiv({ "class": "bm-flex-between" }).addButton({ "class": "bm-button-circle", "innerHTML": "\u{1F9D9}", "title": "Template Wizard" }, (instance, button) => {
+Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().addDiv({ "class": "bm-container bm-flex-between", "style": "margin-bottom: 0; flex-direction: column;" }).addDiv({ "class": "bm-flex-between" }).addButton({ "class": "bm-button-circle", "innerHTML": "\u{1F9D9}", "title": "Template Wizard" }, (instance, button) => {
button.onclick = () => {
const templateManager2 = instance.apiManager?.templateManager;
const wizard = new WindowWizard(this.name, this.version, templateManager2?.schemaVersion, templateManager2);
@@ -2977,7 +3033,12 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add
button.onclick = () => {
window.open("https://ko-fi.com/swingthevine", "_blank", "noopener noreferrer");
};
- }).buildElement().addSmall({ "textContent": "Made by SwingTheVine", "style": "margin-top: auto;" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent);
+ }).buildElement().addButton({ "class": "bm-button-circle", "innerHTML": "\u{1F91D}", "title": "Credits" }, (instance, button) => {
+ button.onclick = () => {
+ const credits = new WindowCredts(this.name, this.version);
+ credits.buildWindow();
+ };
+ }).buildElement().buildElement().addSmall({ "textContent": "Made by SwingTheVine", "style": "margin-top: auto;" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent);
this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`);
}
};
diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js
index 42d6a23..dd56fdf 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.90.0
+// @version 0.90.17
// @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
@@ -29,4 +29,4 @@
// License --> https://www.mozilla.org/en-US/MPL/2.0/
// Donate --> https://ko-fi.com/swingthevine
-(()=>{var t=t=>{throw TypeError(t)},e=(e,i,n)=>i.has(e)?t("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,n),i=(e,i,n)=>(((e,i)=>{i.has(e)||t("Cannot access private method")})(e,i),n);function n(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function a(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function o(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function r(...t){(0,console.log)(...t)}function l(...t){(0,console.error)(...t)}function c(...t){(0,console.warn)(...t)}function h(t,e){if(0===t)return e[0];let i="";const n=e.length;for(;t>0;)i=e[t%n]+i,t=Math.floor(t/n);return i}function m(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&l(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function d(t){let e="";for(let i=0;i(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}var p,f,w,g,y,v=[{id:0,premium:!1,name:"Transparent",rgb:[0,0,0]},{id:1,premium:!1,name:"Black",rgb:[0,0,0]},{id:2,premium:!1,name:"Dark Gray",rgb:[60,60,60]},{id:3,premium:!1,name:"Gray",rgb:[120,120,120]},{id:4,premium:!1,name:"Light Gray",rgb:[210,210,210]},{id:5,premium:!1,name:"White",rgb:[255,255,255]},{id:6,premium:!1,name:"Deep Red",rgb:[96,0,24]},{id:7,premium:!1,name:"Red",rgb:[237,28,36]},{id:8,premium:!1,name:"Orange",rgb:[255,127,39]},{id:9,premium:!1,name:"Gold",rgb:[246,170,9]},{id:10,premium:!1,name:"Yellow",rgb:[249,221,59]},{id:11,premium:!1,name:"Light Yellow",rgb:[255,250,188]},{id:12,premium:!1,name:"Dark Green",rgb:[14,185,104]},{id:13,premium:!1,name:"Green",rgb:[19,230,123]},{id:14,premium:!1,name:"Light Green",rgb:[135,255,94]},{id:15,premium:!1,name:"Dark Teal",rgb:[12,129,110]},{id:16,premium:!1,name:"Teal",rgb:[16,174,166]},{id:17,premium:!1,name:"Light Teal",rgb:[19,225,190]},{id:18,premium:!1,name:"Dark Blue",rgb:[40,80,158]},{id:19,premium:!1,name:"Blue",rgb:[64,147,228]},{id:20,premium:!1,name:"Cyan",rgb:[96,247,242]},{id:21,premium:!1,name:"Indigo",rgb:[107,80,246]},{id:22,premium:!1,name:"Light Indigo",rgb:[153,177,251]},{id:23,premium:!1,name:"Dark Purple",rgb:[120,12,153]},{id:24,premium:!1,name:"Purple",rgb:[170,56,185]},{id:25,premium:!1,name:"Light Purple",rgb:[224,159,249]},{id:26,premium:!1,name:"Dark Pink",rgb:[203,0,122]},{id:27,premium:!1,name:"Pink",rgb:[236,31,128]},{id:28,premium:!1,name:"Light Pink",rgb:[243,141,169]},{id:29,premium:!1,name:"Dark Brown",rgb:[104,70,52]},{id:30,premium:!1,name:"Brown",rgb:[149,104,42]},{id:31,premium:!1,name:"Beige",rgb:[248,178,119]},{id:32,premium:!0,name:"Medium Gray",rgb:[170,170,170]},{id:33,premium:!0,name:"Dark Red",rgb:[165,14,30]},{id:34,premium:!0,name:"Light Red",rgb:[250,128,114]},{id:35,premium:!0,name:"Dark Orange",rgb:[228,92,26]},{id:36,premium:!0,name:"Light Tan",rgb:[214,181,148]},{id:37,premium:!0,name:"Dark Goldenrod",rgb:[156,132,49]},{id:38,premium:!0,name:"Goldenrod",rgb:[197,173,49]},{id:39,premium:!0,name:"Light Goldenrod",rgb:[232,212,95]},{id:40,premium:!0,name:"Dark Olive",rgb:[74,107,58]},{id:41,premium:!0,name:"Olive",rgb:[90,148,74]},{id:42,premium:!0,name:"Light Olive",rgb:[132,197,115]},{id:43,premium:!0,name:"Dark Cyan",rgb:[15,121,159]},{id:44,premium:!0,name:"Light Cyan",rgb:[187,250,242]},{id:45,premium:!0,name:"Light Blue",rgb:[125,199,255]},{id:46,premium:!0,name:"Dark Indigo",rgb:[77,49,184]},{id:47,premium:!0,name:"Dark Slate Blue",rgb:[74,66,132]},{id:48,premium:!0,name:"Slate Blue",rgb:[122,113,196]},{id:49,premium:!0,name:"Light Slate Blue",rgb:[181,174,241]},{id:50,premium:!0,name:"Light Brown",rgb:[219,164,99]},{id:51,premium:!0,name:"Dark Beige",rgb:[209,128,81]},{id:52,premium:!0,name:"Light Beige",rgb:[255,197,165]},{id:53,premium:!0,name:"Dark Peach",rgb:[155,82,73]},{id:54,premium:!0,name:"Peach",rgb:[209,128,120]},{id:55,premium:!0,name:"Light Peach",rgb:[250,182,164]},{id:56,premium:!0,name:"Dark Tan",rgb:[123,99,82]},{id:57,premium:!0,name:"Tan",rgb:[156,132,107]},{id:58,premium:!0,name:"Dark Slate",rgb:[51,57,65]},{id:59,premium:!0,name:"Slate",rgb:[109,117,141]},{id:60,premium:!0,name:"Light Slate",rgb:[179,185,209]},{id:61,premium:!0,name:"Dark Stone",rgb:[109,100,63]},{id:62,premium:!0,name:"Stone",rgb:[148,140,107]},{id:63,premium:!0,name:"Light Stone",rgb:[205,197,158]}],x=class{constructor({displayName:t="My template",o:i=0,l:n="",url:s="",file:a=null,coords:o=null,h:r=null,m:l={},u:c=1e3}={}){e(this,p),this.displayName=t,this.o=i,this.l=n,this.url=s,this.file=a,this.coords=o,this.h=r,this.m=l,this.u=c,this.p={total:0,colors:new Map}}async v(t,e){const n=await createImageBitmap(this.file),s=n.width,a=n.height;this.u=t;const o={},r={},l=new OffscreenCanvas(this.u,this.u),c=l.getContext("2d",{M:!0});l.width=s,l.height=a,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,p,f).call(this,c.getImageData(0,0,s,a),e);let u=0;for(const[t,e]of m)0!=t&&(u+=e);this.p={total:u,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),w=b.getContext("2d");w.clearRect(0,0,3,3),w.fillStyle="white",w.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,a,o]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const o=a.get(n);a.set(n,o?o+1:1)}return a};var M,T,$,C,S=class{constructor(t,i){e(this,w),this.name=t,this.version=i,this.D=null,this.O="bm-i",this.k=null,this.L=null,this.N=[]}B(t){this.D=t}I(){return this.N.length>0&&(this.L=this.N.pop()),this}A(t){t?.appendChild(this.k),this.k=null,this.L=null,this.N=[]}H(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"div",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"p",{},t)),this}W(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"small",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"span",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"details",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"summary",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"img",{},t)),this}j(t,e={},n=()=>{}){return n(this,i(this,w,g).call(this,"h"+t,{},e)),this}R(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"hr",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"br",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"form",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"fieldset",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"legend",{},t)),this}q(t={},e=()=>{}){const n=i(this,w,g).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,w,g).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.I(),e(this,n,s),this}Z(t={},e=()=>{}){const n=i(this,w,g).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.I(),e(this,n,i(this,w,g).call(this,"select",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"option",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"ol",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"ul",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"menu",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"li",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"table",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"caption",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"thead",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tbody",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tfoot",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"tr",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"th",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"td",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"button",{},t)),this}ft(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-M",onclick:()=>{this.wt(this.O,n)}};return e(this,i(this,w,g).call(this,"button",s,t)),this}gt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"input",{},t)),this}yt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,w,g).call(this,"div"),a=i(this,w,g).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.I();const o=i(this,w,g).call(this,"button",{textContent:n});return this.I(),this.I(),o.addEventListener("click",()=>{a.click()}),a.addEventListener("change",()=>{o.style.maxWidth=`${o.offsetWidth}px`,a.files.length>0?o.textContent=a.files[0].name:o.textContent=n}),e(this,s,a,o),this}vt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"textarea",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,w,g).call(this,"div",{class:"bm-H"},t)),this}Mt(t=Date.now(),e=500,n={},s=()=>{}){const a="bm-L",o=n?.id||a+"-"+crypto.randomUUID().slice(0,8),r={class:a},l=i(this,w,g).call(this,"time",r,n);return l.id=o,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),i=Math.floor(e/3600),n=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${i}H${s}M${n}S`),l.textContent=String(i).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(n).padStart(2,"0")},e),s(this,l),this}wt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Tt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-J"),i=t.closest(".bm-H"),n=e.querySelector("h1"),s=e.querySelector(".bm-f");if(e.parentElement.append(e),"expanded"==t.dataset.buttonStatus){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",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)});const i=n.cloneNode(!0),a=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${a}"`}else{const n=i.querySelector("h1"),a=n.textContent;n.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="",t.disabled=!1,t.style.textDecoration="",s.removeEventListener("transitionend",e)}),t.textContent="ā¼",t.dataset.buttonStatus="expanded",t.ariaLabel=`Minimize window "${a}"`}}$t(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Ct(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,a=!1,o=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(a){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,i.style.transform=`translate(${l}px, ${c}px)`,i.style.left="0px",i.style.top="0px",i.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{a=!0,d=i.getBoundingClientRect(),s=t-d.left,o=e-d.top;const b=window.getComputedStyle(i).transform;if(b&&"none"!==b){const t=new DOMMatrix(b);l=t.m41,c=t.m42}else l=d.left,c=d.top;h=l,m=c,document.body.style.userSelect="none",n.classList.add("bm-C"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{a=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-C"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",w),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{a&&d&&(h=t.clientX-s,m=t.clientY-o)},w=t=>{if(a&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-o,t.preventDefault()}};n.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),n.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}St(t){(0,console.info)(`${this.name}: ${t}`),this.wt(this.O,"Status: "+t,!0)}Ct(t){(0,console.error)(`${this.name}: ${t}`),this.wt(this.O,"Error: "+t,!0)}};w=new WeakSet,g=function(t,e={},n={}){const s=document.createElement(t);this.k?(this.L?.appendChild(s),this.N.push(this.L),this.L=s):(this.k=s,this.L=s);for(const[t,n]of Object.entries(e))i(this,w,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,w,y).call(this,s,t,e);return s},y=function(t,e,i){if("class"==e)t.classList.add(...i.split(/\s+/));else if("for"==e)t.htmlFor=i;else if("tabindex"==e)t.tabIndex=Number(i);else if("readonly"==e)t.readOnly="true"==i||"1"==i;else if("maxlength"==e)t.maxLength=Number(i);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i;else if(e.startsWith("aria")){const n=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+n[0].toUpperCase()+n.slice(1)]=i}else t[e]=i};var D=class extends S{constructor(t,i,n,s=void 0){super(t,i),e(this,M),this.window=null,this.Dt="bm-j",this.Ot=document.body,this.kt=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.kt?.scriptVersion,this.schemaVersion=this.kt?.schemaVersion,this.Lt=void 0,this.Nt=n,this.Bt=s}It(){if(document.querySelector(`#${this.Dt}`))return void document.querySelector(`#${this.Dt}`).remove();let t="";document.querySelector("#bm-t")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.Dt,class:"bm-J",style:t},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().bt({class:"bm-k",textContent:"šŖ","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Dt}`)?.remove()},e.ontouchend=()=>{e.click()}}).I().I().H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Template Wizard"}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Status"}).I().P({id:"bm-l",textContent:"Loading template storage status..."}).I().I().H({class:"bm-B bm-x"}).j(2,{textContent:"Detected templates:"}).I().I().I().I().A(this.Ot),this.$t(`#${this.Dt}.bm-J`,`#${this.Dt} .bm-H`),i(this,M,T).call(this),i(this,M,$).call(this)}};M=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Nt.split(/[-\.\+]/);let n="";t[0]==e[0]?t[1]==e[1]?(n='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Lt="Good"):(n='Template storage health: Poor!
You can still use your template, but some features may not work. It is recommended that you update Blue Marble\'s template storage. (Reason: MINOR version mismatch)',this.Lt="Poor"):t[0]Bad!
It is guaranteed that some features are broken. You might still be able to use the template. It is HIGHLY recommended that you download all templates and update Blue Marble\'s template storage before continuing. (Reason: MAJOR version mismatch)',this.Lt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Lt="Dead");const s=`
If you want to continue using your current templates, then make sure the template storage (schema) is up-to-date.
If you don't want to update the template storage, then downgrade Blue Marble to version ${o(this.scriptVersion)} to continue using your templates.
Alternatively, if you don't care about corrupting the templates listed below, you can fix any issues with the template storage by uploading a new template.`;this.wt("#bm-l",`${n}
Your templates were created during Blue Marble version ${o(this.scriptVersion)} with schema version ${o(this.schemaVersion)}.
The current Blue Marble version is ${o(this.version)} and requires schema version ${o(this.Nt)}.${"Good"!=this.Lt?s:""}`);const a=new S(this.name,this.version);"Dead"!=this.Lt&&(a.H({class:"bm-B bm-u bm-b",style:"gap: 1.5ch;"}),a.bt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Bt.At().then(()=>{e.disabled=!1})}}).I()),"Poor"!=this.Lt&&"Bad"!=this.Lt||a.bt({textContent:`Update template storage to ${this.Nt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,M,C).call(this,!0)}}).I(),a.I().A(document.querySelector("#bm-l").parentNode)},$=function(){const t=this.kt?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Dt} .bm-x`),i=new S(this.name,this.version);i.H({id:"bm-o",class:"bm-B"});for(const e in t){const n=e,a=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),o=m(t?.[1]||"0",this.Bt.Ht),r=a.name||`Template ${e||""}`,l=a?.coords?.split(",").map(Number),c=a.pixels?.total??void 0,h=void 0,d="number"==typeof e?s(e):"???",u="number"==typeof o?s(o):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-B bm-u"}).H({class:"bm-u",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"š¼ļø"}).I().W({textContent:`#${d}`}).I().I().H({class:"bm-u bm-0"}).j(3,{textContent:r}).I().U({textContent:`Uploaded by user #${u}`}).I().U({textContent:`Coordinates: ${l.join(", ")}`}).I().U({textContent:`Total Pixels: ${b}`}).I().I().I()}}i.I().A(e)}},C=async function(t){if(t){const t=document.querySelector(`#${this.Dt} .bm-f`);t.innerHTML="",new S(this.name,this.version).H({class:"bm-B"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Template Wizard"}).I().I().R().I().H({class:"bm-B"}).j(2,{textContent:"Status"}).I().P({textContent:"Updating template storage. Please wait..."}).I().I().I().A(t)}GM_deleteValue("bmCoords");const e=this.kt?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new x({displayName:i.name,h:i.tiles});t.C();const e=await this.Bt.Pt(t);await this.Bt.Wt(e,t.displayName,t.coords)}t&&(document.querySelector(`#${this.Dt}`).remove(),new D(this.name,this.version,this.Nt,this.Bt).It())};var O,k,L,N,B=D;O=new WeakSet,k=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ut))},L=async function(t){const e=t.templates,i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),a=t?.scriptVersion;n[0]==s[0]?(n[1]!=s[1]&&new B(this.name,this.version,this.schemaVersion,this).It(),this.Gt=await async function({u:t,zt:i,Gt:n}){if(Object.keys(e).length>0)for(const s in e){const a=s,o=e[s];if(e.hasOwnProperty(s)){const e=a.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=o.name||`Template ${s||""}`,c={total:o.pixels?.total,colors:new Map(Object.entries(o.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=o.tiles,m={},d={},b=t*i;for(const t in h)if(h.hasOwnProperty(t)){const e=u(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(b,b).getContext("2d");s.drawImage(n,0,0);const a=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(a.data.buffer)}const p=new x({displayName:l,o:s||this.Gt?.length||0,l:r||""});p.p=c,p.h=m,p.m=d,n.push(p)}}return n}({u:this.u,zt:this.zt,Gt:this.Gt})):n[0]>>24&255,w=b>>>24&255,g=m.get(p)??-2;if(this.Vt.get(g)&&(e[i*r+l]=b),-1==g){const t=536870912;this.Vt.get(g)?e[i*r+l]=0:(h/n&1)==(u/n&1)?(e[i*r+l]=t,e[(i-1)*r+(l-1)]=t,e[(i-1)*r+(l+1)]=t,e[(i+1)*r+(l-1)]=t,e[(i+1)*r+(l+1)]=t):(e[i*r+l]=0,e[(i-1)*r+l]=t,e[(i+1)*r+l]=t,e[i*r+(l-1)]=t,e[i*r+(l+1)]=t)}if(-1==g&&b<=c){const t=d.get(g);d.set(g,t?t+1:1);continue}if(f<=c||w<=c)continue;if((m.get(b)??-2)!=g)continue;const y=d.get(g);d.set(g,y?y+1:1)}return{Et:d,Xt:e}};var I,A,H,P,W=class{constructor(){this.Jt=Math.ceil(80/1300*window.innerWidth),this.qt=v.slice(1)}Qt(t){const e=document.createElement("div");for(let t=0;t{t.parentNode.childElementCount<=1?t.parentNode.remove():t.remove()},e.appendChild(t)}t.appendChild(e)}},U=class extends HTMLElement{};customElements.define("confetti-piece",U);var G,z,_,F,j,R=class extends S{constructor(t){super(t.name,t.version),e(this,I),this.window=null,this.Dt="bm-m",this.Ot=document.body,this.Bt=t.D?.Bt,this.Zt='',this.Kt='';const{palette:i,S:n}=this.Bt.Yt;this.palette=i,this.te=0,this.ee=0}It(){if(document.querySelector(`#${this.Dt}`))return void document.querySelector(`#${this.Dt}`).remove();this.window=this.H({id:this.Dt,class:"bm-J"},(t,e)=>{}).xt().bt({class:"bm-k",textContent:"ā¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Tt(e),e.ontouchend=()=>{e.click()}}).I().H().I().bt({class:"bm-k",textContent:"šŖ","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Dt}`)?.remove()},e.ontouchend=()=>{e.click()}}).I().I().H({class:"bm-f"}).H({class:"bm-B bm-b"}).j(1,{textContent:"Color Filter"}).I().I().R().I().H({class:"bm-B bm-p bm-b",style:"gap: 1.5ch;"}).bt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,I,P).call(this,!1)}).I().bt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,I,P).call(this,!0)}).I().I().H({class:"bm-B bm-x"}).H({class:"bm-B",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-B"}).U({id:"bm-c",innerHTML:"Tiles Loaded: 0 / ???"}).I().Y().I().U({id:"bm-7",innerHTML:"Correct Pixels: ???"}).I().Y().I().U({id:"bm-d",innerHTML:"Total Pixels: ???"}).I().Y().I().U({id:"bm-3",innerHTML:"Complete: ??? (???)"}).I().Y().I().U({id:"bm-4",innerHTML:"??? ???"}).I().I().H({class:"bm-B"}).P({innerHTML:`Colors with the icon ${this.Zt.replace("