From 9110d2aa0b48d048ff876a863adafb7eb108d87e Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Tue, 3 Mar 2026 17:30:02 -0500 Subject: [PATCH 01/15] Fixed CSS selector fighting --- dist/BlueMarble-For-GreasyFork.user.css | 256 ++++++++++++------------ dist/BlueMarble-For-GreasyFork.user.js | 6 +- 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/WindowFilter.css | 32 +-- 10 files changed, 157 insertions(+), 157 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index eb9d159..8b7727d 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -1,131 +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-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; -} -.bm-windowed #bm-filter-flex { - flex-direction: column; - gap: 0.25em; -} -.bm-windowed .bm-filter-color { - width: auto; - margin: 0; - padding: 0; -} -.bm-windowed .bm-filter-container-rgb { - display: flex; - width: 100%; - gap: 0.5ch; - align-items: center; - padding: 0.1em 0.5ch; - border: none; - border-radius: 1em; -} -#bm-window-filter.bm-windowed .bm-filter-container-rgb button { - padding: 0.5em 0.25ch; -} -.bm-windowed .bm-filter-container-rgb svg { - width: 3ch; -} -.bm-windowed .bm-filter-color h2 { - font-size: 0.75em; -} - -/* 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; @@ -413,4 +285,132 @@ input[type=file] { font-size: 1em; } +/* 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-window-filter .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-window-filter .bm-filter-color:hover, +#bm-window-filter.bm-filter-color:focus-within { + background-color: rgba(17, 40, 85, 0.9); +} +#bm-window-filter .bm-filter-container-rgb { + display: block; + border: thick double darkslategray; + width: fit-content; + height: fit-content; + padding: 1ch; +} +#bm-window-filter .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-window-filter .bm-filter-color[data-id="-1"] .bm-filter-container-rgb { + background: url('data:image/svg+xml;utf8,') repeat; + background-color: transparent !important; +} +#bm-window-filter .bm-filter-color[data-id="-1"] .bm-filter-container-rgb svg { + fill: white !important; +} +#bm-window-filter .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-window-filter .bm-filter-container-rgb svg { + width: 4ch; +} +#bm-window-filter .bm-filter-color > .bm-flex-between { + flex-direction: column; + align-items: flex-start; + gap: 0; +} +#bm-window-filter .bm-filter-color small { + font-size: 0.75em; +} +#bm-window-filter .bm-filter-color.bm-color-hide { + display: none; +} +#bm-window-filter.bm-windowed #bm-filter-flex { + flex-direction: column; + gap: 0.25em; +} +#bm-window-filter.bm-windowed .bm-filter-color { + width: auto; + margin: 0; + padding: 0; +} +#bm-window-filter.bm-windowed .bm-filter-container-rgb { + display: flex; + width: 100%; + gap: 0.5ch; + align-items: center; + padding: 0.1em 0.5ch; + border: none; + border-radius: 1em; +} +#bm-window-filter.bm-windowed .bm-filter-container-rgb button { + padding: 0.5em 0.25ch; +} +#bm-window-filter.bm-windowed .bm-filter-container-rgb svg { + width: 3ch; +} +#bm-window-filter.bm-windowed .bm-filter-color h2 { + font-size: 0.75em; +} + +/* 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 10597ba..d5d3b36 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.91.0 +// @version 0.91.2 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine // @license MPL-2.0 // @supportURL https://discord.gg/tpeBPy46hf // @homepageURL https://bluemarble.lol/ -// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/ffa17bc9a7c2db10efc201437dbf1637e11a6f61/dist/assets/Favicon.png +// @icon https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/78477321232b29c09e3794c360068d7d23a0172c/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/ffa17bc9a7c2db10efc201437dbf1637e11a6f61/dist/BlueMarble-For-GreasyFork.user.css +// @resource CSS-BM-File https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/78477321232b29c09e3794c360068d7d23a0172c/dist/BlueMarble-For-GreasyFork.user.css // @antifeature tracking Anonymous opt-in telemetry data // @noframes // ==/UserScript== diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index c4cfd7b..8c836db 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.91.0 +// @version 0.91.2 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var w,g,y,x,v,M=[{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]}],C=class{constructor({displayName:t="My template",p:i=0,v:n="",url:s="",file:o=null,coords:a=null,M:r=null,C:l={},$:c=1e3}={}){e(this,w),this.displayName=t,this.p=i,this.v=n,this.url=s,this.file=o,this.coords=a,this.M=r,this.C=l,this.$=c,this.T={total:0,colors:new Map}}async S(t,e){const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.$=t;const a={},r={},l=new OffscreenCanvas(this.$,this.$),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,w,g).call(this,c.getImageData(0,0,s,o),e);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return o};var $,T,S,k,D=class{constructor(t,i){e(this,y),this.name=t,this.version=i,this.O=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}W(t){this.O=t}P(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}U(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"div",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"details",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"summary",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,y,x).call(this,"h"+t,{},e)),this}J(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"hr",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const n=i(this,y,x).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,y,x).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.P(),e(this,n,s),this}it(t={},e=()=>{}){const n=i(this,y,x).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.P(),e(this,n,i(this,y,x).call(this,"select",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"tr",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"th",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"button",{},t)),this}xt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.vt(this.B,n)}};return e(this,i(this,y,x).call(this,"button",s,t)),this}Mt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"input",{},t)),this}Ct(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,y,x).call(this,"div"),o=i(this,y,x).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.P();const a=i(this,y,x).call(this,"button",{textContent:n});return this.P(),this.P(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}$t(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,y,x).call(this,"time",r,n);return l.id=a,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}vt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Dt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Lt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),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=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",w),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},w=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Nt(t){(0,console.info)(`${this.name}: ${t}`),this.vt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.vt(this.B,"Error: "+t,!0)}};y=new WeakSet,x=function(t,e={},n={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,n]of Object.entries(e))i(this,y,v).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,y,v).call(this,s,t,e);return s},v=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 L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,$),this.window=null,this.Ot="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=n,this.Wt=s}Pt(){if(document.querySelector(`#${this.Ot}`))return void document.querySelector(`#${this.Ot}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.Ot,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).P().P().J().P().U({class:"bm-E"}).q(2,{textContent:"Status"}).P().G({id:"bm-o",textContent:"Loading template storage status..."}).P().P().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`),i(this,$,T).call(this),i(this,$,S).call(this)}};$=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.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.Ht="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.Ht="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.Ht="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.vt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Wt._t().then(()=>{e.disabled=!1})}}).P()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,$,k).call(this,!0)}}).P(),c.P()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Ot} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Wt.zt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"}).P().F({textContent:`#${m}`}).P().P().U({class:"bm-x bm-0"}).q(3,{textContent:r}).P().R({textContent:`Uploaded by user #${u}`}).P().R({textContent:`Coordinates: ${l.join(", ")}`}).P().R({textContent:`Total Pixels: ${b}`}).P().P().P()}}i.P()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Ot} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).P().P().J().P().U({class:"bm-E"}).q(2,{textContent:"Status"}).P().G({textContent:"Updating template storage. Please wait..."}).P().P().P()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new C({displayName:i.name,M:i.tiles});t.L();const e=await this.Wt.Ut(t);await this.Wt.Gt(e,t.displayName,t.coords)}t&&(document.querySelector(`#${this.Ot}`).remove(),new L(this.name,this.version,this.At,this.Wt).Pt())};var N,O,B,I,H=L;N=new WeakSet,O=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){const e=t.templates,i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Pt(),this.Rt=await async function({$:t,jt:i,Rt:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new C({displayName:l,p:s||this.Rt?.length||0,v:r||""});p.T=c,p.M=m,p.C=d,n.push(p)}}return n}({$:this.$,jt:this.jt,Rt:this.Rt})):n[0]>>24&255,w=b>>>24&255,g=m.get(p)??-2;if(this.Xt.get(g)&&(e[i*r+l]=b),-1==g){const t=536870912;this.Xt.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{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=M.slice(1)}ee(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,_,z,U,G,F,R,j,E,V,Y=class extends D{constructor(t,e){super(t,e),this.window=null,this.Ot="bm-i",this.Bt=document.body}Pt(){document.querySelector(`#${this.Ot}`)?document.querySelector(`#${this.Ot}`).remove():(this.window=this.U({id:this.Ot,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).P().P().J().P().U({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).P().P().X().P().J().P().X().P().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).P().X().P().R({innerHTML:'The Blue Marble Website is made by crqch.'}).P().X().P().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).P().X().P().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).P().X().P().R({textContent:"Special Thanks:"}).P().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).P().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).P().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).P().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).P().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).P().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).P().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).P().lt({innerHTML:'Force Network for hosting the telemetry server!'}).P().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).P().P().X().P().R({innerHTML:'Donators:'}).P().ot().lt({textContent:"Espresso"}).P().lt({textContent:"BEST FAN"}).P().lt({textContent:"Jack"}).P().lt({textContent:"raiken_au"}).P().lt({textContent:"Jacob"}).P().lt({textContent:"StupidOne"}).P().lt({textContent:"1 Anonymous Supporter"}).P().P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.Ot="bm-p",this.ie="bm-y",this.Bt=document.body,this.Wt=t.O?.Wt,this.ne='',this.se='';const{palette:i,N:n}=this.Wt.Jt;this.palette=i,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Pt(){if(document.querySelector(`#${this.Ot}`))return void document.querySelector(`#${this.Ot}`).remove();this.window=this.U({id:this.Ot,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).P().P().J().P().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).P().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).P().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).P().P().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).P().X().P().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).P().X().P().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).P().X().P().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).P().X().P().R({id:"bm-5",innerHTML:"??? ???"}).P().P().U({class:"bm-E"}).G({innerHTML:`Colors with the icon ${this.ne.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Ot} form`)),n={};for(const[t,i]of e)n[t]=i;i(this,P,z).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).P().P().P().P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`);const t=document.querySelector(`#${this.Ot} .bm-E.bm-A`);i(this,P,_).call(this,t),i(this,P,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.vt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.vt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.vt("#bm-f",`Total Pixels: ${s(this.he)}`),this.vt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.vt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Ot}`))return void document.querySelector(`#${this.Ot}`).remove();this.window=this.U({id:this.Ot,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove(),this.Pt()},e.ontouchend=()=>{e.click()}}).P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).P().P().J().P().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).P().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).P().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).P().P().U({class:"bm-E bm-A"}).P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`);const t=document.querySelector(`#${this.Ot} .bm-E.bm-A`);i(this,P,_).call(this,t),i(this,P,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){i(this,P,G).call(this);const t=document.querySelector(`#${this.ie}`),e={};for(const t of this.palette){const i=this.re.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={be:i,pe:n,fe:a,we:r,ge:l,ye:c}}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{fe:n,we:s,ge:o,be:a,pe:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Ot} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Ot} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}i(this,P,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,_=function(t){const e=t.closest(`#${this.Ot}`)?.classList.contains("bm-G"),i=new D(this.name,this.version);i.U({id:this.ie});const n=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,we:c,ge:h,be:m,pe:d,ye:u}=n[t.id],b=!!this.Wt.Xt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.se.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},U=function(t){const e=document.querySelector(`#${this.ie}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Wt.Rt){const e=t.T?.total??0;this.he+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.re.get(t)??0;this.re.set(t,n+i)}const n=t.T?.correct??{};this.oe+=Object.keys(n).length,this.ae+=Object.keys(t.M).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.ce+=t;const n=this.le.get(e)??0;this.le.set(e,n+t)}}this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Ot}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new q(this).Pt()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.vt("bm-H",s?.[0]||""),t.vt("bm-I",s?.[1]||"")):1==s.length?t.vt(e.id,s?.[0]||""):(t.vt("bm-J",s?.[0]||""),t.vt("bm-K",s?.[1]||""),t.vt("bm-H",s?.[2]||""),t.vt("bm-I",s?.[3]||""))},E=new WeakSet,V=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var J=GM_info.script.name.toString(),X=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",J),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data;if(Date.now(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const e=await s.apply(this,t),i=e.clone(),o=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",a=i.headers.get("content-type")||"";if(a.includes("application/json"))i.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:o,jsonData:t},"*")}).catch(t=>{});else if(a.includes("image/")&&!o.includes("openfreemap")&&!o.includes("maps")){const t=Date.now(),e=await i.blob();return new Promise(s=>{const a=crypto.randomUUID();n.set(a,t=>{s(new Response(t,{headers:i.headers,status:i.status,statusText:i.statusText}))}),window.postMessage({source:"blue-marble",endpoint:o,blobID:a,blobData:e,blink:t})}).catch(t=>{Date.now()})}return e}});var Q=`#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}.bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}.bm-t:hover,.bm-t:focus-within{background-color:#112855e6}.bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}.bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}.bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}.bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}.bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}.bm-7 svg{width:4ch}.bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}.bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}.bm-G #bm-y{flex-direction:column;gap:.25em}.bm-G .bm-t{width:auto;margin:0;padding:0}.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}.bm-G .bm-7 svg{width:3ch}.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin:.25em 0}.bm-G h1:not(#bm-w h1){font-size:1em}`;GM_addStyle(Q);var Z,K="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0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D/GHxiZt4LhVUeRHSLQKhuRqsT/mvXPm7+kqv1xRpcL4NrV/3LijKmRA3CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?GM_addStyle(K):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.xe=null,this.ve=null,this.Me="#bm-j"}Ce(t){return this.ve=t,this.xe=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Me)}),this}$e(){return this.xe}observe(t,e=!1,i=!1){t.observe(this.ve,{childList:e,subtree:i})}};var tt=new class extends D{constructor(t,i){super(t,i),e(this,F),this.window=null,this.Ot="bm-w",this.Bt=document.body}Pt(){document.querySelector(`#${this.Ot}`)?this.Lt("Main window already exists!"):(this.window=this.U({id:this.Ot,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().P().U({class:"bm-h"}).U({class:"bm-E"}).Y({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAA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7pwQBvsHSBuyqSg3c+Rfu27HvX0VN7Y2U1ZSK4pVw+dHD7N+/Vr0ej0h8+/H0bFPYisYM2Y8v//DJpxEft95b5squ2ZzKTnZ6WTKUbrl5dfYvHmzzPsBQegqrq5Gurt71ZugsaGR+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Ot}`))})}).P().q(1,{textContent:this.name}).P().P().J().P().U({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).P().X().P().R({id:"bm-k",textContent:"Next level in..."}).P().X().P().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.O.Te=e.id}).P().P().P().J().P().U({class:"bm-E"}).U({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.O?.Se;e?.[0]?(t.vt("bm-J",e?.[0]||""),t.vt("bm-K",e?.[1]||""),t.vt("bm-H",e?.[2]||""),t.vt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).P().Mt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().Mt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().Mt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().Mt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().P().U({class:"bm-E"}).Ct({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).P().P().U({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.O?.Wt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Nt("Disabled templates!")):(t.O?.Wt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Nt("Enabled templates!")),e.disabled=!1}}).P().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Ot} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.O?.Wt.Gt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Nt("Drew to canvas!")):t.Lt("No file selected!")}}).P().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,F,R).call(this)}).P().P().U({class:"bm-E"}).$t({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).P().P().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.O?.Wt;new H(this.name,this.version,e?.schemaVersion,e).Pt()}}).P().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).P().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).P().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).P().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new Y(this.name,this.version).Pt()}}).P().P().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).P().P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`))}}(J,X),et=new class{constructor(t,i,n){e(this,N),this.name=t,this.version=i,this.I=n,this.schemaVersion="2.0.0",this.De=null,this.zt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.$=1e3,this.jt=3,this.qt=3,this.Jt=function(t){const e=M;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,N:i}}(this.qt),this.Vt=null,this.Le="",this.Rt=[],this.Ft=null,this.Ne=!0,this.Oe=null,this.Xt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Gt(t,e,n){this.Ft||(this.Ft=await this.Be()),this.I.Nt(`Creating template at ${n.join(", ")}...`);const s=new C({displayName:e,p:0,v:m(this.De||0,this.zt),file:t,coords:n}),{k:o,D:a}=await s.S(this.$,this.Jt);s.M=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.v}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Nt(`Template created at ${n.join(", ")}!`),await i(this,N,O).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be())}async Ae(){l("Downloading all templates...");for(const t of this.Rt)await this.We(t),await n(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.We(new C({displayName:i.name,p:e.split(" ")?.[0],v:e.split(" ")?.[1],M:i.tiles})),await n(500))}async We(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Pe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){const e=t.M,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.$+c,u=l*this.$+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)});const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt,d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.$+r,m=a*this.$+l;u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async _e(t,e){if(!this.Ne)return t;const n=this.$*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0");const o=this.Rt;o.sort((t,e)=>t.p-e.p);const a=o.map(t=>{const i=Object.keys(t.M).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{ze:t,Ue:t.M[e],C:t.C?.[e],Ge:[i[0],i[1]],Fe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean),r=a?.length||0;if(!(r>0))return this.I.Nt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.M).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Nt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){const n=!!t.ze.T?.colors?.get(-1);let s=t.C.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.Xt.size||n||h.drawImage(t.Ue,o,a),!s){const e=h.getImageData(o,a,t.Ue.width,t.Ue.height);s=new Uint32Array(e.data.buffer)}Date.now();const{Qt:r,Zt:l}=i(this,N,I).call(this,{Et:d,Vt:s,Yt:[o,a,t.Ue.width,t.Ue.height]});let c=0;const m=0;for(const[t,e]of r)t!=m&&(c+=e);(0!=this.Xt.size||n)&&h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(l.buffer),t.Ue.width,t.Ue.height)),o,a),void 0===t.ze.T.correct&&(t.ze.T.correct={}),t.ze.T.correct[e]=r}return await c.convertToBlob({type:"image/png"})}Re(t){"BlueMarble"==t?.whoami&&i(this,N,B).call(this,t)}ke(t){this.Ne=t}}(J,X,tt),it=new class{constructor(t){this.Wt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ve(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(n.id||n.id,this.Wt.De=n.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.vt("bm-q",`Droplets: ${s(n.droplets)}`),t.vt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),m=document.querySelectorAll("span");for(const t of m)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let d=i.endpoint.split("/");d=[parseInt(d[d.length-2]),parseInt(d[d.length-1].replace(".png",""))];const u=i.blobID,b=i.blobData,p=(Date.now(),await this.Wt._e(b,d));window.postMessage({source:"blue-marble",blobID:u,blobData:p,blink:i.blink});break;case"robots":this.je="false"==n.userscript?.toString().toLowerCase()}var a,r})}async Ye(t){let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return;const i=navigator.userAgent;let n=await this.qe(i),s=this.Je(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async qe(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Je(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.W(it);var nt=JSON.parse(GM_getValue("bmTemplates","{}"));et.Re(nt);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(0==Object.keys(st).length){const t=crypto.randomUUID();GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>it.Ye(X),18e5);var ot=st?.telemetry;if(null==ot||ot>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.Ot="bm-g",this.Bt=document.body,this.Xe=n,this.uuid=s}async Pt(){if(document.querySelector(`#${this.Ot}`))return void this.Lt("Telemetry window already exists!");const t=await this.O.qe(navigator.userAgent),e=this.O.Je(navigator.userAgent);this.window=this.U({id:this.Ot,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).P().P().J().P().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,V).call(this,this.Xe);const t=document.getElementById(this.Ot);t?.remove()}}).P().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,V).call(this,0);const t=document.getElementById(this.Ot);t?.remove()}}).P().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).P().P().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"}).P().G({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 ${this.name}!`}).P().P().J().P().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).P().G({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).P().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).P().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).P().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).P().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).P().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).P().P().G({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).P().P().P().P().P()._(this.Bt)}}(J,X,1,st?.uuid);t.W(it),t.Pt()}tt.Pt(),it.Ve(tt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${J}%c (${X}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin:.25em 0}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzg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wTQK3D/GHxiZt4LhVUeRHSLQKhuRqsT/mvXPm7+kqv1xRpcL4NrV/3LijKmRA3CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGw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eIjDjLp58cFq14leXLH+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"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 9978f90..476de32 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}.bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}.bm-t:hover,.bm-t:focus-within{background-color:#112855e6}.bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}.bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}.bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}.bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}.bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}.bm-7 svg{width:4ch}.bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}.bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}.bm-G #bm-y{flex-direction:column;gap:.25em}.bm-G .bm-t{width:auto;margin:0;padding:0}.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}.bm-G .bm-7 svg{width:3ch}.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin:.25em 0}.bm-G h1:not(#bm-w h1){font-size:1em} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin:.25em 0}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 8b0afb3..318aa52 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.91.0 +// @version 0.91.2 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var w,g,y,x,v,M=[{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]}],C=class{constructor({displayName:t="My template",p:i=0,v:n="",url:s="",file:o=null,coords:a=null,M:r=null,C:l={},$:c=1e3}={}){e(this,w),this.displayName=t,this.p=i,this.v=n,this.url=s,this.file=o,this.coords=a,this.M=r,this.C=l,this.$=c,this.T={total:0,colors:new Map}}async S(t,e){const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.$=t;const a={},r={},l=new OffscreenCanvas(this.$,this.$),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,w,g).call(this,c.getImageData(0,0,s,o),e);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return o};var $,T,S,k,D=class{constructor(t,i){e(this,y),this.name=t,this.version=i,this.O=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}W(t){this.O=t}P(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}U(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"div",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"details",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"summary",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,y,x).call(this,"h"+t,{},e)),this}J(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"hr",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const n=i(this,y,x).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,y,x).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.P(),e(this,n,s),this}it(t={},e=()=>{}){const n=i(this,y,x).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.P(),e(this,n,i(this,y,x).call(this,"select",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"tr",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"th",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"button",{},t)),this}xt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.vt(this.B,n)}};return e(this,i(this,y,x).call(this,"button",s,t)),this}Mt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"input",{},t)),this}Ct(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,y,x).call(this,"div"),o=i(this,y,x).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.P();const a=i(this,y,x).call(this,"button",{textContent:n});return this.P(),this.P(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}$t(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,i(this,y,x).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,y,x).call(this,"time",r,n);return l.id=a,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}vt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Dt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Lt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),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=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",w),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},w=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Nt(t){(0,console.info)(`${this.name}: ${t}`),this.vt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.vt(this.B,"Error: "+t,!0)}};y=new WeakSet,x=function(t,e={},n={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,n]of Object.entries(e))i(this,y,v).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,y,v).call(this,s,t,e);return s},v=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 L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,$),this.window=null,this.Ot="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=n,this.Wt=s}Pt(){if(document.querySelector(`#${this.Ot}`))return void document.querySelector(`#${this.Ot}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.Ot,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).P().P().J().P().U({class:"bm-E"}).q(2,{textContent:"Status"}).P().G({id:"bm-o",textContent:"Loading template storage status..."}).P().P().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`),i(this,$,T).call(this),i(this,$,S).call(this)}};$=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.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.Ht="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.Ht="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.Ht="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.vt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Wt._t().then(()=>{e.disabled=!1})}}).P()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,$,k).call(this,!0)}}).P(),c.P()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Ot} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Wt.zt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"}).P().F({textContent:`#${m}`}).P().P().U({class:"bm-x bm-0"}).q(3,{textContent:r}).P().R({textContent:`Uploaded by user #${u}`}).P().R({textContent:`Coordinates: ${l.join(", ")}`}).P().R({textContent:`Total Pixels: ${b}`}).P().P().P()}}i.P()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Ot} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).P().P().J().P().U({class:"bm-E"}).q(2,{textContent:"Status"}).P().G({textContent:"Updating template storage. Please wait..."}).P().P().P()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new C({displayName:i.name,M:i.tiles});t.L();const e=await this.Wt.Ut(t);await this.Wt.Gt(e,t.displayName,t.coords)}t&&(document.querySelector(`#${this.Ot}`).remove(),new L(this.name,this.version,this.At,this.Wt).Pt())};var N,O,B,I,H=L;N=new WeakSet,O=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){const e=t.templates,i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Pt(),this.Rt=await async function({$:t,jt:i,Rt:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new C({displayName:l,p:s||this.Rt?.length||0,v:r||""});p.T=c,p.M=m,p.C=d,n.push(p)}}return n}({$:this.$,jt:this.jt,Rt:this.Rt})):n[0]>>24&255,w=b>>>24&255,g=m.get(p)??-2;if(this.Xt.get(g)&&(e[i*r+l]=b),-1==g){const t=536870912;this.Xt.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{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=M.slice(1)}ee(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,_,z,U,G,F,R,j,E,V,Y=class extends D{constructor(t,e){super(t,e),this.window=null,this.Ot="bm-i",this.Bt=document.body}Pt(){document.querySelector(`#${this.Ot}`)?document.querySelector(`#${this.Ot}`).remove():(this.window=this.U({id:this.Ot,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).P().P().J().P().U({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).P().P().X().P().J().P().X().P().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).P().X().P().R({innerHTML:'The Blue Marble Website is made by crqch.'}).P().X().P().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).P().X().P().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).P().X().P().R({textContent:"Special Thanks:"}).P().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).P().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).P().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).P().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).P().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).P().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).P().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).P().lt({innerHTML:'Force Network for hosting the telemetry server!'}).P().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).P().P().X().P().R({innerHTML:'Donators:'}).P().ot().lt({textContent:"Espresso"}).P().lt({textContent:"BEST FAN"}).P().lt({textContent:"Jack"}).P().lt({textContent:"raiken_au"}).P().lt({textContent:"Jacob"}).P().lt({textContent:"StupidOne"}).P().lt({textContent:"1 Anonymous Supporter"}).P().P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.Ot="bm-p",this.ie="bm-y",this.Bt=document.body,this.Wt=t.O?.Wt,this.ne='',this.se='';const{palette:i,N:n}=this.Wt.Jt;this.palette=i,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Pt(){if(document.querySelector(`#${this.Ot}`))return void document.querySelector(`#${this.Ot}`).remove();this.window=this.U({id:this.Ot,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).P().P().J().P().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).P().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).P().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).P().P().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).P().X().P().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).P().X().P().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).P().X().P().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).P().X().P().R({id:"bm-5",innerHTML:"??? ???"}).P().P().U({class:"bm-E"}).G({innerHTML:`Colors with the icon ${this.ne.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Ot} form`)),n={};for(const[t,i]of e)n[t]=i;i(this,P,z).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).P().P().P().P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`);const t=document.querySelector(`#${this.Ot} .bm-E.bm-A`);i(this,P,_).call(this,t),i(this,P,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.vt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.vt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.vt("#bm-f",`Total Pixels: ${s(this.he)}`),this.vt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.vt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Ot}`))return void document.querySelector(`#${this.Ot}`).remove();this.window=this.U({id:this.Ot,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove(),this.Pt()},e.ontouchend=()=>{e.click()}}).P().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Ot}`)?.remove()},e.ontouchend=()=>{e.click()}}).P().P().P().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).P().P().J().P().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).P().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).P().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).P().P().U({class:"bm-E bm-A"}).P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`);const t=document.querySelector(`#${this.Ot} .bm-E.bm-A`);i(this,P,_).call(this,t),i(this,P,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){i(this,P,G).call(this);const t=document.querySelector(`#${this.ie}`),e={};for(const t of this.palette){const i=this.re.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={be:i,pe:n,fe:a,we:r,ge:l,ye:c}}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{fe:n,we:s,ge:o,be:a,pe:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Ot} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Ot} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}i(this,P,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,_=function(t){const e=t.closest(`#${this.Ot}`)?.classList.contains("bm-G"),i=new D(this.name,this.version);i.U({id:this.ie});const n=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,we:c,ge:h,be:m,pe:d,ye:u}=n[t.id],b=!!this.Wt.Xt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.se.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},U=function(t){const e=document.querySelector(`#${this.ie}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Wt.Rt){const e=t.T?.total??0;this.he+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.re.get(t)??0;this.re.set(t,n+i)}const n=t.T?.correct??{};this.oe+=Object.keys(n).length,this.ae+=Object.keys(t.M).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.ce+=t;const n=this.le.get(e)??0;this.le.set(e,n+t)}}this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Ot}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new q(this).Pt()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.vt("bm-H",s?.[0]||""),t.vt("bm-I",s?.[1]||"")):1==s.length?t.vt(e.id,s?.[0]||""):(t.vt("bm-J",s?.[0]||""),t.vt("bm-K",s?.[1]||""),t.vt("bm-H",s?.[2]||""),t.vt("bm-I",s?.[3]||""))},E=new WeakSet,V=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var J=GM_info.script.name.toString(),X=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",J),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data;if(Date.now(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const e=await s.apply(this,t),i=e.clone(),o=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",a=i.headers.get("content-type")||"";if(a.includes("application/json"))i.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:o,jsonData:t},"*")}).catch(t=>{});else if(a.includes("image/")&&!o.includes("openfreemap")&&!o.includes("maps")){const t=Date.now(),e=await i.blob();return new Promise(s=>{const a=crypto.randomUUID();n.set(a,t=>{s(new Response(t,{headers:i.headers,status:i.status,statusText:i.statusText}))}),window.postMessage({source:"blue-marble",endpoint:o,blobID:a,blobData:e,blink:t})}).catch(t=>{Date.now()})}return e}});var Q=GM_getResourceText("CSS-BM-File");GM_addStyle(Q);var Z,K="robotoMonoInjectionPoint";K.indexOf("@font-face")+1?GM_addStyle(K):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.xe=null,this.ve=null,this.Me="#bm-j"}Ce(t){return this.ve=t,this.xe=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Me)}),this}$e(){return this.xe}observe(t,e=!1,i=!1){t.observe(this.ve,{childList:e,subtree:i})}};var tt=new class extends D{constructor(t,i){super(t,i),e(this,F),this.window=null,this.Ot="bm-w",this.Bt=document.body}Pt(){document.querySelector(`#${this.Ot}`)?this.Lt("Main window already exists!"):(this.window=this.U({id:this.Ot,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).P().U().P().P().U({class:"bm-h"}).U({class:"bm-E"}).Y({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Ot}`))})}).P().q(1,{textContent:this.name}).P().P().J().P().U({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).P().X().P().R({id:"bm-k",textContent:"Next level in..."}).P().X().P().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.O.Te=e.id}).P().P().P().J().P().U({class:"bm-E"}).U({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.O?.Se;e?.[0]?(t.vt("bm-J",e?.[0]||""),t.vt("bm-K",e?.[1]||""),t.vt("bm-H",e?.[2]||""),t.vt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).P().Mt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().Mt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().Mt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().Mt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,F,j).call(this,t,e,n))}).P().P().U({class:"bm-E"}).Ct({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).P().P().U({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.O?.Wt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Nt("Disabled templates!")):(t.O?.Wt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Nt("Enabled templates!")),e.disabled=!1}}).P().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Ot} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.O?.Wt.Gt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Nt("Drew to canvas!")):t.Lt("No file selected!")}}).P().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,F,R).call(this)}).P().P().U({class:"bm-E"}).$t({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).P().P().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.O?.Wt;new H(this.name,this.version,e?.schemaVersion,e).Pt()}}).P().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).P().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).P().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).P().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new Y(this.name,this.version).Pt()}}).P().P().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).P().P().P().P().P()._(this.Bt),this.Dt(`#${this.Ot}.bm-N`,`#${this.Ot} .bm-L`))}}(J,X),et=new class{constructor(t,i,n){e(this,N),this.name=t,this.version=i,this.I=n,this.schemaVersion="2.0.0",this.De=null,this.zt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.$=1e3,this.jt=3,this.qt=3,this.Jt=function(t){const e=M;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,N:i}}(this.qt),this.Vt=null,this.Le="",this.Rt=[],this.Ft=null,this.Ne=!0,this.Oe=null,this.Xt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Gt(t,e,n){this.Ft||(this.Ft=await this.Be()),this.I.Nt(`Creating template at ${n.join(", ")}...`);const s=new C({displayName:e,p:0,v:m(this.De||0,this.zt),file:t,coords:n}),{k:o,D:a}=await s.S(this.$,this.Jt);s.M=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.v}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Nt(`Template created at ${n.join(", ")}!`),await i(this,N,O).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be())}async Ae(){l("Downloading all templates...");for(const t of this.Rt)await this.We(t),await n(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.We(new C({displayName:i.name,p:e.split(" ")?.[0],v:e.split(" ")?.[1],M:i.tiles})),await n(500))}async We(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Pe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){const e=t.M,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.$+c,u=l*this.$+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)});const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt,d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.$+r,m=a*this.$+l;u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async _e(t,e){if(!this.Ne)return t;const n=this.$*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0");const o=this.Rt;o.sort((t,e)=>t.p-e.p);const a=o.map(t=>{const i=Object.keys(t.M).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{ze:t,Ue:t.M[e],C:t.C?.[e],Ge:[i[0],i[1]],Fe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean),r=a?.length||0;if(!(r>0))return this.I.Nt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.M).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Nt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){const n=!!t.ze.T?.colors?.get(-1);let s=t.C.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.Xt.size||n||h.drawImage(t.Ue,o,a),!s){const e=h.getImageData(o,a,t.Ue.width,t.Ue.height);s=new Uint32Array(e.data.buffer)}Date.now();const{Qt:r,Zt:l}=i(this,N,I).call(this,{Et:d,Vt:s,Yt:[o,a,t.Ue.width,t.Ue.height]});let c=0;const m=0;for(const[t,e]of r)t!=m&&(c+=e);(0!=this.Xt.size||n)&&h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(l.buffer),t.Ue.width,t.Ue.height)),o,a),void 0===t.ze.T.correct&&(t.ze.T.correct={}),t.ze.T.correct[e]=r}return await c.convertToBlob({type:"image/png"})}Re(t){"BlueMarble"==t?.whoami&&i(this,N,B).call(this,t)}ke(t){this.Ne=t}}(J,X,tt),it=new class{constructor(t){this.Wt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ve(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(n.id||n.id,this.Wt.De=n.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.vt("bm-q",`Droplets: ${s(n.droplets)}`),t.vt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),m=document.querySelectorAll("span");for(const t of m)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let d=i.endpoint.split("/");d=[parseInt(d[d.length-2]),parseInt(d[d.length-1].replace(".png",""))];const u=i.blobID,b=i.blobData,p=(Date.now(),await this.Wt._e(b,d));window.postMessage({source:"blue-marble",blobID:u,blobData:p,blink:i.blink});break;case"robots":this.je="false"==n.userscript?.toString().toLowerCase()}var a,r})}async Ye(t){let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return;const i=navigator.userAgent;let n=await this.qe(i),s=this.Je(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async qe(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Je(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.W(it);var nt=JSON.parse(GM_getValue("bmTemplates","{}"));et.Re(nt);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(0==Object.keys(st).length){const t=crypto.randomUUID();GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>it.Ye(X),18e5);var ot=st?.telemetry;if(null==ot||ot>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.Ot="bm-g",this.Bt=document.body,this.Xe=n,this.uuid=s}async Pt(){if(document.querySelector(`#${this.Ot}`))return void this.Lt("Telemetry window already exists!");const t=await this.O.qe(navigator.userAgent),e=this.O.Je(navigator.userAgent);this.window=this.U({id:this.Ot,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).P().P().J().P().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,V).call(this,this.Xe);const t=document.getElementById(this.Ot);t?.remove()}}).P().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,V).call(this,0);const t=document.getElementById(this.Ot);t?.remove()}}).P().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).P().P().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"}).P().G({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 ${this.name}!`}).P().P().J().P().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).P().G({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).P().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).P().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).P().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).P().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).P().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).P().P().G({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).P().P().P().P().P()._(this.Bt)}}(J,X,1,st?.uuid);t.W(it),t.Pt()}tt.Pt(),it.Ve(tt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${J}%c (${X}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=GM_getResourceText("CSS-BM-File");GM_addStyle(Q);var Z,K="robotoMonoInjectionPoint";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 2421ba8..4ae8d0c 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 8baaf9a..a7a962e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.90.76", + "version": "0.91.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.90.76", + "version": "0.91.2", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index c1d47aa..ae104fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.0", + "version": "0.91.2", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 52f4f98..d9fa94c 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.91.0 +// @version 0.91.2 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/WindowFilter.css b/src/WindowFilter.css index c9a2356..42e726a 100644 --- a/src/WindowFilter.css +++ b/src/WindowFilter.css @@ -17,7 +17,7 @@ } /* Filter color */ -.bm-filter-color { +#bm-window-filter .bm-filter-color { width: fit-content; max-width: 35ch; background-color: rgba(21, 48, 99, 0.9); @@ -28,13 +28,13 @@ } /* Filter color on hover */ -.bm-filter-color:hover, -.bm-filter-color:focus-within { +#bm-window-filter .bm-filter-color:hover, +#bm-window-filter.bm-filter-color:focus-within { background-color: rgba(17, 40, 85, 0.9); } /* Filter window container for RGB color display */ -.bm-filter-container-rgb { +#bm-window-filter .bm-filter-container-rgb { display: block; border: thick double darkslategray; width: fit-content; @@ -43,7 +43,7 @@ } /* Filter window container for RGB color display for Other color */ -.bm-filter-color[data-id="-2"] .bm-filter-container-rgb { +#bm-window-filter .bm-filter-color[data-id="-2"] .bm-filter-container-rgb { background: conic-gradient( #aa0000 0%, #aaaa00 16.6%, @@ -56,16 +56,16 @@ } /* Filter window container for RGB color display for Erased color */ -.bm-filter-color[data-id="-1"] .bm-filter-container-rgb { +#bm-window-filter .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 { +#bm-window-filter .bm-filter-color[data-id="-1"] .bm-filter-container-rgb svg { fill: white !important; } /* Filter window container for RGB color display for Transparent color */ -.bm-filter-color[data-id="0"] .bm-filter-container-rgb { +#bm-window-filter .bm-filter-color[data-id="0"] .bm-filter-container-rgb { background-color: transparent !important; } @@ -75,19 +75,19 @@ } /* Filter window hide color button SVG */ -.bm-filter-container-rgb svg { +#bm-window-filter .bm-filter-container-rgb svg { width: 4ch; } /* Filter window container for color information */ -.bm-filter-color > .bm-flex-between { +#bm-window-filter .bm-filter-color > .bm-flex-between { flex-direction: column; align-items: flex-start; gap: 0; } /* Filter window color flavor text */ -.bm-filter-color small { +#bm-window-filter .bm-filter-color small { font-size: 0.75em; } @@ -99,20 +99,20 @@ /* WINDOWED MODE */ /* Filter flex in windowed mode */ -.bm-windowed #bm-filter-flex { +#bm-window-filter.bm-windowed #bm-filter-flex { flex-direction: column; gap: 0.25em; } /* Filter color in windowed mode */ -.bm-windowed .bm-filter-color { +#bm-window-filter.bm-windowed .bm-filter-color { width: auto; margin: 0; padding: 0; } /* Filter window container for RGB color display in windowed mode */ -.bm-windowed .bm-filter-container-rgb { +#bm-window-filter.bm-windowed .bm-filter-container-rgb { display: flex; width: 100%; gap: 0.5ch; @@ -128,11 +128,11 @@ } /* Filter window hide color button SVG in windowed mode */ -.bm-windowed .bm-filter-container-rgb svg { +#bm-window-filter.bm-windowed .bm-filter-container-rgb svg { width: 3ch; } /* Filter window header 2 in windowed mode */ -.bm-windowed .bm-filter-color h2 { +#bm-window-filter.bm-windowed .bm-filter-color h2 { font-size: 0.75em; } \ No newline at end of file From 0f99906cc507fd77277a2ec3b4c7dfa3e7611cee Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Tue, 3 Mar 2026 17:34:47 -0500 Subject: [PATCH 02/15] Fixed vertical alignment in Windowed mode --- dist/BlueMarble-For-GreasyFork.user.css | 3 ++- dist/BlueMarble-For-GreasyFork.user.js | 2 +- dist/BlueMarble-Standalone.user.js | 4 ++-- dist/BlueMarble.user.css | 2 +- dist/BlueMarble.user.js | 2 +- docs/README.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/BlueMarble.meta.js | 2 +- src/overlay.css | 4 +++- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 8b7727d..cfe9f5d 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -279,7 +279,8 @@ input[type=file] { font-family: monospace; } .bm-container:not(#bm-window-main .bm-container) { - margin: 0.25em 0; + margin-top: 0.25em; + margin-bottom: 0.25em; } .bm-windowed h1:not(#bm-window-main h1) { font-size: 1em; diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index d5d3b36..d0d5079 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.91.2 +// @version 0.91.3 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index 8c836db..add0f66 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.91.2 +// @version 0.91.3 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin:.25em 0}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAA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RGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP//AAAAAAAAubU+IZJzuMAAAAtoSURBVFhHlZZ3fJSFGce/NzKOhITL4kJCEgmJ7D2UXQKJghVBFEWkLC3ioNWigFrhg9ZRKBZUWigtcTBEQUEgBDAESEJCQvYk+7LnZV4u6+2TV8unfqRqnz9yd2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GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@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+JIiJf6k8fvmlMgTb7HBGzQZtEAQxQER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OfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAG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kiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 476de32..c3c9d80 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin:.25em 0}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 318aa52..015ca3a 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.91.2 +// @version 0.91.3 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/docs/README.md b/docs/README.md index 4ae8d0c..f0c1945 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 a7a962e..42366ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.2", + "version": "0.91.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.2", + "version": "0.91.3", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index ae104fd..9f9c7e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.2", + "version": "0.91.3", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index d9fa94c..1e90f18 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.91.2 +// @version 0.91.3 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/overlay.css b/src/overlay.css index 37a0711..a622785 100644 --- a/src/overlay.css +++ b/src/overlay.css @@ -346,7 +346,9 @@ input[type="file"] { /* Containers for "sections" of elements in windowed mode */ /* Does not apply to the main window */ .bm-container:not(#bm-window-main .bm-container) { - margin: 0.25em 0; + margin-top: 0.25em; + margin-bottom: 0.25em; + /* Do not use 'margin' shorthand, as it will override left/right margin */ } /* Header 1 in windowed mode */ From 4d628f486bdc76bd352be79b7e0cb2f9d2546de7 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Tue, 3 Mar 2026 19:38:26 -0500 Subject: [PATCH 03/15] Filter dragbar shows correct/total pixels --- dist/BlueMarble-For-GreasyFork.user.css | 3 ++- dist/BlueMarble-For-GreasyFork.user.js | 18 ++++++++++++--- 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/WindowFilter.js | 29 +++++++++++++++++++++++-- src/overlay.css | 4 +++- 11 files changed, 57 insertions(+), 17 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index cfe9f5d..4057235 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -94,7 +94,8 @@ confetti-piece { font-weight: bold; vertical-align: middle; } -.bm-dragbar h1 { +.bm-dragbar h1, +.bm-dragbar-text { font-size: 1.2em; user-select: none; overflow: hidden; diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index d0d5079..eaa63e5 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.91.3 +// @version 0.91.8 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -2818,11 +2818,17 @@ Did you try clicking the canvas first?`); return; } this.window = this.addDiv({ "id": this.windowID, "class": "bm-window bm-windowed" }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Color Filter"', "data-button-status": "expanded" }, (instance, button) => { - button.onclick = () => instance.handleMinimization(button); + button.onclick = () => { + const windowedColorTotals = document.querySelector("#bm-filter-windowed-color-totals"); + if (windowedColorTotals) { + windowedColorTotals.style.display = button.dataset["status"] == "expanded" ? "none" : ""; + } + instance.handleMinimization(button); + }; button.ontouchend = () => { button.click(); }; - }).buildElement().addDiv().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "textContent": "\u{1F5D6}", "aria-label": 'Switch to fullscreen mode for "Color Filter"' }, (instance, button) => { + }).buildElement().addDiv().addSpan({ "id": "bm-filter-windowed-color-totals", "class": "bm-dragbar-text", "style": "font-weight: 700;" }).buildElement().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "textContent": "\u{1F5D6}", "aria-label": 'Switch to fullscreen mode for "Color Filter"' }, (instance, button) => { button.onclick = () => { document.querySelector(`#${this.windowID}`)?.remove(); this.buildWindow(); @@ -2894,6 +2900,12 @@ Did you try clicking the canvas first?`); colorIncorrect }; } + const windowedColorTotals = document.querySelector("#bm-filter-windowed-color-totals"); + if (windowedColorTotals) { + const allCorrect = this.allPixelsCorrectTotal.toString().length > 7 ? this.allPixelsCorrectTotal.toString().slice(0, 2) + "\u2026" + this.allPixelsCorrectTotal.toString().slice(-3) : this.allPixelsCorrectTotal.toString(); + const allTotal = this.allPixelsTotal.toString().length > 7 ? this.allPixelsTotal.toString().slice(0, 2) + "\u2026" + this.allPixelsTotal.toString().slice(-3) : this.allPixelsTotal.toString(); + this.updateInnerHTML("#bm-filter-windowed-color-totals", `${allCorrect}/${allTotal}`, true); + } if (!colorList) { return colorStatistics; } diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index add0f66..b7047b2 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.91.3 +// @version 0.91.8 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8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hECq0+ItPwpB7LuTOwTQK3D/GHxiZt4LhVUeRHSLQKhuRqsT/mvXPm7+kqv1xRpcL4NrV/3LijKmRA3CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAG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M7CiQ0bNpCansGpM6eIjDjLp58cFq14leXLH+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"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.status?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEP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TOwTQK3D/GHxiZt4LhVUeRHSLQKhuRqsT/mvXPm7+kqv1xRpcL4NrV/3LijKmRA3CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAA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M6eIjDjLp58cFq14leXLH+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"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index c3c9d80..af6efbc 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 015ca3a..bf5c3bf 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.91.3 +// @version 0.91.8 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=GM_getResourceText("CSS-BM-File");GM_addStyle(Q);var Z,K="robotoMonoInjectionPoint";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.status?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=GM_getResourceText("CSS-BM-File");GM_addStyle(Q);var Z,K="robotoMonoInjectionPoint";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index f0c1945..6963e12 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 42366ce..0e1c34b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.3", + "version": "0.91.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.3", + "version": "0.91.8", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 9f9c7e6..9c736de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.3", + "version": "0.91.8", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 1e90f18..4a6bc28 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.91.3 +// @version 0.91.8 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/WindowFilter.js b/src/WindowFilter.js index 68e0110..531ceaf 100644 --- a/src/WindowFilter.js +++ b/src/WindowFilter.js @@ -210,10 +210,19 @@ export default class WindowFilter extends Overlay { this.window = this.addDiv({'id': this.windowID, 'class': 'bm-window bm-windowed'}) .addDragbar() .addButton({'class': 'bm-button-circle', 'textContent': 'ā–¼', 'aria-label': 'Minimize window "Color Filter"', 'data-button-status': 'expanded'}, (instance, button) => { - button.onclick = () => instance.handleMinimization(button); + button.onclick = () => { + const windowedColorTotals = document.querySelector('#bm-filter-windowed-color-totals'); + if (windowedColorTotals) { + windowedColorTotals.style.display = (button.dataset['status'] == 'expanded') ? 'none' : ''; + } + instance.handleMinimization(button); + }; button.ontouchend = () => {button.click()}; // Needed only to negate weird interaction with dragbar }).buildElement() - .addDiv().buildElement() // Contains the minimized h1 element + .addDiv() + .addSpan({'id': 'bm-filter-windowed-color-totals', 'class': 'bm-dragbar-text', 'style': 'font-weight: 700;'}).buildElement() // Contains correct / total pixel values + // Minimized h1 element will appear here + .buildElement() .addDiv({'class': 'bm-flex-center'}) .addButton({'class': 'bm-button-circle', 'textContent': 'šŸ—–', 'aria-label': 'Switch to fullscreen mode for "Color Filter"'}, (instance, button) => { button.onclick = () => { @@ -577,6 +586,22 @@ export default class WindowFilter extends Overlay { } } + // Obtains the correct / total pixels display element, or `undefined` if in fullscreen mode + const windowedColorTotals = document.querySelector('#bm-filter-windowed-color-totals'); + + // If the element exists... + if (windowedColorTotals) { + + // Returns the number, unlocalized (no space to localize) + // OR returns the three characters on either end of the string, with the middle replaced with an ellipse. + // E.g. '1234567' or '123…678' + const allCorrect = (this.allPixelsCorrectTotal.toString().length > 7) ? this.allPixelsCorrectTotal.toString().slice(0, 2) + '…' + this.allPixelsCorrectTotal.toString().slice(-3) : this.allPixelsCorrectTotal.toString(); + const allTotal = (this.allPixelsTotal.toString().length > 7) ? this.allPixelsTotal.toString().slice(0, 2) + '…' + this.allPixelsTotal.toString().slice(-3) : this.allPixelsTotal.toString(); + + // Updates the display with XSS protection enabled (because why not) + this.updateInnerHTML('#bm-filter-windowed-color-totals', `${allCorrect}/${allTotal}`, true); + } + // Return early if the color list does not exist. // We can't update DOM elements that don't exist, so we exit now. if (!colorList) {return colorStatistics;} diff --git a/src/overlay.css b/src/overlay.css index a622785..4382bb9 100644 --- a/src/overlay.css +++ b/src/overlay.css @@ -92,7 +92,9 @@ } /* Header 1 when inside dragbar */ -.bm-dragbar h1 { +/* Or, when the custom class is used */ +.bm-dragbar h1, +.bm-dragbar-text { font-size: 1.2em; user-select: none; overflow: hidden; From 3303fa5ad3fb07d981c31c4e0f9b7f56fecca47f Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Tue, 3 Mar 2026 19:50:02 -0500 Subject: [PATCH 04/15] Fixed Wiki crash error --- src/WindowFilter.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/WindowFilter.js b/src/WindowFilter.js index 531ceaf..76937d9 100644 --- a/src/WindowFilter.js +++ b/src/WindowFilter.js @@ -522,18 +522,21 @@ export default class WindowFilter extends Overlay { } } + /** The information about a specific color on the palette. + * @typedef {Object} ColorData + * @property {number | string} colorTotal + * @property {string} colorTotalLocalized + * @property {number | string} colorCorrect + * @property {string} colorCorrectLocalized + * @property {string} colorPercent + * @property {number} colorIncorrect + */ + /** Updates the information inside the colors in the color list. * If the color list does not exist yet, it returns the color information instead. * This assumes the information inside each element is the same between fullscreen and windowed mode. * @since 0.90.60 - * @returns {Object} */ updateColorList() { From 0182eb5277c72c89dc576837b3f913e077d26e09 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Tue, 3 Mar 2026 20:13:12 -0500 Subject: [PATCH 05/15] Fixed filter grammar issue --- src/WindowFilter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WindowFilter.js b/src/WindowFilter.js index 76937d9..32b63d7 100644 --- a/src/WindowFilter.js +++ b/src/WindowFilter.js @@ -432,7 +432,7 @@ export default class WindowFilter extends Overlay { .addSmall({'textContent': `#${color.id.toString().padStart(2, 0)}`}).buildElement() .addSmall({'class': 'bm-filter-color-pxl-cnt', 'textContent': `${colorCorrectLocalized} / ${colorTotalLocalized}`}).buildElement() .buildElement() - .addP({'class': 'bm-filter-color-pxl-desc', 'textContent': `${((typeof colorIncorrect == 'number') && !isNaN(colorIncorrect)) ? colorIncorrect : '???'} incorrect pixels. Completed: ${colorPercent}`}).buildElement() + .addP({'class': 'bm-filter-color-pxl-desc', 'textContent': `${((typeof colorIncorrect == 'number') && !isNaN(colorIncorrect)) ? colorIncorrect : '???'} incorrect pixel${(colorIncorrect == 1) ? '' : 's'}. Completed: ${colorPercent}`}).buildElement() .buildElement() .buildElement(); } @@ -638,7 +638,7 @@ export default class WindowFilter extends Overlay { // Updates the pixel description if it exists const pixelDesc = document.querySelector(`#${this.windowID} .bm-filter-color[data-id="${colorID}"] .bm-filter-color-pxl-desc`); - if (pixelDesc) {pixelDesc.textContent = `${((typeof colorIncorrect == 'number') && !isNaN(colorIncorrect)) ? colorIncorrect : '???'} incorrect pixels. Completed: ${colorPercent}`;} + if (pixelDesc) {pixelDesc.textContent = `${((typeof colorIncorrect == 'number') && !isNaN(colorIncorrect)) ? colorIncorrect : '???'} incorrect pixel${(colorIncorrect == 1) ? '' : 's'}. Completed: ${colorPercent}`;} } // Since the dataset has changed, we need to sort again From dd95406b31212334386288ec863a444fd0ddd868 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Tue, 3 Mar 2026 20:53:02 -0500 Subject: [PATCH 06/15] Fixed bugs in filter windowed dragbar text area --- dist/BlueMarble-For-GreasyFork.user.css | 3 +++ dist/BlueMarble-For-GreasyFork.user.js | 26 +++++++++++++------------ 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/WindowFilter.css | 5 +++++ src/WindowFilter.js | 2 +- 11 files changed, 33 insertions(+), 23 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 4057235..8a664aa 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -385,6 +385,9 @@ input[type=file] { #bm-window-filter.bm-windowed .bm-filter-color h2 { font-size: 0.75em; } +#bm-window-filter #bm-filter-windowed-color-totals { + font-size: 1em; +} /* src/WindowWizard.css */ #bm-wizard-tlist { diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index eaa63e5..ebe7333 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.91.8 +// @version 0.91.10 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -2821,7 +2821,7 @@ Did you try clicking the canvas first?`); button.onclick = () => { const windowedColorTotals = document.querySelector("#bm-filter-windowed-color-totals"); if (windowedColorTotals) { - windowedColorTotals.style.display = button.dataset["status"] == "expanded" ? "none" : ""; + windowedColorTotals.style.display = button.dataset["buttonStatus"] == "expanded" ? "none" : ""; } instance.handleMinimization(button); }; @@ -2859,18 +2859,20 @@ Did you try clicking the canvas first?`); __privateMethod(this, _WindowFilter_instances, buildColorList_fn).call(this, scrollableContainer); __privateMethod(this, _WindowFilter_instances, sortColorList_fn).call(this, this.sortPrimary, this.sortSecondary, this.showUnused); } + /** The information about a specific color on the palette. + * @typedef {Object} ColorData + * @property {number | string} colorTotal + * @property {string} colorTotalLocalized + * @property {number | string} colorCorrect + * @property {string} colorCorrectLocalized + * @property {string} colorPercent + * @property {number} colorIncorrect + */ /** Updates the information inside the colors in the color list. * If the color list does not exist yet, it returns the color information instead. * This assumes the information inside each element is the same between fullscreen and windowed mode. * @since 0.90.60 - * @returns {Object} */ updateColorList() { __privateMethod(this, _WindowFilter_instances, calculatePixelStatistics_fn).call(this); @@ -2930,7 +2932,7 @@ Did you try clicking the canvas first?`); } const pixelDesc = document.querySelector(`#${this.windowID} .bm-filter-color[data-id="${colorID}"] .bm-filter-color-pxl-desc`); if (pixelDesc) { - pixelDesc.textContent = `${typeof colorIncorrect == "number" && !isNaN(colorIncorrect) ? colorIncorrect : "???"} incorrect pixels. Completed: ${colorPercent}`; + pixelDesc.textContent = `${typeof colorIncorrect == "number" && !isNaN(colorIncorrect) ? colorIncorrect : "???"} incorrect pixel${colorIncorrect == 1 ? "" : "s"}. Completed: ${colorPercent}`; } } __privateMethod(this, _WindowFilter_instances, sortColorList_fn).call(this, this.sortPrimary, this.sortSecondary, this.showUnused); @@ -3045,7 +3047,7 @@ Did you try clicking the canvas first?`); button.disabled = true; } } - ).buildElement().buildElement().addSmall({ "textContent": color.id == -2 ? "???????" : colorValueHex }).buildElement().buildElement().addDiv({ "class": "bm-flex-between" }).addHeader(2, { "textContent": (color.premium ? "\u2605 " : "") + color.name }).buildElement().addDiv({ "class": "bm-flex-between", "style": "gap: 1.5ch;" }).addSmall({ "textContent": `#${color.id.toString().padStart(2, 0)}` }).buildElement().addSmall({ "class": "bm-filter-color-pxl-cnt", "textContent": `${colorCorrectLocalized} / ${colorTotalLocalized}` }).buildElement().buildElement().addP({ "class": "bm-filter-color-pxl-desc", "textContent": `${typeof colorIncorrect == "number" && !isNaN(colorIncorrect) ? colorIncorrect : "???"} incorrect pixels. Completed: ${colorPercent}` }).buildElement().buildElement().buildElement(); + ).buildElement().buildElement().addSmall({ "textContent": color.id == -2 ? "???????" : colorValueHex }).buildElement().buildElement().addDiv({ "class": "bm-flex-between" }).addHeader(2, { "textContent": (color.premium ? "\u2605 " : "") + color.name }).buildElement().addDiv({ "class": "bm-flex-between", "style": "gap: 1.5ch;" }).addSmall({ "textContent": `#${color.id.toString().padStart(2, 0)}` }).buildElement().addSmall({ "class": "bm-filter-color-pxl-cnt", "textContent": `${colorCorrectLocalized} / ${colorTotalLocalized}` }).buildElement().buildElement().addP({ "class": "bm-filter-color-pxl-desc", "textContent": `${typeof colorIncorrect == "number" && !isNaN(colorIncorrect) ? colorIncorrect : "???"} incorrect pixel${colorIncorrect == 1 ? "" : "s"}. Completed: ${colorPercent}` }).buildElement().buildElement().buildElement(); } } colorList.buildOverlay(parentElement); diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index b7047b2..c0bdbaa 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.91.8 +// @version 0.91.10 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.status?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0g0J/d40/5oG0OtRBAwc6XSWGItIJZo8IJg5jPBC+B01EUEffgsggea4pIfj/1ht+/7P9+Dv8dv/t7ffblTXq0vVLtHD38MrDy8/VDxce7j6sPmQ+pDxMFrXEx8Y74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DjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQ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6WTKUbrl5dfYvHmzzPsBQegqrq5Gurt71ZugsaGR+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0g0J/d40/5oG0OtRBAwc6XSWGItIJZo8IJg5jPBC+B01EUEffgsggea4pIfj/1ht+/7P9+Dv8dv/t7ffblTXq0vVLtHD38MrDy8/VDxce7j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0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgA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DJpxEft95b5squ2ZzKTnZ6WTKUbrl5dfYvHmzzPsBQegqrq5Gurt71ZugsaGR+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index af6efbc..5d68a7a 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index bf5c3bf..8e45a2d 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.91.8 +// @version 0.91.10 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.status?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixels. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=GM_getResourceText("CSS-BM-File");GM_addStyle(Q);var Z,K="robotoMonoInjectionPoint";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=GM_getResourceText("CSS-BM-File");GM_addStyle(Q);var Z,K="robotoMonoInjectionPoint";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 6963e12..e450113 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 0e1c34b..572058c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.8", + "version": "0.91.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.8", + "version": "0.91.10", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 9c736de..d5e001b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.8", + "version": "0.91.10", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 4a6bc28..131c70c 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.91.8 +// @version 0.91.10 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/WindowFilter.css b/src/WindowFilter.css index 42e726a..bc5135f 100644 --- a/src/WindowFilter.css +++ b/src/WindowFilter.css @@ -135,4 +135,9 @@ /* Filter window header 2 in windowed mode */ #bm-window-filter.bm-windowed .bm-filter-color h2 { font-size: 0.75em; +} + +/* Filter window dragbar text area in windowed mode */ +#bm-window-filter #bm-filter-windowed-color-totals { + font-size: 1em; } \ No newline at end of file diff --git a/src/WindowFilter.js b/src/WindowFilter.js index 32b63d7..5506ddf 100644 --- a/src/WindowFilter.js +++ b/src/WindowFilter.js @@ -213,7 +213,7 @@ export default class WindowFilter extends Overlay { button.onclick = () => { const windowedColorTotals = document.querySelector('#bm-filter-windowed-color-totals'); if (windowedColorTotals) { - windowedColorTotals.style.display = (button.dataset['status'] == 'expanded') ? 'none' : ''; + windowedColorTotals.style.display = (button.dataset['buttonStatus'] == 'expanded') ? 'none' : ''; } instance.handleMinimization(button); }; From fbe86b89650c2e47bbc2839a0dbe05402bf6131f Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Wed, 4 Mar 2026 15:42:32 -0500 Subject: [PATCH 07/15] Added Settings Window & Highlight UI --- dist/BlueMarble-For-GreasyFork.user.css | 27 ++++ dist/BlueMarble-For-GreasyFork.user.js | 181 ++++++++++++++++++++++-- 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 | 14 +- src/WindowCredits.js | 2 +- src/WindowFilter.js | 2 +- src/WindowMain.js | 5 + src/WindowSettings.css | 36 +++++ src/WindowSettings.js | 86 +++++++++++ src/main.css | 1 + src/main.js | 6 +- src/settingsManager.js | 144 +++++++++++++++++++ 18 files changed, 498 insertions(+), 26 deletions(-) create mode 100644 src/WindowSettings.css create mode 100644 src/WindowSettings.js create mode 100644 src/settingsManager.js diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 8a664aa..0c7d981 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -389,6 +389,33 @@ input[type=file] { font-size: 1em; } +/* src/WindowSettings.css */ +#bm-window-settings .bm-highlight-grid { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + width: 25%; + min-width: 3ch; + max-width: 30ch; +} +#bm-window-settings .bm-highlight-grid > button { + width: 100%; + aspect-ratio: 1 / 1; + background-color: white; + border: #333 1px solid; + border-radius: 0; + box-sizing: border-box; +} +#bm-window-settings .bm-highlight-grid > button[data-status=Incorrect] { + background-color: brown; +} +#bm-window-settings .bm-highlight-grid > button[data-status=Template] { + background-color: darkslategray; +} +#bm-window-settings .bm-highlight-grid > button:hover, +#bm-window-settings .bm-highlight-grid > button:focus { + opacity: 0.8; +} + /* src/WindowWizard.css */ #bm-wizard-tlist { display: flex; diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index ebe7333..1c7b04e 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.91.10 +// @version 0.91.38 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -521,6 +521,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); this.name = name2; this.version = version2; this.apiManager = null; + this.settingsManager = null; this.outputStatusId = "bm-output-status"; this.overlay = null; this.currentParent = null; @@ -533,6 +534,13 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); setApiManager(apiManager2) { this.apiManager = apiManager2; } + /** Populates the settingsManager variable with the settingsManager class. + * @param {SettingsManager} settingsManager - The settingsManager class instance + * @since 0.91.11 + */ + setSettingsManager(settingsManager2) { + this.settingsManager = settingsManager2; + } /** Finishes building an element. * Call this after you are finished adding children. * If the element will have no children, call it anyways. @@ -1713,10 +1721,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); (part, i) => i == 0 ? part : part[0].toUpperCase() + part.slice(1) ).join("")] = value; } else if (property.startsWith("aria")) { - const camelCase = property.slice(5).split("-").map( - (part, i) => i == 0 ? part : part[0].toUpperCase() + part.slice(1) - ).join(""); - element["aria" + camelCase[0].toUpperCase() + camelCase.slice(1)] = value; + element.setAttribute(property, value); } else { element[property] = value; } @@ -2707,7 +2712,7 @@ Did you try clicking the canvas first?`); 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({ "role": "img", "aria-label": this.name }).addSpan({ "innerHTML": ascii, "class": "bm-ascii", "aria-hidden": "true" }).buildElement().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": 'cfp for creating the template overlay that Blue Marble was based on!' }).buildElement().addLi({ "innerHTML": 'Force Network for hosting the telemetry server!' }).buildElement().addLi({ "innerHTML": 'TheBlueCorner for getting me interested in online pixel canvases!' }).buildElement().buildElement().addBr().buildElement().addSpan({ "innerHTML": 'Donators:' }).buildElement().addUl().addLi({ "textContent": "Espresso" }).buildElement().addLi({ "textContent": "BEST FAN" }).buildElement().addLi({ "textContent": "Jack" }).buildElement().addLi({ "textContent": "raiken_au" }).buildElement().addLi({ "textContent": "Jacob" }).buildElement().addLi({ "textContent": "StupidOne" }).buildElement().addLi({ "textContent": "1 Anonymous Supporter" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); + }).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({ "role": "img", "aria-label": this.name }).addSpan({ "innerHTML": ascii, "class": "bm-ascii", "aria-hidden": "true" }).buildElement().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": 'cfp for creating the template overlay that Blue Marble was based on!' }).buildElement().addLi({ "innerHTML": 'Force Network for hosting the telemetry server!' }).buildElement().addLi({ "innerHTML": 'TheBlueCorner for getting me interested in online pixel canvases!' }).buildElement().buildElement().addBr().buildElement().addSpan({ "innerHTML": 'Donators:' }).buildElement().addUl().addLi({ "textContent": "Espresso" }).buildElement().addLi({ "textContent": "BEST FAN" }).buildElement().addLi({ "textContent": "Jack" }).buildElement().addLi({ "textContent": "raiken_au" }).buildElement().addLi({ "textContent": "Jacob" }).buildElement().addLi({ "textContent": "StupidOne" }).buildElement().addLi({ "textContent": "2 Anonymous Supporters" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); } }; @@ -2785,7 +2790,7 @@ Did you try clicking the canvas first?`); }; }).buildElement().addButton({ "textContent": "Show All Colors" }, (instance, button) => { button.onclick = () => __privateMethod(this, _WindowFilter_instances, selectColorList_fn).call(this, true); - }).buildElement().buildElement().addDiv({ "class": "bm-container bm-scrollable" }).addDiv({ "class": "bm-container", "style": "margin-left: 2.5ch; margin-right: 2.5ch;" }).addDiv({ "class": "bm-container" }).addSpan({ "id": "bm-filter-tile-load", "innerHTML": "Tiles Loaded: 0 / ???" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-correct", "innerHTML": "Correct Pixels: ???" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-total", "innerHTML": "Total Pixels: ???" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-remaining", "innerHTML": "Complete: ??? (???)" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-completed", "innerHTML": "??? ???" }).buildElement().buildElement().addDiv({ "class": "bm-container" }).addP({ "innerHTML": `Colors with the icon ${this.eyeOpen.replace(" { + }).buildElement().buildElement().addDiv({ "class": "bm-container bm-scrollable" }).addDiv({ "class": "bm-container", "style": "margin-left: 2.5ch; margin-right: 2.5ch;" }).addDiv({ "class": "bm-container" }).addSpan({ "id": "bm-filter-tile-load", "innerHTML": "Tiles Loaded: 0 / ???" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-correct", "innerHTML": "Correct Pixels: ???" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-total", "innerHTML": "Total Pixels: ???" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-remaining", "innerHTML": "Complete: ??? (???)" }).buildElement().addBr().buildElement().addSpan({ "id": "bm-filter-tot-completed", "innerHTML": "??? ???" }).buildElement().buildElement().addDiv({ "class": "bm-container" }).addP({ "innerHTML": `Press the \u{1F5D7} button to make this window smaller. Colors with the icon ${this.eyeOpen.replace(" { button.onclick = (event) => { event.preventDefault(); const formData = new FormData(document.querySelector(`#${this.windowID} form`)); @@ -3267,7 +3272,11 @@ 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; flex-direction: column;" }).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": "\u2699\uFE0F", "title": "Settings" }, (instance, button) => { + button.onclick = () => { + instance.settingsManager.buildWindow(); + }; + }).buildElement().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); @@ -3388,6 +3397,158 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add GM.setValue("bmUserSettings", JSON.stringify(userSettings2)); }; + // src/WindowSettings.js + var _WindowSettings_instances, errorOverrideFailure_fn; + var WindowSettings = class extends Overlay { + /** Constructor for the Settings window + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @since 0.91.11 + * @see {@link Overlay#constructor} for examples + */ + constructor(name2, version2) { + super(name2, version2); + __privateAdd(this, _WindowSettings_instances); + this.window = null; + this.windowID = "bm-window-settings"; + this.windowParent = document.body; + } + /** Spawns a Settings window. + * If another settings window already exists, we DON'T spawn another! + * Parent/child relationships in the DOM structure below are indicated by indentation. + * @since 0.91.11 + */ + buildWindow() { + if (document.querySelector(`#${this.windowID}`)) { + document.querySelector(`#${this.windowID}`).remove(); + return; + } + this.window = this.addDiv({ "id": this.windowID, "class": "bm-window" }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Color Filter"', "data-button-status": "expanded" }, (instance, button) => { + button.onclick = () => instance.handleMinimization(button); + button.ontouchend = () => { + button.click(); + }; + }).buildElement().addDiv().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "textContent": "\u2716", "aria-label": 'Close window "Color Filter"' }, (instance, button) => { + button.onclick = () => { + document.querySelector(`#${this.windowID}`)?.remove(); + }; + button.ontouchend = () => { + button.click(); + }; + }).buildElement().buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Settings" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container bm-scrollable" }, (instance, div) => { + this.buildHighlight(); + }).buildElement().buildElement().buildElement().buildOverlay(this.windowParent); + this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); + } + /** Builds the highlight section of the window. + * This should be overriden by {@link SettingsManager} + * @since 0.91.11 + */ + buildHighlight() { + __privateMethod(this, _WindowSettings_instances, errorOverrideFailure_fn).call(this, "Pixel Highlight"); + } + }; + _WindowSettings_instances = new WeakSet(); + /** Displays an error when a settings category fails to load. + * @param {string} name - The name of the category + */ + errorOverrideFailure_fn = function(name2) { + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": name2 }).buildElement().addHr().buildElement().addP({ "innerHTML": `An error occured loading the ${name2} category. SettingsManager failed to override the ${name2} function inside WindowSettings.` }).buildElement().buildElement(); + }; + + // src/settingsManager.js + var _SettingsManager_instances, updateHighlightSettings_fn; + var SettingsManager = class extends WindowSettings { + /** Constructor for the SettingsManager class + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @param {Object} userSettings - The user settings as an object + * @since 0.91.11 + */ + constructor(name2, version2, userSettings2) { + super(name2, version2); + __privateAdd(this, _SettingsManager_instances); + this.userSettings = userSettings2; + this.lastUpdateTime = 0; + } + // This is one of the most insane OOP setups I have ever laid my eyes on + /** Builds the "highlight" category of the settings window + * @since 0.91.18 + * @see WindowSettings#buildHighlight + */ + buildHighlight() { + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }).addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [-1, -1]); + }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [0, -1]); + }).buildElement().addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [1, -1]); + }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [-1, 0]); + }).buildElement().addButton({ "data-status": "Template", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [0, 0]); + }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [1, 0]); + }).buildElement().addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [-1, 1]); + }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [0, 1]); + }).buildElement().addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [1, 1]); + }).buildElement().buildElement().buildElement().buildElement(); + } + }; + _SettingsManager_instances = new WeakSet(); + /** Updates the display of the highlight buttons in the settings window. + * Additionally, it will update user settings with the new selection. + * @param {HTMLButtonElement} button - The button that was pressed + * @param {Array} coords - The relative coordinates of the button + */ + updateHighlightSettings_fn = function(button, coords2) { + console.log(coords2); + button.disabled = true; + const status = button.dataset["status"]; + const userStorageOld = this.userSettings?.highlight || [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + let userStorageChange = [2, 0, 0]; + const userStorageNew = userStorageOld; + console.log(userStorageOld); + switch (status) { + // If the button was in the "Disabled" state + case "Disabled": + button.dataset["status"] = "Incorrect"; + button.ariaLabel = "Sub-pixel incorrect"; + userStorageChange = [1, ...coords2]; + break; + // If the button was in the "Incorrect" state + case "Incorrect": + button.dataset["status"] = "Template"; + button.ariaLabel = "Sub-pixel template"; + userStorageChange = [2, ...coords2]; + break; + // If the button was in the "Template" state + case "Template": + button.dataset["status"] = "Disabled"; + button.ariaLabel = "Sub-pixel disabled"; + userStorageChange = [0, ...coords2]; + break; + } + console.log(userStorageChange); + const indexOfChange = userStorageOld.findIndex(([, x, y]) => x == userStorageChange[1] && y == userStorageChange[2]); + console.log(indexOfChange); + if (userStorageChange[0] != 0) { + if (indexOfChange != -1) { + userStorageNew[indexOfChange] = userStorageChange; + } else { + userStorageNew.push(userStorageChange); + } + } else if (indexOfChange != -1) { + userStorageNew.splice(indexOfChange, 1); + } + console.log(userStorageNew); + this.userSettings["highlight"] = userStorageNew; + button.disabled = false; + }; + // src/main.js var name = GM_info.script.name.toString(); var version = GM_info.script.version.toString(); @@ -3493,15 +3654,17 @@ Time Since Blink: ${String(Math.floor(elapsed / 6e4)).padStart(2, "0")}:${String document.head?.appendChild(stylesheetLink); } var stylesheetLink; + var userSettings = JSON.parse(GM_getValue("bmUserSettings", "{}")); var observers = new Observers(); var windowMain = new WindowMain(name, version); var templateManager = new TemplateManager(name, version, windowMain); var apiManager = new ApiManager(templateManager); + var settingsManager = new SettingsManager(name, version, userSettings); + windowMain.setSettingsManager(settingsManager); windowMain.setApiManager(apiManager); var storageTemplates = JSON.parse(GM_getValue("bmTemplates", "{}")); console.log(storageTemplates); templateManager.importJSON(storageTemplates); - var userSettings = JSON.parse(GM_getValue("bmUserSettings", "{}")); console.log(userSettings); console.log(Object.keys(userSettings).length); if (Object.keys(userSettings).length == 0) { diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index c0bdbaa..d1b4e16 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.91.10 +// @version 0.91.38 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(Q);var Z,K="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0g0J/d40/5oG0OtRBAwc6XSWGItIJZo8IJg5jPBC+B01EUEffgsggea4pIfj/1ht+/7P9+Dv8dv/t7ffblTXq0vVLtHD38MrDy8/VDxce7j6sPmQ+pDxMFrXEx8Y74vWe8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NkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP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Ubrl5dfYvHmzzPsBQegqrq5Gurt71ZugsaGR+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,$,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}F(){return this.W.length>0&&(this.A=this.W.pop()),this}G(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}U(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"span",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,$).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,$).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.F(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.F(),e(this,n,i(this,x,$).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"th",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,x,$).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,$).call(this,"div"),o=i(this,x,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.F();const a=i(this,x,$).call(this,"button",{textContent:n});return this.F(),this.F(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,$).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};x=new WeakSet,$=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,x,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({id:"bm-o",textContent:"Loading template storage status..."}).F().F().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ft().then(()=>{e.disabled=!1})}}).F()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).F(),c.F().G(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Gt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"}).F().j({textContent:`#${m}`}).F().F().U({class:"bm-x bm-0"}).q(3,{textContent:r}).F().Y({textContent:`Uploaded by user #${u}`}).F().Y({textContent:`Coordinates: ${l.join(", ")}`}).F().Y({textContent:`Total Pixels: ${b}`}).F().F().F()}}i.F().G(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({textContent:"Updating template storage. Please wait..."}).F().F().F().G(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Ut(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,F,G,U,R,j,E,Y,V,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).F().F().Z().F().U({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).F().F().K().F().Z().F().K().F().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).F().K().F().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).F().K().F().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).F().K().F().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).F().K().F().Y({textContent:"Special Thanks:"}).F().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).F().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).F().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).F().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).F().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).F().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).F().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).F().ht({innerHTML:'Force Network for hosting the telemetry server!'}).F().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).F().F().K().F().Y({innerHTML:'Donators:'}).F().lt().ht({textContent:"Espresso"}).F().ht({textContent:"BEST FAN"}).F().ht({textContent:"Jack"}).F().ht({textContent:"raiken_au"}).F().ht({textContent:"Jacob"}).F().ht({textContent:"StupidOne"}).F().ht({textContent:"2 Anonymous Supporters"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).F().K().F().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).F().K().F().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).F().K().F().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).F().K().F().Y({id:"bm-5",innerHTML:"??? ???"}).F().F().U({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).F().F().F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).F().U().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).F().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,G).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,$e:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,$e:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,$e:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},F=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,V),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).F().F().Z().F().U({class:"bm-E bm-A"},(t,e)=>{this.ve()}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,V,J).call(this,"Pixel Highlight")}};V=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t}).F().Z().F().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).F().F()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight||[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(it);var nt,st="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjC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EbhECq0+ItPwpB7LuTOwTQK3D/GHxiZt4LhVUeRHSLQKhuRqsT/mvXPm7+kqv1xRpcL4NrV/3LijKmRA3CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().F().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqo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58uhjK9TxKikuxUNmvEUSOHLkKM7CiQ0bNpCansGpM6eIjDjLp58cFq14leXLH+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"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).F().q(1,{textContent:this.name}).F().F().Z().F().U({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).F().K().F().Y({id:"bm-k",textContent:"Next level in..."}).F().K().F().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).F().F().F().Z().F().U({class:"bm-E"}).U({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).F().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().F().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).F().F().U({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).F().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).F().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,R).call(this)}).F().F().U({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).F().F().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).F().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).F().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).F().F().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Gt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Jt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Gt),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Fe(t),await n(500)}async Ft(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Fe(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Fe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ge:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Vt:d,Jt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ve(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Je=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=0}ve(){this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).F().Z().F().U({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).F().U({class:"bm-1h",role:"group","aria-labelledby":"bm-12"}).yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,-1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,0])}).F().yt({"data-status":"Template","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,0])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,0])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,1])}).F().F().F().F()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Ve(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.ei=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).F().F().Z().F().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.ei);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"}).F().R({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 ${this.name}!`}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).F().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).F().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).F().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).F().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).F().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).F().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).F().F().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).F().F().F().F().F().G(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 5d68a7a..d9fa52e 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 8e45a2d..52c5b44 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.91.10 +// @version 0.91.38 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{var t=t=>{throw TypeError(t)},e=(e,n,i)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),n=(e,n,i)=>(((e,n)=>{n.has(e)||t("Cannot access private method")})(e,n),i);function i(t){return new Promise(e=>setTimeout(e,t))}function s(t){return(new Intl.NumberFormat).format(t)}function o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(t,e){if(0===t)return e[0];let n="";const i=e.length;for(;t>0;)n=e[t%i]+n,t=Math.floor(t/i);return n}function d(t,e){let n=0;const i=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),n=n*i+t}return n}function u(t){let e="";for(let n=0;n(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4));return.2126*e[0]+.7152*e[1]+.0722*e[2]}function f(t,e,n){return Array.isArray(t)&&([t,e,n]=t),(1<<24|t<<16|e<<8|n).toString(16).slice(1)}var g,w,y,$,x,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]}],M=class{constructor({displayName:t="My template",p:n=0,$:i="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=n,this.$=i,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const i=await createImageBitmap(this.file),s=i.width,o=i.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(i,0,0);let h=Date.now();const m=n(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[i,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(i);o.set(i,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,n){e(this,y),this.name=t,this.version=n,this.N=null,this.B="bm-l",this.I=null,this.H=null,this.A=[]}P(t){this.N=t}W(){return this.A.length>0&&(this.H=this.A.pop()),this}_(t){t?.appendChild(this.I),this.I=null,this.H=null,this.A=[]}G(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{},t)),this}U(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"p",{},t)),this}F(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"small",{},t)),this}R(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"span",{},t)),this}j(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"details",{},t)),this}Y(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"summary",{},t)),this}V(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"img",{},t)),this}J(t,e={},i=()=>{}){return i(this,n(this,y,$).call(this,"h"+t,{},e)),this}X(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"hr",{},t)),this}q(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"br",{},t)),this}Z(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"form",{},t)),this}K(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"fieldset",{},t)),this}tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"legend",{},t)),this}et(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=n(this,y,$).call(this,"input",{type:"checkbox"},t);return i.insertBefore(s,i.firstChild),this.W(),e(this,i,s),this}nt(t={},e=()=>{}){const i=n(this,y,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.W(),e(this,i,n(this,y,$).call(this,"select",{},t)),this}it(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"option",{},t)),this}st(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ol",{},t)),this}ot(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"ul",{},t)),this}rt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"menu",{},t)),this}lt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"li",{},t)),this}ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"table",{},t)),this}ht(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"caption",{},t)),this}dt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"thead",{},t)),this}ut(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tbody",{},t)),this}bt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tfoot",{},t)),this}ft(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"tr",{},t)),this}gt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"th",{},t)),this}wt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"button",{},t)),this}$t(t={},e=()=>{}){const i=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${i}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.xt(this.B,i)}};return e(this,n(this,y,$).call(this,"button",s,t)),this}vt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"input",{},t)),this}Mt(t={},e=()=>{}){const i=t.textContent??"";delete t.textContent;const s=n(this,y,$).call(this,"div"),o=n(this,y,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.W();const a=n(this,y,$).call(this,"button",{textContent:i});return this.W(),this.W(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=i}),e(this,s,o,a),this}Ct(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"textarea",{},t)),this}Tt(t={},e=()=>{}){return e(this,n(this,y,$).call(this,"div",{class:"bm-L"},t)),this}St(t=Date.now(),e=500,i={},s=()=>{}){const o="bm-P",a=i?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=n(this,y,$).call(this,"time",r,i);return l.id=a,l.dataset.endDate=t,setInterval(()=>{if(!l.isConnected)return;const t=Math.max(l.dataset.endDate-Date.now(),0),e=Math.floor(t/1e3),n=Math.floor(e/3600),i=Math.floor(e%60),s=Math.floor(e%3600/60);l.setAttribute("datetime",`PT${n}H${s}M${i}S`),l.textContent=String(n).padStart(2,"0")+":"+String(s).padStart(2,"0")+":"+String(i).padStart(2,"0")},e),s(this,l),this}xt(t,e,n=!1){const i=document.getElementById(t.replace(/^#/,""));i&&(i instanceof HTMLInputElement?i.value=e:n?i.textContent=e:i.innerHTML=e)}kt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),n=t.closest(".bm-L"),i=e.querySelector("h1"),s=e.querySelector(".bm-h");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 n=i.cloneNode(!0),o=n.textContent;t.nextElementSibling.appendChild(n),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const i=n.querySelector("h1"),o=i.textContent;i.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 "${o}"`}}Dt(t,e){const n=document.querySelector(t),i=document.querySelector(e);if(!n||!i)return void this.Lt(`Can not drag! ${n?"":"moveMe"} ${n||i?"":"and "}${i?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){const t=Math.abs(l-h),e=Math.abs(c-m);(t>.5||e>.5)&&(l=h,c=m,n.style.transform=`translate(${l}px, ${c}px)`,n.style.left="0px",n.style.top="0px",n.style.right=""),r=requestAnimationFrame(u)}},b=(t,e)=>{o=!0,d=n.getBoundingClientRect(),s=t-d.left,a=e-d.top;const b=window.getComputedStyle(n).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",i.classList.add("bm-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",i.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,t.preventDefault()}};i.addEventListener("mousedown",function(t){t.preventDefault(),b(t.clientX,t.clientY)}),i.addEventListener("touchstart",function(t){const e=t?.touches?.[0];e&&(b(e.clientX,e.clientY),t.preventDefault())},{passive:!1})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.xt(this.B,"Status: "+t,!0)}Lt(t){(0,console.error)(`${this.name}: ${t}`),this.xt(this.B,"Error: "+t,!0)}};y=new WeakSet,$=function(t,e={},i={}){const s=document.createElement(t);this.I?(this.H?.appendChild(s),this.A.push(this.H),this.H=s):(this.I=s,this.H=s);for(const[t,i]of Object.entries(e))n(this,y,x).call(this,s,t,i);for(const[t,e]of Object.entries(i))n(this,y,x).call(this,s,t,e);return s},x=function(t,e,n){if("class"==e)t.classList.add(...n.split(/\s+/));else if("for"==e)t.htmlFor=n;else if("tabindex"==e)t.tabIndex=Number(n);else if("readonly"==e)t.readOnly="true"==n||"1"==n;else if("maxlength"==e)t.maxLength=Number(n);else if(e.startsWith("data"))t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=n;else if(e.startsWith("aria")){const i=e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("");t["aria"+i[0].toUpperCase()+i.slice(1)]=n}else t[e]=n};var L=class extends D{constructor(t,n,i,s=void 0){super(t,n),e(this,C),this.window=null,this.Nt="bm-m",this.Bt=document.body,this.It=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.It?.scriptVersion,this.schemaVersion=this.It?.schemaVersion,this.Ht=void 0,this.At=i,this.Pt=s}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.Nt,class:"bm-N",style:t},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({id:"bm-o",textContent:"Loading template storage status..."}).W().W().G({class:"bm-E bm-A"}).J(2,{textContent:"Detected templates:"}).W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`),n(this,C,T).call(this),n(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.At.split(/[-\.\+]/);let i="";t[0]==e[0]?t[1]==e[1]?(i='Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)',this.Ht="Good"):(i='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.Ht="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.Ht="Bad"):(i='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Ht="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.xt("#bm-o",`${i}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.At)}.
Wplace was last updated on ${l}.${"Good"!=this.Ht?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Ht&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Pt.zt().then(()=>{e.disabled=!1})}}).W()),"Poor"!=this.Ht&&"Bad"!=this.Ht||c.yt({textContent:`Update template storage to ${this.At}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,n(this,C,k).call(this,!0)}}).W(),c.W()._(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.It?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Nt} .bm-A`),n=new D(this.name,this.version);n.G({id:"bm-r",class:"bm-E"});for(const e in t){const i=e,o=t[e];if(t.hasOwnProperty(e)){const t=i.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Pt._t),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";n.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).W().F({textContent:`#${m}`}).W().W().G({class:"bm-x bm-0"}).J(3,{textContent:r}).W().R({textContent:`Uploaded by user #${u}`}).W().R({textContent:`Coordinates: ${l.join(", ")}`}).W().R({textContent:`Total Pixels: ${b}`}).W().W().W()}}n.W()._(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Nt} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Template Wizard"}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Status"}).W().U({textContent:"Updating template storage. Please wait..."}).W().W().W()._(t)}GM_deleteValue("bmCoords");const e=this.It?.templates;if(Object.keys(e).length>0)for(const[t,n]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:n.name,v:n.tiles});t.L();const e=await this.Pt.Gt(t);await this.Pt.Ut(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Nt}`).remove(),new L(this.name,this.version,this.At,this.Pt).Wt())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ft))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const n=t?.schemaVersion,i=n.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${n}; Script Version: ${o}`),i[0]==s[0]?(i[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this).Wt(),this.Rt=await async function({C:t,jt:n,Rt:i}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*n;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),n=new Blob([e],{type:"image/png"}),i=await createImageBitmap(n);m[t]=i;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(i,0,0);const o=s.getImageData(0,0,i.width,i.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Rt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,i.push(p),console.log(this.Rt),console.log("^^^ This ^^^")}}return i}({C:this.C,jt:this.jt,Rt:this.Rt})):i[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.qt.get(w)&&(e[n*r+l]=b),-1==w){const t=536870912;this.qt.get(w)?e[n*r+l]=0:(h/i&1)==(u/i&1)?(e[n*r+l]=t,e[(n-1)*r+(l-1)]=t,e[(n-1)*r+(l+1)]=t,e[(n+1)*r+(l-1)]=t,e[(n+1)*r+(l+1)]=t):(e[n*r+l]=0,e[(n-1)*r+l]=t,e[(n+1)*r+l]=t,e[n*r+(l-1)]=t,e[n*r+(l+1)]=t)}if(-1==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const y=d.get(w);d.set(w,y?y+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Qt:d,Zt:e}};var A=class{constructor(){this.Kt=Math.ceil(80/1300*window.innerWidth),this.te=v.slice(1)}ee(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)}},P=class extends HTMLElement{};customElements.define("confetti-piece",P);var W,z,_,G,U,F,R,j,E,Y,V=class extends D{constructor(t,e){super(t,e),this.window=null,this.Nt="bm-i",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?document.querySelector(`#${this.Nt}`).remove():(this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Credits"}).W().W().X().W().G({class:"bm-E bm-A"}).R({role:"img","aria-label":this.name}).R({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).W().W().q().W().X().W().q().W().R({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).W().q().W().R({innerHTML:'The Blue Marble Website is made by crqch.'}).W().q().W().R({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).W().q().W().R({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).W().q().W().R({textContent:"Special Thanks:"}).W().ot().lt({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).W().lt({innerHTML:'nof, darkness for creating similar userscripts!'}).W().lt({innerHTML:'Wonda for the Blue Marble banner image!'}).W().lt({innerHTML:'BullStein, allanf181 for being early beta testers!'}).W().lt({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).W().lt({innerHTML:'Nomad and Gustav for the tutorials!'}).W().lt({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).W().lt({innerHTML:'Force Network for hosting the telemetry server!'}).W().lt({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).W().W().q().W().R({innerHTML:'Donators:'}).W().ot().lt({textContent:"Espresso"}).W().lt({textContent:"BEST FAN"}).W().lt({textContent:"Jack"}).W().lt({textContent:"raiken_au"}).W().lt({textContent:"Jacob"}).W().lt({textContent:"StupidOne"}).W().lt({textContent:"1 Anonymous Supporter"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}},J=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Nt="bm-p",this.ne="bm-y",this.Bt=document.body,this.Pt=t.N?.Pt,this.ie='',this.se='';const{palette:n,O:i}=this.Pt.Xt;this.palette=n,this.oe=0,this.ae=0,this.re=new Map,this.le=new Map,this.ce=0,this.he=0,this.timeRemaining=0,this.me="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Wt(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.de()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).R({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).W().q().W().R({id:"bm-9",innerHTML:"Correct Pixels: ???"}).W().q().W().R({id:"bm-f",innerHTML:"Total Pixels: ???"}).W().q().W().R({id:"bm-4",innerHTML:"Complete: ??? (???)"}).W().q().W().R({id:"bm-5",innerHTML:"??? ???"}).W().W().G({class:"bm-E"}).U({innerHTML:`Colors with the icon ${this.ie.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Nt} form`)),i={};for(const[t,n]of e)i[t]=n;console.log(`Primary: ${i.sortPrimary}; Secondary: ${i.sortSecondary}; Unused: ${"on"==i.showUnused}`),n(this,W,_).call(this,i.sortPrimary,i.sortSecondary,"on"==i.showUnused)}}).W().W().W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.xt("#bm-e",`Tiles Loaded: ${s(this.oe)} / ${s(this.ae)}`),this.xt("#bm-9",`Correct Pixels: ${s(this.ce)}`),this.xt("#bm-f",`Total Pixels: ${s(this.he)}`),this.xt("#bm-4",`Remaining: ${s((this.he||0)-(this.ce||0))} (${o(((this.he||0)-(this.ce||0))/(this.he||1))})`),this.xt("#bm-5",`Completed at: `)}de(){if(document.querySelector(`#${this.Nt}`))return void document.querySelector(`#${this.Nt}`).remove();this.window=this.G({id:this.Nt,class:"bm-N bm-G"}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const n=document.querySelector("#bm-X");n&&(n.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.kt(e)},e.ontouchend=()=>{e.click()}}).W().G().R({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).W().W().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove(),this.Wt()},e.ontouchend=()=>{e.click()}}).W().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Nt}`)?.remove()},e.ontouchend=()=>{e.click()}}).W().W().W().G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:"Color Filter"}).W().W().X().W().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!1)}).W().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ue(),e.disabled=!1}}).W().yt({textContent:"All"},(t,e)=>{e.onclick=()=>n(this,W,G).call(this,!0)}).W().W().G({class:"bm-E bm-A"}).W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`);const t=document.querySelector(`#${this.Nt} .bm-E.bm-A`);n(this,W,z).call(this,t),n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ue(){n(this,W,U).call(this);const t=document.querySelector(`#${this.ne}`),e={};for(const t of this.palette){const n=this.re.get(t.id)??0,i=s(n);let a=0,r="0",l=o(1);0!=n&&(a=this.le.get(t.id)??"???","number"!=typeof a&&this.oe==this.ae&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/n)?"???":o(a/n));const c=parseInt(n)-parseInt(a);e[t.id]={be:n,pe:i,fe:a,ge:r,we:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.ce.toString().length>7?this.ce.toString().slice(0,2)+"…"+this.ce.toString().slice(-3):this.ce.toString(),e=this.he.toString().length>7?this.he.toString().slice(0,2)+"…"+this.he.toString().slice(-3):this.he.toString();this.xt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const i=Array.from(t.children);for(const t of i){const n=parseInt(t.dataset.id),{fe:i,ge:s,we:o,be:a,pe:r,ye:l}=e[n];t.dataset.correct=Number.isNaN(parseInt(i))?"0":i,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Nt} .bm-t[data-id="${n}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}n(this,W,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,z=function(t){const e=t.closest(`#${this.Nt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const n=new D(this.name,this.version);n.G({id:this.ne});const i=this.ue();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{fe:l,ge:c,we:h,be:m,pe:d,ye:u}=i[t.id],b=!!this.Pt.qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;n.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.se.replace("{n.onclick=()=>{n.style.textDecoration="none",n.disabled=!0,"shown"==n.dataset.state?(n.innerHTML=this.se.replace("{const o=i.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(n?i.classList.remove("bm-B"):Number(i.getAttribute("data-total"))||i.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),n=a.toLowerCase();return tn?"ascending"===e?1:-1:0}}),s.forEach(t=>i.appendChild(t))},G=function(t){const e=document.querySelector(`#${this.ne}`),n=Array.from(e.children);for(const e of n){if(e.classList?.contains("bm-B"))continue;const n=e.querySelector(".bm-7 button");("hidden"!=n.dataset.state||t)&&("shown"==n.dataset.state&&t||n.click())}},U=function(){this.he=0,this.ce=0,this.le=new Map,this.re=new Map;for(const t of this.Pt.Rt){const e=t.T?.total??0;this.he+=e??0;const n=t.T?.colors??new Map;for(const[t,e]of n){const n=Number(e)||0,i=this.re.get(t)??0;this.re.set(t,i+n)}const i=t.T?.correct??{};this.oe+=Object.keys(i).length,this.ae+=Object.keys(t.v).length;for(const t of Object.values(i))for(const[e,n]of t){const t=Number(n)||0;this.ce+=t;const i=this.le.get(e)??0;this.le.set(e,i+t)}}console.log(`Tiles loaded: ${this.oe} / ${this.ae}`),this.ce>=this.he&&this.he&&this.oe==this.ae&&(new A).ee(document.querySelector(`#${this.Nt}`)),this.timeRemaining=new Date(30*(this.he-this.ce)*1e3+Date.now()),this.me=a(this.timeRemaining)},F=new WeakSet,R=function(){new J(this).Wt()},j=async function(t,e,n){n.preventDefault();const i=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(n),s=i.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.xt("bm-H",s?.[0]||""),t.xt("bm-I",s?.[1]||"")):1==s.length?t.xt(e.id,s?.[0]||""):(t.xt("bm-J",s?.[0]||""),t.xt("bm-K",s?.[1]||""),t.xt("bm-H",s?.[2]||""),t.xt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var X=GM_info.script.name.toString(),q=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",X),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",n=t?.getAttribute("bm-O")||"",i=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%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 t=i.get(a);"function"==typeof t?t(r):h(`%c${e}%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(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,n,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,n,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${i.size} Sending IMAGE message about endpoint "${r}"`,n,""),new Promise(o=>{const l=crypto.randomUUID();i.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${i.size} Processed blob "${l}"`,n,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,n,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,n,""),console.log(`Endpoint: ${r}\nThere are ${i.size} blobs processing...\nBlink: ${t.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 Q=GM_getResourceText("CSS-BM-File");GM_addStyle(Q);var Z,K="robotoMonoInjectionPoint";K.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(K)):((Z=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",Z.rel="preload",Z.as="style",Z.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(Z)),new class{constructor(){this.$e=null,this.xe=null,this.ve="#bm-j"}Me(t){return this.xe=t,this.$e=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.ve)}),this}Ce(){return this.$e}observe(t,e=!1,n=!1){t.observe(this.xe,{childList:e,subtree:n})}};var tt=new class extends D{constructor(t,n){super(t,n),e(this,F),this.window=null,this.Nt="bm-w",this.Bt=document.body}Wt(){document.querySelector(`#${this.Nt}`)?this.Lt("Main window already exists!"):(this.window=this.G({id:this.Nt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).Tt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.kt(e),e.ontouchend=()=>{e.click()}}).W().G().W().W().G({class:"bm-h"}).G({class:"bm-E"}).V({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const n=new Date;204==Math.floor((n.getTime()-new Date(n.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ee(document.querySelector(`#${this.Nt}`))})}).W().J(1,{textContent:this.name}).W().W().X().W().G({class:"bm-E"}).R({id:"bm-q",textContent:"Droplets:"}).W().q().W().R({id:"bm-k",textContent:"Next level in..."}).W().q().W().R({textContent:"Charges: "}).St(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Te=e.id}).W().W().W().X().W().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Se;e?.[0]?(t.xt("bm-J",e?.[0]||""),t.xt("bm-K",e?.[1]||""),t.xt("bm-H",e?.[2]||""),t.xt("bm-I",e?.[3]||"")):t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).W().vt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().vt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",i=>n(this,F,j).call(this,t,e,i))}).W().W().G({class:"bm-E"}).Mt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).W().W().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Pt?.ke(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Pt?.ke(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}}).W().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Nt} .bm-D`),n=document.querySelector("#bm-J");if(!n.checkValidity())return n.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const i=document.querySelector("#bm-K");if(!i.checkValidity())return i.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Lt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Pt.Ut(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(n.value),Number(i.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Lt("No file selected!")}}).W().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>n(this,F,R).call(this)}).W().W().G({class:"bm-E"}).Ct({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).W().W().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Pt;new H(this.name,this.version,e?.schemaVersion,e).Wt()}}).W().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).W().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new V(this.name,this.version).Wt()}}).W().W().F({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).W().W().W().W().W()._(this.Bt),this.Dt(`#${this.Nt}.bm-N`,`#${this.Nt} .bm-L`))}}(X,q),et=new class{constructor(t,n,i){e(this,O),this.name=t,this.version=n,this.I=i,this.schemaVersion="2.0.0",this.De=null,this._t="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.jt=3,this.Jt=3,this.Xt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const n=new Map;for(const i of e){if(0==i.id||-2==i.id)continue;const e=i.rgb[0],s=i.rgb[1],o=i.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;n.has(m)||n.set(m,i.id)}}return{palette:e,O:n}}(this.Jt),this.Yt=null,this.Le="",this.Rt=[],this.Ft=null,this.Oe=!0,this.Ne=null,this.qt=new Map}async Be(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Ut(t,e,i){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${i.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.De||0,this._t),file:t,coords:i}),{k:o,D:a}=await s.S(this.C,this.Xt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Ft.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:i.join(", "),enabled:!0,pixels:r,tiles:a},this.Rt=[],this.Rt.push(s),this.I.Ot(`Template created at ${i.join(", ")}!`),console.log(Object.keys(this.Ft.templates).length),console.log(this.Ft),console.log(this.Rt),console.log(JSON.stringify(this.Ft)),await n(this,O,N).call(this)}Ie(){}async He(){this.Ft||(this.Ft=await this.Be(),console.log("Creating JSON..."))}async Ae(){l("Downloading all templates..."),console.log(this.Rt);for(const t of this.Rt)await this.Pe(t),await i(500)}async zt(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,n]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Pe(new M({displayName:n.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:n.tiles})),await i(500))}async Pe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,n=await this.Gt(t);await GM.download({url:URL.createObjectURL(n),name:e+".png",We:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,n)=>{c(`Download of template '${e}' failed because ${t}! Details: ${n}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,n=Object.keys(e).sort(),i=await Promise.all(n.map(t=>{return n=e[t],new Promise((t,e)=>{const i=new Image;i.onload=()=>t(i),i.onerror=e,i.src="data:image/png;base64,"+n});var n}));let s=1/0,o=1/0,a=0,r=0;n.forEach((t,e)=>{const[n,l,c,h]=t.split(",").map(Number),m=i[e],d=n*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.jt),r=Math.max(r,u+m.height/this.jt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.jt,m=c*this.jt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");n.forEach((t,e)=>{const[n,a,r,l]=t.split(",").map(Number),c=i[e],h=n*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${n}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.jt,(m-o)*this.jt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.jt,c*this.jt,0,0,l,c),b.convertToBlob({type:"image/png"})}async ze(t,e){if(!this.Oe)return t;const i=this.C*this.jt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Rt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const n=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===n.length)return null;const i=n.map(e=>{const n=e.split(",");return{_e:t,Ge:t.v[e],M:t.M?.[e],Ue:[n[0],n[1]],Fe:[n[2],n[3]]}});return i?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(i,i),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,i,i),h.clip(),h.clearRect(0,0,i,i),h.drawImage(l,0,0,i,i);const m=h.getImageData(0,0,i,i),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const i=!!t._e.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Fe[0])*this.jt,a=Number(t.Fe[1])*this.jt;if(0!=this.qt.size||i||h.drawImage(t.Ge,o,a),!s){const e=h.getImageData(o,a,t.Ge.width,t.Ge.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Qt:l,Zt:c}=n(this,O,I).call(this,{Et:d,Yt:s,Vt:[o,a,t.Ge.width,t.Ge.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.qt.size||i)&&(console.log("Colors to filter: ",this.qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ge.width,t.Ge.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t._e.T.correct&&(t._e.T.correct={}),t._e.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Re(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&n(this,O,B).call(this,t)}ke(t){this.Oe=t}}(X,q,tt),nt=new class{constructor(t){this.Pt=t,this.je=!1,this.Te="",this.Se=[],this.Ee=[]}Ye(t){window.addEventListener("message",async e=>{const n=e.data,i=n.jsonData;if(!n||"blue-marble"!==n.source)return;if(!n.endpoint)return;const o=n.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.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 t.Lt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(i.level)*Math.pow(30,.65),1/.65)-i.pixelsPainted);if(console.log(i.id),(i.id||0===i.id)&&console.log(m(i.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Pt.De=i.id,0!=this.Te.length){const t=document.querySelector("#"+this.Te);if(t){const e=i.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.xt("bm-q",`Droplets: ${s(i.droplets)}`),t.xt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=n.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(n.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Se.length&&(!o.length||!c.length))return void t.Lt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Se=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const n=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=n:(e=document.createElement("span"),e.id="bm-j",e.textContent=n,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=n.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=n.blobID,p=n.blobData,f=Date.now(),g=await this.Pt.ze(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:n.blink});break;case"robots":this.je="false"==i.userscript?.toString().toLowerCase();break}var a,r})}async Ve(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const n=navigator.userAgent;let i=await this.Je(n),s=this.Xe(n);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:i,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Je(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Xe(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(et);tt.P(nt);var it=JSON.parse(GM_getValue("bmTemplates","{}"));console.log(it),et.Re(it);var st=JSON.parse(GM_getValue("bmUserSettings","{}"));if(console.log(st),console.log(Object.keys(st).length),0==Object.keys(st).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>nt.Ve(q),18e5);var ot=st?.telemetry;if(console.log(`Telemetry is ${!(null==ot)}`),null==ot||ot>1){const t=new class extends D{constructor(t,n,i,s){super(t,n),e(this,E),this.window=null,this.Nt="bm-g",this.Bt=document.body,this.qe=i,this.uuid=s}async Wt(){if(document.querySelector(`#${this.Nt}`))return void this.Lt("Telemetry window already exists!");const t=await this.N.Je(navigator.userAgent),e=this.N.Xe(navigator.userAgent);this.window=this.G({id:this.Nt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).J(1,{textContent:`${this.name} Telemetry`}).W().W().X().W().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,this.qe);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{n(this,E,Y).call(this,0);const t=document.getElementById(this.Nt);t?.remove()}}).W().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).W().W().G({class:"bm-E bm-A"}).G({class:"bm-E"}).J(2,{textContent:"Legal"}).W().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 ${this.name}!`}).W().W().X().W().G({class:"bm-E"}).J(2,{textContent:"Non-Legal Summary"}).W().U({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).W().ot().lt({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).W().lt({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).W().lt({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).W().lt({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).W().lt({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).W().W().U({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).W().W().W().W().W()._(this.Bt)}}(X,q,1,st?.uuid);t.P(nt),t.Wt()}tt.Wt(),nt.Ye(tt),new MutationObserver((t,e)=>{const n=document.querySelector("#color-1");if(!n)return;let i=document.querySelector("#bm-z");if(!i){i=document.createElement("button"),i.id="bm-z",i.textContent="Move ↑",i.className="btn btn-soft",i.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=n.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(i)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${X}%c (${q}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,$,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}F(){return this.W.length>0&&(this.A=this.W.pop()),this}G(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}U(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"span",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,$).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,$).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.F(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.F(),e(this,n,i(this,x,$).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"th",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,x,$).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,$).call(this,"div"),o=i(this,x,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.F();const a=i(this,x,$).call(this,"button",{textContent:n});return this.F(),this.F(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,$).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};x=new WeakSet,$=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,x,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({id:"bm-o",textContent:"Loading template storage status..."}).F().F().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ft().then(()=>{e.disabled=!1})}}).F()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).F(),c.F().G(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Gt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"}).F().j({textContent:`#${m}`}).F().F().U({class:"bm-x bm-0"}).q(3,{textContent:r}).F().Y({textContent:`Uploaded by user #${u}`}).F().Y({textContent:`Coordinates: ${l.join(", ")}`}).F().Y({textContent:`Total Pixels: ${b}`}).F().F().F()}}i.F().G(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({textContent:"Updating template storage. Please wait..."}).F().F().F().G(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Ut(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,F,G,U,R,j,E,Y,V,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).F().F().Z().F().U({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).F().F().K().F().Z().F().K().F().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).F().K().F().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).F().K().F().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).F().K().F().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).F().K().F().Y({textContent:"Special Thanks:"}).F().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).F().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).F().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).F().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).F().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).F().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).F().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).F().ht({innerHTML:'Force Network for hosting the telemetry server!'}).F().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).F().F().K().F().Y({innerHTML:'Donators:'}).F().lt().ht({textContent:"Espresso"}).F().ht({textContent:"BEST FAN"}).F().ht({textContent:"Jack"}).F().ht({textContent:"raiken_au"}).F().ht({textContent:"Jacob"}).F().ht({textContent:"StupidOne"}).F().ht({textContent:"2 Anonymous Supporters"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).F().K().F().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).F().K().F().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).F().K().F().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).F().K().F().Y({id:"bm-5",innerHTML:"??? ???"}).F().F().U({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).F().F().F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).F().U().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).F().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,G).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,$e:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,$e:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,$e:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},F=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,V),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).F().F().Z().F().U({class:"bm-E bm-A"},(t,e)=>{this.ve()}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,V,J).call(this,"Pixel Highlight")}};V=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t}).F().Z().F().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).F().F()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight||[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=GM_getResourceText("CSS-BM-File");GM_addStyle(it);var nt,st="robotoMonoInjectionPoint";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().F().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).F().q(1,{textContent:this.name}).F().F().Z().F().U({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).F().K().F().Y({id:"bm-k",textContent:"Next level in..."}).F().K().F().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).F().F().F().Z().F().U({class:"bm-E"}).U({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).F().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().F().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).F().F().U({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).F().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).F().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,R).call(this)}).F().F().U({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).F().F().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).F().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).F().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).F().F().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Gt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Jt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Gt),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Fe(t),await n(500)}async Ft(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Fe(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Fe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ge:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Vt:d,Jt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ve(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Je=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=0}ve(){this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).F().Z().F().U({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).F().U({class:"bm-1h",role:"group","aria-labelledby":"bm-12"}).yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,-1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,0])}).F().yt({"data-status":"Template","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,0])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,0])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,1])}).F().F().F().F()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Ve(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.ei=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).F().F().Z().F().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.ei);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"}).F().R({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 ${this.name}!`}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).F().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).F().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).F().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).F().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).F().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).F().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).F().F().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).F().F().F().F().F().G(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index e450113..ba6ac63 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 572058c..e7b45a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.10", + "version": "0.91.38", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.10", + "version": "0.91.38", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index d5e001b..068e2af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.10", + "version": "0.91.38", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 131c70c..dcddff4 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.91.10 +// @version 0.91.38 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/Overlay.js b/src/Overlay.js index e3c5396..336bc7b 100644 --- a/src/Overlay.js +++ b/src/Overlay.js @@ -37,6 +37,9 @@ export default class Overlay { /** The API manager instance. Later populated when setApiManager is called @type {ApiManager} */ this.apiManager = null; + + /** The Settings Manager instance. Later populated when setSettingsManager is called @type {SettingsManager} */ + this.settingsManager = null; this.outputStatusId = 'bm-output-status'; // ID for status element @@ -51,6 +54,12 @@ export default class Overlay { */ setApiManager(apiManager) {this.apiManager = apiManager;} + /** Populates the settingsManager variable with the settingsManager class. + * @param {SettingsManager} settingsManager - The settingsManager class instance + * @since 0.91.11 + */ + setSettingsManager(settingsManager) {this.settingsManager = settingsManager;} + /** Creates an element. * For **internal use** of the {@link Overlay} class. * @param {string} tag - The tag name as a string. @@ -109,10 +118,7 @@ export default class Overlay { ).join('') ] = value; } else if (property.startsWith('aria')) { - const camelCase = property.slice(5).split('-').map( - (part, i) => (i == 0) ? part : part[0].toUpperCase() + part.slice(1) - ).join(''); - element['aria' + camelCase[0].toUpperCase() + camelCase.slice(1)] = value; + element.setAttribute(property, value); // We can't do the solution for 'data', as 'aria-labelledby' would fail to apply } else { element[property] = value; } diff --git a/src/WindowCredits.js b/src/WindowCredits.js index ca405c3..6e2bf85 100644 --- a/src/WindowCredits.js +++ b/src/WindowCredits.js @@ -105,7 +105,7 @@ export default class WindowCredts extends Overlay { .addLi({'textContent': 'raiken_au'}).buildElement() .addLi({'textContent': 'Jacob'}).buildElement() .addLi({'textContent': 'StupidOne'}).buildElement() - .addLi({'textContent': '1 Anonymous Supporter'}).buildElement() + .addLi({'textContent': '2 Anonymous Supporters'}).buildElement() .buildElement() .buildElement() .buildElement() diff --git a/src/WindowFilter.js b/src/WindowFilter.js index 5506ddf..9cedaa8 100644 --- a/src/WindowFilter.js +++ b/src/WindowFilter.js @@ -124,7 +124,7 @@ export default class WindowFilter extends Overlay { .addSpan({'id': 'bm-filter-tot-completed', 'innerHTML': '??? ???'}).buildElement() .buildElement() .addDiv({'class': 'bm-container'}) - .addP({'innerHTML': `Colors with the icon ${this.eyeOpen.replace(' { + button.onclick = () => { + instance.settingsManager.buildWindow(); + } + }).buildElement() .addButton({'class': 'bm-button-circle', 'innerHTML': 'šŸ§™', 'title': 'Template Wizard'}, (instance, button) => { button.onclick = () => { const templateManager = instance.apiManager?.templateManager; diff --git a/src/WindowSettings.css b/src/WindowSettings.css new file mode 100644 index 0000000..4dd3998 --- /dev/null +++ b/src/WindowSettings.css @@ -0,0 +1,36 @@ +/* @since 0.91.22 */ + +/* Highlight pattern container */ +#bm-window-settings .bm-highlight-grid { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + width: 25%; + min-width: 3ch; + max-width: 30ch; +} + +/* Highlight pattern button */ +#bm-window-settings .bm-highlight-grid > button { + width: 100%; + aspect-ratio: 1 / 1; + background-color: white; + border: #333 1px solid; + border-radius: 0; + box-sizing: border-box; +} + +/* Highlight pattern button in 'Incorrect' mode */ +#bm-window-settings .bm-highlight-grid > button[data-status="Incorrect"] { + background-color: brown; +} + +/* Highlight pattern button in 'Template' mode */ +#bm-window-settings .bm-highlight-grid > button[data-status="Template"] { + background-color: darkslategray; +} + +/* Highlight pattern button when hovered/focused */ +#bm-window-settings .bm-highlight-grid > button:hover, +#bm-window-settings .bm-highlight-grid > button:focus { + opacity: 0.8; +} \ No newline at end of file diff --git a/src/WindowSettings.js b/src/WindowSettings.js new file mode 100644 index 0000000..78cc545 --- /dev/null +++ b/src/WindowSettings.js @@ -0,0 +1,86 @@ +import Overlay from "./Overlay"; + +/** The overlay builder for the settings window in Blue Marble. + * The logic for this window is managed in {@link SettingsManager} + * @description This class handles the overlay UI for the settings window of the Blue Marble userscript. + * @class WindowSettings + * @since 0.91.11 + * @see {@link Overlay} for examples + */ +export default class WindowSettings extends Overlay { + + /** Constructor for the Settings window + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @since 0.91.11 + * @see {@link Overlay#constructor} for examples + */ + constructor(name, version) { + super(name, version); // Executes the code in the Overlay constructor + this.window = null; // Contains the *window* DOM tree + this.windowID = 'bm-window-settings'; // The ID attribute for this window + this.windowParent = document.body; // The parent of the window DOM tree + } + + /** Spawns a Settings window. + * If another settings window already exists, we DON'T spawn another! + * Parent/child relationships in the DOM structure below are indicated by indentation. + * @since 0.91.11 + */ + buildWindow() { + + // If a settings window already exists, close it + if (document.querySelector(`#${this.windowID}`)) { + document.querySelector(`#${this.windowID}`).remove(); + return; + } + + this.window = this.addDiv({'id': this.windowID, 'class': 'bm-window'}) + .addDragbar() + .addButton({'class': 'bm-button-circle', 'textContent': 'ā–¼', 'aria-label': 'Minimize window "Color Filter"', 'data-button-status': 'expanded'}, (instance, button) => { + button.onclick = () => instance.handleMinimization(button); + button.ontouchend = () => {button.click()}; // Needed only to negate weird interaction with dragbar + }).buildElement() + .addDiv().buildElement() // Contains the minimized h1 element + .addDiv({'class': 'bm-flex-center'}) + .addButton({'class': 'bm-button-circle', 'textContent': 'āœ–', 'aria-label': 'Close window "Color Filter"'}, (instance, button) => { + button.onclick = () => {document.querySelector(`#${this.windowID}`)?.remove();}; + button.ontouchend = () => {button.click();}; // Needed only to negate weird interaction with dragbar + }).buildElement() + .buildElement() + .buildElement() + .addDiv({'class': 'bm-window-content'}) + .addDiv({'class': 'bm-container bm-center-vertically'}) + .addHeader(1, {'textContent': 'Settings'}).buildElement() + .buildElement() + .addHr().buildElement() + .addDiv({'class': 'bm-container bm-scrollable'}, (instance, div) => { + // Each category in the settings window + this.buildHighlight(); + }).buildElement() + .buildElement() + .buildElement().buildOverlay(this.windowParent); + + // Creates dragging capability on the drag bar for dragging the window + this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); + } + + /** Displays an error when a settings category fails to load. + * @param {string} name - The name of the category + */ + #errorOverrideFailure(name) { + this.window = this.addDiv({'class': 'bm-container'}) + .addHeader(2, {'textContent': name}).buildElement() + .addHr().buildElement() + .addP({'innerHTML': `An error occured loading the ${name} category. SettingsManager failed to override the ${name} function inside WindowSettings.`}).buildElement() + .buildElement(); + } + + /** Builds the highlight section of the window. + * This should be overriden by {@link SettingsManager} + * @since 0.91.11 + */ + buildHighlight() { + this.#errorOverrideFailure('Pixel Highlight'); + } +} \ No newline at end of file diff --git a/src/main.css b/src/main.css index bc2c40c..bfa8ce9 100644 --- a/src/main.css +++ b/src/main.css @@ -6,4 +6,5 @@ @import './confettiManager.css'; @import './overlay.css'; @import './WindowFilter.css'; +@import './WindowSettings.css'; @import './WindowWizard.css'; diff --git a/src/main.js b/src/main.js index 94f47af..7fa2f8a 100644 --- a/src/main.js +++ b/src/main.js @@ -8,6 +8,7 @@ import TemplateManager from './templateManager.js'; import { consoleLog, consoleWarn } from './utils.js'; import WindowMain from './WindowMain.js'; import WindowTelemetry from './WindowTelemetry.js'; +import SettingsManager from './settingsManager.js'; const name = GM_info.script.name.toString(); // Name of userscript const version = GM_info.script.version.toString(); // Version of userscript @@ -186,19 +187,22 @@ if (!!(robotoMonoInjectionPoint.indexOf('@font-face') + 1)) { document.head?.appendChild(stylesheetLink); } +const userSettings = JSON.parse(GM_getValue('bmUserSettings', '{}')); // Loads the user settings + // CONSTRUCTORS const observers = new Observers(); // Constructs a new Observers object const windowMain = new WindowMain(name, version); // Constructs a new Overlay object for the main overlay const templateManager = new TemplateManager(name, version, windowMain); // Constructs a new TemplateManager object const apiManager = new ApiManager(templateManager); // Constructs a new ApiManager object +const settingsManager = new SettingsManager(name, version, userSettings); // Constructs a new SettingsManager +windowMain.setSettingsManager(settingsManager); // Sets the settings manager windowMain.setApiManager(apiManager); // Sets the API manager const storageTemplates = JSON.parse(GM_getValue('bmTemplates', '{}')); console.log(storageTemplates); templateManager.importJSON(storageTemplates); // Loads the templates -const userSettings = JSON.parse(GM_getValue('bmUserSettings', '{}')); // Loads the user settings console.log(userSettings); console.log(Object.keys(userSettings).length); diff --git a/src/settingsManager.js b/src/settingsManager.js new file mode 100644 index 0000000..76bfb51 --- /dev/null +++ b/src/settingsManager.js @@ -0,0 +1,144 @@ +import WindowSettings from "./WindowSettings"; + +/** SettingsManager class for handling user settings and making them persist between sessions. + * Logic for {@link WindowSettings} is managed here. + * @class SettingsManager + * @since 0.91.11 + * @examples + * { + * "uuid": "497dcba3-ecbf-4587-a2dd-5eb0665e6880", + * "telemetry": 1, + * "flags": ["willHighlight", "openWindowed"], + * "highlight": [[1,0,-1],[1,-1,0],[2,1,0],[1,0,1]], + * "filter": [-2,0,4,5,6,29,63] + * } + */ +export default class SettingsManager extends WindowSettings { + + /** Constructor for the SettingsManager class + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @param {Object} userSettings - The user settings as an object + * @since 0.91.11 + */ + constructor(name, version, userSettings) { + super(name, version); // Executes WindowSettings constructor + + this.userSettings = userSettings; // User settings as an Object + + this.lastUpdateTime = 0; // When this unix timestamp is within the last 5 seconds, we should save this.userSettings to storage + } + + // This is one of the most insane OOP setups I have ever laid my eyes on + + /** Builds the "highlight" category of the settings window + * @since 0.91.18 + * @see WindowSettings#buildHighlight + */ + buildHighlight() { + + // Constructs the category and adds it to the window + this.window = this.addDiv({'class': 'bm-container'}) + .addHeader(2, {'textContent': 'Pixel Highlight'}).buildElement() + .addHr().buildElement() + .addDiv({'style': 'margin-left: 1.5ch;'}) + .addP({'id': 'bm-highlight-grid-label', 'textContent': 'Create a custom pattern:'}).buildElement() + .addDiv({'class': 'bm-highlight-grid', 'role': 'group', 'aria-labelledby': 'bm-highlight-grid-label'}) + .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [-1, -1]);}).buildElement() + .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [0, -1]);}).buildElement() + .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [1, -1]);}).buildElement() + .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [-1, 0]);}).buildElement() + .addButton({'data-status': 'Template', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [0, 0]);}).buildElement() + .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [1, 0]);}).buildElement() + .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [-1, 1]);}).buildElement() + .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [0, 1]);}).buildElement() + .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [1, 1]);}).buildElement() + .buildElement() + .buildElement() + .buildElement(); + + // TODO: First-time load of highlight settings from user storage + } + + /** Updates the display of the highlight buttons in the settings window. + * Additionally, it will update user settings with the new selection. + * @param {HTMLButtonElement} button - The button that was pressed + * @param {Array} coords - The relative coordinates of the button + */ + #updateHighlightSettings(button, coords) { + + console.log(coords); + + button.disabled = true; // Disabled the button until we are done + + const status = button.dataset['status']; // Obtains the current status of the button + + /** Obtains the old highlight storage, or sets it to default. @type {Array} */ + const userStorageOld = this.userSettings?.highlight || [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + + let userStorageChange = [2, 0, 0]; // The new change to the user storage + + const userStorageNew = userStorageOld; // The old storage with the new change + + console.log(userStorageOld); + + // For each different type of status... + switch (status) { + + // If the button was in the "Disabled" state + case 'Disabled': + + // Change to "Incorrect" + button.dataset['status'] = 'Incorrect'; + button.ariaLabel = 'Sub-pixel incorrect'; + userStorageChange = [1, ...coords]; + break; + + // If the button was in the "Incorrect" state + case 'Incorrect': + + // Change to "Template" + button.dataset['status'] = 'Template'; + button.ariaLabel = 'Sub-pixel template'; + userStorageChange = [2, ...coords]; + break; + + // If the button was in the "Template" state + case 'Template': + + // Change to "Disabled" + button.dataset['status'] = 'Disabled'; + button.ariaLabel = 'Sub-pixel disabled'; + userStorageChange = [0, ...coords]; + break; + } + + console.log(userStorageChange); + + // Finds the index of the pixel to change + const indexOfChange = userStorageOld.findIndex(([, x, y]) => ((x == userStorageChange[1]) && (y == userStorageChange[2]))); + + console.log(indexOfChange); + + // If the new sub-pixel state is NOT disabled + if (userStorageChange[0] != 0) { + + // If a sub-pixel was found... + if (indexOfChange != -1) { + userStorageNew[indexOfChange] = userStorageChange; + } else { + userStorageNew.push(userStorageChange); + } + } else if (indexOfChange != -1) { + // Else, it is disabled. We want to remove it if it exists. + userStorageNew.splice(indexOfChange, 1); // Removes 1 index from the array at the index of the pixel change + } + + console.log(userStorageNew); + + this.userSettings['highlight'] = userStorageNew; + // TODO: Add timer update here + + button.disabled = false; // Reenables the button since we are done + } +} \ No newline at end of file From bfb02708dfb3c85996a3ab567952e60c69d7e589 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Wed, 4 Mar 2026 16:59:45 -0500 Subject: [PATCH 08/15] Highlight settings persist --- dist/BlueMarble-For-GreasyFork.user.js | 60 +++++++++++++++--------- dist/BlueMarble-Standalone.user.js | 4 +- dist/BlueMarble.user.js | 4 +- docs/README.md | 2 +- package-lock.json | 4 +- package.json | 2 +- src/BlueMarble.meta.js | 2 +- src/WindowSettings.css | 1 + src/settingsManager.js | 65 ++++++++++++++++++++------ 9 files changed, 100 insertions(+), 44 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index 1c7b04e..3edd359 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.91.38 +// @version 0.91.42 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -3469,7 +3469,24 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add super(name2, version2); __privateAdd(this, _SettingsManager_instances); this.userSettings = userSettings2; + this.userSettingsOld = structuredClone(this.userSettings); + this.userSettingsSaveLocation = "bmUserSettings"; + this.updateFrequency = 5e3; this.lastUpdateTime = 0; + setInterval(this.updateUserStorage.bind(this), this.updateFrequency); + } + /** Updates the user settings in userscript storage + * @since 0.91.39 + */ + async updateUserStorage() { + const userSettingsCurrent = JSON.stringify(this.userSettings); + const userSettingsOld = JSON.stringify(this.userSettingsOld); + if (userSettingsCurrent != userSettingsOld && Date.now() - this.lastUpdateTime > this.updateFrequency) { + await GM.setValue(this.userSettingsSaveLocation, userSettingsCurrent); + this.userSettingsOld = structuredClone(this.userSettings); + this.lastUpdateTime = Date.now(); + console.log(userSettingsCurrent); + } } // This is one of the most insane OOP setups I have ever laid my eyes on /** Builds the "highlight" category of the settings window @@ -3477,25 +3494,26 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add * @see WindowSettings#buildHighlight */ buildHighlight() { - this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }).addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [-1, -1]); - }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [0, -1]); - }).buildElement().addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [1, -1]); - }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [-1, 0]); - }).buildElement().addButton({ "data-status": "Template", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [0, 0]); - }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [1, 0]); - }).buildElement().addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [-1, 1]); - }).buildElement().addButton({ "data-status": "Incorrect", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [0, 1]); - }).buildElement().addButton({ "data-status": "Disabled", "aria-label": "Sub-pixel disabled" }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [1, 1]); - }).buildElement().buildElement().buildElement().buildElement(); + const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }); + for (let buttonY = -1; buttonY <= 1; buttonY++) { + for (let buttonX = -1; buttonX <= 1; buttonX++) { + const buttonState = storedHighlight[storedHighlight.findIndex(([, x, y]) => x == buttonX && y == buttonY)]?.[0] ?? 0; + let buttonStateName = "Disabled"; + if (buttonState == 1) { + buttonStateName = "Incorrect"; + } else if (buttonState == 2) { + buttonStateName = "Template"; + } + this.window = this.addButton({ + "data-status": buttonStateName, + "aria-label": `Sub-pixel ${buttonStateName.toLowerCase()}` + }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [buttonX, buttonY]); + }).buildElement(); + } + } + this.window = this.buildElement().buildElement().buildElement(); } }; _SettingsManager_instances = new WeakSet(); @@ -3508,7 +3526,7 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add console.log(coords2); button.disabled = true; const status = button.dataset["status"]; - const userStorageOld = this.userSettings?.highlight || [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + const userStorageOld = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; let userStorageChange = [2, 0, 0]; const userStorageNew = userStorageOld; console.log(userStorageOld); diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index d1b4e16..71015ec 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.91.38 +// @version 0.91.42 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,$,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}F(){return this.W.length>0&&(this.A=this.W.pop()),this}G(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}U(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"span",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,$).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,$).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.F(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.F(),e(this,n,i(this,x,$).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"th",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,x,$).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,$).call(this,"div"),o=i(this,x,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.F();const a=i(this,x,$).call(this,"button",{textContent:n});return this.F(),this.F(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,$).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};x=new WeakSet,$=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,x,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({id:"bm-o",textContent:"Loading template storage status..."}).F().F().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ft().then(()=>{e.disabled=!1})}}).F()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).F(),c.F().G(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Gt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"}).F().j({textContent:`#${m}`}).F().F().U({class:"bm-x bm-0"}).q(3,{textContent:r}).F().Y({textContent:`Uploaded by user #${u}`}).F().Y({textContent:`Coordinates: ${l.join(", ")}`}).F().Y({textContent:`Total Pixels: ${b}`}).F().F().F()}}i.F().G(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({textContent:"Updating template storage. Please wait..."}).F().F().F().G(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Ut(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,F,G,U,R,j,E,Y,V,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).F().F().Z().F().U({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).F().F().K().F().Z().F().K().F().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).F().K().F().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).F().K().F().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).F().K().F().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).F().K().F().Y({textContent:"Special Thanks:"}).F().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).F().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).F().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).F().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).F().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).F().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).F().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).F().ht({innerHTML:'Force Network for hosting the telemetry server!'}).F().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).F().F().K().F().Y({innerHTML:'Donators:'}).F().lt().ht({textContent:"Espresso"}).F().ht({textContent:"BEST FAN"}).F().ht({textContent:"Jack"}).F().ht({textContent:"raiken_au"}).F().ht({textContent:"Jacob"}).F().ht({textContent:"StupidOne"}).F().ht({textContent:"2 Anonymous Supporters"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).F().K().F().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).F().K().F().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).F().K().F().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).F().K().F().Y({id:"bm-5",innerHTML:"??? ???"}).F().F().U({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).F().F().F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).F().U().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).F().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,G).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,$e:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,$e:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,$e:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},F=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,V),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).F().F().Z().F().U({class:"bm-E bm-A"},(t,e)=>{this.ve()}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,V,J).call(this,"Pixel Highlight")}};V=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t}).F().Z().F().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).F().F()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight||[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(it);var nt,st="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9TVEFUSACEThEICoGbAPoCC4NKAAE2AiQDg0oEIAWEWAeEYQwHGz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tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().F().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP//AAAAAAAAubU+IZJzuMAAAAtoSURBVFhHlZZ3fJSFGce/NzKOhITL4kJCEgmJ7D2UXQKJghVBFEWkLC3ioNWigFrhg9ZRKBZUWigtcTBEQUEgBDAESEJCQvYk+7LnZV4u6+2TV8unfqRqnz9yd2/unvF7fs/veTT8HxaXVKBk52QSNGQSN65dxeThTktbG0tWPkhWtpmq8ho65fO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NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).F().q(1,{textContent:this.name}).F().F().Z().F().U({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).F().K().F().Y({id:"bm-k",textContent:"Next level in..."}).F().K().F().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).F().F().F().Z().F().U({class:"bm-E"}).U({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).F().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().F().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).F().F().U({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).F().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).F().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,R).call(this)}).F().F().U({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).F().F().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).F().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).F().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).F().F().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Gt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Jt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Gt),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Fe(t),await n(500)}async Ft(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Fe(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Fe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ge:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Vt:d,Jt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ve(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Je=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=0}ve(){this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).F().Z().F().U({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).F().U({class:"bm-1h",role:"group","aria-labelledby":"bm-12"}).yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,-1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,0])}).F().yt({"data-status":"Template","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,0])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,0])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,1])}).F().F().F().F()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Ve(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.ei=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).F().F().Z().F().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.ei);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"}).F().R({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 ${this.name}!`}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).F().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).F().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).F().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).F().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).F().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).F().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).F().F().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).F().F().F().F().F().G(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,$,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,$),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}U(){return this.W.length>0&&(this.A=this.W.pop()),this}F(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}G(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"span",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"details",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,$,x).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,$,x).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.U(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.U(),e(this,n,i(this,$,x).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tr",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"th",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,$,x).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,$,x).call(this,"div"),o=i(this,$,x).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.U();const a=i(this,$,x).call(this,"button",{textContent:n});return this.U(),this.U(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,$,x).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};$=new WeakSet,x=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,$,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,$,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({id:"bm-o",textContent:"Loading template storage status..."}).U().U().G({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ut().then(()=>{e.disabled=!1})}}).U()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).U(),c.U().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.G({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).U().j({textContent:`#${m}`}).U().U().G({class:"bm-x bm-0"}).q(3,{textContent:r}).U().Y({textContent:`Uploaded by user #${u}`}).U().Y({textContent:`Coordinates: ${l.join(", ")}`}).U().Y({textContent:`Total Pixels: ${b}`}).U().U().U()}}i.U().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({textContent:"Updating template storage. Please wait..."}).U().U().U().F(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Gt(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const $=d.get(w);d.set(w,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,U,F,G,R,j,E,Y,J,V,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).U().U().Z().U().G({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).U().U().K().U().Z().U().K().U().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).U().K().U().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).U().K().U().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).U().K().U().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).U().K().U().Y({textContent:"Special Thanks:"}).U().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).U().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).U().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).U().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).U().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).U().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).U().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).U().ht({innerHTML:'Force Network for hosting the telemetry server!'}).U().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).U().U().K().U().Y({innerHTML:'Donators:'}).U().lt().ht({textContent:"Espresso"}).U().ht({textContent:"BEST FAN"}).U().ht({textContent:"Jack"}).U().ht({textContent:"raiken_au"}).U().ht({textContent:"Jacob"}).U().ht({textContent:"StupidOne"}).U().ht({textContent:"2 Anonymous Supporters"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).U().K().U().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).U().K().U().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).U().K().U().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).U().K().U().Y({id:"bm-5",innerHTML:"??? ???"}).U().U().G({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).U().U().U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).U().G().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).U().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,$e:r,xe:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,$e:s,xe:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.G({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,$e:c,xe:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},U=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},G=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,J),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).U().U().Z().U().G({class:"bm-E bm-A"},(t,e)=>{this.ve()}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,J,V).call(this,"Pixel Highlight")}};J=new WeakSet,V=function(t){this.window=this.G({class:"bm-E"}).q(2,{textContent:t}).U().Z().U().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).U().U()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(it);var nt,st="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9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BgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,G),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.G({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().U().G({class:"bm-h"}).G({class:"bm-E"}).X({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP//AAAAAAAAubU+IZJzuMAAAAtoSURBVFhHlZZ3fJSFGce/NzKOhITL4kJCEgmJ7D2UXQKJghVBFEWkLC3ioNWigFrhg9ZRKBZUWigtcTBEQUEgBDAESEJCQvYk+7LnZV4u6+2TV8unfqRqnz9yd2/unvF7f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z4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).U().q(1,{textContent:this.name}).U().U().Z().U().G({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).U().K().U().Y({id:"bm-k",textContent:"Next level in..."}).U().K().U().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).U().U().U().Z().U().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).U().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().U().G({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).U().U().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).U().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).U().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,G,R).call(this)}).U().U().G({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).U().U().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).U().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).U().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).U().U().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Vt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Ue(t),await n(500)}async Ut(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Ue(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Ue(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Gt(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ge(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Jt:d,Vt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Je(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Ve=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ge(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Ve="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.G({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).U().Z().U().G({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).U().G({class:"bm-1h",role:"group","aria-labelledby":"bm-12"});for(let e=-1;e<=1;e++)for(let n=-1;n<=1;n++){const s=t[t.findIndex(([,t,i])=>t==n&&i==e)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.yt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(t,s)=>{s.onclick=()=>i(this,Q,Z).call(this,s,[n,e])}).U()}this.window=this.U().U().U()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Je(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.oi=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.G({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).U().U().Z().U().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.oi);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E"}).q(2,{textContent:"Legal"}).U().R({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 ${this.name}!`}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).U().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).U().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).U().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).U().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).U().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).U().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).U().U().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).U().U().U().U().U().F(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 52c5b44..9be85dc 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.91.38 +// @version 0.91.42 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,$,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}F(){return this.W.length>0&&(this.A=this.W.pop()),this}G(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}U(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"span",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,$).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,$).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.F(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,$).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.F(),e(this,n,i(this,x,$).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"th",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,x,$).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,$).call(this,"div"),o=i(this,x,$).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.F();const a=i(this,x,$).call(this,"button",{textContent:n});return this.F(),this.F(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,$).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,$).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};x=new WeakSet,$=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,x,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({id:"bm-o",textContent:"Loading template storage status..."}).F().F().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ft().then(()=>{e.disabled=!1})}}).F()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).F(),c.F().G(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Gt),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"}).F().j({textContent:`#${m}`}).F().F().U({class:"bm-x bm-0"}).q(3,{textContent:r}).F().Y({textContent:`Uploaded by user #${u}`}).F().Y({textContent:`Coordinates: ${l.join(", ")}`}).F().Y({textContent:`Total Pixels: ${b}`}).F().F().F()}}i.F().G(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Status"}).F().R({textContent:"Updating template storage. Please wait..."}).F().F().F().G(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Ut(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,F,G,U,R,j,E,Y,V,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).F().F().Z().F().U({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).F().F().K().F().Z().F().K().F().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).F().K().F().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).F().K().F().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).F().K().F().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).F().K().F().Y({textContent:"Special Thanks:"}).F().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).F().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).F().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).F().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).F().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).F().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).F().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).F().ht({innerHTML:'Force Network for hosting the telemetry server!'}).F().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).F().F().K().F().Y({innerHTML:'Donators:'}).F().lt().ht({textContent:"Espresso"}).F().ht({textContent:"BEST FAN"}).F().ht({textContent:"Jack"}).F().ht({textContent:"raiken_au"}).F().ht({textContent:"Jacob"}).F().ht({textContent:"StupidOne"}).F().ht({textContent:"2 Anonymous Supporters"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).F().K().F().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).F().K().F().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).F().K().F().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).F().K().F().Y({id:"bm-5",innerHTML:"??? ???"}).F().F().U({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).F().F().F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.U({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).F().U().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).F().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).F().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).F().F().Z().F().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!1)}).F().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).F().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,F).call(this,!0)}).F().F().U({class:"bm-E bm-A"}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,G).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,$e:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,$e:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,$e:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},F=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},G=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,V),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.U({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().U({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).F().F().F().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).F().F().Z().F().U({class:"bm-E bm-A"},(t,e)=>{this.ve()}).F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,V,J).call(this,"Pixel Highlight")}};V=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t}).F().Z().F().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).F().F()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight||[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=GM_getResourceText("CSS-BM-File");GM_addStyle(it);var nt,st="robotoMonoInjectionPoint";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).F().U().F().F().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).F().q(1,{textContent:this.name}).F().F().Z().F().U({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).F().K().F().Y({id:"bm-k",textContent:"Next level in..."}).F().K().F().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).F().F().F().Z().F().U({class:"bm-E"}).U({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).F().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,j).call(this,t,e,n))}).F().F().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).F().F().U({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).F().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).F().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,R).call(this)}).F().F().U({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).F().F().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).F().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).F().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).F().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).F().F().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).F().F().F().F().F().G(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Gt="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Jt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Gt),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Fe(t),await n(500)}async Ft(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Fe(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Fe(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ge:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Vt:d,Jt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ve(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Je=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=0}ve(){this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).F().Z().F().U({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).F().U({class:"bm-1h",role:"group","aria-labelledby":"bm-12"}).yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,-1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,-1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,0])}).F().yt({"data-status":"Template","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,0])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,0])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[-1,1])}).F().yt({"data-status":"Incorrect","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[0,1])}).F().yt({"data-status":"Disabled","aria-label":"Sub-pixel disabled"},(t,e)=>{e.onclick=()=>i(this,Q,Z).call(this,e,[1,1])}).F().F().F().F()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Ve(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.ei=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).F().F().Z().F().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.ei);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).F().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).F().F().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"}).F().R({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 ${this.name}!`}).F().F().Z().F().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).F().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).F().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).F().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).F().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).F().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).F().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).F().F().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).F().F().F().F().F().G(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,$,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,$),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}U(){return this.W.length>0&&(this.A=this.W.pop()),this}F(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}G(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"span",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"details",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,$,x).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,$,x).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.U(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.U(),e(this,n,i(this,$,x).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tr",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"th",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,$,x).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,$,x).call(this,"div"),o=i(this,$,x).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.U();const a=i(this,$,x).call(this,"button",{textContent:n});return this.U(),this.U(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,$,x).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};$=new WeakSet,x=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,$,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,$,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({id:"bm-o",textContent:"Loading template storage status..."}).U().U().G({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ut().then(()=>{e.disabled=!1})}}).U()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).U(),c.U().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.G({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).U().j({textContent:`#${m}`}).U().U().G({class:"bm-x bm-0"}).q(3,{textContent:r}).U().Y({textContent:`Uploaded by user #${u}`}).U().Y({textContent:`Coordinates: ${l.join(", ")}`}).U().Y({textContent:`Total Pixels: ${b}`}).U().U().U()}}i.U().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({textContent:"Updating template storage. Please wait..."}).U().U().U().F(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Gt(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const $=d.get(w);d.set(w,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,U,F,G,R,j,E,Y,J,V,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).U().U().Z().U().G({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).U().U().K().U().Z().U().K().U().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).U().K().U().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).U().K().U().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).U().K().U().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).U().K().U().Y({textContent:"Special Thanks:"}).U().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).U().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).U().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).U().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).U().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).U().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).U().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).U().ht({innerHTML:'Force Network for hosting the telemetry server!'}).U().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).U().U().K().U().Y({innerHTML:'Donators:'}).U().lt().ht({textContent:"Espresso"}).U().ht({textContent:"BEST FAN"}).U().ht({textContent:"Jack"}).U().ht({textContent:"raiken_au"}).U().ht({textContent:"Jacob"}).U().ht({textContent:"StupidOne"}).U().ht({textContent:"2 Anonymous Supporters"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).U().K().U().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).U().K().U().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).U().K().U().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).U().K().U().Y({id:"bm-5",innerHTML:"??? ???"}).U().U().G({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).U().U().U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).U().G().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).U().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,$e:r,xe:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,$e:s,xe:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.G({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,$e:c,xe:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},U=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},G=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,J),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).U().U().Z().U().G({class:"bm-E bm-A"},(t,e)=>{this.ve()}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,J,V).call(this,"Pixel Highlight")}};J=new WeakSet,V=function(t){this.window=this.G({class:"bm-E"}).q(2,{textContent:t}).U().Z().U().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).U().U()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=GM_getResourceText("CSS-BM-File");GM_addStyle(it);var nt,st="robotoMonoInjectionPoint";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,G),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.G({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().U().G({class:"bm-h"}).G({class:"bm-E"}).X({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).U().q(1,{textContent:this.name}).U().U().Z().U().G({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).U().K().U().Y({id:"bm-k",textContent:"Next level in..."}).U().K().U().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).U().U().U().Z().U().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).U().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().U().G({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).U().U().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).U().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).U().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,G,R).call(this)}).U().U().G({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).U().U().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).U().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).U().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).U().U().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Vt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Ue(t),await n(500)}async Ut(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Ue(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Ue(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Gt(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ge(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Jt:d,Vt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Je(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Ve=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ge(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Ve="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.G({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).U().Z().U().G({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).U().G({class:"bm-1h",role:"group","aria-labelledby":"bm-12"});for(let e=-1;e<=1;e++)for(let n=-1;n<=1;n++){const s=t[t.findIndex(([,t,i])=>t==n&&i==e)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.yt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(t,s)=>{s.onclick=()=>i(this,Q,Z).call(this,s,[n,e])}).U()}this.window=this.U().U().U()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Je(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.oi=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.G({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).U().U().Z().U().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.oi);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E"}).q(2,{textContent:"Legal"}).U().R({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 ${this.name}!`}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).U().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).U().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).U().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).U().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).U().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).U().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).U().U().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).U().U().U().U().U().F(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index ba6ac63..578dc1e 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 e7b45a4..adfc9d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.38", + "version": "0.91.42", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.38", + "version": "0.91.42", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 068e2af..93e2368 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.38", + "version": "0.91.42", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index dcddff4..7011d10 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.91.38 +// @version 0.91.42 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/WindowSettings.css b/src/WindowSettings.css index 4dd3998..cec6c94 100644 --- a/src/WindowSettings.css +++ b/src/WindowSettings.css @@ -12,6 +12,7 @@ /* Highlight pattern button */ #bm-window-settings .bm-highlight-grid > button { width: 100%; + padding: 0; aspect-ratio: 1 / 1; background-color: white; border: #333 1px solid; diff --git a/src/settingsManager.js b/src/settingsManager.js index 76bfb51..457e848 100644 --- a/src/settingsManager.js +++ b/src/settingsManager.js @@ -25,8 +25,31 @@ export default class SettingsManager extends WindowSettings { super(name, version); // Executes WindowSettings constructor this.userSettings = userSettings; // User settings as an Object + this.userSettingsOld = structuredClone(this.userSettings); // Creates a duplicate of the user settings to store the old version of user settings from 5+ seconds ago + this.userSettingsSaveLocation = 'bmUserSettings'; // Storage save location + this.updateFrequency = 5000; // Cooldown between saving to storage (throttle) this.lastUpdateTime = 0; // When this unix timestamp is within the last 5 seconds, we should save this.userSettings to storage + + setInterval(this.updateUserStorage.bind(this), this.updateFrequency); // Runs every X seconds (see updateFrequency) + } + + /** Updates the user settings in userscript storage + * @since 0.91.39 + */ + async updateUserStorage() { + + // Turns the objects into a string + const userSettingsCurrent = JSON.stringify(this.userSettings); + const userSettingsOld = JSON.stringify(this.userSettingsOld); + + // If the user settings have changed, AND the last update to user storage was over 5 seconds ago (5sec throttle)... + if ((userSettingsCurrent != userSettingsOld) && ((Date.now() - this.lastUpdateTime) > this.updateFrequency)) { + await GM.setValue(this.userSettingsSaveLocation, userSettingsCurrent); // Updates user storage + this.userSettingsOld = structuredClone(this.userSettings); // Updates the old user settings with a duplicate of the current user settings + this.lastUpdateTime = Date.now(); // Updates the variable that contains the last time updated + console.log(userSettingsCurrent); + } } // This is one of the most insane OOP setups I have ever laid my eyes on @@ -37,27 +60,41 @@ export default class SettingsManager extends WindowSettings { */ buildHighlight() { + // Obtains user settings for highlight from storage, or the default array if nothing was found + const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + // Constructs the category and adds it to the window this.window = this.addDiv({'class': 'bm-container'}) .addHeader(2, {'textContent': 'Pixel Highlight'}).buildElement() .addHr().buildElement() .addDiv({'style': 'margin-left: 1.5ch;'}) .addP({'id': 'bm-highlight-grid-label', 'textContent': 'Create a custom pattern:'}).buildElement() - .addDiv({'class': 'bm-highlight-grid', 'role': 'group', 'aria-labelledby': 'bm-highlight-grid-label'}) - .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [-1, -1]);}).buildElement() - .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [0, -1]);}).buildElement() - .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [1, -1]);}).buildElement() - .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [-1, 0]);}).buildElement() - .addButton({'data-status': 'Template', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [0, 0]);}).buildElement() - .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [1, 0]);}).buildElement() - .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [-1, 1]);}).buildElement() - .addButton({'data-status': 'Incorrect', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [0, 1]);}).buildElement() - .addButton({'data-status': 'Disabled', 'aria-label': 'Sub-pixel disabled'}, (instance, button) => {button.onclick = () => this.#updateHighlightSettings(button, [1, 1]);}).buildElement() - .buildElement() + .addDiv({'class': 'bm-highlight-grid', 'role': 'group', 'aria-labelledby': 'bm-highlight-grid-label'}); + // We leave this open so we can add buttons + + // For each of the 9 buttons... + for (let buttonY = -1; buttonY <= 1; buttonY++) { + for (let buttonX = -1; buttonX <= 1; buttonX++) { + const buttonState = storedHighlight[storedHighlight.findIndex(([, x, y]) => ((x == buttonX) && (y == buttonY)))]?.[0] ?? 0; + let buttonStateName = 'Disabled'; + if (buttonState == 1) { + buttonStateName = 'Incorrect'; + } else if (buttonState == 2) { + buttonStateName = 'Template'; + } + this.window = this.addButton({ + 'data-status': buttonStateName, + 'aria-label': `Sub-pixel ${buttonStateName.toLowerCase()}` + }, (instance, button) => { + button.onclick = () => this.#updateHighlightSettings(button, [buttonX, buttonY]) + }).buildElement(); + } + } + + // Resumes from where we left off before we added buttons + this.window = this.buildElement() .buildElement() .buildElement(); - - // TODO: First-time load of highlight settings from user storage } /** Updates the display of the highlight buttons in the settings window. @@ -74,7 +111,7 @@ export default class SettingsManager extends WindowSettings { const status = button.dataset['status']; // Obtains the current status of the button /** Obtains the old highlight storage, or sets it to default. @type {Array} */ - const userStorageOld = this.userSettings?.highlight || [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + const userStorageOld = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; let userStorageChange = [2, 0, 0]; // The new change to the user storage From aa3ce4bc1974afba6899b14113f6365c397c129a Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Wed, 4 Mar 2026 20:58:33 -0500 Subject: [PATCH 09/15] Finished highlight UI --- dist/BlueMarble-For-GreasyFork.user.css | 26 ++++++ dist/BlueMarble-For-GreasyFork.user.js | 61 ++++++++++++- 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/WindowSettings.css | 35 ++++++++ src/WindowSettings.js | 1 + src/settingsManager.js | 108 ++++++++++++++++++++++++ src/utils.js | 2 +- 13 files changed, 238 insertions(+), 15 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 0c7d981..4a1abe1 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -390,6 +390,31 @@ input[type=file] { } /* src/WindowSettings.css */ +#bm-window-settings .bm-highlight-preset-container { + display: flex; + flex-direction: column; +} +#bm-window-settings .bm-highlight-preset-container span { + width: fit-content; + margin: auto; + font-size: 0.7em; +} +#bm-window-settings .bm-highlight-preset-container button { + width: fit-content; + padding: 0; + border-radius: 0; +} +#bm-window-settings .bm-highlight-preset-container svg { + stroke: #333; + stroke-width: 0.02px; + width: 100%; + min-width: 1ch; + max-width: 10ch; +} +#bm-window-settings .bm-highlight-preset-container button:hover svg, +#bm-window-settings .bm-highlight-preset-container button:focus svg { + opacity: 0.9; +} #bm-window-settings .bm-highlight-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; @@ -399,6 +424,7 @@ input[type=file] { } #bm-window-settings .bm-highlight-grid > button { width: 100%; + padding: 0; aspect-ratio: 1 / 1; background-color: white; border: #333 1px solid; diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index 3edd359..db7704a 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.91.42 +// @version 0.91.53 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -3435,7 +3435,7 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add button.ontouchend = () => { button.click(); }; - }).buildElement().buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Settings" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container bm-scrollable" }, (instance, div) => { + }).buildElement().buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Settings" }).buildElement().buildElement().addHr().buildElement().addP({ "textContent": "Settings take 5 seconds to save." }).buildElement().addDiv({ "class": "bm-container bm-scrollable" }, (instance, div) => { this.buildHighlight(); }).buildElement().buildElement().buildElement().buildOverlay(this.windowParent); this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); @@ -3457,7 +3457,7 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add }; // src/settingsManager.js - var _SettingsManager_instances, updateHighlightSettings_fn; + var _SettingsManager_instances, updateHighlightSettings_fn, updateHighlightToPreset_fn; var SettingsManager = class extends WindowSettings { /** Constructor for the SettingsManager class * @param {string} name - The name of the userscript @@ -3494,8 +3494,18 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add * @see WindowSettings#buildHighlight */ buildHighlight() { + const highlightPresetOff = ''; + const highlightPresetCross = ''; const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; - this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }); + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:" }).buildElement().addDiv({ "class": "bm-container bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "None"); + }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Cross" }).buildElement().addButton({ "innerHTML": highlightPresetCross, "aria-label": 'Preset "Cross Shape"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Cross"); + }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "X" }).buildElement().addButton({ "innerHTML": highlightPresetCross.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"', 'd="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'), "aria-label": 'Preset "X Shape"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "X"); + }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Full" }).buildElement().addButton({ "innerHTML": highlightPresetOff.replace("#fff", "#2f4f4f"), "aria-label": 'Preset "Full Template"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Full"); + }).buildElement().buildElement().buildElement().addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }); for (let buttonY = -1; buttonY <= 1; buttonY++) { for (let buttonX = -1; buttonX <= 1; buttonX++) { const buttonState = storedHighlight[storedHighlight.findIndex(([, x, y]) => x == buttonX && y == buttonY)]?.[0] ?? 0; @@ -3521,6 +3531,7 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add * Additionally, it will update user settings with the new selection. * @param {HTMLButtonElement} button - The button that was pressed * @param {Array} coords - The relative coordinates of the button + * @since 0.91.46 */ updateHighlightSettings_fn = function(button, coords2) { console.log(coords2); @@ -3566,6 +3577,48 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add this.userSettings["highlight"] = userStorageNew; button.disabled = false; }; + updateHighlightToPreset_fn = async function(preset) { + const presetButtons = document.querySelectorAll(".bm-highlight-preset-container button"); + for (const button of presetButtons) { + button.disabled = true; + } + let presetArray = [0, 0, 0, 0, 2, 0, 0, 0, 0]; + switch (preset) { + case "Cross": + presetArray = [0, 1, 0, 1, 2, 1, 0, 1, 0]; + break; + case "X": + presetArray = [1, 0, 1, 0, 2, 0, 1, 0, 1]; + break; + case "Full": + presetArray = [2, 2, 2, 2, 2, 2, 2, 2, 2]; + break; + } + const buttons = document.querySelector(".bm-highlight-grid")?.childNodes ?? []; + for (let buttonIndex = 0; buttonIndex < buttons.length; buttonIndex++) { + const button = buttons[buttonIndex]; + let buttonState = button.dataset["status"]; + buttonState = buttonState != "Disabled" ? buttonState != "Incorrect" ? 2 : 1 : 0; + let buttonStateDelta = presetArray[buttonIndex] - buttonState; + if (buttonStateDelta == 0) { + continue; + } + buttonStateDelta += buttonStateDelta < 0 ? 3 : 0; + button.click(); + if (buttonStateDelta == 2) { + for (let timeWaited = 0; timeWaited < 200; timeWaited += 10) { + if (!button.disabled) { + break; + } + await sleep(10); + } + button.click(); + } + } + for (const button of presetButtons) { + button.disabled = false; + } + }; // src/main.js var name = GM_info.script.name.toString(); diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index 71015ec..5c50ddd 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.91.42 +// @version 0.91.53 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,$,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,$),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}U(){return this.W.length>0&&(this.A=this.W.pop()),this}F(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}G(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"span",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"details",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,$,x).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,$,x).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.U(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.U(),e(this,n,i(this,$,x).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tr",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"th",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,$,x).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,$,x).call(this,"div"),o=i(this,$,x).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.U();const a=i(this,$,x).call(this,"button",{textContent:n});return this.U(),this.U(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,$,x).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};$=new WeakSet,x=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,$,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,$,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({id:"bm-o",textContent:"Loading template storage status..."}).U().U().G({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ut().then(()=>{e.disabled=!1})}}).U()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).U(),c.U().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.G({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).U().j({textContent:`#${m}`}).U().U().G({class:"bm-x bm-0"}).q(3,{textContent:r}).U().Y({textContent:`Uploaded by user #${u}`}).U().Y({textContent:`Coordinates: ${l.join(", ")}`}).U().Y({textContent:`Total Pixels: ${b}`}).U().U().U()}}i.U().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({textContent:"Updating template storage. Please wait..."}).U().U().U().F(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Gt(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const $=d.get(w);d.set(w,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,U,F,G,R,j,E,Y,J,V,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).U().U().Z().U().G({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).U().U().K().U().Z().U().K().U().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).U().K().U().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).U().K().U().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).U().K().U().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).U().K().U().Y({textContent:"Special Thanks:"}).U().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).U().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).U().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).U().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).U().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).U().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).U().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).U().ht({innerHTML:'Force Network for hosting the telemetry server!'}).U().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).U().U().K().U().Y({innerHTML:'Donators:'}).U().lt().ht({textContent:"Espresso"}).U().ht({textContent:"BEST FAN"}).U().ht({textContent:"Jack"}).U().ht({textContent:"raiken_au"}).U().ht({textContent:"Jacob"}).U().ht({textContent:"StupidOne"}).U().ht({textContent:"2 Anonymous Supporters"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).U().K().U().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).U().K().U().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).U().K().U().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).U().K().U().Y({id:"bm-5",innerHTML:"??? ???"}).U().U().G({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).U().U().U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).U().G().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).U().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,$e:r,xe:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,$e:s,xe:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.G({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,$e:c,xe:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},U=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},G=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,J),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).U().U().Z().U().G({class:"bm-E bm-A"},(t,e)=>{this.ve()}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,J,V).call(this,"Pixel Highlight")}};J=new WeakSet,V=function(t){this.window=this.G({class:"bm-E"}).q(2,{textContent:t}).U().Z().U().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).U().U()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(it);var nt,st="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4Au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('woff2');}";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,G),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.G({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().U().G({class:"bm-h"}).G({class:"bm-E"}).X({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJ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C"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).U().q(1,{textContent:this.name}).U().U().Z().U().G({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).U().K().U().Y({id:"bm-k",textContent:"Next level in..."}).U().K().U().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).U().U().U().Z().U().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).U().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().U().G({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).U().U().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).U().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).U().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,G,R).call(this)}).U().U().G({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).U().U().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).U().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).U().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).U().U().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Vt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Ue(t),await n(500)}async Ut(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Ue(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Ue(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Gt(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ge(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Jt:d,Vt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Je(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Ve=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ge(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Ve="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.G({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).U().Z().U().G({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).U().G({class:"bm-1h",role:"group","aria-labelledby":"bm-12"});for(let e=-1;e<=1;e++)for(let n=-1;n<=1;n++){const s=t[t.findIndex(([,t,i])=>t==n&&i==e)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.yt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(t,s)=>{s.onclick=()=>i(this,Q,Z).call(this,s,[n,e])}).U()}this.window=this.U().U().U()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Je(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.oi=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.G({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).U().U().Z().U().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.oi);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E"}).q(2,{textContent:"Legal"}).U().R({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 ${this.name}!`}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).U().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).U().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).U().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).U().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).U().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).U().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).U().U().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).U().U().U().U().U().F(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.O=null,this.B="bm-l",this.I=null,this.P=null,this.A=[]}W(t){this.N=t}V(t){this.O=t}_(){return this.A.length>0&&(this.P=this.A.pop()),this}F(t){t?.appendChild(this.I),this.I=null,this.P=null,this.A=[]}U(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"p",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"small",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"span",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,y).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,y).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this._(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this._(),e(this,n,i(this,x,y).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"th",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"td",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.B,n)}};return e(this,i(this,x,y).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,y).call(this,"div"),o=i(this,x,y).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this._();const a=i(this,x,y).call(this,"button",{textContent:n});return this._(),this._(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,y).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ht(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.B,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.B,"Error: "+t,!0)}};x=new WeakSet,y=function(t,e={},n={}){const s=document.createElement(t);this.I?(this.P?.appendChild(s),this.A.push(this.P),this.P=s):(this.I=s,this.P=s);for(const[t,n]of Object.entries(e))i(this,x,$).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,$).call(this,s,t,e);return s},$=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.Bt="bm-m",this.It=document.body,this.Pt=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.Pt?.scriptVersion,this.schemaVersion=this.Pt?.schemaVersion,this.At=void 0,this.Wt=n,this.Vt=s}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.Bt,class:"bm-N",style:t},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({id:"bm-o",textContent:"Loading template storage status..."})._()._().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"})._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Wt.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.At="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.At="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.At="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.At="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Wt)}.
Wplace was last updated on ${l}.${"Good"!=this.At?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.At&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.$t({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Vt._t().then(()=>{e.disabled=!1})}})._()),"Poor"!=this.At&&"Bad"!=this.At||c.$t({textContent:`Update template storage to ${this.Wt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}})._(),c._().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.Pt?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Bt} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Vt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"})._().R({textContent:`#${m}`})._()._().U({class:"bm-x bm-0"}).q(3,{textContent:r})._().j({textContent:`Uploaded by user #${u}`})._().j({textContent:`Coordinates: ${l.join(", ")}`})._().j({textContent:`Total Pixels: ${b}`})._()._()._()}}i._().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Bt} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({textContent:"Updating template storage. Please wait..."})._()._()._().F(t)}GM_deleteValue("bmCoords");const e=this.Pt?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.Vt.Ut(t);await this.Vt.Gt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Bt}`).remove(),new L(this.name,this.version,this.Wt,this.Vt).zt())};var H,N,O,B,I=L;H=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Rt))},O=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new I(this.name,this.version,this.schemaVersion,this).zt(),this.jt=await async function({C:t,Et:i,jt:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.jt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.jt),console.log("^^^ This ^^^")}}return n}({C:this.C,Et:this.Et,jt:this.jt})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Qt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Qt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var P=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},A=class extends HTMLElement{};customElements.define("confetti-piece",A);var W,V,z,_,F,U,G,R,j,E,Y,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.Bt="bm-i",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"})._()._().Z()._().U({class:"bm-E bm-A"}).j({role:"img","aria-label":this.name}).j({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"})._()._().K()._().Z()._().K()._().j({textContent:'"Blue Marble" userscript is made by SwingTheVine.'})._().K()._().j({innerHTML:'The Blue Marble Website is made by crqch.'})._().K()._().j({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`})._().K()._().j({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'})._().K()._().j({textContent:"Special Thanks:"})._().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."})._().ht({innerHTML:'nof, darkness for creating similar userscripts!'})._().ht({innerHTML:'Wonda for the Blue Marble banner image!'})._().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'})._().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'})._().ht({innerHTML:'Nomad and Gustav for the tutorials!'})._().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'})._().ht({innerHTML:'Force Network for hosting the telemetry server!'})._().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'})._()._().K()._().j({innerHTML:'Donators:'})._().lt().ht({textContent:"Espresso"})._().ht({textContent:"BEST FAN"})._().ht({textContent:"Jack"})._().ht({textContent:"raiken_au"})._().ht({textContent:"Jacob"})._().ht({textContent:"StupidOne"})._().ht({textContent:"2 Anonymous Supporters"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Bt="bm-p",this.se="bm-y",this.It=document.body,this.Vt=t.N?.Vt,this.oe='',this.ae='';const{palette:i,H:n}=this.Vt.Zt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).j({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"})._().K()._().j({id:"bm-9",innerHTML:"Correct Pixels: ???"})._().K()._().j({id:"bm-f",innerHTML:"Total Pixels: ???"})._().K()._().j({id:"bm-4",innerHTML:"Complete: ??? (???)"})._().K()._().j({id:"bm-5",innerHTML:"??? ???"})._()._().U({class:"bm-E"}).G({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Bt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,W,z).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}})._()._()._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N bm-G"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}})._().U().j({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"})._()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.zt()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,W,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,ye:l,$e:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,ye:o,fe:a,ge:r,$e:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,V=function(t){const e=t.closest(`#${this.Bt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,ye:h,fe:m,ge:d,$e:u}=n[t.id],b=!!this.Vt.Qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},_=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.Vt.jt){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new P).ne(document.querySelector(`#${this.Bt}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,G=function(){new q(this).zt()},R=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},j=new WeakSet,E=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Z,Q,K,tt=class extends D{constructor(t,i){super(t,i),e(this,Y),this.window=null,this.Bt="bm-N-settings",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"})._()._().Z()._().G({textContent:"Settings take 5 seconds to save."})._().U({class:"bm-E bm-A"},(t,e)=>{this.ve()})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}ve(){i(this,Y,J).call(this,"Pixel Highlight")}};Y=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t})._().Z()._().G({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`})._()._()},Z=new WeakSet,Q=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1},K=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1h")?.childNodes??[];for(let t=0;t{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+kuJDaft726r09zRd1TAn9LLCnq5xKpWLhSaRJcnn8ZuWTyMNYzBiVQejdkbvEPRyKpF4LBYhK8yasmcmQbLRB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Vjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.Bt="bm-w",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.Bt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._()._().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ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7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new P).ne(document.querySelector(`#${this.Bt}`))})})._().q(1,{textContent:this.name})._()._().Z()._().U({class:"bm-E"}).j({id:"bm-q",textContent:"Droplets:"})._().K()._().j({id:"bm-k",textContent:"Next level in..."})._().K()._().j({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id})._()._()._().Z()._().U({class:"bm-E"}).U({class:"bm-E"}).$t({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.He;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}})._().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._()._().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"})._()._().U({class:"bm-E bm-s"}).$t({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Vt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Vt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}})._().$t({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Bt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Vt.Gt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Nt("No file selected!")}})._().$t({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,G).call(this)})._()._().U({class:"bm-E"}).St({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0})._()._().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).$t({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.O.zt()}})._().$t({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Vt;new I(this.name,this.version,e?.schemaVersion,e).zt()}})._().$t({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version).zt()}})._()._().R({textContent:"Made by SwingTheVine",style:"margin-top: auto;"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i,n){e(this,H),this.name=t,this.version=i,this.I=n,this.schemaVersion="2.0.0",this.Oe=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Et=3,this.qt=3,this.Zt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,H:i}}(this.qt),this.Jt=null,this.Be="",this.jt=[],this.Rt=null,this.Ie=!0,this.Pe=null,this.Qt=new Map}async Ae(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Gt(t,e,n){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Oe||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Zt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Rt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.jt=[],this.jt.push(s),this.I.Ot(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.Rt.templates).length),console.log(this.Rt),console.log(this.jt),console.log(JSON.stringify(this.Rt)),await i(this,H,N).call(this)}We(){}async Ve(){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON..."))}async ze(){l("Downloading all templates..."),console.log(this.jt);for(const t of this.jt)await this._e(t),await n(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this._e(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async _e(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Et),r=Math.max(r,u+m.height/this.Et)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Et,m=c*this.Et;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Et,(m-o)*this.Et,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Et,c*this.Et,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.Ie)return t;const n=this.C*this.Et;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.jt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ge:t,Re:t.v[e],M:t.M?.[e],je:[i[0],i[1]],Ee:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ge.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ee[0])*this.Et,a=Number(t.Ee[1])*this.Et;if(0!=this.Qt.size||n||h.drawImage(t.Re,o,a),!s){const e=h.getImageData(o,a,t.Re.width,t.Re.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,H,B).call(this,{Yt:d,Jt:s,Xt:[o,a,t.Re.width,t.Re.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Qt.size||n)&&(console.log("Colors to filter: ",this.Qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Re.width,t.Re.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ge.T.correct&&(t.Ge.T.correct={}),t.Ge.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ye(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,H,O).call(this,t)}Ne(t){this.Ie=t}}(et,it,rt),ct=new class{constructor(t){this.Vt=t,this.Je=!1,this.Le="",this.He=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Vt.Oe=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.He.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.He=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Vt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Ze(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Qe(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Qe(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends tt{constructor(t,i,n){super(t,i),e(this,Z),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t='',e='',n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"})._().Z()._().U({style:"margin-left: 1.5ch;"}).G({id:"bm-Z",textContent:"Choose a preset:"})._().U({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).U({class:"bm-Y"}).j({textContent:"None"})._().$t({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"None")})._()._().U({class:"bm-Y"}).j({textContent:"Cross"})._().$t({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Cross")})._()._().U({class:"bm-Y"}).j({textContent:"X"})._().$t({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"X")})._()._().U({class:"bm-Y"}).j({textContent:"Full"})._().$t({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Full")})._()._()._().G({id:"bm-14",textContent:"Create a custom pattern:"})._().U({class:"bm-1h",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.$t({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,Z,Q).call(this,s,[e,t])})._()}this.window=this._()._()._()}}(et,it,at);rt.V(ht),rt.W(ct);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ye(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.Ze(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,j),this.window=null,this.Bt="bm-g",this.It=document.body,this.oi=n,this.uuid=s}async zt(){if(document.querySelector(`#${this.Bt}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Qe(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.Bt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`})._()._().Z()._().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).$t({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,this.oi);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,0);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"})._().G({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 ${this.name}!`})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"})._().G({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'})._().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`})._().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`})._().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`})._().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`})._().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."})._()._().G({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'})._()._()._()._()._().F(this.It)}}(et,it,1,at?.uuid);t.W(ct),t.zt()}rt.zt(),ct.qe(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index d9fa52e..67b1972 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 9be85dc..2d96276 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.91.42 +// @version 0.91.53 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,$,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,$),this.name=t,this.version=i,this.N=null,this.B=null,this.I="bm-l",this.H=null,this.A=null,this.W=[]}P(t){this.N=t}_(t){this.B=t}U(){return this.W.length>0&&(this.A=this.W.pop()),this}F(t){t?.appendChild(this.H),this.H=null,this.A=null,this.W=[]}G(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"p",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"small",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"span",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"details",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,$,x).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,$,x).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.U(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,$,x).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.U(),e(this,n,i(this,$,x).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"tr",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"th",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"td",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.I,n)}};return e(this,i(this,$,x).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,$,x).call(this,"div"),o=i(this,$,x).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.U();const a=i(this,$,x).call(this,"button",{textContent:n});return this.U(),this.U(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,$,x).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,$,x).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ot(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Bt(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.I,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.I,"Error: "+t,!0)}};$=new WeakSet,x=function(t,e={},n={}){const s=document.createElement(t);this.H?(this.A?.appendChild(s),this.W.push(this.A),this.A=s):(this.H=s,this.A=s);for(const[t,n]of Object.entries(e))i(this,$,y).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,$,y).call(this,s,t,e);return s},y=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.It="bm-m",this.Ht=document.body,this.At=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.At?.scriptVersion,this.schemaVersion=this.At?.schemaVersion,this.Wt=void 0,this.Pt=n,this.zt=s}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.G({id:this.It,class:"bm-N",style:t},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({id:"bm-o",textContent:"Loading template storage status..."}).U().U().G({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"}).U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Pt.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.Wt="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.Wt="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.Wt="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.Wt="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Pt)}.
Wplace was last updated on ${l}.${"Good"!=this.Wt?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.Wt&&(c.G({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.yt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.zt.Ut().then(()=>{e.disabled=!1})}}).U()),"Poor"!=this.Wt&&"Bad"!=this.Wt||c.yt({textContent:`Update template storage to ${this.Pt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}}).U(),c.U().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.At?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.It} .bm-A`),i=new D(this.name,this.version);i.G({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.zt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.G({class:"bm-E bm-x"}).G({class:"bm-x",style:"flex-direction: column; gap: 0;"}).G({class:"bm-1",textContent:h||"šŸ–¼ļø"}).U().j({textContent:`#${m}`}).U().U().G({class:"bm-x bm-0"}).q(3,{textContent:r}).U().Y({textContent:`Uploaded by user #${u}`}).U().Y({textContent:`Coordinates: ${l.join(", ")}`}).U().Y({textContent:`Total Pixels: ${b}`}).U().U().U()}}i.U().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.It} .bm-h`);t.innerHTML="",new D(this.name,this.version).G({class:"bm-E"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Status"}).U().R({textContent:"Updating template storage. Please wait..."}).U().U().U().F(t)}GM_deleteValue("bmCoords");const e=this.At?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.zt.Gt(t);await this.zt.Rt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.It}`).remove(),new L(this.name,this.version,this.Pt,this.zt)._t())};var O,N,B,I,H=L;O=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.jt))},B=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new H(this.name,this.version,this.schemaVersion,this)._t(),this.Et=await async function({C:t,Yt:i,Et:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.Et?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.Et),console.log("^^^ This ^^^")}}return n}({C:this.C,Yt:this.Yt,Et:this.Et})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Zt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Zt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const $=d.get(w);d.set(w,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var A=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},W=class extends HTMLElement{};customElements.define("confetti-piece",W);var P,z,_,U,F,G,R,j,E,Y,J,V,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.It="bm-i",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Credits"}).U().U().Z().U().G({class:"bm-E bm-A"}).Y({role:"img","aria-label":this.name}).Y({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).U().U().K().U().Z().U().K().U().Y({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).U().K().U().Y({innerHTML:'The Blue Marble Website is made by crqch.'}).U().K().U().Y({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).U().K().U().Y({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).U().K().U().Y({textContent:"Special Thanks:"}).U().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).U().ht({innerHTML:'nof, darkness for creating similar userscripts!'}).U().ht({innerHTML:'Wonda for the Blue Marble banner image!'}).U().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'}).U().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).U().ht({innerHTML:'Nomad and Gustav for the tutorials!'}).U().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).U().ht({innerHTML:'Force Network for hosting the telemetry server!'}).U().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).U().U().K().U().Y({innerHTML:'Donators:'}).U().lt().ht({textContent:"Espresso"}).U().ht({textContent:"BEST FAN"}).U().ht({textContent:"Jack"}).U().ht({textContent:"raiken_au"}).U().ht({textContent:"Jacob"}).U().ht({textContent:"StupidOne"}).U().ht({textContent:"2 Anonymous Supporters"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,P),this.window=null,this.It="bm-p",this.se="bm-y",this.Ht=document.body,this.zt=t.N?.zt,this.oe='',this.ae='';const{palette:i,O:n}=this.zt.Qt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}_t(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).G({class:"bm-E"}).Y({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).U().K().U().Y({id:"bm-9",innerHTML:"Correct Pixels: ???"}).U().K().U().Y({id:"bm-f",innerHTML:"Total Pixels: ???"}).U().K().U().Y({id:"bm-4",innerHTML:"Complete: ??? (???)"}).U().K().U().Y({id:"bm-5",innerHTML:"??? ???"}).U().U().G({class:"bm-E"}).R({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.It} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,P,_).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).U().U().U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.It}`))return void document.querySelector(`#${this.It}`).remove();this.window=this.G({id:this.It,class:"bm-N bm-G"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}}).U().G().Y({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).U().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove(),this._t()},e.ontouchend=()=>{e.click()}}).U().yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"}).U().U().Z().U().G({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).yt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!1)}).U().yt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}}).U().yt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,P,U).call(this,!0)}).U().U().G({class:"bm-E bm-A"}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`);const t=document.querySelector(`#${this.It} .bm-E.bm-A`);i(this,P,z).call(this,t),i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,P,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,$e:r,xe:l,ye:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,$e:s,xe:o,fe:a,ge:r,ye:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.It} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,P,_).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};P=new WeakSet,z=function(t){const e=t.closest(`#${this.It}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.G({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,$e:c,xe:h,fe:m,ge:d,ye:u}=n[t.id],b=!!this.zt.Zt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.G({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).G({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).yt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},U=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.zt.Et){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new A).ne(document.querySelector(`#${this.It}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},G=new WeakSet,R=function(){new q(this)._t()},j=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},E=new WeakSet,Y=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Q,Z,K=class extends D{constructor(t,i){super(t,i),e(this,J),this.window=null,this.It="bm-N-settings",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?document.querySelector(`#${this.It}`).remove():(this.window=this.G({id:this.It,class:"bm-N"}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().G({class:"bm-x"}).yt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.It}`)?.remove()},e.ontouchend=()=>{e.click()}}).U().U().U().G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:"Settings"}).U().U().Z().U().G({class:"bm-E bm-A"},(t,e)=>{this.ve()}).U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}ve(){i(this,J,V).call(this,"Pixel Highlight")}};J=new WeakSet,V=function(t){this.window=this.G({class:"bm-E"}).q(2,{textContent:t}).U().Z().U().R({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).U().U()},Q=new WeakSet,Z=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1};var tt=GM_info.script.name.toString(),et=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",tt),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 it=GM_getResourceText("CSS-BM-File");GM_addStyle(it);var nt,st="robotoMonoInjectionPoint";st.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(st)):((nt=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",nt.rel="preload",nt.as="style",nt.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(nt));var ot=JSON.parse(GM_getValue("bmUserSettings","{}")),at=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,G),this.window=null,this.It="bm-w",this.Ht=document.body}_t(){document.querySelector(`#${this.It}`)?this.Nt("Main window already exists!"):(this.window=this.G({id:this.It,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().yt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}}).U().G().U().U().G({class:"bm-h"}).G({class:"bm-E"}).X({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new A).ne(document.querySelector(`#${this.It}`))})}).U().q(1,{textContent:this.name}).U().U().Z().U().G({class:"bm-E"}).Y({id:"bm-q",textContent:"Droplets:"}).U().K().U().Y({id:"bm-k",textContent:"Next level in..."}).U().K().U().Y({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id}).U().U().U().Z().U().G({class:"bm-E"}).G({class:"bm-E"}).yt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.Oe;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).U().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,G,j).call(this,t,e,n))}).U().U().G({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).U().U().G({class:"bm-E bm-s"}).yt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.zt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Bt("Disabled templates!")):(t.N?.zt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Bt("Enabled templates!")),e.disabled=!1}}).U().yt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.It} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.zt.Rt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Bt("Drew to canvas!")):t.Nt("No file selected!")}}).U().yt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,G,R).call(this)}).U().U().G({class:"bm-E"}).St({id:this.I,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).U().U().G({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).G({class:"bm-s"}).yt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.B._t()}}).U().yt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.zt;new H(this.name,this.version,e?.schemaVersion,e)._t()}}).U().yt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).U().yt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version)._t()}}).U().U().j({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).U().U().U().U().U().F(this.Ht),this.Ot(`#${this.It}.bm-N`,`#${this.It} .bm-L`))}}(tt,et)),rt=new class{constructor(t,i,n){e(this,O),this.name=t,this.version=i,this.H=n,this.schemaVersion="2.0.0",this.Be=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Yt=3,this.qt=3,this.Qt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,O:i}}(this.qt),this.Vt=null,this.Ie="",this.Et=[],this.jt=null,this.He=!0,this.Ae=null,this.Zt=new Map}async We(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Rt(t,e,n){this.jt||(this.jt=await this.We(),console.log("Creating JSON...")),this.H.Bt(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Be||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Qt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.jt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.Et=[],this.Et.push(s),this.H.Bt(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.jt.templates).length),console.log(this.jt),console.log(this.Et),console.log(JSON.stringify(this.jt)),await i(this,O,N).call(this)}Pe(){}async ze(){this.jt||(this.jt=await this.We(),console.log("Creating JSON..."))}async _e(){l("Downloading all templates..."),console.log(this.Et);for(const t of this.Et)await this.Ue(t),await n(500)}async Ut(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Ue(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async Ue(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Gt(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Gt(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Yt),r=Math.max(r,u+m.height/this.Yt)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Yt,m=c*this.Yt;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Yt,(m-o)*this.Yt,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Yt,c*this.Yt,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ge(t,e){if(!this.He)return t;const n=this.C*this.Yt;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.Et;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Re:t,je:t.v[e],M:t.M?.[e],Ee:[i[0],i[1]],Ye:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.H.Bt(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.H.Bt(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Re.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ye[0])*this.Yt,a=Number(t.Ye[1])*this.Yt;if(0!=this.Zt.size||n||h.drawImage(t.je,o,a),!s){const e=h.getImageData(o,a,t.je.width,t.je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,O,I).call(this,{Jt:d,Vt:s,Xt:[o,a,t.je.width,t.je.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Zt.size||n)&&(console.log("Colors to filter: ",this.Zt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.je.width,t.je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Re.T.correct&&(t.Re.T.correct={}),t.Re.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Je(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,O,B).call(this,t)}Ne(t){this.He=t}}(tt,et,at),lt=new class{constructor(t){this.zt=t,this.Ve=!1,this.Le="",this.Oe=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.zt.Be=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Oe.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Oe=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.zt.Ge(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Ve="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Qe(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Ze(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Ze(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(rt),ct=new class extends K{constructor(t,i,n){super(t,i),e(this,Q),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.G({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"}).U().Z().U().G({style:"margin-left: 1.5ch;"}).R({id:"bm-12",textContent:"Create a custom pattern:"}).U().G({class:"bm-1h",role:"group","aria-labelledby":"bm-12"});for(let e=-1;e<=1;e++)for(let n=-1;n<=1;n++){const s=t[t.findIndex(([,t,i])=>t==n&&i==e)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.yt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(t,s)=>{s.onclick=()=>i(this,Q,Z).call(this,s,[n,e])}).U()}this.window=this.U().U().U()}}(tt,et,ot);at._(ct),at.P(lt);var ht=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(ht),rt.Je(ht),console.log(ot),console.log(Object.keys(ot).length),0==Object.keys(ot).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>lt.Qe(et),18e5);var mt=ot?.telemetry;if(console.log(`Telemetry is ${!(null==mt)}`),null==mt||mt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,E),this.window=null,this.It="bm-g",this.Ht=document.body,this.oi=n,this.uuid=s}async _t(){if(document.querySelector(`#${this.It}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Ze(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.G({id:this.It,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).G({class:"bm-h"}).G({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`}).U().U().Z().U().G({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).yt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,this.oi);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,E,Y).call(this,0);const t=document.getElementById(this.It);t?.remove()}}).U().yt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).U().U().G({class:"bm-E bm-A"}).G({class:"bm-E"}).q(2,{textContent:"Legal"}).U().R({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 ${this.name}!`}).U().U().Z().U().G({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"}).U().R({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).U().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).U().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).U().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).U().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).U().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).U().U().R({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).U().U().U().U().U().F(this.Ht)}}(tt,et,1,ot?.uuid);t.P(lt),t._t()}at._t(),lt.qe(at),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${tt}%c (${et}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.O=null,this.B="bm-l",this.I=null,this.P=null,this.A=[]}W(t){this.N=t}V(t){this.O=t}_(){return this.A.length>0&&(this.P=this.A.pop()),this}F(t){t?.appendChild(this.I),this.I=null,this.P=null,this.A=[]}U(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"p",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"small",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"span",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,y).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,y).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this._(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this._(),e(this,n,i(this,x,y).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"th",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"td",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.B,n)}};return e(this,i(this,x,y).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,y).call(this,"div"),o=i(this,x,y).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this._();const a=i(this,x,y).call(this,"button",{textContent:n});return this._(),this._(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,y).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ht(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.B,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.B,"Error: "+t,!0)}};x=new WeakSet,y=function(t,e={},n={}){const s=document.createElement(t);this.I?(this.P?.appendChild(s),this.A.push(this.P),this.P=s):(this.I=s,this.P=s);for(const[t,n]of Object.entries(e))i(this,x,$).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,$).call(this,s,t,e);return s},$=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.Bt="bm-m",this.It=document.body,this.Pt=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.Pt?.scriptVersion,this.schemaVersion=this.Pt?.schemaVersion,this.At=void 0,this.Wt=n,this.Vt=s}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.Bt,class:"bm-N",style:t},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({id:"bm-o",textContent:"Loading template storage status..."})._()._().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"})._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Wt.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.At="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.At="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.At="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.At="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Wt)}.
Wplace was last updated on ${l}.${"Good"!=this.At?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.At&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.$t({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Vt._t().then(()=>{e.disabled=!1})}})._()),"Poor"!=this.At&&"Bad"!=this.At||c.$t({textContent:`Update template storage to ${this.Wt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}})._(),c._().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.Pt?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Bt} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Vt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"})._().R({textContent:`#${m}`})._()._().U({class:"bm-x bm-0"}).q(3,{textContent:r})._().j({textContent:`Uploaded by user #${u}`})._().j({textContent:`Coordinates: ${l.join(", ")}`})._().j({textContent:`Total Pixels: ${b}`})._()._()._()}}i._().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Bt} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({textContent:"Updating template storage. Please wait..."})._()._()._().F(t)}GM_deleteValue("bmCoords");const e=this.Pt?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.Vt.Ut(t);await this.Vt.Gt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Bt}`).remove(),new L(this.name,this.version,this.Wt,this.Vt).zt())};var H,N,O,B,I=L;H=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Rt))},O=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new I(this.name,this.version,this.schemaVersion,this).zt(),this.jt=await async function({C:t,Et:i,jt:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.jt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.jt),console.log("^^^ This ^^^")}}return n}({C:this.C,Et:this.Et,jt:this.jt})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Qt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Qt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var P=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},A=class extends HTMLElement{};customElements.define("confetti-piece",A);var W,V,z,_,F,U,G,R,j,E,Y,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.Bt="bm-i",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"})._()._().Z()._().U({class:"bm-E bm-A"}).j({role:"img","aria-label":this.name}).j({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"})._()._().K()._().Z()._().K()._().j({textContent:'"Blue Marble" userscript is made by SwingTheVine.'})._().K()._().j({innerHTML:'The Blue Marble Website is made by crqch.'})._().K()._().j({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`})._().K()._().j({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'})._().K()._().j({textContent:"Special Thanks:"})._().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."})._().ht({innerHTML:'nof, darkness for creating similar userscripts!'})._().ht({innerHTML:'Wonda for the Blue Marble banner image!'})._().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'})._().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'})._().ht({innerHTML:'Nomad and Gustav for the tutorials!'})._().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'})._().ht({innerHTML:'Force Network for hosting the telemetry server!'})._().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'})._()._().K()._().j({innerHTML:'Donators:'})._().lt().ht({textContent:"Espresso"})._().ht({textContent:"BEST FAN"})._().ht({textContent:"Jack"})._().ht({textContent:"raiken_au"})._().ht({textContent:"Jacob"})._().ht({textContent:"StupidOne"})._().ht({textContent:"2 Anonymous Supporters"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Bt="bm-p",this.se="bm-y",this.It=document.body,this.Vt=t.N?.Vt,this.oe='',this.ae='';const{palette:i,H:n}=this.Vt.Zt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).j({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"})._().K()._().j({id:"bm-9",innerHTML:"Correct Pixels: ???"})._().K()._().j({id:"bm-f",innerHTML:"Total Pixels: ???"})._().K()._().j({id:"bm-4",innerHTML:"Complete: ??? (???)"})._().K()._().j({id:"bm-5",innerHTML:"??? ???"})._()._().U({class:"bm-E"}).G({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Bt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,W,z).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}})._()._()._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N bm-G"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}})._().U().j({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"})._()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.zt()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,W,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,ye:l,$e:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,ye:o,fe:a,ge:r,$e:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,V=function(t){const e=t.closest(`#${this.Bt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,ye:h,fe:m,ge:d,$e:u}=n[t.id],b=!!this.Vt.Qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},_=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.Vt.jt){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new P).ne(document.querySelector(`#${this.Bt}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,G=function(){new q(this).zt()},R=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},j=new WeakSet,E=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Z,Q,K,tt=class extends D{constructor(t,i){super(t,i),e(this,Y),this.window=null,this.Bt="bm-N-settings",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"})._()._().Z()._().G({textContent:"Settings take 5 seconds to save."})._().U({class:"bm-E bm-A"},(t,e)=>{this.ve()})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}ve(){i(this,Y,J).call(this,"Pixel Highlight")}};Y=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t})._().Z()._().G({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`})._()._()},Z=new WeakSet,Q=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1},K=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1h")?.childNodes??[];for(let t=0;t{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.Bt="bm-w",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.Bt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._()._().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new P).ne(document.querySelector(`#${this.Bt}`))})})._().q(1,{textContent:this.name})._()._().Z()._().U({class:"bm-E"}).j({id:"bm-q",textContent:"Droplets:"})._().K()._().j({id:"bm-k",textContent:"Next level in..."})._().K()._().j({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id})._()._()._().Z()._().U({class:"bm-E"}).U({class:"bm-E"}).$t({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.He;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}})._().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._()._().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"})._()._().U({class:"bm-E bm-s"}).$t({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Vt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Vt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}})._().$t({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Bt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Vt.Gt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Nt("No file selected!")}})._().$t({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,G).call(this)})._()._().U({class:"bm-E"}).St({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0})._()._().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).$t({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.O.zt()}})._().$t({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Vt;new I(this.name,this.version,e?.schemaVersion,e).zt()}})._().$t({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version).zt()}})._()._().R({textContent:"Made by SwingTheVine",style:"margin-top: auto;"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i,n){e(this,H),this.name=t,this.version=i,this.I=n,this.schemaVersion="2.0.0",this.Oe=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Et=3,this.qt=3,this.Zt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,H:i}}(this.qt),this.Jt=null,this.Be="",this.jt=[],this.Rt=null,this.Ie=!0,this.Pe=null,this.Qt=new Map}async Ae(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Gt(t,e,n){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Oe||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Zt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Rt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.jt=[],this.jt.push(s),this.I.Ot(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.Rt.templates).length),console.log(this.Rt),console.log(this.jt),console.log(JSON.stringify(this.Rt)),await i(this,H,N).call(this)}We(){}async Ve(){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON..."))}async ze(){l("Downloading all templates..."),console.log(this.jt);for(const t of this.jt)await this._e(t),await n(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this._e(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async _e(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Et),r=Math.max(r,u+m.height/this.Et)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Et,m=c*this.Et;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Et,(m-o)*this.Et,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Et,c*this.Et,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.Ie)return t;const n=this.C*this.Et;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.jt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ge:t,Re:t.v[e],M:t.M?.[e],je:[i[0],i[1]],Ee:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ge.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ee[0])*this.Et,a=Number(t.Ee[1])*this.Et;if(0!=this.Qt.size||n||h.drawImage(t.Re,o,a),!s){const e=h.getImageData(o,a,t.Re.width,t.Re.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,H,B).call(this,{Yt:d,Jt:s,Xt:[o,a,t.Re.width,t.Re.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Qt.size||n)&&(console.log("Colors to filter: ",this.Qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Re.width,t.Re.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ge.T.correct&&(t.Ge.T.correct={}),t.Ge.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ye(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,H,O).call(this,t)}Ne(t){this.Ie=t}}(et,it,rt),ct=new class{constructor(t){this.Vt=t,this.Je=!1,this.Le="",this.He=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Vt.Oe=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.He.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.He=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Vt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Ze(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Qe(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Qe(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends tt{constructor(t,i,n){super(t,i),e(this,Z),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t='',e='',n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"})._().Z()._().U({style:"margin-left: 1.5ch;"}).G({id:"bm-Z",textContent:"Choose a preset:"})._().U({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).U({class:"bm-Y"}).j({textContent:"None"})._().$t({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"None")})._()._().U({class:"bm-Y"}).j({textContent:"Cross"})._().$t({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Cross")})._()._().U({class:"bm-Y"}).j({textContent:"X"})._().$t({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"X")})._()._().U({class:"bm-Y"}).j({textContent:"Full"})._().$t({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Full")})._()._()._().G({id:"bm-14",textContent:"Create a custom pattern:"})._().U({class:"bm-1h",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.$t({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,Z,Q).call(this,s,[e,t])})._()}this.window=this._()._()._()}}(et,it,at);rt.V(ht),rt.W(ct);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ye(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.Ze(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,j),this.window=null,this.Bt="bm-g",this.It=document.body,this.oi=n,this.uuid=s}async zt(){if(document.querySelector(`#${this.Bt}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Qe(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.Bt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`})._()._().Z()._().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).$t({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,this.oi);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,0);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"})._().G({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 ${this.name}!`})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"})._().G({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'})._().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`})._().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`})._().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`})._().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`})._().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."})._()._().G({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'})._()._()._()._()._().F(this.It)}}(et,it,1,at?.uuid);t.W(ct),t.zt()}rt.zt(),ct.qe(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 578dc1e..6ffca3f 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 adfc9d3..bec80f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.42", + "version": "0.91.53", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.42", + "version": "0.91.53", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 93e2368..6377127 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.42", + "version": "0.91.53", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 7011d10..54ae7eb 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.91.42 +// @version 0.91.53 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/WindowSettings.css b/src/WindowSettings.css index cec6c94..6b87be7 100644 --- a/src/WindowSettings.css +++ b/src/WindowSettings.css @@ -1,5 +1,40 @@ /* @since 0.91.22 */ +/* Highlight preset container */ +#bm-window-settings .bm-highlight-preset-container { + display: flex; + flex-direction: column; +} + +/* Highlight preset title */ +#bm-window-settings .bm-highlight-preset-container span { + width: fit-content; + margin: auto; + font-size: 0.7em; +} + +/* Highlight preset button */ +#bm-window-settings .bm-highlight-preset-container button { + width: fit-content; + padding: 0; + border-radius: 0; +} + +/* Highlight preset SVG */ +#bm-window-settings .bm-highlight-preset-container svg { + stroke: #333; + stroke-width: 0.02px; + width: 100%; + min-width: 1ch; + max-width: 10ch; +} + +/* Highlight preset SVG on hover/focus */ +#bm-window-settings .bm-highlight-preset-container button:hover svg, +#bm-window-settings .bm-highlight-preset-container button:focus svg { + opacity: 0.9; +} + /* Highlight pattern container */ #bm-window-settings .bm-highlight-grid { display: grid; diff --git a/src/WindowSettings.js b/src/WindowSettings.js index 78cc545..168bbc9 100644 --- a/src/WindowSettings.js +++ b/src/WindowSettings.js @@ -54,6 +54,7 @@ export default class WindowSettings extends Overlay { .addHeader(1, {'textContent': 'Settings'}).buildElement() .buildElement() .addHr().buildElement() + .addP({'textContent': 'Settings take 5 seconds to save.'}).buildElement() .addDiv({'class': 'bm-container bm-scrollable'}, (instance, div) => { // Each category in the settings window this.buildHighlight(); diff --git a/src/settingsManager.js b/src/settingsManager.js index 457e848..a161771 100644 --- a/src/settingsManager.js +++ b/src/settingsManager.js @@ -1,7 +1,9 @@ +import { sleep } from "./utils"; import WindowSettings from "./WindowSettings"; /** SettingsManager class for handling user settings and making them persist between sessions. * Logic for {@link WindowSettings} is managed here. + * "Flags" should follow the same styling as `.classList()` and should not contain spaces. * @class SettingsManager * @since 0.91.11 * @examples @@ -60,6 +62,9 @@ export default class SettingsManager extends WindowSettings { */ buildHighlight() { + const highlightPresetOff = ''; + const highlightPresetCross = ''; + // Obtains user settings for highlight from storage, or the default array if nothing was found const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; @@ -68,6 +73,25 @@ export default class SettingsManager extends WindowSettings { .addHeader(2, {'textContent': 'Pixel Highlight'}).buildElement() .addHr().buildElement() .addDiv({'style': 'margin-left: 1.5ch;'}) + .addP({'id': 'bm-highlight-preset-label', 'textContent': 'Choose a preset:'}).buildElement() + .addDiv({'class': 'bm-container bm-flex-center', 'style': 'width: 50%;', 'role': 'group', 'aria-labelledby': 'bm-highlight-preset-label'}) + .addDiv({'class': 'bm-highlight-preset-container'}) + .addSpan({'textContent': 'None'}).buildElement() + .addButton({'innerHTML': highlightPresetOff, 'aria-label': 'Preset "None"'}, (instance, button) => {button.onclick = () => this.#updateHighlightToPreset('None')}).buildElement() + .buildElement() + .addDiv({'class': 'bm-highlight-preset-container'}) + .addSpan({'textContent': 'Cross'}).buildElement() + .addButton({'innerHTML': highlightPresetCross, 'aria-label': 'Preset "Cross Shape"'}, (instance, button) => {button.onclick = () => this.#updateHighlightToPreset('Cross')}).buildElement() + .buildElement() + .addDiv({'class': 'bm-highlight-preset-container'}) + .addSpan({'textContent': 'X'}).buildElement() + .addButton({'innerHTML': highlightPresetCross.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"', 'd="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'), 'aria-label': 'Preset "X Shape"'}, (instance, button) => {button.onclick = () => this.#updateHighlightToPreset('X')}).buildElement() + .buildElement() + .addDiv({'class': 'bm-highlight-preset-container'}) + .addSpan({'textContent': 'Full'}).buildElement() + .addButton({'innerHTML': highlightPresetOff.replace('#fff', '#2f4f4f'), 'aria-label': 'Preset "Full Template"'}, (instance, button) => {button.onclick = () => this.#updateHighlightToPreset('Full')}).buildElement() + .buildElement() + .buildElement() .addP({'id': 'bm-highlight-grid-label', 'textContent': 'Create a custom pattern:'}).buildElement() .addDiv({'class': 'bm-highlight-grid', 'role': 'group', 'aria-labelledby': 'bm-highlight-grid-label'}); // We leave this open so we can add buttons @@ -101,6 +125,7 @@ export default class SettingsManager extends WindowSettings { * Additionally, it will update user settings with the new selection. * @param {HTMLButtonElement} button - The button that was pressed * @param {Array} coords - The relative coordinates of the button + * @since 0.91.46 */ #updateHighlightSettings(button, coords) { @@ -178,4 +203,87 @@ export default class SettingsManager extends WindowSettings { button.disabled = false; // Reenables the button since we are done } + + /** Changes the highlight buttons to the clicked preset. + * @param {string} preset - The name of the preset + * @since 0.91.49 + */ + async #updateHighlightToPreset(preset) { + + // Obtains all preset buttons as a NodeList + const presetButtons = document.querySelectorAll('.bm-highlight-preset-container button'); + + // For each preset... + for (const button of presetButtons) { + button.disabled = true; // Disables the button + } + + let presetArray = [0,0,0,0,2,0,0,0,0]; // The preset "None" + + // Selects the preset passed in + switch (preset) { + case 'Cross': + presetArray = [0,1,0,1,2,1,0,1,0]; // The preset "Cross" + break; + case 'X': + presetArray = [1,0,1,0,2,0,1,0,1]; // The preset "X" + break; + case 'Full': + presetArray = [2,2,2,2,2,2,2,2,2]; // The preset "Full" + break; + } + + // Obtains the buttons to click as a NodeList + const buttons = document.querySelector('.bm-highlight-grid')?.childNodes ?? []; + + // For each button... + for (let buttonIndex = 0; buttonIndex < buttons.length; buttonIndex++) { + + const button = buttons[buttonIndex]; // Gets the current button to check + + // Gets the state of the button as a number + let buttonState = button.dataset['status']; + buttonState = (buttonState != 'Disabled') ? ((buttonState != 'Incorrect') ? 2 : 1) : 0; + + // Finds the difference between the preset and the button + let buttonStateDelta = presetArray[buttonIndex] - buttonState; + + // Since there is no difference, the button matches, so we skip it + if (buttonStateDelta == 0) {continue;} + + // Makes the difference positive + buttonStateDelta += (buttonStateDelta < 0) ? 3 : 0; + + /** At this point, these are the possible options: + * 1. The preset is zero and the button is two (-2) so we need to click once + * 2. The preset is one and the button is two (-1) so we need to click twice + * 3. The preset is one ahead of the button (1) so we need to click once + * 4. The preset is two ahead of the button (2) so we need to click twice + * Due to the addition of three in the line above, options 1 & 3 combine, and options 2 & 4 combine. + * Now the only options we have are: + * 1. If (1) then click once + * 2. If (2) then click twice + * Also due to the addition of three in the line above, our two options are POSITIVE numbers + */ + + button.click(); // Clicks once + + // Clicks a second time if needed + if (buttonStateDelta == 2) { + + // For 0.2 seconds, or when the button is NOT disabled, wait for 10 milliseconds before attempting to continue + for (let timeWaited = 0; timeWaited < 200; timeWaited += 10) { + if (!button.disabled) {break;} // Breaks early once the button is enabled + await sleep(10); + } + + button.click(); // Clicks again + } + } + + // For each preset... + for (const button of presetButtons) { + button.disabled = false; // Re-enables the button + } + } } \ No newline at end of file diff --git a/src/utils.js b/src/utils.js index fa917f0..a610b3c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -15,7 +15,7 @@ export function getWplaceVersion() { /** Halts execution of this specific userscript, for the specified time. * This will not block the thread. - * @param {number} - Time to wait in milliseconds + * @param {number} time - Time to wait in milliseconds * @since 0.88.483 * @returns {Promise} Promise of a setTimeout() */ From 4099e3f779e18ac383c868f4f0408971db3f1dc2 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Wed, 4 Mar 2026 22:59:51 -0500 Subject: [PATCH 10/15] Highlighting done --- dist/BlueMarble-For-GreasyFork.user.js | 2557 ++++++++++++------------ 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/main.js | 5 +- src/templateManager.js | 106 +- 10 files changed, 1405 insertions(+), 1283 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index db7704a..4f164ff 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.91.53 +// @version 0.91.59 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -317,196 +317,6 @@ { "id": 63, "premium": true, "name": "Light Stone", "rgb": [205, 197, 158] } ]; - // src/Template.js - var _Template_instances, calculateTotalPixelsFromImageData_fn; - var Template = class { - /** The constructor for the {@link Template} class with enhanced pixel tracking. - * @param {Object} [params={}] - Object containing all optional parameters - * @param {string} [params.displayName='My template'] - The display name of the template - * @param {number} [params.sortID=0] - The sort number of the template for rendering priority - * @param {string} [params.authorID=''] - The user ID of the person who exported the template (prevents sort ID collisions) - * @param {string} [params.url=''] - The URL to the source image - * @param {File} [params.file=null] - The template file (pre-processed File or processed bitmap) - * @param {Array} [params.coords=null] - The coordinates of the top left corner as (tileX, tileY, pixelX, pixelY) - * @param {Object} [params.chunked=null] - The affected chunks of the template, and their template for each chunk as a bitmap - * @param {Object} [params.chunked32={}] - The affected chunks of the template, and their template for each chunk as a Uint32Array - * @param {number} [params.tileSize=1000] - The size of a tile in pixels (assumes square tiles) - * @param {Object} [params.pixelCount={total:0, colors:Map}] - Total number of pixels in the template (calculated automatically during processing) - * @since 0.65.2 - */ - constructor({ - displayName = "My template", - sortID = 0, - authorID = "", - url = "", - file = null, - coords: coords2 = null, - chunked = null, - chunked32 = {}, - tileSize = 1e3 - } = {}) { - __privateAdd(this, _Template_instances); - this.displayName = displayName; - this.sortID = sortID; - this.authorID = authorID; - this.url = url; - this.file = file; - this.coords = coords2; - this.chunked = chunked; - this.chunked32 = chunked32; - this.tileSize = tileSize; - this.pixelCount = { total: 0, colors: /* @__PURE__ */ new Map() }; - } - /** Creates chunks of the template for each tile. - * @param {Number} tileSize - Size of the tile as determined by templateManager - * @param {Object} paletteBM - An collection of Uint32Arrays containing the palette BM uses - * @returns {Object} Collection of template bitmaps & buffers organized by tile coordinates - * @since 0.65.4 - */ - async createTemplateTiles(tileSize, paletteBM) { - console.log("Template coordinates:", this.coords); - const shreadSize = 3; - const bitmap = await createImageBitmap(this.file); - const imageWidth = bitmap.width; - const imageHeight = bitmap.height; - this.tileSize = tileSize; - const templateTiles = {}; - const templateTilesBuffers = {}; - const canvas = new OffscreenCanvas(this.tileSize, this.tileSize); - const context = canvas.getContext("2d", { willReadFrequently: true }); - canvas.width = imageWidth; - canvas.height = imageHeight; - context.imageSmoothingEnabled = false; - context.drawImage(bitmap, 0, 0); - let timer = Date.now(); - const totalPixelMap = __privateMethod(this, _Template_instances, calculateTotalPixelsFromImageData_fn).call(this, context.getImageData(0, 0, imageWidth, imageHeight), paletteBM); - console.log(`Calculating total pixels took ${(Date.now() - timer) / 1e3} seconds`); - let totalPixels = 0; - const transparentColorID = 0; - for (const [color, total] of totalPixelMap) { - if (color == transparentColorID) { - continue; - } - totalPixels += total; - } - this.pixelCount = { total: totalPixels, colors: totalPixelMap }; - timer = Date.now(); - const canvasMask = new OffscreenCanvas(3, 3); - const contextMask = canvasMask.getContext("2d"); - contextMask.clearRect(0, 0, 3, 3); - contextMask.fillStyle = "white"; - contextMask.fillRect(1, 1, 1, 1); - for (let pixelY = this.coords[3]; pixelY < imageHeight + this.coords[3]; ) { - const drawSizeY = Math.min(this.tileSize - pixelY % this.tileSize, imageHeight - (pixelY - this.coords[3])); - console.log(`Math.min(${this.tileSize} - (${pixelY} % ${this.tileSize}), ${imageHeight} - (${pixelY - this.coords[3]}))`); - for (let pixelX = this.coords[2]; pixelX < imageWidth + this.coords[2]; ) { - console.log(`Pixel X: ${pixelX} -Pixel Y: ${pixelY}`); - const drawSizeX = Math.min(this.tileSize - pixelX % this.tileSize, imageWidth - (pixelX - this.coords[2])); - console.log(`Math.min(${this.tileSize} - (${pixelX} % ${this.tileSize}), ${imageWidth} - (${pixelX - this.coords[2]}))`); - console.log(`Draw Size X: ${drawSizeX} -Draw Size Y: ${drawSizeY}`); - const canvasWidth = drawSizeX * shreadSize; - const canvasHeight = drawSizeY * shreadSize; - canvas.width = canvasWidth; - canvas.height = canvasHeight; - console.log(`Draw X: ${drawSizeX} -Draw Y: ${drawSizeY} -Canvas Width: ${canvasWidth} -Canvas Height: ${canvasHeight}`); - context.imageSmoothingEnabled = false; - console.log(`Getting X ${pixelX}-${pixelX + drawSizeX} -Getting Y ${pixelY}-${pixelY + drawSizeY}`); - context.clearRect(0, 0, canvasWidth, canvasHeight); - context.drawImage( - bitmap, - // Bitmap image to draw - pixelX - this.coords[2], - // Coordinate X to draw *from* - pixelY - this.coords[3], - // Coordinate Y to draw *from* - drawSizeX, - // X width to draw *from* - drawSizeY, - // Y height to draw *from* - 0, - // Coordinate X to draw *at* - 0, - // Coordinate Y to draw *at* - drawSizeX * shreadSize, - // X width to draw *at* - drawSizeY * shreadSize - // Y height to draw *at* - ); - context.save(); - context.globalCompositeOperation = "destination-in"; - context.fillStyle = context.createPattern(canvasMask, "repeat"); - context.fillRect(0, 0, canvasWidth, canvasHeight); - context.restore(); - const imageData = context.getImageData(0, 0, canvasWidth, canvasHeight); - console.log(`Shreaded pixels for ${pixelX}, ${pixelY}`, imageData); - const templateTileName = `${(this.coords[0] + Math.floor(pixelX / 1e3)).toString().padStart(4, "0")},${(this.coords[1] + Math.floor(pixelY / 1e3)).toString().padStart(4, "0")},${(pixelX % 1e3).toString().padStart(3, "0")},${(pixelY % 1e3).toString().padStart(3, "0")}`; - this.chunked32[templateTileName] = new Uint32Array(imageData.data.buffer); - templateTiles[templateTileName] = await createImageBitmap(canvas); - const canvasBlob = await canvas.convertToBlob(); - const canvasBuffer = await canvasBlob.arrayBuffer(); - const canvasBufferBytes = Array.from(new Uint8Array(canvasBuffer)); - templateTilesBuffers[templateTileName] = uint8ToBase64(canvasBufferBytes); - console.log(templateTiles); - pixelX += drawSizeX; - } - pixelY += drawSizeY; - } - console.log(`Parsing template took ${(Date.now() - timer) / 1e3} seconds`); - console.log("Template Tiles: ", templateTiles); - console.log("Template Tiles Buffers: ", templateTilesBuffers); - console.log("Template Tiles Uint32Array: ", this.chunked32); - return { templateTiles, templateTilesBuffers }; - } - /** Calculates top left coordinate of template. - * It uses `Template.chunked` to update `Template.coords` - * @since 0.88.504 - */ - calculateCoordsFromChunked() { - let topLeftCoord = [Infinity, Infinity, Infinity, Infinity]; - const tileKeys = Object.keys(this.chunked).sort(); - tileKeys.forEach((key, index) => { - const [tileX, tileY, pixelX, pixelY] = key.split(",").map(Number); - if (tileY < topLeftCoord[1] || tileY == topLeftCoord[1] && tileX < topLeftCoord[0]) { - topLeftCoord = [tileX, tileY, pixelX, pixelY]; - } - }); - this.coords = topLeftCoord; - } - }; - _Template_instances = new WeakSet(); - /** Calculates the total pixels for each color for the image. - * - * @param {ImageData} imageData - The pre-shreaded image "casted" onto a canvas - * @param {Object} paletteBM - The palette Blue Marble uses for colors - * @param {Number} paletteTolerance - How close an RGB color has to be in order to be considered a palette color. A tolerance of "3" means the sum of the RGB can be up to 3 away from the actual value. - * @returns {Map} A map where the key is the color ID, and the value is the total pixels for that color ID - * @since 0.88.6 - */ - calculateTotalPixelsFromImageData_fn = function(imageData, paletteBM) { - const buffer32Arr = new Uint32Array(imageData.data.buffer); - const { palette: _, LUT: lookupTable } = paletteBM; - const _colorpalette = /* @__PURE__ */ new Map(); - for (let pixelIndex = 0; pixelIndex < buffer32Arr.length; pixelIndex++) { - const pixel = buffer32Arr[pixelIndex]; - let bestColorID = -2; - if (pixel >>> 24 == 0) { - bestColorID = 0; - } else { - bestColorID = lookupTable.get(pixel) ?? -2; - } - const colorIDcount = _colorpalette.get(bestColorID); - _colorpalette.set(bestColorID, colorIDcount ? colorIDcount + 1 : 1); - } - console.log(_colorpalette); - return _colorpalette; - }; - // src/Overlay.js var _Overlay_instances, createElement_fn, applyAttribute_fn; var Overlay = class { @@ -1727,898 +1537,417 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); } }; - // src/WindowWizard.js - var _WindowWizard_instances, displaySchemaHealth_fn, displayTemplateList_fn, convertSchema_1_x_x_To_2_x_x_fn; - var _WindowWizard = class _WindowWizard extends Overlay { - /** Constructor for the Template Wizard window + // src/WindowSettings.js + var _WindowSettings_instances, errorOverrideFailure_fn; + var WindowSettings = class extends Overlay { + /** Constructor for the Settings window * @param {string} name - The name of the userscript * @param {string} version - The version of the userscript - * @param {string} schemaVersionBleedingEdge - The bleeding edge of schema versions for Blue Marble - * @param {TemplateManager} [templateManager=undefined] - (Optional) The TemplateManager class instance - * @since 0.88.434 + * @since 0.91.11 * @see {@link Overlay#constructor} for examples */ - constructor(name2, version2, schemaVersionBleedingEdge, templateManager2 = void 0) { + constructor(name2, version2) { super(name2, version2); - __privateAdd(this, _WindowWizard_instances); + __privateAdd(this, _WindowSettings_instances); this.window = null; - this.windowID = "bm-window-wizard"; + this.windowID = "bm-window-settings"; this.windowParent = document.body; - this.currentJSON = JSON.parse(GM_getValue("bmTemplates", "{}")); - this.scriptVersion = this.currentJSON?.scriptVersion; - this.schemaVersion = this.currentJSON?.schemaVersion; - this.schemaHealth = void 0; - this.schemaVersionBleedingEdge = schemaVersionBleedingEdge; - this.templateManager = templateManager2; } - /** Spawns a Template Wizard window. - * If another template wizard window already exists, we DON'T spawn another! + /** Spawns a Settings window. + * If another settings window already exists, we DON'T spawn another! * Parent/child relationships in the DOM structure below are indicated by indentation. - * @since 0.88.434 + * @since 0.91.11 */ buildWindow() { if (document.querySelector(`#${this.windowID}`)) { document.querySelector(`#${this.windowID}`).remove(); return; } - let style = ""; - if (!document.querySelector(`#bm-window-main`)) { - style = style.concat("z-index: 9001;").trim(); - } - this.window = this.addDiv({ "id": this.windowID, "class": "bm-window", "style": style }, (instance, div) => { - }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Template Wizard"', "data-button-status": "expanded" }, (instance, button) => { + this.window = this.addDiv({ "id": this.windowID, "class": "bm-window" }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Color Filter"', "data-button-status": "expanded" }, (instance, button) => { button.onclick = () => instance.handleMinimization(button); button.ontouchend = () => { button.click(); }; - }).buildElement().addDiv().buildElement().addButton({ "class": "bm-button-circle", "textContent": "\u2716", "aria-label": 'Close window "Template Wizard"' }, (instance, button) => { + }).buildElement().addDiv().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "textContent": "\u2716", "aria-label": 'Close window "Color Filter"' }, (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": "Template Wizard" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Status" }).buildElement().addP({ "id": "bm-wizard-status", "textContent": "Loading template storage status..." }).buildElement().buildElement().addDiv({ "class": "bm-container bm-scrollable" }).addHeader(2, { "textContent": "Detected templates:" }).buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); + }).buildElement().buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Settings" }).buildElement().buildElement().addHr().buildElement().addP({ "textContent": "Settings take 5 seconds to save." }).buildElement().addDiv({ "class": "bm-container bm-scrollable" }, (instance, div) => { + this.buildHighlight(); + }).buildElement().buildElement().buildElement().buildOverlay(this.windowParent); this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); - __privateMethod(this, _WindowWizard_instances, displaySchemaHealth_fn).call(this); - __privateMethod(this, _WindowWizard_instances, displayTemplateList_fn).call(this); } - }; - _WindowWizard_instances = new WeakSet(); - /** Determines how "healthy" the template storage is. - * @since 0.88.436 - */ - displaySchemaHealth_fn = function() { - const schemaVersionArray = this.schemaVersion.split(/[-\.\+]/); - const schemaVersionBleedingEdgeArray = this.schemaVersionBleedingEdge.split(/[-\.\+]/); - let schemaHealthBanner = ""; - if (schemaVersionArray[0] == schemaVersionBleedingEdgeArray[0]) { - if (schemaVersionArray[1] == schemaVersionBleedingEdgeArray[1]) { - schemaHealthBanner = 'Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)'; - this.schemaHealth = "Good"; - } else { - schemaHealthBanner = `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.schemaHealth = "Poor"; - } - } else if (schemaVersionArray[0] < schemaVersionBleedingEdgeArray[0]) { - schemaHealthBanner = `Template storage health: 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.schemaHealth = "Bad"; - } else { - schemaHealthBanner = 'Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)'; - this.schemaHealth = "Dead"; - } - const recoveryInstructions = `
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 ${escapeHTML(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.`; - const wplaceUpdateTime = getWplaceVersion(); - let wplaceUpdateTimeLocalized = wplaceUpdateTime ? localizeDate(wplaceUpdateTime) : "???"; - this.updateInnerHTML("#bm-wizard-status", `${schemaHealthBanner}
Your templates were created during Blue Marble version ${escapeHTML(this.scriptVersion)} with schema version ${escapeHTML(this.schemaVersion)}.
The current Blue Marble version is ${escapeHTML(this.version)} and requires schema version ${escapeHTML(this.schemaVersionBleedingEdge)}.
Wplace was last updated on ${wplaceUpdateTimeLocalized}.${this.schemaHealth != "Good" ? recoveryInstructions : ""}`); - const buttonOptions = new Overlay(this.name, this.version); - if (this.schemaHealth != "Dead") { - buttonOptions.addDiv({ "class": "bm-container bm-flex-center bm-center-vertically", "style": "gap: 1.5ch;" }); - buttonOptions.addButton({ "textContent": "Download all templates" }, (instance, button) => { - button.onclick = () => { - button.disabled = true; - this.templateManager.downloadAllTemplatesFromStorage().then(() => { - button.disabled = false; - }); - }; - }).buildElement(); - } - if (this.schemaHealth == "Poor" || this.schemaHealth == "Bad") { - buttonOptions.addButton({ "textContent": `Update template storage to ${this.schemaVersionBleedingEdge}` }, (instance, button) => { - button.onclick = () => { - button.disabled = true; - __privateMethod(this, _WindowWizard_instances, convertSchema_1_x_x_To_2_x_x_fn).call(this, true); - }; - }).buildElement(); - } - buttonOptions.buildElement().buildOverlay(document.querySelector("#bm-wizard-status").parentNode); - }; - /** Displays loaded templates to the user. - * @since 0.88.441 - */ - displayTemplateList_fn = function() { - const templates = this.currentJSON?.templates; - if (Object.keys(templates).length > 0) { - const templateListParentElement = document.querySelector(`#${this.windowID} .bm-scrollable`); - const templateList = new Overlay(this.name, this.version); - templateList.addDiv({ "id": "bm-wizard-tlist", "class": "bm-container" }); - for (const template in templates) { - const templateKey = template; - const templateValue = templates[template]; - if (templates.hasOwnProperty(template)) { - const templateKeyArray = templateKey.split(" "); - const sortID = Number(templateKeyArray?.[0]); - const authorID = encodedToNumber(templateKeyArray?.[1] || "0", this.templateManager.encodingBase); - const displayName = templateValue.name || `Template ${sortID || ""}`; - const coords2 = templateValue?.coords?.split(",").map(Number); - const totalPixelCount = templateValue.pixels?.total ?? void 0; - const templateImage = void 0; - const sortIDLocalized = typeof sortID == "number" ? localizeNumber(sortID) : "???"; - const authorIDLocalized = typeof authorID == "number" ? localizeNumber(authorID) : "???"; - const totalPixelCountLocalized = typeof totalPixelCount == "number" ? localizeNumber(totalPixelCount) : "???"; - templateList.addDiv({ "class": "bm-container bm-flex-center" }).addDiv({ "class": "bm-flex-center", "style": "flex-direction: column; gap: 0;" }).addDiv({ "class": "bm-wizard-template-container-image", "textContent": templateImage || "\u{1F5BC}\uFE0F" }).buildElement().addSmall({ "textContent": `#${sortIDLocalized}` }).buildElement().buildElement().addDiv({ "class": "bm-flex-center bm-wizard-template-container-flavor" }).addHeader(3, { "textContent": displayName }).buildElement().addSpan({ "textContent": `Uploaded by user #${authorIDLocalized}` }).buildElement().addSpan({ "textContent": `Coordinates: ${coords2.join(", ")}` }).buildElement().addSpan({ "textContent": `Total Pixels: ${totalPixelCountLocalized}` }).buildElement().buildElement().buildElement(); - } - } - templateList.buildElement().buildOverlay(templateListParentElement); - } - }; - convertSchema_1_x_x_To_2_x_x_fn = async function(shouldWindowWizardOpen) { - if (shouldWindowWizardOpen) { - const windowContent = document.querySelector(`#${this.windowID} .bm-window-content`); - windowContent.innerHTML = ""; - const loadingScreen = new Overlay(this.name, this.version); - loadingScreen.addDiv({ "class": "bm-container" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Template Wizard" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Status" }).buildElement().addP({ "textContent": "Updating template storage. Please wait..." }).buildElement().buildElement().buildElement().buildOverlay(windowContent); - } - GM_deleteValue("bmCoords"); - const templates = this.currentJSON?.templates; - if (Object.keys(templates).length > 0) { - for (const [key, template] of Object.entries(templates)) { - if (templates.hasOwnProperty(key)) { - const _template = new Template({ - displayName: template.name, - chunked: template.tiles - }); - _template.calculateCoordsFromChunked(); - const blob = await this.templateManager.convertTemplateToBlob(_template); - await this.templateManager.createTemplate(blob, _template.displayName, _template.coords); - } - } - } - if (shouldWindowWizardOpen) { - console.log(`Restarting Template Wizard...`); - document.querySelector(`#${this.windowID}`).remove(); - new _WindowWizard(this.name, this.version, this.schemaVersionBleedingEdge, this.templateManager).buildWindow(); - } - }; - var WindowWizard = _WindowWizard; - - // src/templateManager.js - var _TemplateManager_instances, loadTemplate_fn, storeTemplates_fn, parseBlueMarble_fn, parseOSU_fn, calculateCorrectPixelsOnTile_And_FilterTile_fn; - var TemplateManager = class { - /** The constructor for the {@link TemplateManager} class. - * @since 0.55.8 + /** Builds the highlight section of the window. + * This should be overriden by {@link SettingsManager} + * @since 0.91.11 */ - constructor(name2, version2, overlay) { - __privateAdd(this, _TemplateManager_instances); - this.name = name2; - this.version = version2; - this.overlay = overlay; - this.schemaVersion = "2.0.0"; - this.userID = null; - this.encodingBase = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - this.tileSize = 1e3; - this.drawMult = 3; - this.paletteTolerance = 3; - this.paletteBM = colorpaletteForBlueMarble(this.paletteTolerance); - this.template = null; - this.templateState = ""; - this.templatesArray = []; - this.templatesJSON = null; - this.templatesShouldBeDrawn = true; - this.templatePixelsCorrect = null; - this.shouldFilterColor = /* @__PURE__ */ new Map(); + buildHighlight() { + __privateMethod(this, _WindowSettings_instances, errorOverrideFailure_fn).call(this, "Pixel Highlight"); } - /** Creates the JSON object to store templates in - * @returns {{ whoami: string, scriptVersion: string, schemaVersion: string, templates: Object }} The JSON object + }; + _WindowSettings_instances = new WeakSet(); + /** Displays an error when a settings category fails to load. + * @param {string} name - The name of the category + */ + errorOverrideFailure_fn = function(name2) { + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": name2 }).buildElement().addHr().buildElement().addP({ "innerHTML": `An error occured loading the ${name2} category. SettingsManager failed to override the ${name2} function inside WindowSettings.` }).buildElement().buildElement(); + }; + + // src/settingsManager.js + var _SettingsManager_instances, updateHighlightSettings_fn, updateHighlightToPreset_fn; + var SettingsManager = class extends WindowSettings { + /** Constructor for the SettingsManager class + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @param {Object} userSettings - The user settings as an object + * @since 0.91.11 + */ + constructor(name2, version2, userSettings2) { + super(name2, version2); + __privateAdd(this, _SettingsManager_instances); + this.userSettings = userSettings2; + this.userSettingsOld = structuredClone(this.userSettings); + this.userSettingsSaveLocation = "bmUserSettings"; + this.updateFrequency = 5e3; + this.lastUpdateTime = 0; + setInterval(this.updateUserStorage.bind(this), this.updateFrequency); + } + /** Updates the user settings in userscript storage + * @since 0.91.39 + */ + async updateUserStorage() { + const userSettingsCurrent = JSON.stringify(this.userSettings); + const userSettingsOld = JSON.stringify(this.userSettingsOld); + if (userSettingsCurrent != userSettingsOld && Date.now() - this.lastUpdateTime > this.updateFrequency) { + await GM.setValue(this.userSettingsSaveLocation, userSettingsCurrent); + this.userSettingsOld = structuredClone(this.userSettings); + this.lastUpdateTime = Date.now(); + console.log(userSettingsCurrent); + } + } + // This is one of the most insane OOP setups I have ever laid my eyes on + /** Builds the "highlight" category of the settings window + * @since 0.91.18 + * @see WindowSettings#buildHighlight + */ + buildHighlight() { + const highlightPresetOff = ''; + const highlightPresetCross = ''; + const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:" }).buildElement().addDiv({ "class": "bm-container bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "None"); + }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Cross" }).buildElement().addButton({ "innerHTML": highlightPresetCross, "aria-label": 'Preset "Cross Shape"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Cross"); + }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "X" }).buildElement().addButton({ "innerHTML": highlightPresetCross.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"', 'd="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'), "aria-label": 'Preset "X Shape"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "X"); + }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Full" }).buildElement().addButton({ "innerHTML": highlightPresetOff.replace("#fff", "#2f4f4f"), "aria-label": 'Preset "Full Template"' }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Full"); + }).buildElement().buildElement().buildElement().addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }); + for (let buttonY = -1; buttonY <= 1; buttonY++) { + for (let buttonX = -1; buttonX <= 1; buttonX++) { + const buttonState = storedHighlight[storedHighlight.findIndex(([, x, y]) => x == buttonX && y == buttonY)]?.[0] ?? 0; + let buttonStateName = "Disabled"; + if (buttonState == 1) { + buttonStateName = "Incorrect"; + } else if (buttonState == 2) { + buttonStateName = "Template"; + } + this.window = this.addButton({ + "data-status": buttonStateName, + "aria-label": `Sub-pixel ${buttonStateName.toLowerCase()}` + }, (instance, button) => { + button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [buttonX, buttonY]); + }).buildElement(); + } + } + this.window = this.buildElement().buildElement().buildElement(); + } + }; + _SettingsManager_instances = new WeakSet(); + /** Updates the display of the highlight buttons in the settings window. + * Additionally, it will update user settings with the new selection. + * @param {HTMLButtonElement} button - The button that was pressed + * @param {Array} coords - The relative coordinates of the button + * @since 0.91.46 + */ + updateHighlightSettings_fn = function(button, coords2) { + console.log(coords2); + button.disabled = true; + const status = button.dataset["status"]; + const userStorageOld = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; + let userStorageChange = [2, 0, 0]; + const userStorageNew = userStorageOld; + console.log(userStorageOld); + switch (status) { + // If the button was in the "Disabled" state + case "Disabled": + button.dataset["status"] = "Incorrect"; + button.ariaLabel = "Sub-pixel incorrect"; + userStorageChange = [1, ...coords2]; + break; + // If the button was in the "Incorrect" state + case "Incorrect": + button.dataset["status"] = "Template"; + button.ariaLabel = "Sub-pixel template"; + userStorageChange = [2, ...coords2]; + break; + // If the button was in the "Template" state + case "Template": + button.dataset["status"] = "Disabled"; + button.ariaLabel = "Sub-pixel disabled"; + userStorageChange = [0, ...coords2]; + break; + } + console.log(userStorageChange); + const indexOfChange = userStorageOld.findIndex(([, x, y]) => x == userStorageChange[1] && y == userStorageChange[2]); + console.log(indexOfChange); + if (userStorageChange[0] != 0) { + if (indexOfChange != -1) { + userStorageNew[indexOfChange] = userStorageChange; + } else { + userStorageNew.push(userStorageChange); + } + } else if (indexOfChange != -1) { + userStorageNew.splice(indexOfChange, 1); + } + console.log(userStorageNew); + this.userSettings["highlight"] = userStorageNew; + button.disabled = false; + }; + updateHighlightToPreset_fn = async function(preset) { + const presetButtons = document.querySelectorAll(".bm-highlight-preset-container button"); + for (const button of presetButtons) { + button.disabled = true; + } + let presetArray = [0, 0, 0, 0, 2, 0, 0, 0, 0]; + switch (preset) { + case "Cross": + presetArray = [0, 1, 0, 1, 2, 1, 0, 1, 0]; + break; + case "X": + presetArray = [1, 0, 1, 0, 2, 0, 1, 0, 1]; + break; + case "Full": + presetArray = [2, 2, 2, 2, 2, 2, 2, 2, 2]; + break; + } + const buttons = document.querySelector(".bm-highlight-grid")?.childNodes ?? []; + for (let buttonIndex = 0; buttonIndex < buttons.length; buttonIndex++) { + const button = buttons[buttonIndex]; + let buttonState = button.dataset["status"]; + buttonState = buttonState != "Disabled" ? buttonState != "Incorrect" ? 2 : 1 : 0; + let buttonStateDelta = presetArray[buttonIndex] - buttonState; + if (buttonStateDelta == 0) { + continue; + } + buttonStateDelta += buttonStateDelta < 0 ? 3 : 0; + button.click(); + if (buttonStateDelta == 2) { + for (let timeWaited = 0; timeWaited < 200; timeWaited += 10) { + if (!button.disabled) { + break; + } + await sleep(10); + } + button.click(); + } + } + for (const button of presetButtons) { + button.disabled = false; + } + }; + + // src/Template.js + var _Template_instances, calculateTotalPixelsFromImageData_fn; + var Template = class { + /** The constructor for the {@link Template} class with enhanced pixel tracking. + * @param {Object} [params={}] - Object containing all optional parameters + * @param {string} [params.displayName='My template'] - The display name of the template + * @param {number} [params.sortID=0] - The sort number of the template for rendering priority + * @param {string} [params.authorID=''] - The user ID of the person who exported the template (prevents sort ID collisions) + * @param {string} [params.url=''] - The URL to the source image + * @param {File} [params.file=null] - The template file (pre-processed File or processed bitmap) + * @param {Array} [params.coords=null] - The coordinates of the top left corner as (tileX, tileY, pixelX, pixelY) + * @param {Object} [params.chunked=null] - The affected chunks of the template, and their template for each chunk as a bitmap + * @param {Object} [params.chunked32={}] - The affected chunks of the template, and their template for each chunk as a Uint32Array + * @param {number} [params.tileSize=1000] - The size of a tile in pixels (assumes square tiles) + * @param {Object} [params.pixelCount={total:0, colors:Map}] - Total number of pixels in the template (calculated automatically during processing) + * @since 0.65.2 + */ + constructor({ + displayName = "My template", + sortID = 0, + authorID = "", + url = "", + file = null, + coords: coords2 = null, + chunked = null, + chunked32 = {}, + tileSize = 1e3 + } = {}) { + __privateAdd(this, _Template_instances); + this.displayName = displayName; + this.sortID = sortID; + this.authorID = authorID; + this.url = url; + this.file = file; + this.coords = coords2; + this.chunked = chunked; + this.chunked32 = chunked32; + this.tileSize = tileSize; + this.pixelCount = { total: 0, colors: /* @__PURE__ */ new Map() }; + } + /** Creates chunks of the template for each tile. + * @param {Number} tileSize - Size of the tile as determined by templateManager + * @param {Object} paletteBM - An collection of Uint32Arrays containing the palette BM uses + * @returns {Object} Collection of template bitmaps & buffers organized by tile coordinates * @since 0.65.4 */ - async createJSON() { - return { - "whoami": this.name.replace(" ", ""), - // Name of userscript without spaces - "scriptVersion": this.version, - // Version of userscript - "schemaVersion": this.schemaVersion, - // Version of JSON schema - "templates": {} - // The templates - }; - } - /** Creates the template from the inputed file blob - * @param {File} blob - The file blob to create a template from - * @param {string} name - The display name of the template - * @param {Array} coords - The coordinates of the top left corner of the template - * @since 0.65.77 - */ - async createTemplate(blob, name2, coords2) { - if (!this.templatesJSON) { - this.templatesJSON = await this.createJSON(); - console.log(`Creating JSON...`); - } - this.overlay.handleDisplayStatus(`Creating template at ${coords2.join(", ")}...`); - const template = new Template({ - displayName: name2, - sortID: 0, - // Object.keys(this.templatesJSON.templates).length || 0, // Uncomment this to enable multiple templates (1/2) - authorID: numberToEncoded(this.userID || 0, this.encodingBase), - file: blob, - coords: coords2 - }); - const { templateTiles, templateTilesBuffers } = await template.createTemplateTiles(this.tileSize, this.paletteBM); - template.chunked = templateTiles; - const _pixels = { "total": template.pixelCount.total, "colors": Object.fromEntries(template.pixelCount.colors) }; - this.templatesJSON.templates[`${template.sortID} ${template.authorID}`] = { - "name": template.displayName, - // Display name of template - "coords": coords2.join(", "), - // The coords of the template - "enabled": true, - "pixels": _pixels, - // The total pixels in the template - "tiles": templateTilesBuffers - // Stores the chunked tile buffers - }; - this.templatesArray = []; - this.templatesArray.push(template); - this.overlay.handleDisplayStatus(`Template created at ${coords2.join(", ")}!`); - console.log(Object.keys(this.templatesJSON.templates).length); - console.log(this.templatesJSON); - console.log(this.templatesArray); - console.log(JSON.stringify(this.templatesJSON)); - await __privateMethod(this, _TemplateManager_instances, storeTemplates_fn).call(this); - } - /** Deletes a template from the JSON object. - * Also delete's the corrosponding {@link Template} class instance - */ - deleteTemplate() { - } - /** Disables the template from view - */ - async disableTemplate() { - if (!this.templatesJSON) { - this.templatesJSON = await this.createJSON(); - console.log(`Creating JSON...`); - } - } - /** Downloads all templates loaded. - * @since 0.88.499 - */ - async downloadAllTemplates() { - consoleLog(`Downloading all templates...`); - console.log(this.templatesArray); - for (const template of this.templatesArray) { - await this.downloadTemplate(template); - await sleep(500); - } - } - /** Downloads all templates from Blue Marble's template storage. - * @since 0.88.474 - */ - async downloadAllTemplatesFromStorage() { - const templates = JSON.parse(GM_getValue("bmTemplates", "{}"))?.templates; - console.log(templates); - if (Object.keys(templates).length > 0) { - for (const [key, template] of Object.entries(templates)) { - if (templates.hasOwnProperty(key)) { - await this.downloadTemplate(new Template({ - displayName: template.name, - sortID: key.split(" ")?.[0], - authorID: key.split(" ")?.[1], - chunked: template.tiles - })); - await sleep(500); - } + async createTemplateTiles(tileSize, paletteBM) { + console.log("Template coordinates:", this.coords); + const shreadSize = 3; + const bitmap = await createImageBitmap(this.file); + const imageWidth = bitmap.width; + const imageHeight = bitmap.height; + this.tileSize = tileSize; + const templateTiles = {}; + const templateTilesBuffers = {}; + const canvas = new OffscreenCanvas(this.tileSize, this.tileSize); + const context = canvas.getContext("2d", { willReadFrequently: true }); + canvas.width = imageWidth; + canvas.height = imageHeight; + context.imageSmoothingEnabled = false; + context.drawImage(bitmap, 0, 0); + let timer = Date.now(); + const totalPixelMap = __privateMethod(this, _Template_instances, calculateTotalPixelsFromImageData_fn).call(this, context.getImageData(0, 0, imageWidth, imageHeight), paletteBM); + console.log(`Calculating total pixels took ${(Date.now() - timer) / 1e3} seconds`); + let totalPixels = 0; + const transparentColorID = 0; + for (const [color, total] of totalPixelMap) { + if (color == transparentColorID) { + continue; } + totalPixels += total; } - } - /** Downloads the template passed-in. - * @param {Template} template - The template class instance to download - * @since 0.88.499 - */ - async downloadTemplate(template) { - template.calculateCoordsFromChunked(); - const templateFileName = `${template.coords.join("-")}_${template.displayName.replaceAll(" ", "-")}`; - const blob = await this.convertTemplateToBlob(template); - await GM.download({ - url: URL.createObjectURL(blob), - name: templateFileName + ".png", - conflictAction: "uniquify", - onload: () => { - consoleLog(`Download of template '${templateFileName}' complete!`); - }, - onerror: (error, details) => { - consoleError(`Download of template '${templateFileName}' failed because ${error}! Details: ${details}`); - }, - ontimeout: () => { - consoleWarn(`Download of template '${templateFileName}' has timed out!`); - } - }); - } - /** Converts a Template class instance into a Blob. - * Specifically, this takes `Template.chunked` and converts it to a Blob. - * @since 0.88.504 - * @returns {Promise} A Promise of a Blob PNG image of the template - */ - async convertTemplateToBlob(template) { - console.log(template); - const templateTiles64 = template.chunked; - const templateTileKeysSorted = Object.keys(templateTiles64).sort(); - const templateTilesImageSorted = await Promise.all(templateTileKeysSorted.map((tileKey) => convertBase64ToImage(templateTiles64[tileKey]))); - let absoluteSmallestX = Infinity; - let absoluteSmallestY = Infinity; - let absoluteLargestX = 0; - let absoluteLargestY = 0; - templateTileKeysSorted.forEach((key, index) => { - const [tileX, tileY, pixelX, pixelY] = key.split(",").map(Number); - const tileImage = templateTilesImageSorted[index]; - const absoluteX = tileX * this.tileSize + pixelX; - const absoluteY = tileY * this.tileSize + pixelY; - absoluteSmallestX = Math.min(absoluteSmallestX, absoluteX); - absoluteSmallestY = Math.min(absoluteSmallestY, absoluteY); - absoluteLargestX = Math.max(absoluteLargestX, absoluteX + tileImage.width / this.drawMult); - absoluteLargestY = Math.max(absoluteLargestY, absoluteY + tileImage.height / this.drawMult); - }); - console.log(`Absolute coordinates: (${absoluteSmallestX}, ${absoluteSmallestY}) and (${absoluteLargestX}, ${absoluteLargestY})`); - const templateWidth = absoluteLargestX - absoluteSmallestX; - const templateHeight = absoluteLargestY - absoluteSmallestY; - const canvasWidth = templateWidth * this.drawMult; - const canvasHeight = templateHeight * this.drawMult; - console.log(`Template Width: ${templateWidth} -Template Height: ${templateHeight} + this.pixelCount = { total: totalPixels, colors: totalPixelMap }; + timer = Date.now(); + const canvasMask = new OffscreenCanvas(3, 3); + const contextMask = canvasMask.getContext("2d"); + contextMask.clearRect(0, 0, 3, 3); + contextMask.fillStyle = "white"; + contextMask.fillRect(1, 1, 1, 1); + for (let pixelY = this.coords[3]; pixelY < imageHeight + this.coords[3]; ) { + const drawSizeY = Math.min(this.tileSize - pixelY % this.tileSize, imageHeight - (pixelY - this.coords[3])); + console.log(`Math.min(${this.tileSize} - (${pixelY} % ${this.tileSize}), ${imageHeight} - (${pixelY - this.coords[3]}))`); + for (let pixelX = this.coords[2]; pixelX < imageWidth + this.coords[2]; ) { + console.log(`Pixel X: ${pixelX} +Pixel Y: ${pixelY}`); + const drawSizeX = Math.min(this.tileSize - pixelX % this.tileSize, imageWidth - (pixelX - this.coords[2])); + console.log(`Math.min(${this.tileSize} - (${pixelX} % ${this.tileSize}), ${imageWidth} - (${pixelX - this.coords[2]}))`); + console.log(`Draw Size X: ${drawSizeX} +Draw Size Y: ${drawSizeY}`); + const canvasWidth = drawSizeX * shreadSize; + const canvasHeight = drawSizeY * shreadSize; + canvas.width = canvasWidth; + canvas.height = canvasHeight; + console.log(`Draw X: ${drawSizeX} +Draw Y: ${drawSizeY} Canvas Width: ${canvasWidth} Canvas Height: ${canvasHeight}`); - const canvas = new OffscreenCanvas(canvasWidth, canvasHeight); - const context = canvas.getContext("2d"); - templateTileKeysSorted.forEach((key, index) => { - const [tileX, tileY, pixelX, pixelY] = key.split(",").map(Number); - const tileImage = templateTilesImageSorted[index]; - const absoluteX = tileX * this.tileSize + pixelX; - const absoluteY = tileY * this.tileSize + pixelY; - console.log(`Drawing tile (${tileX}, ${tileY}, ${pixelX}, ${pixelY}) (${absoluteX}, ${absoluteY}) at (${absoluteX - absoluteSmallestX}, ${absoluteY - absoluteSmallestY}) on the canvas...`); - context.drawImage(tileImage, (absoluteX - absoluteSmallestX) * this.drawMult, (absoluteY - absoluteSmallestY) * this.drawMult, tileImage.width, tileImage.height); - }); - context.globalCompositeOperation = "destination-over"; - context.drawImage(canvas, 0, -1); - context.drawImage(canvas, 0, 1); - context.drawImage(canvas, -1, 0); - context.drawImage(canvas, 1, 0); - const smallCanvas = new OffscreenCanvas(templateWidth, templateHeight); - const smallContext = smallCanvas.getContext("2d"); - smallContext.imageSmoothingEnabled = false; - smallContext.drawImage( - canvas, - 0, - 0, - templateWidth * this.drawMult, - templateHeight * this.drawMult, - // Source image size - 0, - 0, - templateWidth, - templateHeight - // Small canvas size - ); - return smallCanvas.convertToBlob({ type: "image/png" }); - function convertBase64ToImage(base64) { - return new Promise((resolve, reject) => { - const image = new Image(); - image.onload = () => resolve(image); - image.onerror = reject; - image.src = "data:image/png;base64," + base64; - }); - } - } - /** Draws all templates on the specified tile. - * This method handles the rendering of template overlays on individual tiles. - * @param {File} tileBlob - The pixels that are placed on a tile - * @param {Array} tileCoords - The tile coordinates [x, y] - * @since 0.65.77 - */ - async drawTemplateOnTile(tileBlob, tileCoords) { - if (!this.templatesShouldBeDrawn) { - return tileBlob; - } - const drawSize = this.tileSize * this.drawMult; - tileCoords = tileCoords[0].toString().padStart(4, "0") + "," + tileCoords[1].toString().padStart(4, "0"); - console.log(`Searching for templates in tile: "${tileCoords}"`); - const templateArray = this.templatesArray; - console.log(templateArray); - templateArray.sort((a, b) => { - return a.sortID - b.sortID; - }); - console.log(templateArray); - const templatesToDraw = templateArray.map((template) => { - const matchingTiles = Object.keys(template.chunked).filter( - (tile) => tile.startsWith(tileCoords) - ); - if (matchingTiles.length === 0) { - return null; - } - 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]], - pixelCoords: [coords2[2], coords2[3]] - }; - }); - return matchingTileBlobs?.[0]; - }).filter(Boolean); - console.log(templatesToDraw); - const templateCount = templatesToDraw?.length || 0; - console.log(`templateCount = ${templateCount}`); - if (templateCount > 0) { - const totalPixels = templateArray.filter((template) => { - const matchingTiles = Object.keys(template.chunked).filter( - (tile) => tile.startsWith(tileCoords) + context.imageSmoothingEnabled = false; + console.log(`Getting X ${pixelX}-${pixelX + drawSizeX} +Getting Y ${pixelY}-${pixelY + drawSizeY}`); + context.clearRect(0, 0, canvasWidth, canvasHeight); + context.drawImage( + bitmap, + // Bitmap image to draw + pixelX - this.coords[2], + // Coordinate X to draw *from* + pixelY - this.coords[3], + // Coordinate Y to draw *from* + drawSizeX, + // X width to draw *from* + drawSizeY, + // Y height to draw *from* + 0, + // Coordinate X to draw *at* + 0, + // Coordinate Y to draw *at* + drawSizeX * shreadSize, + // X width to draw *at* + drawSizeY * shreadSize + // Y height to draw *at* ); - return matchingTiles.length > 0; - }).reduce((sum, template) => sum + (template.pixelCount.total || 0), 0); - const pixelCountFormatted = localizeNumber(totalPixels); - this.overlay.handleDisplayStatus( - `Displaying ${templateCount} template${templateCount == 1 ? "" : "s"}. -Total pixels: ${pixelCountFormatted}` - ); - } else { - this.overlay.handleDisplayStatus(`Sleeping -Version: ${this.version}`); - return tileBlob; + context.save(); + context.globalCompositeOperation = "destination-in"; + context.fillStyle = context.createPattern(canvasMask, "repeat"); + context.fillRect(0, 0, canvasWidth, canvasHeight); + context.restore(); + const imageData = context.getImageData(0, 0, canvasWidth, canvasHeight); + console.log(`Shreaded pixels for ${pixelX}, ${pixelY}`, imageData); + const templateTileName = `${(this.coords[0] + Math.floor(pixelX / 1e3)).toString().padStart(4, "0")},${(this.coords[1] + Math.floor(pixelY / 1e3)).toString().padStart(4, "0")},${(pixelX % 1e3).toString().padStart(3, "0")},${(pixelY % 1e3).toString().padStart(3, "0")}`; + this.chunked32[templateTileName] = new Uint32Array(imageData.data.buffer); + templateTiles[templateTileName] = await createImageBitmap(canvas); + const canvasBlob = await canvas.convertToBlob(); + const canvasBuffer = await canvasBlob.arrayBuffer(); + const canvasBufferBytes = Array.from(new Uint8Array(canvasBuffer)); + templateTilesBuffers[templateTileName] = uint8ToBase64(canvasBufferBytes); + console.log(templateTiles); + pixelX += drawSizeX; + } + pixelY += drawSizeY; } - const tileBitmap = await createImageBitmap(tileBlob); - const canvas = new OffscreenCanvas(drawSize, drawSize); - const context = canvas.getContext("2d"); - context.imageSmoothingEnabled = false; - context.beginPath(); - context.rect(0, 0, drawSize, drawSize); - context.clip(); - context.clearRect(0, 0, drawSize, drawSize); - context.drawImage(tileBitmap, 0, 0, drawSize, drawSize); - const tileBeforeTemplates = context.getImageData(0, 0, drawSize, drawSize); - const tileBeforeTemplates32 = new Uint32Array(tileBeforeTemplates.data.buffer); - for (const template of templatesToDraw) { - console.log(`Template:`); - console.log(template); - const templateHasErased = !!template.instance.pixelCount?.colors?.get(-1); - let templateBeforeFilter32 = template.chunked32.slice(); - const coordXtoDrawAt = Number(template.pixelCoords[0]) * this.drawMult; - const coordYtoDrawAt = Number(template.pixelCoords[1]) * this.drawMult; - if (this.shouldFilterColor.size == 0 && !templateHasErased) { - context.drawImage(template.bitmap, coordXtoDrawAt, coordYtoDrawAt); - } - if (!templateBeforeFilter32) { - const templateBeforeFilter = context.getImageData(coordXtoDrawAt, coordYtoDrawAt, template.bitmap.width, template.bitmap.height); - templateBeforeFilter32 = new Uint32Array(templateBeforeFilter.data.buffer); - } - const timer = Date.now(); - const { - correctPixels: pixelsCorrect, - filteredTemplate: templateAfterFilter - } = __privateMethod(this, _TemplateManager_instances, calculateCorrectPixelsOnTile_And_FilterTile_fn).call(this, { - tile: tileBeforeTemplates32, - template: templateBeforeFilter32, - templateInfo: [coordXtoDrawAt, coordYtoDrawAt, template.bitmap.width, template.bitmap.height] - }); - let pixelsCorrectTotal = 0; - const transparentColorID = 0; - for (const [color, total] of pixelsCorrect) { - if (color == transparentColorID) { - continue; - } - pixelsCorrectTotal += total; - } - if (this.shouldFilterColor.size != 0 || templateHasErased) { - console.log("Colors to filter: ", this.shouldFilterColor); - context.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(templateAfterFilter.buffer), template.bitmap.width, template.bitmap.height)), coordXtoDrawAt, coordYtoDrawAt); - } - console.log(`Finished calculating correct pixels & filtering colors for the tile ${tileCoords} in ${(Date.now() - timer) / 1e3} seconds! -There are ${pixelsCorrectTotal} correct pixels.`); - if (typeof template.instance.pixelCount["correct"] == "undefined") { - template.instance.pixelCount["correct"] = {}; - } - template.instance.pixelCount["correct"][tileCoords] = pixelsCorrect; - } - return await canvas.convertToBlob({ type: "image/png" }); + console.log(`Parsing template took ${(Date.now() - timer) / 1e3} seconds`); + console.log("Template Tiles: ", templateTiles); + console.log("Template Tiles Buffers: ", templateTilesBuffers); + console.log("Template Tiles Uint32Array: ", this.chunked32); + return { templateTiles, templateTilesBuffers }; } - /** Imports the JSON object, and appends it to any JSON object already loaded - * @param {string} json - The JSON string to parse + /** Calculates top left coordinate of template. + * It uses `Template.chunked` to update `Template.coords` + * @since 0.88.504 */ - importJSON(json) { - console.log(`Importing JSON...`); - console.log(json); - if (json?.whoami == "BlueMarble") { - __privateMethod(this, _TemplateManager_instances, parseBlueMarble_fn).call(this, json); - } - } - /** Sets the `templatesShouldBeDrawn` boolean to a value. - * @param {boolean} value - The value to set the boolean to - * @since 0.73.7 - */ - setTemplatesShouldBeDrawn(value) { - this.templatesShouldBeDrawn = value; - } - }; - _TemplateManager_instances = new WeakSet(); - /** Generates a {@link Template} class instance from the JSON object template. - * {@link createTemplate()} will create a class instance and save to template storage. - * `#loadTemplate()` will create a class instance without saving to the template storage. - * @param {Object} template - The template to load - * @since 0.88.504 - */ - loadTemplate_fn = function(templateObject) { - const pixelCount = { - total: templateObject.pixels?.total, - colors: new Map(Object.entries(templateObject.pixels?.colors || {}).map(([key, value]) => [Number(key), value])) - }; - const template = new Template({ - displayName: templateObject.displayName, - sortID: Object.keys(this.templatesJSON.templates).length || 0, - authorID: numberToEncoded(this.userID || 0, this.encodingBase), - pixelCount, - chunked: templateObject.tiles - }); - template.calculateCoordsFromChunked(); - this.templatesArray.push(template); - }; - storeTemplates_fn = async function() { - GM.setValue("bmTemplates", JSON.stringify(this.templatesJSON)); - }; - parseBlueMarble_fn = async function(json) { - console.log(`Parsing BlueMarble...`); - const templates = json.templates; - console.log(`BlueMarble length: ${Object.keys(templates).length}`); - const schemaVersion = json?.schemaVersion; - const schemaVersionArray = schemaVersion.split(/[-\.\+]/); - const schemaVersionBleedingEdge = this.schemaVersion.split(/[-\.\+]/); - const scriptVersion = json?.scriptVersion; - console.log(`BlueMarble Template Schema: ${schemaVersion}; Script Version: ${scriptVersion}`); - if (schemaVersionArray[0] == schemaVersionBleedingEdge[0]) { - if (schemaVersionArray[1] != schemaVersionBleedingEdge[1]) { - const windowWizard = new WindowWizard(this.name, this.version, this.schemaVersion, this); - windowWizard.buildWindow(); - } - this.templatesArray = await loadSchema({ - tileSize: this.tileSize, - drawMult: this.drawMult, - templatesArray: this.templatesArray + calculateCoordsFromChunked() { + let topLeftCoord = [Infinity, Infinity, Infinity, Infinity]; + const tileKeys = Object.keys(this.chunked).sort(); + tileKeys.forEach((key, index) => { + const [tileX, tileY, pixelX, pixelY] = key.split(",").map(Number); + if (tileY < topLeftCoord[1] || tileY == topLeftCoord[1] && tileX < topLeftCoord[0]) { + topLeftCoord = [tileX, tileY, pixelX, pixelY]; + } }); - } else if (schemaVersionArray[0] < schemaVersionBleedingEdge[0]) { - const windowWizard = new WindowWizard(this.name, this.version, this.schemaVersion, this); - windowWizard.buildWindow(); - } else { - this.overlay.handleDisplayError(`Template version ${schemaVersion} is unsupported. -Use Blue Marble version ${scriptVersion} or load a new template.`); - } - async function loadSchema({ - tileSize, - drawMult, - templatesArray - }) { - if (Object.keys(templates).length > 0) { - for (const template in templates) { - const templateKey = template; - const templateValue = templates[template]; - console.log(`Template Key: ${templateKey}`); - if (templates.hasOwnProperty(template)) { - const templateKeyArray = templateKey.split(" "); - const sortID = Number(templateKeyArray?.[0]); - const authorID = templateKeyArray?.[1] || "0"; - const displayName = templateValue.name || `Template ${sortID || ""}`; - const pixelCount = { - total: templateValue.pixels?.total, - colors: new Map(Object.entries(templateValue.pixels?.colors || {}).map(([key, value]) => [Number(key), value])) - }; - const tilesbase64 = templateValue.tiles; - const templateTiles = {}; - const templateTiles32 = {}; - const actualTileSize = tileSize * drawMult; - for (const tile in tilesbase64) { - console.log(tile); - if (tilesbase64.hasOwnProperty(tile)) { - const encodedTemplateBase64 = tilesbase64[tile]; - const templateUint8Array = base64ToUint8(encodedTemplateBase64); - const templateBlob = new Blob([templateUint8Array], { type: "image/png" }); - const templateBitmap = await createImageBitmap(templateBlob); - templateTiles[tile] = templateBitmap; - const canvas = new OffscreenCanvas(actualTileSize, actualTileSize); - const context = canvas.getContext("2d"); - context.drawImage(templateBitmap, 0, 0); - const imageData = context.getImageData(0, 0, templateBitmap.width, templateBitmap.height); - templateTiles32[tile] = new Uint32Array(imageData.data.buffer); - } - } - const template2 = new Template({ - displayName, - sortID: sortID || this.templatesArray?.length || 0, - authorID: authorID || "" - //coords: coords, - }); - template2.pixelCount = pixelCount; - template2.chunked = templateTiles; - template2.chunked32 = templateTiles32; - templatesArray.push(template2); - console.log(this.templatesArray); - console.log(`^^^ This ^^^`); - } - } - } - return templatesArray; + this.coords = topLeftCoord; } }; - /** Parses the OSU! Place JSON object + _Template_instances = new WeakSet(); + /** Calculates the total pixels for each color for the image. + * + * @param {ImageData} imageData - The pre-shreaded image "casted" onto a canvas + * @param {Object} paletteBM - The palette Blue Marble uses for colors + * @param {Number} paletteTolerance - How close an RGB color has to be in order to be considered a palette color. A tolerance of "3" means the sum of the RGB can be up to 3 away from the actual value. + * @returns {Map} A map where the key is the color ID, and the value is the total pixels for that color ID + * @since 0.88.6 */ - parseOSU_fn = function() { - }; - /** Calculates the correct pixels on this tile. - * In addition, this function filters colors based on user input. - * In addition, this function modifies colors to properly display (#deface). - * This function has multiple purposes only to reduce iterations of scans over every pixel on the template. - * @param {Object} params - Object containing all parameters - * @param {Uint32Array} params.tile - The tile without templates as a Uint32Array - * @param {Uint32Array} params.template - The template without filtering as a Uint32Array - * @param {Array} params.templateInfo - Information about template location and size - * @returns {{correctPixels: Map, filteredTemplate: Uint32Array}} A Map containing the color IDs (keys) and how many correct pixels there are for that color (values) - */ - calculateCorrectPixelsOnTile_And_FilterTile_fn = function({ - tile: tile32, - template: template32, - templateInfo: templateInformation - }) { - const pixelSize = this.drawMult; - const tileWidth = this.tileSize * pixelSize; - const tileHeight = tileWidth; - const tilePixelOffsetY = -1; - const tilePixelOffsetX = 0; - const templateCoordX = templateInformation[0]; - const templateCoordY = templateInformation[1]; - const templateWidth = templateInformation[2]; - const templateHeight = templateInformation[3]; - const tolerance = this.paletteTolerance; - const { palette: _, LUT: lookupTable } = this.paletteBM; + calculateTotalPixelsFromImageData_fn = function(imageData, paletteBM) { + const buffer32Arr = new Uint32Array(imageData.data.buffer); + const { palette: _, LUT: lookupTable } = paletteBM; const _colorpalette = /* @__PURE__ */ new Map(); - for (let templateRow = 1; templateRow < templateHeight; templateRow += pixelSize) { - for (let templateColumn = 1; templateColumn < templateWidth; templateColumn += pixelSize) { - const tileRow = templateCoordY + templateRow + tilePixelOffsetY; - const tileColumn = templateCoordX + templateColumn + tilePixelOffsetX; - const tilePixelAbove = tile32[tileRow * tileWidth + tileColumn]; - const templatePixel = template32[templateRow * templateWidth + templateColumn]; - const templatePixelAlpha = templatePixel >>> 24 & 255; - const tilePixelAlpha = tilePixelAbove >>> 24 & 255; - const bestTemplateColorID = lookupTable.get(templatePixel) ?? -2; - if (this.shouldFilterColor.get(bestTemplateColorID)) { - template32[templateRow * templateWidth + templateColumn] = tilePixelAbove; - } - if (bestTemplateColorID == -1) { - const blackTrans = 536870912; - if (this.shouldFilterColor.get(bestTemplateColorID)) { - template32[templateRow * templateWidth + templateColumn] = 0; - } else { - if ((tileRow / pixelSize & 1) == (tileColumn / pixelSize & 1)) { - template32[templateRow * templateWidth + templateColumn] = blackTrans; - template32[(templateRow - 1) * templateWidth + (templateColumn - 1)] = blackTrans; - template32[(templateRow - 1) * templateWidth + (templateColumn + 1)] = blackTrans; - template32[(templateRow + 1) * templateWidth + (templateColumn - 1)] = blackTrans; - template32[(templateRow + 1) * templateWidth + (templateColumn + 1)] = blackTrans; - } else { - template32[templateRow * templateWidth + templateColumn] = 0; - template32[(templateRow - 1) * templateWidth + templateColumn] = blackTrans; - template32[(templateRow + 1) * templateWidth + templateColumn] = blackTrans; - template32[templateRow * templateWidth + (templateColumn - 1)] = blackTrans; - template32[templateRow * templateWidth + (templateColumn + 1)] = blackTrans; - } - } - } - if (bestTemplateColorID == -1 && tilePixelAbove <= tolerance) { - const colorIDcount2 = _colorpalette.get(bestTemplateColorID); - _colorpalette.set(bestTemplateColorID, colorIDcount2 ? colorIDcount2 + 1 : 1); - continue; - } - if (templatePixelAlpha <= tolerance || tilePixelAlpha <= tolerance) { - continue; - } - const bestTileColorID = lookupTable.get(tilePixelAbove) ?? -2; - if (bestTileColorID != bestTemplateColorID) { - continue; - } - const colorIDcount = _colorpalette.get(bestTemplateColorID); - _colorpalette.set(bestTemplateColorID, colorIDcount ? colorIDcount + 1 : 1); + for (let pixelIndex = 0; pixelIndex < buffer32Arr.length; pixelIndex++) { + const pixel = buffer32Arr[pixelIndex]; + let bestColorID = -2; + if (pixel >>> 24 == 0) { + bestColorID = 0; + } else { + bestColorID = lookupTable.get(pixel) ?? -2; } + const colorIDcount = _colorpalette.get(bestColorID); + _colorpalette.set(bestColorID, colorIDcount ? colorIDcount + 1 : 1); } - console.log(`List of template pixels that match the tile:`); console.log(_colorpalette); - return { correctPixels: _colorpalette, filteredTemplate: template32 }; - }; - - // src/apiManager.js - var ApiManager = class { - /** Constructor for ApiManager class - * @param {TemplateManager} templateManager - * @since 0.11.34 - */ - constructor(templateManager2) { - this.templateManager = templateManager2; - this.disableAll = false; - this.chargeRefillTimerID = ""; - this.coordsTilePixel = []; - this.templateCoordsTilePixel = []; - } - /** Determines if the spontaneously received response is something we want. - * Otherwise, we can ignore it. - * Note: Due to aggressive compression, make your calls like `data['jsonData']['name']` instead of `data.jsonData.name` - * - * @param {Overlay} overlay - The Overlay class instance - * @since 0.11.1 - */ - spontaneousResponseListener(overlay) { - window.addEventListener("message", async (event) => { - const data = event.data; - const dataJSON = data["jsonData"]; - if (!(data && data["source"] === "blue-marble")) { - return; - } - if (!data["endpoint"]) { - return; - } - const endpointText = data["endpoint"]?.split("?")[0].split("/").filter((s) => s && isNaN(Number(s))).filter((s) => s && !s.includes(".")).pop(); - console.log(`%cBlue Marble%c: Recieved message about "%s"`, "color: cornflowerblue;", "", endpointText); - switch (endpointText) { - case "me": - if (dataJSON["status"] && dataJSON["status"]?.toString()[0] != "2") { - overlay.handleDisplayError(`You are not logged in or Wplace is offline! -Could not fetch userdata.`); - return; - } - const nextLevelPixels = Math.ceil(Math.pow(Math.floor(dataJSON["level"]) * Math.pow(30, 0.65), 1 / 0.65) - dataJSON["pixelsPainted"]); - console.log(dataJSON["id"]); - if (!!dataJSON["id"] || dataJSON["id"] === 0) { - console.log(numberToEncoded( - dataJSON["id"], - "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~" - )); - } - this.templateManager.userID = dataJSON["id"]; - if (this.chargeRefillTimerID.length != 0) { - const chargeRefillTimer = document.querySelector("#" + this.chargeRefillTimerID); - if (chargeRefillTimer) { - const chargeData = dataJSON["charges"]; - chargeRefillTimer.dataset["endDate"] = Date.now() + (chargeData["max"] - chargeData["count"]) * chargeData["cooldownMs"]; - } - } - overlay.updateInnerHTML("bm-user-droplets", `Droplets: ${localizeNumber(dataJSON["droplets"])}`); - overlay.updateInnerHTML("bm-user-nextlevel", `Next level in ${localizeNumber(nextLevelPixels)} pixel${nextLevelPixels == 1 ? "" : "s"}`); - break; - case "pixel": - const coordsTile = data["endpoint"].split("?")[0].split("/").filter((s) => s && !isNaN(Number(s))); - const payloadExtractor = new URLSearchParams(data["endpoint"].split("?")[1]); - const coordsPixel = [payloadExtractor.get("x"), payloadExtractor.get("y")]; - if (this.coordsTilePixel.length && (!coordsTile.length || !coordsPixel.length)) { - overlay.handleDisplayError(`Coordinates are malformed! -Did you try clicking the canvas first?`); - return; - } - this.coordsTilePixel = [...coordsTile, ...coordsPixel]; - const displayTP = serverTPtoDisplayTP(coordsTile, coordsPixel); - const spanElements = document.querySelectorAll("span"); - for (const element of spanElements) { - if (element.textContent.trim().includes(`${displayTP[0]}, ${displayTP[1]}`)) { - let displayCoords = document.querySelector("#bm-display-coords"); - const text = `(Tl X: ${coordsTile[0]}, Tl Y: ${coordsTile[1]}, Px X: ${coordsPixel[0]}, Px Y: ${coordsPixel[1]})`; - if (!displayCoords) { - displayCoords = document.createElement("span"); - displayCoords.id = "bm-display-coords"; - displayCoords.textContent = text; - displayCoords.style = "margin-left: calc(var(--spacing)*3); font-size: small;"; - element.parentNode.parentNode.insertAdjacentElement("afterend", displayCoords); - } else { - displayCoords.textContent = text; - } - } - } - break; - case "tile": - case "tiles": - let tileCoordsTile = data["endpoint"].split("/"); - tileCoordsTile = [parseInt(tileCoordsTile[tileCoordsTile.length - 2]), parseInt(tileCoordsTile[tileCoordsTile.length - 1].replace(".png", ""))]; - const blobUUID = data["blobID"]; - const blobData = data["blobData"]; - const timer = Date.now(); - const templateBlob = await this.templateManager.drawTemplateOnTile(blobData, tileCoordsTile); - console.log(`Finished loading the tile in ${(Date.now() - timer) / 1e3} seconds!`); - window.postMessage({ - source: "blue-marble", - blobID: blobUUID, - blobData: templateBlob, - blink: data["blink"] - }); - break; - case "robots": - this.disableAll = dataJSON["userscript"]?.toString().toLowerCase() == "false"; - break; - } - }); - } - // Sends a heartbeat to the telemetry server - async sendHeartbeat(version2) { - console.log("Sending heartbeat to telemetry server..."); - let userSettings2 = GM_getValue("bmUserSettings", "{}"); - userSettings2 = JSON.parse(userSettings2); - if (!userSettings2 || !userSettings2.telemetry || !userSettings2.uuid) { - console.log("Telemetry is disabled, not sending heartbeat."); - return; - } - const ua = navigator.userAgent; - let browser = await this.getBrowserFromUA(ua); - let os = this.getOS(ua); - GM_xmlhttpRequest({ - method: "POST", - url: "https://telemetry.thebluecorner.net/heartbeat", - headers: { - "Content-Type": "application/json" - }, - data: JSON.stringify({ - uuid: userSettings2.uuid, - version: version2, - browser, - os - }), - onload: (response) => { - if (response.status !== 200) { - consoleError("Failed to send heartbeat:", response.statusText); - } - }, - onerror: (error) => { - consoleError("Error sending heartbeat:", error); - } - }); - } - async getBrowserFromUA(ua = navigator.userAgent) { - ua = ua || ""; - if (ua.includes("OPR/") || ua.includes("Opera")) return "Opera"; - if (ua.includes("Edg/")) return "Edge"; - if (ua.includes("Vivaldi")) return "Vivaldi"; - if (ua.includes("YaBrowser")) return "Yandex"; - if (ua.includes("Kiwi")) return "Kiwi"; - if (ua.includes("Brave")) return "Brave"; - if (ua.includes("Firefox/")) return "Firefox"; - if (ua.includes("Chrome/")) return "Chrome"; - if (ua.includes("Safari/")) return "Safari"; - if (navigator.brave && typeof navigator.brave.isBrave === "function") { - if (await navigator.brave.isBrave()) return "Brave"; - } - return "Unknown"; - } - getOS(ua = navigator.userAgent) { - ua = ua || ""; - if (/Windows NT 11/i.test(ua)) return "Windows 11"; - if (/Windows NT 10/i.test(ua)) return "Windows 10"; - if (/Windows NT 6\.3/i.test(ua)) return "Windows 8.1"; - if (/Windows NT 6\.2/i.test(ua)) return "Windows 8"; - if (/Windows NT 6\.1/i.test(ua)) return "Windows 7"; - if (/Windows NT 6\.0/i.test(ua)) return "Windows Vista"; - if (/Windows NT 5\.1|Windows XP/i.test(ua)) return "Windows XP"; - if (/Mac OS X 10[_\.]15/i.test(ua)) return "macOS Catalina"; - if (/Mac OS X 10[_\.]14/i.test(ua)) return "macOS Mojave"; - if (/Mac OS X 10[_\.]13/i.test(ua)) return "macOS High Sierra"; - if (/Mac OS X 10[_\.]12/i.test(ua)) return "macOS Sierra"; - if (/Mac OS X 10[_\.]11/i.test(ua)) return "OS X El Capitan"; - if (/Mac OS X 10[_\.]10/i.test(ua)) return "OS X Yosemite"; - if (/Mac OS X 10[_\.]/i.test(ua)) return "macOS"; - if (/Android/i.test(ua)) return "Android"; - if (/iPhone|iPad|iPod/i.test(ua)) return "iOS"; - if (/Linux/i.test(ua)) return "Linux"; - return "Unknown"; - } + return _colorpalette; }; // src/confetttiManager.js @@ -3152,6 +2481,171 @@ Did you try clicking the canvas first?`); this.timeRemainingLocalized = localizeDate(this.timeRemaining); }; + // src/WindowWizard.js + var _WindowWizard_instances, displaySchemaHealth_fn, displayTemplateList_fn, convertSchema_1_x_x_To_2_x_x_fn; + var _WindowWizard = class _WindowWizard extends Overlay { + /** Constructor for the Template Wizard window + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript + * @param {string} schemaVersionBleedingEdge - The bleeding edge of schema versions for Blue Marble + * @param {TemplateManager} [templateManager=undefined] - (Optional) The TemplateManager class instance + * @since 0.88.434 + * @see {@link Overlay#constructor} for examples + */ + constructor(name2, version2, schemaVersionBleedingEdge, templateManager2 = void 0) { + super(name2, version2); + __privateAdd(this, _WindowWizard_instances); + this.window = null; + this.windowID = "bm-window-wizard"; + this.windowParent = document.body; + this.currentJSON = JSON.parse(GM_getValue("bmTemplates", "{}")); + this.scriptVersion = this.currentJSON?.scriptVersion; + this.schemaVersion = this.currentJSON?.schemaVersion; + this.schemaHealth = void 0; + this.schemaVersionBleedingEdge = schemaVersionBleedingEdge; + this.templateManager = templateManager2; + } + /** Spawns a Template Wizard window. + * If another template wizard window already exists, we DON'T spawn another! + * Parent/child relationships in the DOM structure below are indicated by indentation. + * @since 0.88.434 + */ + buildWindow() { + if (document.querySelector(`#${this.windowID}`)) { + document.querySelector(`#${this.windowID}`).remove(); + return; + } + let style = ""; + if (!document.querySelector(`#bm-window-main`)) { + style = style.concat("z-index: 9001;").trim(); + } + this.window = this.addDiv({ "id": this.windowID, "class": "bm-window", "style": style }, (instance, div) => { + }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Template Wizard"', "data-button-status": "expanded" }, (instance, button) => { + button.onclick = () => instance.handleMinimization(button); + button.ontouchend = () => { + button.click(); + }; + }).buildElement().addDiv().buildElement().addButton({ "class": "bm-button-circle", "textContent": "\u2716", "aria-label": 'Close window "Template Wizard"' }, (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": "Template Wizard" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Status" }).buildElement().addP({ "id": "bm-wizard-status", "textContent": "Loading template storage status..." }).buildElement().buildElement().addDiv({ "class": "bm-container bm-scrollable" }).addHeader(2, { "textContent": "Detected templates:" }).buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); + this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); + __privateMethod(this, _WindowWizard_instances, displaySchemaHealth_fn).call(this); + __privateMethod(this, _WindowWizard_instances, displayTemplateList_fn).call(this); + } + }; + _WindowWizard_instances = new WeakSet(); + /** Determines how "healthy" the template storage is. + * @since 0.88.436 + */ + displaySchemaHealth_fn = function() { + const schemaVersionArray = this.schemaVersion.split(/[-\.\+]/); + const schemaVersionBleedingEdgeArray = this.schemaVersionBleedingEdge.split(/[-\.\+]/); + let schemaHealthBanner = ""; + if (schemaVersionArray[0] == schemaVersionBleedingEdgeArray[0]) { + if (schemaVersionArray[1] == schemaVersionBleedingEdgeArray[1]) { + schemaHealthBanner = 'Template storage health: Healthy!
No futher action required. (Reason: Semantic version matches)'; + this.schemaHealth = "Good"; + } else { + schemaHealthBanner = `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.schemaHealth = "Poor"; + } + } else if (schemaVersionArray[0] < schemaVersionBleedingEdgeArray[0]) { + schemaHealthBanner = `Template storage health: 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.schemaHealth = "Bad"; + } else { + schemaHealthBanner = 'Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)'; + this.schemaHealth = "Dead"; + } + const recoveryInstructions = `
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 ${escapeHTML(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.`; + const wplaceUpdateTime = getWplaceVersion(); + let wplaceUpdateTimeLocalized = wplaceUpdateTime ? localizeDate(wplaceUpdateTime) : "???"; + this.updateInnerHTML("#bm-wizard-status", `${schemaHealthBanner}
Your templates were created during Blue Marble version ${escapeHTML(this.scriptVersion)} with schema version ${escapeHTML(this.schemaVersion)}.
The current Blue Marble version is ${escapeHTML(this.version)} and requires schema version ${escapeHTML(this.schemaVersionBleedingEdge)}.
Wplace was last updated on ${wplaceUpdateTimeLocalized}.${this.schemaHealth != "Good" ? recoveryInstructions : ""}`); + const buttonOptions = new Overlay(this.name, this.version); + if (this.schemaHealth != "Dead") { + buttonOptions.addDiv({ "class": "bm-container bm-flex-center bm-center-vertically", "style": "gap: 1.5ch;" }); + buttonOptions.addButton({ "textContent": "Download all templates" }, (instance, button) => { + button.onclick = () => { + button.disabled = true; + this.templateManager.downloadAllTemplatesFromStorage().then(() => { + button.disabled = false; + }); + }; + }).buildElement(); + } + if (this.schemaHealth == "Poor" || this.schemaHealth == "Bad") { + buttonOptions.addButton({ "textContent": `Update template storage to ${this.schemaVersionBleedingEdge}` }, (instance, button) => { + button.onclick = () => { + button.disabled = true; + __privateMethod(this, _WindowWizard_instances, convertSchema_1_x_x_To_2_x_x_fn).call(this, true); + }; + }).buildElement(); + } + buttonOptions.buildElement().buildOverlay(document.querySelector("#bm-wizard-status").parentNode); + }; + /** Displays loaded templates to the user. + * @since 0.88.441 + */ + displayTemplateList_fn = function() { + const templates = this.currentJSON?.templates; + if (Object.keys(templates).length > 0) { + const templateListParentElement = document.querySelector(`#${this.windowID} .bm-scrollable`); + const templateList = new Overlay(this.name, this.version); + templateList.addDiv({ "id": "bm-wizard-tlist", "class": "bm-container" }); + for (const template in templates) { + const templateKey = template; + const templateValue = templates[template]; + if (templates.hasOwnProperty(template)) { + const templateKeyArray = templateKey.split(" "); + const sortID = Number(templateKeyArray?.[0]); + const authorID = encodedToNumber(templateKeyArray?.[1] || "0", this.templateManager.encodingBase); + const displayName = templateValue.name || `Template ${sortID || ""}`; + const coords2 = templateValue?.coords?.split(",").map(Number); + const totalPixelCount = templateValue.pixels?.total ?? void 0; + const templateImage = void 0; + const sortIDLocalized = typeof sortID == "number" ? localizeNumber(sortID) : "???"; + const authorIDLocalized = typeof authorID == "number" ? localizeNumber(authorID) : "???"; + const totalPixelCountLocalized = typeof totalPixelCount == "number" ? localizeNumber(totalPixelCount) : "???"; + templateList.addDiv({ "class": "bm-container bm-flex-center" }).addDiv({ "class": "bm-flex-center", "style": "flex-direction: column; gap: 0;" }).addDiv({ "class": "bm-wizard-template-container-image", "textContent": templateImage || "\u{1F5BC}\uFE0F" }).buildElement().addSmall({ "textContent": `#${sortIDLocalized}` }).buildElement().buildElement().addDiv({ "class": "bm-flex-center bm-wizard-template-container-flavor" }).addHeader(3, { "textContent": displayName }).buildElement().addSpan({ "textContent": `Uploaded by user #${authorIDLocalized}` }).buildElement().addSpan({ "textContent": `Coordinates: ${coords2.join(", ")}` }).buildElement().addSpan({ "textContent": `Total Pixels: ${totalPixelCountLocalized}` }).buildElement().buildElement().buildElement(); + } + } + templateList.buildElement().buildOverlay(templateListParentElement); + } + }; + convertSchema_1_x_x_To_2_x_x_fn = async function(shouldWindowWizardOpen) { + if (shouldWindowWizardOpen) { + const windowContent = document.querySelector(`#${this.windowID} .bm-window-content`); + windowContent.innerHTML = ""; + const loadingScreen = new Overlay(this.name, this.version); + loadingScreen.addDiv({ "class": "bm-container" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Template Wizard" }).buildElement().buildElement().addHr().buildElement().addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Status" }).buildElement().addP({ "textContent": "Updating template storage. Please wait..." }).buildElement().buildElement().buildElement().buildOverlay(windowContent); + } + GM_deleteValue("bmCoords"); + const templates = this.currentJSON?.templates; + if (Object.keys(templates).length > 0) { + for (const [key, template] of Object.entries(templates)) { + if (templates.hasOwnProperty(key)) { + const _template = new Template({ + displayName: template.name, + chunked: template.tiles + }); + _template.calculateCoordsFromChunked(); + const blob = await this.templateManager.convertTemplateToBlob(_template); + await this.templateManager.createTemplate(blob, _template.displayName, _template.coords); + } + } + } + if (shouldWindowWizardOpen) { + console.log(`Restarting Template Wizard...`); + document.querySelector(`#${this.windowID}`).remove(); + new _WindowWizard(this.name, this.version, this.schemaVersionBleedingEdge, this.templateManager).buildWindow(); + } + }; + var WindowWizard = _WindowWizard; + // src/WindowMain.js var _WindowMain_instances, buildWindowFilter_fn, coordinateInputPaste_fn; var WindowMain = class extends Overlay { @@ -3333,6 +2827,770 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add } }; + // src/templateManager.js + var _TemplateManager_instances, loadTemplate_fn, storeTemplates_fn, parseBlueMarble_fn, parseOSU_fn, calculateCorrectPixelsOnTile_And_FilterTile_fn; + var TemplateManager = class { + /** The constructor for the {@link TemplateManager} class. + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript (SemVer as string) + * @since 0.55.8 + */ + constructor(name2, version2) { + __privateAdd(this, _TemplateManager_instances); + this.name = name2; + this.version = version2; + this.windowMain = null; + this.settingsManager = null; + this.schemaVersion = "2.0.0"; + this.userID = null; + this.encodingBase = "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"; + this.tileSize = 1e3; + this.drawMult = 3; + this.paletteTolerance = 3; + this.paletteBM = colorpaletteForBlueMarble(this.paletteTolerance); + this.template = null; + this.templateState = ""; + this.templatesArray = []; + this.templatesJSON = null; + this.templatesShouldBeDrawn = true; + this.templatePixelsCorrect = null; + this.shouldFilterColor = /* @__PURE__ */ new Map(); + } + /** Updates the stored instance of the main window. + * @param {WindowMain} windowMain - The main window instance + * @since 0.91.54 + */ + setWindowMain(windowMain2) { + this.windowMain = windowMain2; + } + /** Updates the stored instance of the SettingsManager. + * @param {SettingsManager} settingsManager - The settings manager instance + * @since 0.91.54 + */ + setSettingsManager(settingsManager2) { + this.settingsManager = settingsManager2; + } + /** Creates the JSON object to store templates in + * @returns {{ whoami: string, scriptVersion: string, schemaVersion: string, templates: Object }} The JSON object + * @since 0.65.4 + */ + async createJSON() { + return { + "whoami": this.name.replace(" ", ""), + // Name of userscript without spaces + "scriptVersion": this.version, + // Version of userscript + "schemaVersion": this.schemaVersion, + // Version of JSON schema + "templates": {} + // The templates + }; + } + /** Creates the template from the inputed file blob + * @param {File} blob - The file blob to create a template from + * @param {string} name - The display name of the template + * @param {Array} coords - The coordinates of the top left corner of the template + * @since 0.65.77 + */ + async createTemplate(blob, name2, coords2) { + if (!this.templatesJSON) { + this.templatesJSON = await this.createJSON(); + console.log(`Creating JSON...`); + } + this.windowMain.handleDisplayStatus(`Creating template at ${coords2.join(", ")}...`); + const template = new Template({ + displayName: name2, + sortID: 0, + // Object.keys(this.templatesJSON.templates).length || 0, // Uncomment this to enable multiple templates (1/2) + authorID: numberToEncoded(this.userID || 0, this.encodingBase), + file: blob, + coords: coords2 + }); + const { templateTiles, templateTilesBuffers } = await template.createTemplateTiles(this.tileSize, this.paletteBM); + template.chunked = templateTiles; + const _pixels = { "total": template.pixelCount.total, "colors": Object.fromEntries(template.pixelCount.colors) }; + this.templatesJSON.templates[`${template.sortID} ${template.authorID}`] = { + "name": template.displayName, + // Display name of template + "coords": coords2.join(", "), + // The coords of the template + "enabled": true, + "pixels": _pixels, + // The total pixels in the template + "tiles": templateTilesBuffers + // Stores the chunked tile buffers + }; + this.templatesArray = []; + this.templatesArray.push(template); + this.windowMain.handleDisplayStatus(`Template created at ${coords2.join(", ")}!`); + console.log(Object.keys(this.templatesJSON.templates).length); + console.log(this.templatesJSON); + console.log(this.templatesArray); + console.log(JSON.stringify(this.templatesJSON)); + await __privateMethod(this, _TemplateManager_instances, storeTemplates_fn).call(this); + } + /** Deletes a template from the JSON object. + * Also delete's the corrosponding {@link Template} class instance + */ + deleteTemplate() { + } + /** Disables the template from view + */ + async disableTemplate() { + if (!this.templatesJSON) { + this.templatesJSON = await this.createJSON(); + console.log(`Creating JSON...`); + } + } + /** Downloads all templates loaded. + * @since 0.88.499 + */ + async downloadAllTemplates() { + consoleLog(`Downloading all templates...`); + console.log(this.templatesArray); + for (const template of this.templatesArray) { + await this.downloadTemplate(template); + await sleep(500); + } + } + /** Downloads all templates from Blue Marble's template storage. + * @since 0.88.474 + */ + async downloadAllTemplatesFromStorage() { + const templates = JSON.parse(GM_getValue("bmTemplates", "{}"))?.templates; + console.log(templates); + if (Object.keys(templates).length > 0) { + for (const [key, template] of Object.entries(templates)) { + if (templates.hasOwnProperty(key)) { + await this.downloadTemplate(new Template({ + displayName: template.name, + sortID: key.split(" ")?.[0], + authorID: key.split(" ")?.[1], + chunked: template.tiles + })); + await sleep(500); + } + } + } + } + /** Downloads the template passed-in. + * @param {Template} template - The template class instance to download + * @since 0.88.499 + */ + async downloadTemplate(template) { + template.calculateCoordsFromChunked(); + const templateFileName = `${template.coords.join("-")}_${template.displayName.replaceAll(" ", "-")}`; + const blob = await this.convertTemplateToBlob(template); + await GM.download({ + url: URL.createObjectURL(blob), + name: templateFileName + ".png", + conflictAction: "uniquify", + onload: () => { + consoleLog(`Download of template '${templateFileName}' complete!`); + }, + onerror: (error, details) => { + consoleError(`Download of template '${templateFileName}' failed because ${error}! Details: ${details}`); + }, + ontimeout: () => { + consoleWarn(`Download of template '${templateFileName}' has timed out!`); + } + }); + } + /** Converts a Template class instance into a Blob. + * Specifically, this takes `Template.chunked` and converts it to a Blob. + * @since 0.88.504 + * @returns {Promise} A Promise of a Blob PNG image of the template + */ + async convertTemplateToBlob(template) { + console.log(template); + const templateTiles64 = template.chunked; + const templateTileKeysSorted = Object.keys(templateTiles64).sort(); + const templateTilesImageSorted = await Promise.all(templateTileKeysSorted.map((tileKey) => convertBase64ToImage(templateTiles64[tileKey]))); + let absoluteSmallestX = Infinity; + let absoluteSmallestY = Infinity; + let absoluteLargestX = 0; + let absoluteLargestY = 0; + templateTileKeysSorted.forEach((key, index) => { + const [tileX, tileY, pixelX, pixelY] = key.split(",").map(Number); + const tileImage = templateTilesImageSorted[index]; + const absoluteX = tileX * this.tileSize + pixelX; + const absoluteY = tileY * this.tileSize + pixelY; + absoluteSmallestX = Math.min(absoluteSmallestX, absoluteX); + absoluteSmallestY = Math.min(absoluteSmallestY, absoluteY); + absoluteLargestX = Math.max(absoluteLargestX, absoluteX + tileImage.width / this.drawMult); + absoluteLargestY = Math.max(absoluteLargestY, absoluteY + tileImage.height / this.drawMult); + }); + console.log(`Absolute coordinates: (${absoluteSmallestX}, ${absoluteSmallestY}) and (${absoluteLargestX}, ${absoluteLargestY})`); + const templateWidth = absoluteLargestX - absoluteSmallestX; + const templateHeight = absoluteLargestY - absoluteSmallestY; + const canvasWidth = templateWidth * this.drawMult; + const canvasHeight = templateHeight * this.drawMult; + console.log(`Template Width: ${templateWidth} +Template Height: ${templateHeight} +Canvas Width: ${canvasWidth} +Canvas Height: ${canvasHeight}`); + const canvas = new OffscreenCanvas(canvasWidth, canvasHeight); + const context = canvas.getContext("2d"); + templateTileKeysSorted.forEach((key, index) => { + const [tileX, tileY, pixelX, pixelY] = key.split(",").map(Number); + const tileImage = templateTilesImageSorted[index]; + const absoluteX = tileX * this.tileSize + pixelX; + const absoluteY = tileY * this.tileSize + pixelY; + console.log(`Drawing tile (${tileX}, ${tileY}, ${pixelX}, ${pixelY}) (${absoluteX}, ${absoluteY}) at (${absoluteX - absoluteSmallestX}, ${absoluteY - absoluteSmallestY}) on the canvas...`); + context.drawImage(tileImage, (absoluteX - absoluteSmallestX) * this.drawMult, (absoluteY - absoluteSmallestY) * this.drawMult, tileImage.width, tileImage.height); + }); + context.globalCompositeOperation = "destination-over"; + context.drawImage(canvas, 0, -1); + context.drawImage(canvas, 0, 1); + context.drawImage(canvas, -1, 0); + context.drawImage(canvas, 1, 0); + const smallCanvas = new OffscreenCanvas(templateWidth, templateHeight); + const smallContext = smallCanvas.getContext("2d"); + smallContext.imageSmoothingEnabled = false; + smallContext.drawImage( + canvas, + 0, + 0, + templateWidth * this.drawMult, + templateHeight * this.drawMult, + // Source image size + 0, + 0, + templateWidth, + templateHeight + // Small canvas size + ); + return smallCanvas.convertToBlob({ type: "image/png" }); + function convertBase64ToImage(base64) { + return new Promise((resolve, reject) => { + const image = new Image(); + image.onload = () => resolve(image); + image.onerror = reject; + image.src = "data:image/png;base64," + base64; + }); + } + } + /** Draws all templates on the specified tile. + * This method handles the rendering of template overlays on individual tiles. + * @param {File} tileBlob - The pixels that are placed on a tile + * @param {Array} tileCoords - The tile coordinates [x, y] + * @since 0.65.77 + */ + async drawTemplateOnTile(tileBlob, tileCoords) { + if (!this.templatesShouldBeDrawn) { + return tileBlob; + } + const drawSize = this.tileSize * this.drawMult; + tileCoords = tileCoords[0].toString().padStart(4, "0") + "," + tileCoords[1].toString().padStart(4, "0"); + console.log(`Searching for templates in tile: "${tileCoords}"`); + const templateArray = this.templatesArray; + console.log(templateArray); + templateArray.sort((a, b) => { + return a.sortID - b.sortID; + }); + console.log(templateArray); + const templatesToDraw = templateArray.map((template) => { + const matchingTiles = Object.keys(template.chunked).filter( + (tile) => tile.startsWith(tileCoords) + ); + if (matchingTiles.length === 0) { + return null; + } + 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]], + pixelCoords: [coords2[2], coords2[3]] + }; + }); + return matchingTileBlobs?.[0]; + }).filter(Boolean); + console.log(templatesToDraw); + const templateCount = templatesToDraw?.length || 0; + console.log(`templateCount = ${templateCount}`); + if (templateCount > 0) { + const totalPixels = templateArray.filter((template) => { + const matchingTiles = Object.keys(template.chunked).filter( + (tile) => tile.startsWith(tileCoords) + ); + return matchingTiles.length > 0; + }).reduce((sum, template) => sum + (template.pixelCount.total || 0), 0); + const pixelCountFormatted = localizeNumber(totalPixels); + this.windowMain.handleDisplayStatus( + `Displaying ${templateCount} template${templateCount == 1 ? "" : "s"}. +Total pixels: ${pixelCountFormatted}` + ); + } else { + this.windowMain.handleDisplayStatus(`Sleeping +Version: ${this.version}`); + return tileBlob; + } + const tileBitmap = await createImageBitmap(tileBlob); + const canvas = new OffscreenCanvas(drawSize, drawSize); + const context = canvas.getContext("2d"); + context.imageSmoothingEnabled = false; + context.beginPath(); + context.rect(0, 0, drawSize, drawSize); + context.clip(); + context.clearRect(0, 0, drawSize, drawSize); + context.drawImage(tileBitmap, 0, 0, drawSize, drawSize); + const tileBeforeTemplates = context.getImageData(0, 0, drawSize, drawSize); + const tileBeforeTemplates32 = new Uint32Array(tileBeforeTemplates.data.buffer); + const highlightPattern = this.settingsManager?.userSettings?.highlight || [[2, 0, 0]]; + const highlightPatternIndexZero = highlightPattern?.[0]; + const highlightDisabled = highlightPattern?.length == 1 && highlightPatternIndexZero?.[0] == 2 && highlightPatternIndexZero?.[1] == 0 && highlightPatternIndexZero?.[2] == 0; + for (const template of templatesToDraw) { + console.log(`Template:`); + console.log(template); + const templateHasErased = !!template.instance.pixelCount?.colors?.get(-1); + let templateBeforeFilter32 = template.chunked32.slice(); + const coordXtoDrawAt = Number(template.pixelCoords[0]) * this.drawMult; + const coordYtoDrawAt = Number(template.pixelCoords[1]) * this.drawMult; + if (this.shouldFilterColor.size == 0 && !templateHasErased) { + context.drawImage(template.bitmap, coordXtoDrawAt, coordYtoDrawAt); + } + if (!templateBeforeFilter32) { + const templateBeforeFilter = context.getImageData(coordXtoDrawAt, coordYtoDrawAt, template.bitmap.width, template.bitmap.height); + templateBeforeFilter32 = new Uint32Array(templateBeforeFilter.data.buffer); + } + const timer = Date.now(); + const { + correctPixels: pixelsCorrect, + filteredTemplate: templateAfterFilter + } = __privateMethod(this, _TemplateManager_instances, calculateCorrectPixelsOnTile_And_FilterTile_fn).call(this, { + tile: tileBeforeTemplates32, + template: templateBeforeFilter32, + templateInfo: [coordXtoDrawAt, coordYtoDrawAt, template.bitmap.width, template.bitmap.height], + highlightPattern, + highlightDisabled + }); + let pixelsCorrectTotal = 0; + const transparentColorID = 0; + for (const [color, total] of pixelsCorrect) { + if (color == transparentColorID) { + continue; + } + pixelsCorrectTotal += total; + } + if (this.shouldFilterColor.size != 0 || templateHasErased || !highlightDisabled) { + console.log("Colors to filter: ", this.shouldFilterColor); + context.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(templateAfterFilter.buffer), template.bitmap.width, template.bitmap.height)), coordXtoDrawAt, coordYtoDrawAt); + } + console.log(`Finished calculating correct pixels & filtering colors for the tile ${tileCoords} in ${(Date.now() - timer) / 1e3} seconds! +There are ${pixelsCorrectTotal} correct pixels.`); + if (typeof template.instance.pixelCount["correct"] == "undefined") { + template.instance.pixelCount["correct"] = {}; + } + template.instance.pixelCount["correct"][tileCoords] = pixelsCorrect; + } + return await canvas.convertToBlob({ type: "image/png" }); + } + /** Imports the JSON object, and appends it to any JSON object already loaded + * @param {string} json - The JSON string to parse + */ + importJSON(json) { + console.log(`Importing JSON...`); + console.log(json); + if (json?.whoami == "BlueMarble") { + __privateMethod(this, _TemplateManager_instances, parseBlueMarble_fn).call(this, json); + } + } + /** Sets the `templatesShouldBeDrawn` boolean to a value. + * @param {boolean} value - The value to set the boolean to + * @since 0.73.7 + */ + setTemplatesShouldBeDrawn(value) { + this.templatesShouldBeDrawn = value; + } + }; + _TemplateManager_instances = new WeakSet(); + /** Generates a {@link Template} class instance from the JSON object template. + * {@link createTemplate()} will create a class instance and save to template storage. + * `#loadTemplate()` will create a class instance without saving to the template storage. + * @param {Object} template - The template to load + * @since 0.88.504 + */ + loadTemplate_fn = function(templateObject) { + const pixelCount = { + total: templateObject.pixels?.total, + colors: new Map(Object.entries(templateObject.pixels?.colors || {}).map(([key, value]) => [Number(key), value])) + }; + const template = new Template({ + displayName: templateObject.displayName, + sortID: Object.keys(this.templatesJSON.templates).length || 0, + authorID: numberToEncoded(this.userID || 0, this.encodingBase), + pixelCount, + chunked: templateObject.tiles + }); + template.calculateCoordsFromChunked(); + this.templatesArray.push(template); + }; + storeTemplates_fn = async function() { + GM.setValue("bmTemplates", JSON.stringify(this.templatesJSON)); + }; + parseBlueMarble_fn = async function(json) { + console.log(`Parsing BlueMarble...`); + const templates = json.templates; + console.log(`BlueMarble length: ${Object.keys(templates).length}`); + const schemaVersion = json?.schemaVersion; + const schemaVersionArray = schemaVersion.split(/[-\.\+]/); + const schemaVersionBleedingEdge = this.schemaVersion.split(/[-\.\+]/); + const scriptVersion = json?.scriptVersion; + console.log(`BlueMarble Template Schema: ${schemaVersion}; Script Version: ${scriptVersion}`); + if (schemaVersionArray[0] == schemaVersionBleedingEdge[0]) { + if (schemaVersionArray[1] != schemaVersionBleedingEdge[1]) { + const windowWizard = new WindowWizard(this.name, this.version, this.schemaVersion, this); + windowWizard.buildWindow(); + } + this.templatesArray = await loadSchema({ + tileSize: this.tileSize, + drawMult: this.drawMult, + templatesArray: this.templatesArray + }); + } else if (schemaVersionArray[0] < schemaVersionBleedingEdge[0]) { + const windowWizard = new WindowWizard(this.name, this.version, this.schemaVersion, this); + windowWizard.buildWindow(); + } else { + this.windowMain.handleDisplayError(`Template version ${schemaVersion} is unsupported. +Use Blue Marble version ${scriptVersion} or load a new template.`); + } + async function loadSchema({ + tileSize, + drawMult, + templatesArray + }) { + if (Object.keys(templates).length > 0) { + for (const template in templates) { + const templateKey = template; + const templateValue = templates[template]; + console.log(`Template Key: ${templateKey}`); + if (templates.hasOwnProperty(template)) { + const templateKeyArray = templateKey.split(" "); + const sortID = Number(templateKeyArray?.[0]); + const authorID = templateKeyArray?.[1] || "0"; + const displayName = templateValue.name || `Template ${sortID || ""}`; + const pixelCount = { + total: templateValue.pixels?.total, + colors: new Map(Object.entries(templateValue.pixels?.colors || {}).map(([key, value]) => [Number(key), value])) + }; + const tilesbase64 = templateValue.tiles; + const templateTiles = {}; + const templateTiles32 = {}; + const actualTileSize = tileSize * drawMult; + for (const tile in tilesbase64) { + console.log(tile); + if (tilesbase64.hasOwnProperty(tile)) { + const encodedTemplateBase64 = tilesbase64[tile]; + const templateUint8Array = base64ToUint8(encodedTemplateBase64); + const templateBlob = new Blob([templateUint8Array], { type: "image/png" }); + const templateBitmap = await createImageBitmap(templateBlob); + templateTiles[tile] = templateBitmap; + const canvas = new OffscreenCanvas(actualTileSize, actualTileSize); + const context = canvas.getContext("2d"); + context.drawImage(templateBitmap, 0, 0); + const imageData = context.getImageData(0, 0, templateBitmap.width, templateBitmap.height); + templateTiles32[tile] = new Uint32Array(imageData.data.buffer); + } + } + const template2 = new Template({ + displayName, + sortID: sortID || this.templatesArray?.length || 0, + authorID: authorID || "" + //coords: coords, + }); + template2.pixelCount = pixelCount; + template2.chunked = templateTiles; + template2.chunked32 = templateTiles32; + templatesArray.push(template2); + console.log(this.templatesArray); + console.log(`^^^ This ^^^`); + } + } + } + return templatesArray; + } + }; + /** Parses the OSU! Place JSON object + */ + parseOSU_fn = function() { + }; + /** Calculates the correct pixels on this tile. + * In addition, this function filters colors based on user input. + * In addition, this function modifies colors to properly display (#deface). + * This function has multiple purposes only to reduce iterations of scans over every pixel on the template. + * @param {Object} params - Object containing all parameters + * @param {Uint32Array} params.tile - The tile without templates as a Uint32Array + * @param {Uint32Array} params.template - The template without filtering as a Uint32Array + * @param {Array} params.templateInfo - Information about template location and size + * @param {Array} params.highlightPattern - The highlight pattern selected by the user + * @param {boolean} params.highlightDisabled - Should highlighting be disabled? + * @returns {{correctPixels: Map, filteredTemplate: Uint32Array}} A Map containing the color IDs (keys) and how many correct pixels there are for that color (values) + */ + calculateCorrectPixelsOnTile_And_FilterTile_fn = function({ + tile: tile32, + template: template32, + templateInfo: templateInformation, + highlightPattern, + highlightDisabled + }) { + const pixelSize = this.drawMult; + const tileWidth = this.tileSize * pixelSize; + const tileHeight = tileWidth; + const tilePixelOffsetY = -1; + const tilePixelOffsetX = 0; + const templateCoordX = templateInformation[0]; + const templateCoordY = templateInformation[1]; + const templateWidth = templateInformation[2]; + const templateHeight = templateInformation[3]; + const tolerance = this.paletteTolerance; + const { palette: _, LUT: lookupTable } = this.paletteBM; + const _colorpalette = /* @__PURE__ */ new Map(); + for (let templateRow = 1; templateRow < templateHeight; templateRow += pixelSize) { + for (let templateColumn = 1; templateColumn < templateWidth; templateColumn += pixelSize) { + const tileRow = templateCoordY + templateRow + tilePixelOffsetY; + const tileColumn = templateCoordX + templateColumn + tilePixelOffsetX; + const tilePixelAbove = tile32[tileRow * tileWidth + tileColumn]; + const templatePixel = template32[templateRow * templateWidth + templateColumn]; + const templatePixelAlpha = templatePixel >>> 24 & 255; + const tilePixelAlpha = tilePixelAbove >>> 24 & 255; + const bestTemplateColorID = lookupTable.get(templatePixel) ?? -2; + if (this.shouldFilterColor.get(bestTemplateColorID)) { + template32[templateRow * templateWidth + templateColumn] = tilePixelAbove; + } + if (bestTemplateColorID == -1) { + const blackTrans = 536870912; + if (this.shouldFilterColor.get(bestTemplateColorID)) { + template32[templateRow * templateWidth + templateColumn] = 0; + } else { + if ((tileRow / pixelSize & 1) == (tileColumn / pixelSize & 1)) { + template32[templateRow * templateWidth + templateColumn] = blackTrans; + template32[(templateRow - 1) * templateWidth + (templateColumn - 1)] = blackTrans; + template32[(templateRow - 1) * templateWidth + (templateColumn + 1)] = blackTrans; + template32[(templateRow + 1) * templateWidth + (templateColumn - 1)] = blackTrans; + template32[(templateRow + 1) * templateWidth + (templateColumn + 1)] = blackTrans; + } else { + template32[templateRow * templateWidth + templateColumn] = 0; + template32[(templateRow - 1) * templateWidth + templateColumn] = blackTrans; + template32[(templateRow + 1) * templateWidth + templateColumn] = blackTrans; + template32[templateRow * templateWidth + (templateColumn - 1)] = blackTrans; + template32[templateRow * templateWidth + (templateColumn + 1)] = blackTrans; + } + } + } + if (bestTemplateColorID == -1 && tilePixelAbove <= tolerance) { + const colorIDcount2 = _colorpalette.get(bestTemplateColorID); + _colorpalette.set(bestTemplateColorID, colorIDcount2 ? colorIDcount2 + 1 : 1); + continue; + } + if (templatePixelAlpha <= tolerance || tilePixelAlpha <= tolerance) { + continue; + } + const bestTileColorID = lookupTable.get(tilePixelAbove) ?? -2; + if (bestTileColorID != bestTemplateColorID) { + if (highlightDisabled) { + continue; + } + const templatePixelColor = template32[templateRow * templateWidth + templateColumn]; + for (const subpixelPattern of highlightPattern) { + const [subpixelState, subpixelColumnDelta, subpixelRowDelta] = subpixelPattern; + const subpixelColor = subpixelState != 0 ? subpixelState != 1 ? templatePixelColor : 4278190335 : 0; + template32[(templateRow + subpixelRowDelta) * templateWidth + (templateColumn + subpixelColumnDelta)] = subpixelColor; + } + continue; + } + const colorIDcount = _colorpalette.get(bestTemplateColorID); + _colorpalette.set(bestTemplateColorID, colorIDcount ? colorIDcount + 1 : 1); + } + } + console.log(`List of template pixels that match the tile:`); + console.log(_colorpalette); + return { correctPixels: _colorpalette, filteredTemplate: template32 }; + }; + + // src/apiManager.js + var ApiManager = class { + /** Constructor for ApiManager class + * @param {TemplateManager} templateManager + * @since 0.11.34 + */ + constructor(templateManager2) { + this.templateManager = templateManager2; + this.disableAll = false; + this.chargeRefillTimerID = ""; + this.coordsTilePixel = []; + this.templateCoordsTilePixel = []; + } + /** Determines if the spontaneously received response is something we want. + * Otherwise, we can ignore it. + * Note: Due to aggressive compression, make your calls like `data['jsonData']['name']` instead of `data.jsonData.name` + * + * @param {Overlay} overlay - The Overlay class instance + * @since 0.11.1 + */ + spontaneousResponseListener(overlay) { + window.addEventListener("message", async (event) => { + const data = event.data; + const dataJSON = data["jsonData"]; + if (!(data && data["source"] === "blue-marble")) { + return; + } + if (!data["endpoint"]) { + return; + } + const endpointText = data["endpoint"]?.split("?")[0].split("/").filter((s) => s && isNaN(Number(s))).filter((s) => s && !s.includes(".")).pop(); + console.log(`%cBlue Marble%c: Recieved message about "%s"`, "color: cornflowerblue;", "", endpointText); + switch (endpointText) { + case "me": + if (dataJSON["status"] && dataJSON["status"]?.toString()[0] != "2") { + overlay.handleDisplayError(`You are not logged in or Wplace is offline! +Could not fetch userdata.`); + return; + } + const nextLevelPixels = Math.ceil(Math.pow(Math.floor(dataJSON["level"]) * Math.pow(30, 0.65), 1 / 0.65) - dataJSON["pixelsPainted"]); + console.log(dataJSON["id"]); + if (!!dataJSON["id"] || dataJSON["id"] === 0) { + console.log(numberToEncoded( + dataJSON["id"], + "!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~" + )); + } + this.templateManager.userID = dataJSON["id"]; + if (this.chargeRefillTimerID.length != 0) { + const chargeRefillTimer = document.querySelector("#" + this.chargeRefillTimerID); + if (chargeRefillTimer) { + const chargeData = dataJSON["charges"]; + chargeRefillTimer.dataset["endDate"] = Date.now() + (chargeData["max"] - chargeData["count"]) * chargeData["cooldownMs"]; + } + } + overlay.updateInnerHTML("bm-user-droplets", `Droplets: ${localizeNumber(dataJSON["droplets"])}`); + overlay.updateInnerHTML("bm-user-nextlevel", `Next level in ${localizeNumber(nextLevelPixels)} pixel${nextLevelPixels == 1 ? "" : "s"}`); + break; + case "pixel": + const coordsTile = data["endpoint"].split("?")[0].split("/").filter((s) => s && !isNaN(Number(s))); + const payloadExtractor = new URLSearchParams(data["endpoint"].split("?")[1]); + const coordsPixel = [payloadExtractor.get("x"), payloadExtractor.get("y")]; + if (this.coordsTilePixel.length && (!coordsTile.length || !coordsPixel.length)) { + overlay.handleDisplayError(`Coordinates are malformed! +Did you try clicking the canvas first?`); + return; + } + this.coordsTilePixel = [...coordsTile, ...coordsPixel]; + const displayTP = serverTPtoDisplayTP(coordsTile, coordsPixel); + const spanElements = document.querySelectorAll("span"); + for (const element of spanElements) { + if (element.textContent.trim().includes(`${displayTP[0]}, ${displayTP[1]}`)) { + let displayCoords = document.querySelector("#bm-display-coords"); + const text = `(Tl X: ${coordsTile[0]}, Tl Y: ${coordsTile[1]}, Px X: ${coordsPixel[0]}, Px Y: ${coordsPixel[1]})`; + if (!displayCoords) { + displayCoords = document.createElement("span"); + displayCoords.id = "bm-display-coords"; + displayCoords.textContent = text; + displayCoords.style = "margin-left: calc(var(--spacing)*3); font-size: small;"; + element.parentNode.parentNode.insertAdjacentElement("afterend", displayCoords); + } else { + displayCoords.textContent = text; + } + } + } + break; + case "tile": + case "tiles": + let tileCoordsTile = data["endpoint"].split("/"); + tileCoordsTile = [parseInt(tileCoordsTile[tileCoordsTile.length - 2]), parseInt(tileCoordsTile[tileCoordsTile.length - 1].replace(".png", ""))]; + const blobUUID = data["blobID"]; + const blobData = data["blobData"]; + const timer = Date.now(); + const templateBlob = await this.templateManager.drawTemplateOnTile(blobData, tileCoordsTile); + console.log(`Finished loading the tile in ${(Date.now() - timer) / 1e3} seconds!`); + window.postMessage({ + source: "blue-marble", + blobID: blobUUID, + blobData: templateBlob, + blink: data["blink"] + }); + break; + case "robots": + this.disableAll = dataJSON["userscript"]?.toString().toLowerCase() == "false"; + break; + } + }); + } + // Sends a heartbeat to the telemetry server + async sendHeartbeat(version2) { + console.log("Sending heartbeat to telemetry server..."); + let userSettings2 = GM_getValue("bmUserSettings", "{}"); + userSettings2 = JSON.parse(userSettings2); + if (!userSettings2 || !userSettings2.telemetry || !userSettings2.uuid) { + console.log("Telemetry is disabled, not sending heartbeat."); + return; + } + const ua = navigator.userAgent; + let browser = await this.getBrowserFromUA(ua); + let os = this.getOS(ua); + GM_xmlhttpRequest({ + method: "POST", + url: "https://telemetry.thebluecorner.net/heartbeat", + headers: { + "Content-Type": "application/json" + }, + data: JSON.stringify({ + uuid: userSettings2.uuid, + version: version2, + browser, + os + }), + onload: (response) => { + if (response.status !== 200) { + consoleError("Failed to send heartbeat:", response.statusText); + } + }, + onerror: (error) => { + consoleError("Error sending heartbeat:", error); + } + }); + } + async getBrowserFromUA(ua = navigator.userAgent) { + ua = ua || ""; + if (ua.includes("OPR/") || ua.includes("Opera")) return "Opera"; + if (ua.includes("Edg/")) return "Edge"; + if (ua.includes("Vivaldi")) return "Vivaldi"; + if (ua.includes("YaBrowser")) return "Yandex"; + if (ua.includes("Kiwi")) return "Kiwi"; + if (ua.includes("Brave")) return "Brave"; + if (ua.includes("Firefox/")) return "Firefox"; + if (ua.includes("Chrome/")) return "Chrome"; + if (ua.includes("Safari/")) return "Safari"; + if (navigator.brave && typeof navigator.brave.isBrave === "function") { + if (await navigator.brave.isBrave()) return "Brave"; + } + return "Unknown"; + } + getOS(ua = navigator.userAgent) { + ua = ua || ""; + if (/Windows NT 11/i.test(ua)) return "Windows 11"; + if (/Windows NT 10/i.test(ua)) return "Windows 10"; + if (/Windows NT 6\.3/i.test(ua)) return "Windows 8.1"; + if (/Windows NT 6\.2/i.test(ua)) return "Windows 8"; + if (/Windows NT 6\.1/i.test(ua)) return "Windows 7"; + if (/Windows NT 6\.0/i.test(ua)) return "Windows Vista"; + if (/Windows NT 5\.1|Windows XP/i.test(ua)) return "Windows XP"; + if (/Mac OS X 10[_\.]15/i.test(ua)) return "macOS Catalina"; + if (/Mac OS X 10[_\.]14/i.test(ua)) return "macOS Mojave"; + if (/Mac OS X 10[_\.]13/i.test(ua)) return "macOS High Sierra"; + if (/Mac OS X 10[_\.]12/i.test(ua)) return "macOS Sierra"; + if (/Mac OS X 10[_\.]11/i.test(ua)) return "OS X El Capitan"; + if (/Mac OS X 10[_\.]10/i.test(ua)) return "OS X Yosemite"; + if (/Mac OS X 10[_\.]/i.test(ua)) return "macOS"; + if (/Android/i.test(ua)) return "Android"; + if (/iPhone|iPad|iPod/i.test(ua)) return "iOS"; + if (/Linux/i.test(ua)) return "Linux"; + return "Unknown"; + } + }; + // src/WindowTelemetry.js var _WindowTelemetry_instances, setTelemetryValue_fn; var WindowTelemetry = class extends Overlay { @@ -3397,229 +3655,6 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add GM.setValue("bmUserSettings", JSON.stringify(userSettings2)); }; - // src/WindowSettings.js - var _WindowSettings_instances, errorOverrideFailure_fn; - var WindowSettings = class extends Overlay { - /** Constructor for the Settings window - * @param {string} name - The name of the userscript - * @param {string} version - The version of the userscript - * @since 0.91.11 - * @see {@link Overlay#constructor} for examples - */ - constructor(name2, version2) { - super(name2, version2); - __privateAdd(this, _WindowSettings_instances); - this.window = null; - this.windowID = "bm-window-settings"; - this.windowParent = document.body; - } - /** Spawns a Settings window. - * If another settings window already exists, we DON'T spawn another! - * Parent/child relationships in the DOM structure below are indicated by indentation. - * @since 0.91.11 - */ - buildWindow() { - if (document.querySelector(`#${this.windowID}`)) { - document.querySelector(`#${this.windowID}`).remove(); - return; - } - this.window = this.addDiv({ "id": this.windowID, "class": "bm-window" }).addDragbar().addButton({ "class": "bm-button-circle", "textContent": "\u25BC", "aria-label": 'Minimize window "Color Filter"', "data-button-status": "expanded" }, (instance, button) => { - button.onclick = () => instance.handleMinimization(button); - button.ontouchend = () => { - button.click(); - }; - }).buildElement().addDiv().buildElement().addDiv({ "class": "bm-flex-center" }).addButton({ "class": "bm-button-circle", "textContent": "\u2716", "aria-label": 'Close window "Color Filter"' }, (instance, button) => { - button.onclick = () => { - document.querySelector(`#${this.windowID}`)?.remove(); - }; - button.ontouchend = () => { - button.click(); - }; - }).buildElement().buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Settings" }).buildElement().buildElement().addHr().buildElement().addP({ "textContent": "Settings take 5 seconds to save." }).buildElement().addDiv({ "class": "bm-container bm-scrollable" }, (instance, div) => { - this.buildHighlight(); - }).buildElement().buildElement().buildElement().buildOverlay(this.windowParent); - this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); - } - /** Builds the highlight section of the window. - * This should be overriden by {@link SettingsManager} - * @since 0.91.11 - */ - buildHighlight() { - __privateMethod(this, _WindowSettings_instances, errorOverrideFailure_fn).call(this, "Pixel Highlight"); - } - }; - _WindowSettings_instances = new WeakSet(); - /** Displays an error when a settings category fails to load. - * @param {string} name - The name of the category - */ - errorOverrideFailure_fn = function(name2) { - this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": name2 }).buildElement().addHr().buildElement().addP({ "innerHTML": `An error occured loading the ${name2} category. SettingsManager failed to override the ${name2} function inside WindowSettings.` }).buildElement().buildElement(); - }; - - // src/settingsManager.js - var _SettingsManager_instances, updateHighlightSettings_fn, updateHighlightToPreset_fn; - var SettingsManager = class extends WindowSettings { - /** Constructor for the SettingsManager class - * @param {string} name - The name of the userscript - * @param {string} version - The version of the userscript - * @param {Object} userSettings - The user settings as an object - * @since 0.91.11 - */ - constructor(name2, version2, userSettings2) { - super(name2, version2); - __privateAdd(this, _SettingsManager_instances); - this.userSettings = userSettings2; - this.userSettingsOld = structuredClone(this.userSettings); - this.userSettingsSaveLocation = "bmUserSettings"; - this.updateFrequency = 5e3; - this.lastUpdateTime = 0; - setInterval(this.updateUserStorage.bind(this), this.updateFrequency); - } - /** Updates the user settings in userscript storage - * @since 0.91.39 - */ - async updateUserStorage() { - const userSettingsCurrent = JSON.stringify(this.userSettings); - const userSettingsOld = JSON.stringify(this.userSettingsOld); - if (userSettingsCurrent != userSettingsOld && Date.now() - this.lastUpdateTime > this.updateFrequency) { - await GM.setValue(this.userSettingsSaveLocation, userSettingsCurrent); - this.userSettingsOld = structuredClone(this.userSettings); - this.lastUpdateTime = Date.now(); - console.log(userSettingsCurrent); - } - } - // This is one of the most insane OOP setups I have ever laid my eyes on - /** Builds the "highlight" category of the settings window - * @since 0.91.18 - * @see WindowSettings#buildHighlight - */ - buildHighlight() { - const highlightPresetOff = ''; - const highlightPresetCross = ''; - const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; - this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:" }).buildElement().addDiv({ "class": "bm-container bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "None"); - }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Cross" }).buildElement().addButton({ "innerHTML": highlightPresetCross, "aria-label": 'Preset "Cross Shape"' }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Cross"); - }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "X" }).buildElement().addButton({ "innerHTML": highlightPresetCross.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"', 'd="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'), "aria-label": 'Preset "X Shape"' }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "X"); - }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Full" }).buildElement().addButton({ "innerHTML": highlightPresetOff.replace("#fff", "#2f4f4f"), "aria-label": 'Preset "Full Template"' }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Full"); - }).buildElement().buildElement().buildElement().addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }); - for (let buttonY = -1; buttonY <= 1; buttonY++) { - for (let buttonX = -1; buttonX <= 1; buttonX++) { - const buttonState = storedHighlight[storedHighlight.findIndex(([, x, y]) => x == buttonX && y == buttonY)]?.[0] ?? 0; - let buttonStateName = "Disabled"; - if (buttonState == 1) { - buttonStateName = "Incorrect"; - } else if (buttonState == 2) { - buttonStateName = "Template"; - } - this.window = this.addButton({ - "data-status": buttonStateName, - "aria-label": `Sub-pixel ${buttonStateName.toLowerCase()}` - }, (instance, button) => { - button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightSettings_fn).call(this, button, [buttonX, buttonY]); - }).buildElement(); - } - } - this.window = this.buildElement().buildElement().buildElement(); - } - }; - _SettingsManager_instances = new WeakSet(); - /** Updates the display of the highlight buttons in the settings window. - * Additionally, it will update user settings with the new selection. - * @param {HTMLButtonElement} button - The button that was pressed - * @param {Array} coords - The relative coordinates of the button - * @since 0.91.46 - */ - updateHighlightSettings_fn = function(button, coords2) { - console.log(coords2); - button.disabled = true; - const status = button.dataset["status"]; - const userStorageOld = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; - let userStorageChange = [2, 0, 0]; - const userStorageNew = userStorageOld; - console.log(userStorageOld); - switch (status) { - // If the button was in the "Disabled" state - case "Disabled": - button.dataset["status"] = "Incorrect"; - button.ariaLabel = "Sub-pixel incorrect"; - userStorageChange = [1, ...coords2]; - break; - // If the button was in the "Incorrect" state - case "Incorrect": - button.dataset["status"] = "Template"; - button.ariaLabel = "Sub-pixel template"; - userStorageChange = [2, ...coords2]; - break; - // If the button was in the "Template" state - case "Template": - button.dataset["status"] = "Disabled"; - button.ariaLabel = "Sub-pixel disabled"; - userStorageChange = [0, ...coords2]; - break; - } - console.log(userStorageChange); - const indexOfChange = userStorageOld.findIndex(([, x, y]) => x == userStorageChange[1] && y == userStorageChange[2]); - console.log(indexOfChange); - if (userStorageChange[0] != 0) { - if (indexOfChange != -1) { - userStorageNew[indexOfChange] = userStorageChange; - } else { - userStorageNew.push(userStorageChange); - } - } else if (indexOfChange != -1) { - userStorageNew.splice(indexOfChange, 1); - } - console.log(userStorageNew); - this.userSettings["highlight"] = userStorageNew; - button.disabled = false; - }; - updateHighlightToPreset_fn = async function(preset) { - const presetButtons = document.querySelectorAll(".bm-highlight-preset-container button"); - for (const button of presetButtons) { - button.disabled = true; - } - let presetArray = [0, 0, 0, 0, 2, 0, 0, 0, 0]; - switch (preset) { - case "Cross": - presetArray = [0, 1, 0, 1, 2, 1, 0, 1, 0]; - break; - case "X": - presetArray = [1, 0, 1, 0, 2, 0, 1, 0, 1]; - break; - case "Full": - presetArray = [2, 2, 2, 2, 2, 2, 2, 2, 2]; - break; - } - const buttons = document.querySelector(".bm-highlight-grid")?.childNodes ?? []; - for (let buttonIndex = 0; buttonIndex < buttons.length; buttonIndex++) { - const button = buttons[buttonIndex]; - let buttonState = button.dataset["status"]; - buttonState = buttonState != "Disabled" ? buttonState != "Incorrect" ? 2 : 1 : 0; - let buttonStateDelta = presetArray[buttonIndex] - buttonState; - if (buttonStateDelta == 0) { - continue; - } - buttonStateDelta += buttonStateDelta < 0 ? 3 : 0; - button.click(); - if (buttonStateDelta == 2) { - for (let timeWaited = 0; timeWaited < 200; timeWaited += 10) { - if (!button.disabled) { - break; - } - await sleep(10); - } - button.click(); - } - } - for (const button of presetButtons) { - button.disabled = false; - } - }; - // src/main.js var name = GM_info.script.name.toString(); var version = GM_info.script.version.toString(); @@ -3728,11 +3763,13 @@ Time Since Blink: ${String(Math.floor(elapsed / 6e4)).padStart(2, "0")}:${String var userSettings = JSON.parse(GM_getValue("bmUserSettings", "{}")); var observers = new Observers(); var windowMain = new WindowMain(name, version); - var templateManager = new TemplateManager(name, version, windowMain); + var templateManager = new TemplateManager(name, version); var apiManager = new ApiManager(templateManager); var settingsManager = new SettingsManager(name, version, userSettings); windowMain.setSettingsManager(settingsManager); windowMain.setApiManager(apiManager); + templateManager.setWindowMain(windowMain); + templateManager.setSettingsManager(settingsManager); var storageTemplates = JSON.parse(GM_getValue("bmTemplates", "{}")); console.log(storageTemplates); templateManager.importJSON(storageTemplates); diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index 5c50ddd..5203fb1 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.91.53 +// @version 0.91.59 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.O=null,this.B="bm-l",this.I=null,this.P=null,this.A=[]}W(t){this.N=t}V(t){this.O=t}_(){return this.A.length>0&&(this.P=this.A.pop()),this}F(t){t?.appendChild(this.I),this.I=null,this.P=null,this.A=[]}U(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"p",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"small",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"span",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,y).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,y).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this._(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this._(),e(this,n,i(this,x,y).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"th",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"td",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.B,n)}};return e(this,i(this,x,y).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,y).call(this,"div"),o=i(this,x,y).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this._();const a=i(this,x,y).call(this,"button",{textContent:n});return this._(),this._(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,y).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ht(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.B,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.B,"Error: "+t,!0)}};x=new WeakSet,y=function(t,e={},n={}){const s=document.createElement(t);this.I?(this.P?.appendChild(s),this.A.push(this.P),this.P=s):(this.I=s,this.P=s);for(const[t,n]of Object.entries(e))i(this,x,$).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,$).call(this,s,t,e);return s},$=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.Bt="bm-m",this.It=document.body,this.Pt=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.Pt?.scriptVersion,this.schemaVersion=this.Pt?.schemaVersion,this.At=void 0,this.Wt=n,this.Vt=s}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.Bt,class:"bm-N",style:t},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({id:"bm-o",textContent:"Loading template storage status..."})._()._().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"})._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Wt.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.At="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.At="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.At="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.At="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Wt)}.
Wplace was last updated on ${l}.${"Good"!=this.At?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.At&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.$t({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Vt._t().then(()=>{e.disabled=!1})}})._()),"Poor"!=this.At&&"Bad"!=this.At||c.$t({textContent:`Update template storage to ${this.Wt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}})._(),c._().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.Pt?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Bt} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Vt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"})._().R({textContent:`#${m}`})._()._().U({class:"bm-x bm-0"}).q(3,{textContent:r})._().j({textContent:`Uploaded by user #${u}`})._().j({textContent:`Coordinates: ${l.join(", ")}`})._().j({textContent:`Total Pixels: ${b}`})._()._()._()}}i._().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Bt} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({textContent:"Updating template storage. Please wait..."})._()._()._().F(t)}GM_deleteValue("bmCoords");const e=this.Pt?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.Vt.Ut(t);await this.Vt.Gt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Bt}`).remove(),new L(this.name,this.version,this.Wt,this.Vt).zt())};var H,N,O,B,I=L;H=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Rt))},O=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new I(this.name,this.version,this.schemaVersion,this).zt(),this.jt=await async function({C:t,Et:i,jt:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.jt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.jt),console.log("^^^ This ^^^")}}return n}({C:this.C,Et:this.Et,jt:this.jt})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Qt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Qt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var P=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},A=class extends HTMLElement{};customElements.define("confetti-piece",A);var W,V,z,_,F,U,G,R,j,E,Y,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.Bt="bm-i",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"})._()._().Z()._().U({class:"bm-E bm-A"}).j({role:"img","aria-label":this.name}).j({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"})._()._().K()._().Z()._().K()._().j({textContent:'"Blue Marble" userscript is made by SwingTheVine.'})._().K()._().j({innerHTML:'The Blue Marble Website is made by crqch.'})._().K()._().j({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`})._().K()._().j({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'})._().K()._().j({textContent:"Special Thanks:"})._().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."})._().ht({innerHTML:'nof, darkness for creating similar userscripts!'})._().ht({innerHTML:'Wonda for the Blue Marble banner image!'})._().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'})._().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'})._().ht({innerHTML:'Nomad and Gustav for the tutorials!'})._().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'})._().ht({innerHTML:'Force Network for hosting the telemetry server!'})._().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'})._()._().K()._().j({innerHTML:'Donators:'})._().lt().ht({textContent:"Espresso"})._().ht({textContent:"BEST FAN"})._().ht({textContent:"Jack"})._().ht({textContent:"raiken_au"})._().ht({textContent:"Jacob"})._().ht({textContent:"StupidOne"})._().ht({textContent:"2 Anonymous Supporters"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Bt="bm-p",this.se="bm-y",this.It=document.body,this.Vt=t.N?.Vt,this.oe='',this.ae='';const{palette:i,H:n}=this.Vt.Zt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).j({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"})._().K()._().j({id:"bm-9",innerHTML:"Correct Pixels: ???"})._().K()._().j({id:"bm-f",innerHTML:"Total Pixels: ???"})._().K()._().j({id:"bm-4",innerHTML:"Complete: ??? (???)"})._().K()._().j({id:"bm-5",innerHTML:"??? ???"})._()._().U({class:"bm-E"}).G({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Bt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,W,z).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}})._()._()._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N bm-G"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}})._().U().j({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"})._()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.zt()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,W,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,ye:l,$e:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,ye:o,fe:a,ge:r,$e:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,V=function(t){const e=t.closest(`#${this.Bt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,ye:h,fe:m,ge:d,$e:u}=n[t.id],b=!!this.Vt.Qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},_=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.Vt.jt){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new P).ne(document.querySelector(`#${this.Bt}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,G=function(){new q(this).zt()},R=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},j=new WeakSet,E=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Z,Q,K,tt=class extends D{constructor(t,i){super(t,i),e(this,Y),this.window=null,this.Bt="bm-N-settings",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"})._()._().Z()._().G({textContent:"Settings take 5 seconds to save."})._().U({class:"bm-E bm-A"},(t,e)=>{this.ve()})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}ve(){i(this,Y,J).call(this,"Pixel Highlight")}};Y=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t})._().Z()._().G({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`})._()._()},Z=new WeakSet,Q=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1},K=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1h")?.childNodes??[];for(let t=0;t{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0g0J/d40/5oG0OtRBAwc6XSWGItIJZo8IJg5jPBC+B01EUEffgsggea4pIfj/1ht+/7P9+Dv8dv/t7ffblTXq0vVLtHD38MrDy8/VDxce7j6sPmQ+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umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.Bt="bm-w",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.Bt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._()._().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5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H0bFPYisYM2Y8v//DJpxEft95b5squ2ZzKTnZ6WTKUbrl5dfYvHmzzPsBQegqrq5Gurt71ZugsaGR+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new P).ne(document.querySelector(`#${this.Bt}`))})})._().q(1,{textContent:this.name})._()._().Z()._().U({class:"bm-E"}).j({id:"bm-q",textContent:"Droplets:"})._().K()._().j({id:"bm-k",textContent:"Next level in..."})._().K()._().j({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id})._()._()._().Z()._().U({class:"bm-E"}).U({class:"bm-E"}).$t({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.He;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}})._().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._()._().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"})._()._().U({class:"bm-E bm-s"}).$t({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Vt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Vt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}})._().$t({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Bt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Vt.Gt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Nt("No file selected!")}})._().$t({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,G).call(this)})._()._().U({class:"bm-E"}).St({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0})._()._().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).$t({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.O.zt()}})._().$t({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Vt;new I(this.name,this.version,e?.schemaVersion,e).zt()}})._().$t({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version).zt()}})._()._().R({textContent:"Made by SwingTheVine",style:"margin-top: auto;"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i,n){e(this,H),this.name=t,this.version=i,this.I=n,this.schemaVersion="2.0.0",this.Oe=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Et=3,this.qt=3,this.Zt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,H:i}}(this.qt),this.Jt=null,this.Be="",this.jt=[],this.Rt=null,this.Ie=!0,this.Pe=null,this.Qt=new Map}async Ae(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Gt(t,e,n){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Oe||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Zt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Rt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.jt=[],this.jt.push(s),this.I.Ot(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.Rt.templates).length),console.log(this.Rt),console.log(this.jt),console.log(JSON.stringify(this.Rt)),await i(this,H,N).call(this)}We(){}async Ve(){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON..."))}async ze(){l("Downloading all templates..."),console.log(this.jt);for(const t of this.jt)await this._e(t),await n(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this._e(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async _e(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Et),r=Math.max(r,u+m.height/this.Et)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Et,m=c*this.Et;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Et,(m-o)*this.Et,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Et,c*this.Et,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.Ie)return t;const n=this.C*this.Et;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.jt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ge:t,Re:t.v[e],M:t.M?.[e],je:[i[0],i[1]],Ee:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ge.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ee[0])*this.Et,a=Number(t.Ee[1])*this.Et;if(0!=this.Qt.size||n||h.drawImage(t.Re,o,a),!s){const e=h.getImageData(o,a,t.Re.width,t.Re.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,H,B).call(this,{Yt:d,Jt:s,Xt:[o,a,t.Re.width,t.Re.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Qt.size||n)&&(console.log("Colors to filter: ",this.Qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Re.width,t.Re.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ge.T.correct&&(t.Ge.T.correct={}),t.Ge.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ye(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,H,O).call(this,t)}Ne(t){this.Ie=t}}(et,it,rt),ct=new class{constructor(t){this.Vt=t,this.Je=!1,this.Le="",this.He=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Vt.Oe=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.He.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.He=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Vt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Ze(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Qe(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Qe(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends tt{constructor(t,i,n){super(t,i),e(this,Z),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t='',e='',n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"})._().Z()._().U({style:"margin-left: 1.5ch;"}).G({id:"bm-Z",textContent:"Choose a preset:"})._().U({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).U({class:"bm-Y"}).j({textContent:"None"})._().$t({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"None")})._()._().U({class:"bm-Y"}).j({textContent:"Cross"})._().$t({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Cross")})._()._().U({class:"bm-Y"}).j({textContent:"X"})._().$t({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"X")})._()._().U({class:"bm-Y"}).j({textContent:"Full"})._().$t({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Full")})._()._()._().G({id:"bm-14",textContent:"Create a custom pattern:"})._().U({class:"bm-1h",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.$t({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,Z,Q).call(this,s,[e,t])})._()}this.window=this._()._()._()}}(et,it,at);rt.V(ht),rt.W(ct);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ye(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.Ze(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,j),this.window=null,this.Bt="bm-g",this.It=document.body,this.oi=n,this.uuid=s}async zt(){if(document.querySelector(`#${this.Bt}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Qe(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.Bt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`})._()._().Z()._().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).$t({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,this.oi);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,0);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"})._().G({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 ${this.name}!`})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"})._().G({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'})._().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`})._().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`})._().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`})._().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`})._().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."})._()._().G({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'})._()._()._()._()._().F(this.It)}}(et,it,1,at?.uuid);t.W(ct),t.zt()}rt.zt(),ct.qe(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,_,F,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D()._().D().V().D()._().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D()._().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D()._().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D()._().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D()._().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D()._().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ft="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D()._().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D()._().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D()._().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D()._().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ft}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ft});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ft}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,_).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,F).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},_=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},F=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,x=f>>>24&255,y=u.get(g)??-2;if(this.re.get(y)&&(e[i*c+h]=f),-1==y){const t=536870912;this.re.get(y)?e[i*c+h]=0:(d/o&1)==(p/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(-1==y&&f<=m){const t=b.get(y);b.set(y,t?t+1:1);continue}if(w<=m||x<=m)continue;if((u.get(f)??-2)!=y){if(s)continue;const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}continue}const $=b.get(y);b.set(y,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(b),{Te:b,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+MzbbQxeN55AxRPykXk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OfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c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AAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D()._().D().B({id:"bm-k",textContent:"Next level in..."}).D()._().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Fe(){}async Ue(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){super(t,i),e(this,C),this.St=n,this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.ci=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.ci);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 67b1972..8d1d342 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1h{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1h>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1h>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1h>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1h>button:hover,#bm-N-settings .bm-1h>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 2d96276..c22b4b0 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.91.53 +// @version 0.91.59 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor({displayName:t="My template",p:i=0,$:n="",url:s="",file:o=null,coords:a=null,v:r=null,M:l={},C:c=1e3}={}){e(this,g),this.displayName=t,this.p=i,this.$=n,this.url=s,this.file=o,this.coords=a,this.v=r,this.M=l,this.C=c,this.T={total:0,colors:new Map}}async S(t,e){console.log("Template coordinates:",this.coords);const n=await createImageBitmap(this.file),s=n.width,o=n.height;this.C=t;const a={},r={},l=new OffscreenCanvas(this.C,this.C),c=l.getContext("2d",{willReadFrequently:!0});l.width=s,l.height=o,c.imageSmoothingEnabled=!1,c.drawImage(n,0,0);let h=Date.now();const m=i(this,g,w).call(this,c.getImageData(0,0,s,o),e);console.log(`Calculating total pixels took ${(Date.now()-h)/1e3} seconds`);let d=0;for(const[t,e]of m)0!=t&&(d+=e);this.T={total:d,colors:m},h=Date.now();const b=new OffscreenCanvas(3,3),p=b.getContext("2d");p.clearRect(0,0,3,3),p.fillStyle="white",p.fillRect(1,1,1,1);for(let t=this.coords[3];t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var C,T,S,k,D=class{constructor(t,i){e(this,x),this.name=t,this.version=i,this.N=null,this.O=null,this.B="bm-l",this.I=null,this.P=null,this.A=[]}W(t){this.N=t}V(t){this.O=t}_(){return this.A.length>0&&(this.P=this.A.pop()),this}F(t){t?.appendChild(this.I),this.I=null,this.P=null,this.A=[]}U(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"p",{},t)),this}R(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"small",{},t)),this}j(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"span",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"details",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"summary",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"img",{},t)),this}q(t,e={},n=()=>{}){return n(this,i(this,x,y).call(this,"h"+t,{},e)),this}Z(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"hr",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"br",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"form",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"fieldset",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"legend",{},t)),this}nt(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,x,y).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this._(),e(this,n,s),this}st(t={},e=()=>{}){const n=i(this,x,y).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this._(),e(this,n,i(this,x,y).call(this,"select",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"option",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ol",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"ul",{},t)),this}ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"menu",{},t)),this}ht(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"li",{},t)),this}dt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"table",{},t)),this}ut(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"caption",{},t)),this}bt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"thead",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tbody",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tfoot",{},t)),this}wt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"tr",{},t)),this}xt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"th",{},t)),this}yt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"td",{},t)),this}$t(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"button",{},t)),this}vt(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.Mt(this.B,n)}};return e(this,i(this,x,y).call(this,"button",s,t)),this}Ct(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"input",{},t)),this}Tt(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,x,y).call(this,"div"),o=i(this,x,y).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this._();const a=i(this,x,y).call(this,"button",{textContent:n});return this._(),this._(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}St(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"textarea",{},t)),this}kt(t={},e=()=>{}){return e(this,i(this,x,y).call(this,"div",{class:"bm-L"},t)),this}Dt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,x,y).call(this,"time",r,n);return l.id=a,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}Mt(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}Lt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}Ht(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.Nt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}Ot(t){(0,console.info)(`${this.name}: ${t}`),this.Mt(this.B,"Status: "+t,!0)}Nt(t){(0,console.error)(`${this.name}: ${t}`),this.Mt(this.B,"Error: "+t,!0)}};x=new WeakSet,y=function(t,e={},n={}){const s=document.createElement(t);this.I?(this.P?.appendChild(s),this.A.push(this.P),this.P=s):(this.I=s,this.P=s);for(const[t,n]of Object.entries(e))i(this,x,$).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,x,$).call(this,s,t,e);return s},$=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var L=class extends D{constructor(t,i,n,s=void 0){super(t,i),e(this,C),this.window=null,this.Bt="bm-m",this.It=document.body,this.Pt=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.Pt?.scriptVersion,this.schemaVersion=this.Pt?.schemaVersion,this.At=void 0,this.Wt=n,this.Vt=s}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.U({id:this.Bt,class:"bm-N",style:t},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({id:"bm-o",textContent:"Loading template storage status..."})._()._().U({class:"bm-E bm-A"}).q(2,{textContent:"Detected templates:"})._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`),i(this,C,T).call(this),i(this,C,S).call(this)}};C=new WeakSet,T=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.Wt.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.At="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.At="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.At="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.At="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.Mt("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.Wt)}.
Wplace was last updated on ${l}.${"Good"!=this.At?s:""}`);const c=new D(this.name,this.version);"Dead"!=this.At&&(c.U({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.$t({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Vt._t().then(()=>{e.disabled=!1})}})._()),"Poor"!=this.At&&"Bad"!=this.At||c.$t({textContent:`Update template storage to ${this.Wt}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,C,k).call(this,!0)}})._(),c._().F(document.querySelector("#bm-o").parentNode)},S=function(){const t=this.Pt?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.Bt} .bm-A`),i=new D(this.name,this.version);i.U({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Vt.Ft),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.U({class:"bm-E bm-x"}).U({class:"bm-x",style:"flex-direction: column; gap: 0;"}).U({class:"bm-1",textContent:h||"šŸ–¼ļø"})._().R({textContent:`#${m}`})._()._().U({class:"bm-x bm-0"}).q(3,{textContent:r})._().j({textContent:`Uploaded by user #${u}`})._().j({textContent:`Coordinates: ${l.join(", ")}`})._().j({textContent:`Total Pixels: ${b}`})._()._()._()}}i._().F(e)}},k=async function(t){if(t){const t=document.querySelector(`#${this.Bt} .bm-h`);t.innerHTML="",new D(this.name,this.version).U({class:"bm-E"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Template Wizard"})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Status"})._().G({textContent:"Updating template storage. Please wait..."})._()._()._().F(t)}GM_deleteValue("bmCoords");const e=this.Pt?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new M({displayName:i.name,v:i.tiles});t.L();const e=await this.Vt.Ut(t);await this.Vt.Gt(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.Bt}`).remove(),new L(this.name,this.version,this.Wt,this.Vt).zt())};var H,N,O,B,I=L;H=new WeakSet,N=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Rt))},O=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new I(this.name,this.version,this.schemaVersion,this).zt(),this.jt=await async function({C:t,Et:i,jt:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new M({displayName:l,p:s||this.jt?.length||0,$:r||""});p.T=c,p.v=m,p.M=d,n.push(p),console.log(this.jt),console.log("^^^ This ^^^")}}return n}({C:this.C,Et:this.Et,jt:this.jt})):n[0]>>24&255,g=b>>>24&255,w=m.get(p)??-2;if(this.Qt.get(w)&&(e[i*r+l]=b),-1==w){const t=536870912;this.Qt.get(w)?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==w&&b<=c){const t=d.get(w);d.set(w,t?t+1:1);continue}if(f<=c||g<=c)continue;if((m.get(b)??-2)!=w)continue;const x=d.get(w);d.set(w,x?x+1:1)}return console.log("List of template pixels that match the tile:"),console.log(d),{Kt:d,te:e}};var P=class{constructor(){this.ee=Math.ceil(80/1300*window.innerWidth),this.ie=v.slice(1)}ne(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)}},A=class extends HTMLElement{};customElements.define("confetti-piece",A);var W,V,z,_,F,U,G,R,j,E,Y,J,X=class extends D{constructor(t,e){super(t,e),this.window=null,this.Bt="bm-i",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Credits"})._()._().Z()._().U({class:"bm-E bm-A"}).j({role:"img","aria-label":this.name}).j({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"})._()._().K()._().Z()._().K()._().j({textContent:'"Blue Marble" userscript is made by SwingTheVine.'})._().K()._().j({innerHTML:'The Blue Marble Website is made by crqch.'})._().K()._().j({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`})._().K()._().j({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'})._().K()._().j({textContent:"Special Thanks:"})._().lt().ht({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."})._().ht({innerHTML:'nof, darkness for creating similar userscripts!'})._().ht({innerHTML:'Wonda for the Blue Marble banner image!'})._().ht({innerHTML:'BullStein, allanf181 for being early beta testers!'})._().ht({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'})._().ht({innerHTML:'Nomad and Gustav for the tutorials!'})._().ht({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'})._().ht({innerHTML:'Force Network for hosting the telemetry server!'})._().ht({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'})._()._().K()._().j({innerHTML:'Donators:'})._().lt().ht({textContent:"Espresso"})._().ht({textContent:"BEST FAN"})._().ht({textContent:"Jack"})._().ht({textContent:"raiken_au"})._().ht({textContent:"Jacob"})._().ht({textContent:"StupidOne"})._().ht({textContent:"2 Anonymous Supporters"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}},q=class extends D{constructor(t){super(t.name,t.version),e(this,W),this.window=null,this.Bt="bm-p",this.se="bm-y",this.It=document.body,this.Vt=t.N?.Vt,this.oe='',this.ae='';const{palette:i,H:n}=this.Vt.Zt;this.palette=i,this.re=0,this.le=0,this.ce=new Map,this.he=new Map,this.me=0,this.de=0,this.timeRemaining=0,this.ue="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}zt(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.be()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).U({class:"bm-E"}).j({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"})._().K()._().j({id:"bm-9",innerHTML:"Correct Pixels: ???"})._().K()._().j({id:"bm-f",innerHTML:"Total Pixels: ???"})._().K()._().j({id:"bm-4",innerHTML:"Complete: ??? (???)"})._().K()._().j({id:"bm-5",innerHTML:"??? ???"})._()._().U({class:"bm-E"}).G({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.oe.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.Bt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,W,z).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}})._()._()._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.Mt("#bm-e",`Tiles Loaded: ${s(this.re)} / ${s(this.le)}`),this.Mt("#bm-9",`Correct Pixels: ${s(this.me)}`),this.Mt("#bm-f",`Total Pixels: ${s(this.de)}`),this.Mt("#bm-4",`Remaining: ${s((this.de||0)-(this.me||0))} (${o(((this.de||0)-(this.me||0))/(this.de||1))})`),this.Mt("#bm-5",`Completed at: `)}be(){if(document.querySelector(`#${this.Bt}`))return void document.querySelector(`#${this.Bt}`).remove();this.window=this.U({id:this.Bt,class:"bm-N bm-G"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.Lt(e)},e.ontouchend=()=>{e.click()}})._().U().j({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"})._()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove(),this.zt()},e.ontouchend=()=>{e.click()}})._().$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Color Filter"})._()._().Z()._().U({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).$t({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!1)})._().$t({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.pe(),e.disabled=!1}})._().$t({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,W,_).call(this,!0)})._()._().U({class:"bm-E bm-A"})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`);const t=document.querySelector(`#${this.Bt} .bm-E.bm-A`);i(this,W,V).call(this,t),i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}pe(){i(this,W,F).call(this);const t=document.querySelector(`#${this.se}`),e={};for(const t of this.palette){const i=this.ce.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.he.get(t.id)??"???","number"!=typeof a&&this.re==this.le&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={fe:i,ge:n,we:a,xe:r,ye:l,$e:c}}if(document.querySelector("#bm-X")){const t=this.me.toString().length>7?this.me.toString().slice(0,2)+"…"+this.me.toString().slice(-3):this.me.toString(),e=this.de.toString().length>7?this.de.toString().slice(0,2)+"…"+this.de.toString().slice(-3):this.de.toString();this.Mt("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{we:n,xe:s,ye:o,fe:a,ge:r,$e:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.Bt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,W,z).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};W=new WeakSet,V=function(t){const e=t.closest(`#${this.Bt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new D(this.name,this.version);i.U({id:this.se});const n=this.pe();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{we:l,xe:c,ye:h,fe:m,ge:d,$e:u}=n[t.id],b=!!this.Vt.Qt.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.U({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).U({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("Number(t)||0).join(",")});`}).$t({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.ae.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.ae.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},_=function(t){const e=document.querySelector(`#${this.se}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},F=function(){this.de=0,this.me=0,this.he=new Map,this.ce=new Map;for(const t of this.Vt.jt){const e=t.T?.total??0;this.de+=e??0;const i=t.T?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ce.get(t)??0;this.ce.set(t,n+i)}const n=t.T?.correct??{};this.re+=Object.keys(n).length,this.le+=Object.keys(t.v).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.me+=t;const n=this.he.get(e)??0;this.he.set(e,n+t)}}console.log(`Tiles loaded: ${this.re} / ${this.le}`),this.me>=this.de&&this.de&&this.re==this.le&&(new P).ne(document.querySelector(`#${this.Bt}`)),this.timeRemaining=new Date(30*(this.de-this.me)*1e3+Date.now()),this.ue=a(this.timeRemaining)},U=new WeakSet,G=function(){new q(this).zt()},R=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.Mt("bm-H",s?.[0]||""),t.Mt("bm-I",s?.[1]||"")):1==s.length?t.Mt(e.id,s?.[0]||""):(t.Mt("bm-J",s?.[0]||""),t.Mt("bm-K",s?.[1]||""),t.Mt("bm-H",s?.[2]||""),t.Mt("bm-I",s?.[3]||""))},j=new WeakSet,E=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var Z,Q,K,tt=class extends D{constructor(t,i){super(t,i),e(this,Y),this.window=null,this.Bt="bm-N-settings",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?document.querySelector(`#${this.Bt}`).remove():(this.window=this.U({id:this.Bt,class:"bm-N"}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._().U({class:"bm-x"}).$t({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.Bt}`)?.remove()},e.ontouchend=()=>{e.click()}})._()._()._().U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:"Settings"})._()._().Z()._().G({textContent:"Settings take 5 seconds to save."})._().U({class:"bm-E bm-A"},(t,e)=>{this.ve()})._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}ve(){i(this,Y,J).call(this,"Pixel Highlight")}};Y=new WeakSet,J=function(t){this.window=this.U({class:"bm-E"}).q(2,{textContent:t})._().Z()._().G({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`})._()._()},Z=new WeakSet,Q=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.Me.highlight=o,t.disabled=!1},K=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1h")?.childNodes??[];for(let t=0;t{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.Ce=null,this.Te=null,this.Se="#bm-j"}ke(t){return this.Te=t,this.Ce=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Se)}),this}De(){return this.Ce}observe(t,e=!1,i=!1){t.observe(this.Te,{childList:e,subtree:i})}},new class extends D{constructor(t,i){super(t,i),e(this,U),this.window=null,this.Bt="bm-w",this.It=document.body}zt(){document.querySelector(`#${this.Bt}`)?this.Nt("Main window already exists!"):(this.window=this.U({id:this.Bt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).kt().$t({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.Lt(e),e.ontouchend=()=>{e.click()}})._().U()._()._().U({class:"bm-h"}).U({class:"bm-E"}).X({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new P).ne(document.querySelector(`#${this.Bt}`))})})._().q(1,{textContent:this.name})._()._().Z()._().U({class:"bm-E"}).j({id:"bm-q",textContent:"Droplets:"})._().K()._().j({id:"bm-k",textContent:"Next level in..."})._().K()._().j({textContent:"Charges: "}).Dt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.N.Le=e.id})._()._()._().Z()._().U({class:"bm-E"}).U({class:"bm-E"}).$t({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.N?.He;e?.[0]?(t.Mt("bm-J",e?.[0]||""),t.Mt("bm-K",e?.[1]||""),t.Mt("bm-H",e?.[2]||""),t.Mt("bm-I",e?.[3]||"")):t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?")}})._().Ct({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._().Ct({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,U,R).call(this,t,e,n))})._()._().U({class:"bm-E"}).Tt({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"})._()._().U({class:"bm-E bm-s"}).$t({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.N?.Vt?.Ne(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.Ot("Disabled templates!")):(t.N?.Vt?.Ne(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.Ot("Enabled templates!")),e.disabled=!1}})._().$t({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.Bt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.Nt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.N?.Vt.Gt(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.Ot("Drew to canvas!")):t.Nt("No file selected!")}})._().$t({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,U,G).call(this)})._()._().U({class:"bm-E"}).St({id:this.B,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0})._()._().U({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).U({class:"bm-s"}).$t({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.O.zt()}})._().$t({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.N?.Vt;new I(this.name,this.version,e?.schemaVersion,e).zt()}})._().$t({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}})._().$t({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}})._().$t({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new X(this.name,this.version).zt()}})._()._().R({textContent:"Made by SwingTheVine",style:"margin-top: auto;"})._()._()._()._()._().F(this.It),this.Ht(`#${this.Bt}.bm-N`,`#${this.Bt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i,n){e(this,H),this.name=t,this.version=i,this.I=n,this.schemaVersion="2.0.0",this.Oe=null,this.Ft="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.C=1e3,this.Et=3,this.qt=3,this.Zt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,H:i}}(this.qt),this.Jt=null,this.Be="",this.jt=[],this.Rt=null,this.Ie=!0,this.Pe=null,this.Qt=new Map}async Ae(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Gt(t,e,n){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON...")),this.I.Ot(`Creating template at ${n.join(", ")}...`);const s=new M({displayName:e,p:0,$:m(this.Oe||0,this.Ft),file:t,coords:n}),{k:o,D:a}=await s.S(this.C,this.Zt);s.v=o;const r={total:s.T.total,colors:Object.fromEntries(s.T.colors)};this.Rt.templates[`${s.p} ${s.$}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.jt=[],this.jt.push(s),this.I.Ot(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.Rt.templates).length),console.log(this.Rt),console.log(this.jt),console.log(JSON.stringify(this.Rt)),await i(this,H,N).call(this)}We(){}async Ve(){this.Rt||(this.Rt=await this.Ae(),console.log("Creating JSON..."))}async ze(){l("Downloading all templates..."),console.log(this.jt);for(const t of this.jt)await this._e(t),await n(500)}async _t(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this._e(new M({displayName:i.name,p:e.split(" ")?.[0],$:e.split(" ")?.[1],v:i.tiles})),await n(500))}async _e(t){t.L();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.Ut(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Fe:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async Ut(t){console.log(t);const e=t.v,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.C+c,u=l*this.C+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Et),r=Math.max(r,u+m.height/this.Et)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Et,m=c*this.Et;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.C+r,m=a*this.C+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Et,(m-o)*this.Et,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Et,c*this.Et,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ue(t,e){if(!this.Ie)return t;const n=this.C*this.Et;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.jt;console.log(o),o.sort((t,e)=>t.p-e.p),console.log(o);const a=o.map(t=>{const i=Object.keys(t.v).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ge:t,Re:t.v[e],M:t.M?.[e],je:[i[0],i[1]],Ee:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.I.Ot(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.v).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.T.total||0),0));this.I.Ot(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer);for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ge.T?.colors?.get(-1);let s=t.M.slice();const o=Number(t.Ee[0])*this.Et,a=Number(t.Ee[1])*this.Et;if(0!=this.Qt.size||n||h.drawImage(t.Re,o,a),!s){const e=h.getImageData(o,a,t.Re.width,t.Re.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Kt:l,te:c}=i(this,H,B).call(this,{Yt:d,Jt:s,Xt:[o,a,t.Re.width,t.Re.height]});let m=0;const u=0;for(const[t,e]of l)t!=u&&(m+=e);(0!=this.Qt.size||n)&&(console.log("Colors to filter: ",this.Qt),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Re.width,t.Re.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ge.T.correct&&(t.Ge.T.correct={}),t.Ge.T.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ye(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,H,O).call(this,t)}Ne(t){this.Ie=t}}(et,it,rt),ct=new class{constructor(t){this.Vt=t,this.Je=!1,this.Le="",this.He=[],this.Xe=[]}qe(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.Nt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Vt.Oe=n.id,0!=this.Le.length){const t=document.querySelector("#"+this.Le);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.Mt("bm-q",`Droplets: ${s(n.droplets)}`),t.Mt("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.He.length&&(!o.length||!c.length))return void t.Nt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.He=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Vt.Ue(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Je="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async Ze(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.Qe(i),s=this.Ke(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async Qe(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}Ke(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends tt{constructor(t,i,n){super(t,i),e(this,Z),this.Me=n,this.ti=structuredClone(this.Me),this.ei="bmUserSettings",this.ii=5e3,this.ni=0,setInterval(this.si.bind(this),this.ii)}async si(){const t=JSON.stringify(this.Me);t!=JSON.stringify(this.ti)&&Date.now()-this.ni>this.ii&&(await GM.setValue(this.ei,t),this.ti=structuredClone(this.Me),this.ni=Date.now(),console.log(t))}ve(){const t='',e='',n=this.Me?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.U({class:"bm-E"}).q(2,{textContent:"Pixel Highlight"})._().Z()._().U({style:"margin-left: 1.5ch;"}).G({id:"bm-Z",textContent:"Choose a preset:"})._().U({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).U({class:"bm-Y"}).j({textContent:"None"})._().$t({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"None")})._()._().U({class:"bm-Y"}).j({textContent:"Cross"})._().$t({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Cross")})._()._().U({class:"bm-Y"}).j({textContent:"X"})._().$t({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"X")})._()._().U({class:"bm-Y"}).j({textContent:"Full"})._().$t({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,Z,K).call(this,"Full")})._()._()._().G({id:"bm-14",textContent:"Create a custom pattern:"})._().U({class:"bm-1h",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.$t({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,Z,Q).call(this,s,[e,t])})._()}this.window=this._()._()._()}}(et,it,at);rt.V(ht),rt.W(ct);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ye(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.Ze(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends D{constructor(t,i,n,s){super(t,i),e(this,j),this.window=null,this.Bt="bm-g",this.It=document.body,this.oi=n,this.uuid=s}async zt(){if(document.querySelector(`#${this.Bt}`))return void this.Nt("Telemetry window already exists!");const t=await this.N.Qe(navigator.userAgent),e=this.N.Ke(navigator.userAgent);this.window=this.U({id:this.Bt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).U({class:"bm-h"}).U({class:"bm-E bm-d"}).q(1,{textContent:`${this.name} Telemetry`})._()._().Z()._().U({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).$t({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,this.oi);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,j,E).call(this,0);const t=document.getElementById(this.Bt);t?.remove()}})._().$t({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}})._()._().U({class:"bm-E bm-A"}).U({class:"bm-E"}).q(2,{textContent:"Legal"})._().G({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 ${this.name}!`})._()._().Z()._().U({class:"bm-E"}).q(2,{textContent:"Non-Legal Summary"})._().G({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'})._().lt().ht({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`})._().ht({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`})._().ht({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`})._().ht({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`})._().ht({innerHTML:"The date and time that Blue Marble sent the telemetry information."})._()._().G({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'})._()._()._()._()._().F(this.It)}}(et,it,1,at?.uuid);t.W(ct),t.zt()}rt.zt(),ct.qe(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,_,F,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D()._().D().V().D()._().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D()._().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D()._().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D()._().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D()._().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D()._().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ft="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D()._().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D()._().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D()._().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D()._().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ft}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ft});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ft}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,_).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,F).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},_=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},F=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,x=f>>>24&255,y=u.get(g)??-2;if(this.re.get(y)&&(e[i*c+h]=f),-1==y){const t=536870912;this.re.get(y)?e[i*c+h]=0:(d/o&1)==(p/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(-1==y&&f<=m){const t=b.get(y);b.set(y,t?t+1:1);continue}if(w<=m||x<=m)continue;if((u.get(f)??-2)!=y){if(s)continue;const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}continue}const $=b.get(y);b.set(y,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(b),{Te:b,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D()._().D().B({id:"bm-k",textContent:"Next level in..."}).D()._().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Fe(){}async Ue(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){super(t,i),e(this,C),this.St=n,this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.ci=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.ci);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 6ffca3f..ab694ef 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 bec80f1..9cb7e3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.53", + "version": "0.91.59", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.53", + "version": "0.91.59", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 6377127..b4a1e6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.53", + "version": "0.91.59", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 54ae7eb..41f1893 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.91.53 +// @version 0.91.59 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/main.js b/src/main.js index 7fa2f8a..322c1b7 100644 --- a/src/main.js +++ b/src/main.js @@ -192,13 +192,16 @@ const userSettings = JSON.parse(GM_getValue('bmUserSettings', '{}')); // Loads t // CONSTRUCTORS const observers = new Observers(); // Constructs a new Observers object const windowMain = new WindowMain(name, version); // Constructs a new Overlay object for the main overlay -const templateManager = new TemplateManager(name, version, windowMain); // Constructs a new TemplateManager object +const templateManager = new TemplateManager(name, version); // Constructs a new TemplateManager object const apiManager = new ApiManager(templateManager); // Constructs a new ApiManager object const settingsManager = new SettingsManager(name, version, userSettings); // Constructs a new SettingsManager windowMain.setSettingsManager(settingsManager); // Sets the settings manager windowMain.setApiManager(apiManager); // Sets the API manager +templateManager.setWindowMain(windowMain); +templateManager.setSettingsManager(settingsManager); // Sets the settings manager + const storageTemplates = JSON.parse(GM_getValue('bmTemplates', '{}')); console.log(storageTemplates); templateManager.importJSON(storageTemplates); // Loads the templates diff --git a/src/templateManager.js b/src/templateManager.js index 70e1660..7c4c19c 100644 --- a/src/templateManager.js +++ b/src/templateManager.js @@ -1,5 +1,7 @@ +import SettingsManager from "./settingsManager"; import Template from "./Template"; import { base64ToUint8, colorpaletteForBlueMarble, consoleError, consoleLog, consoleWarn, localizeNumber, numberToEncoded, sleep, viewCanvasInNewTab } from "./utils"; +import WindowMain from "./WindowMain"; import WindowWizard from "./WindowWizard"; /** Manages the template system. @@ -83,14 +85,17 @@ import WindowWizard from "./WindowWizard"; export default class TemplateManager { /** The constructor for the {@link TemplateManager} class. + * @param {string} name - The name of the userscript + * @param {string} version - The version of the userscript (SemVer as string) * @since 0.55.8 */ - constructor(name, version, overlay) { + constructor(name, version) { // Meta this.name = name; // Name of userscript this.version = version; // Version of userscript - this.overlay = overlay; // The main instance of the Overlay class + this.windowMain = null; // The main instance of the Overlay class + this.settingsManager = null; // The main instance of the SettingsManager class this.schemaVersion = '2.0.0'; // Version of JSON schema this.userID = null; // The ID of the current user this.encodingBase = '!#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~'; // Characters to use for encoding/decoding @@ -111,6 +116,22 @@ export default class TemplateManager { this.shouldFilterColor = new Map(); } + /** Updates the stored instance of the main window. + * @param {WindowMain} windowMain - The main window instance + * @since 0.91.54 + */ + setWindowMain(windowMain) { + this.windowMain = windowMain; + } + + /** Updates the stored instance of the SettingsManager. + * @param {SettingsManager} settingsManager - The settings manager instance + * @since 0.91.54 + */ + setSettingsManager(settingsManager) { + this.settingsManager = settingsManager; + } + /** Creates the JSON object to store templates in * @returns {{ whoami: string, scriptVersion: string, schemaVersion: string, templates: Object }} The JSON object * @since 0.65.4 @@ -135,7 +156,7 @@ export default class TemplateManager { // Creates the JSON object if it does not already exist if (!this.templatesJSON) {this.templatesJSON = await this.createJSON(); console.log(`Creating JSON...`);} - this.overlay.handleDisplayStatus(`Creating template at ${coords.join(', ')}...`); + this.windowMain.handleDisplayStatus(`Creating template at ${coords.join(', ')}...`); // Creates a new template instance const template = new Template({ @@ -166,7 +187,7 @@ export default class TemplateManager { this.templatesArray = []; // Remove this to enable multiple templates (2/2) this.templatesArray.push(template); // Pushes the Template object instance to the Template Array - this.overlay.handleDisplayStatus(`Template created at ${coords.join(', ')}!`); + this.windowMain.handleDisplayStatus(`Template created at ${coords.join(', ')}!`); console.log(Object.keys(this.templatesJSON.templates).length); console.log(this.templatesJSON); @@ -497,12 +518,12 @@ export default class TemplateManager { const pixelCountFormatted = localizeNumber(totalPixels); // Display status information about the templates being rendered - this.overlay.handleDisplayStatus( + this.windowMain.handleDisplayStatus( `Displaying ${templateCount} template${templateCount == 1 ? '' : 's'}.\nTotal pixels: ${pixelCountFormatted}` ); } else { //this.overlay.handleDisplayStatus(`Displaying ${templateCount} templates.`); - this.overlay.handleDisplayStatus(`Sleeping\nVersion: ${this.version}`); + this.windowMain.handleDisplayStatus(`Sleeping\nVersion: ${this.version}`); return tileBlob; // No templates are on this tile. Return the original tile early } @@ -523,6 +544,26 @@ export default class TemplateManager { const tileBeforeTemplates = context.getImageData(0, 0, drawSize, drawSize); const tileBeforeTemplates32 = new Uint32Array(tileBeforeTemplates.data.buffer); + + // Obtains the highlight pattern + const highlightPattern = this.settingsManager?.userSettings?.highlight || [[2, 0, 0]]; + // The code demands that a highlight pattern always exists. + // Therefore, to disable highlighting, the highlight pattern is `[[2, 0, 0]]`. + // `[[2, 0, 0]]` is special, and will skip the highlighting code altogether. + // As a side-effect, the template will always display while enabled. + // You can't disable all sub-pixels in order to hide the template. + + // Contains the first index of the highlight pattern. + const highlightPatternIndexZero = highlightPattern?.[0]; + // This is so we can later determine if the pattern is the preset "None" + + // Should highlighting be disabled? + const highlightDisabled = ( + (highlightPattern?.length == 1) + && (highlightPatternIndexZero?.[0] == 2) + && (highlightPatternIndexZero?.[1] == 0) + && (highlightPatternIndexZero?.[2] == 0) + ) // For each template in this tile, draw them. for (const template of templatesToDraw) { @@ -557,7 +598,9 @@ export default class TemplateManager { } = this.#calculateCorrectPixelsOnTile_And_FilterTile({ tile: tileBeforeTemplates32, template: templateBeforeFilter32, - templateInfo: [coordXtoDrawAt, coordYtoDrawAt, template.bitmap.width, template.bitmap.height] + templateInfo: [coordXtoDrawAt, coordYtoDrawAt, template.bitmap.width, template.bitmap.height], + highlightPattern: highlightPattern, + highlightDisabled: highlightDisabled }); let pixelsCorrectTotal = 0; @@ -573,7 +616,8 @@ export default class TemplateManager { // If there are colors to filter, then we draw the filtered template on the canvas // Or, if there are Erased (#deface) pixels, then we draw the modified template on the canvas - if ((this.shouldFilterColor.size != 0) || templateHasErased) { + // Or, if the user has enabled highlighting, then we draw the modified template on the canvas + if ((this.shouldFilterColor.size != 0) || templateHasErased || !highlightDisabled) { console.log('Colors to filter: ', this.shouldFilterColor); //context.putImageData(new ImageData(new Uint8ClampedArray(templateAfterFilter.buffer), template.bitmap.width, template.bitmap.height), coordXtoDrawAt, coordYtoDrawAt); context.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(templateAfterFilter.buffer), template.bitmap.width, template.bitmap.height)), coordXtoDrawAt, coordYtoDrawAt); @@ -654,7 +698,7 @@ export default class TemplateManager { } else { // We don't know what the schema is. Unsupported? - this.overlay.handleDisplayError(`Template version ${schemaVersion} is unsupported.\nUse Blue Marble version ${scriptVersion} or load a new template.`); + this.windowMain.handleDisplayError(`Template version ${schemaVersion} is unsupported.\nUse Blue Marble version ${scriptVersion} or load a new template.`); } /** Loads schema of Blue Marble template storage @@ -762,12 +806,16 @@ export default class TemplateManager { * @param {Uint32Array} params.tile - The tile without templates as a Uint32Array * @param {Uint32Array} params.template - The template without filtering as a Uint32Array * @param {Array} params.templateInfo - Information about template location and size + * @param {Array} params.highlightPattern - The highlight pattern selected by the user + * @param {boolean} params.highlightDisabled - Should highlighting be disabled? * @returns {{correctPixels: Map, filteredTemplate: Uint32Array}} A Map containing the color IDs (keys) and how many correct pixels there are for that color (values) */ #calculateCorrectPixelsOnTile_And_FilterTile({ tile: tile32, template: template32, - templateInfo: templateInformation + templateInfo: templateInformation, + highlightPattern: highlightPattern, + highlightDisabled: highlightDisabled }) { // Size of a pixel in actuality @@ -796,6 +844,10 @@ export default class TemplateManager { // For each center pixel... for (let templateRow = 1; templateRow < templateHeight; templateRow += pixelSize) { for (let templateColumn = 1; templateColumn < templateWidth; templateColumn += pixelSize) { + // ROWS ARE VERTICAL. "ROWS" AS IN, LIKE ON A SPREADSHEET + // COLUMNS ARE HORIZONTAL. "COLUMNS" AS IN, LIKE ON A SPREADSHEET + // THE FIFTH ROW IS FIVE DOWN FROM THE ZEROTH ROW + // THE THIRD COLUMN IS TO THE RIGHT OF THE FIRST COLUMN // The pixel on the tile to target (1 pixel above the template) const tileRow = (templateCoordY + templateRow) + tilePixelOffsetY; // (Template offset + current row) - 1 @@ -877,8 +929,38 @@ export default class TemplateManager { // Finds the best matching color ID for the tile pixel. If none is found, default to "-2" const bestTileColorID = lookupTable.get(tilePixelAbove) ?? -2; - // If the template pixel does not match the tile pixel, then the pixel is skipped. - if (bestTileColorID != bestTemplateColorID) {continue;} + // If the template pixel does not match the tile pixel, then the pixel is skipped after highlighting. + if (bestTileColorID != bestTemplateColorID) { + + // ----- HIGHLIGHTING ----- + + // If highlighting is disabled, then we skip highlighting + if (highlightDisabled) {continue;} + + // Obtains the template color of this pixel + const templatePixelColor = template32[(templateRow * templateWidth) + templateColumn]; + // This will retrieve the tile background instead if the color is filtered! + + for (const subpixelPattern of highlightPattern) { + + // Deconstructs the sub pixel + const [subpixelState, subpixelColumnDelta, subpixelRowDelta] = subpixelPattern; + // "Delta" because the coordinate of the sub-pixel is relative to the center of the pixel + + // Obtains the subpixel color to use + const subpixelColor = (subpixelState != 0) ? ((subpixelState != 1) ? templatePixelColor : 0xFF0000FF) : 0x00000000; + // 0 = Transparent (black) + // 1 = Red (#FF0000) + // 2 = Template (matches template or hides if filtered) + + // Sets the subpixel to match the color on the highlight pattern + template32[((templateRow + subpixelRowDelta) * templateWidth) + (templateColumn + subpixelColumnDelta)] = subpixelColor; + } + + // ----- END OF HIGHLIGHTING ----- + + continue; + } // If the code passes this point, the template pixel matches the tile pixel. // Increments the count by 1 for the best matching color ID (which can be negative). From f5dc4b43478eb62189ec366848616044161c25a5 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Thu, 5 Mar 2026 19:04:08 -0500 Subject: [PATCH 11/15] Added supporter to credits --- docs/CREDITS.md | 1 + src/WindowCredits.js | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/CREDITS.md b/docs/CREDITS.md index c41ea49..d343680 100644 --- a/docs/CREDITS.md +++ b/docs/CREDITS.md @@ -39,6 +39,7 @@ Special Thanks: [Donators](https://ko-fi.com/swingthevine): * Espresso * BEST FAN +* FuchsDresden * Jack * raiken_au * Jacob diff --git a/src/WindowCredits.js b/src/WindowCredits.js index 6e2bf85..30bfcd6 100644 --- a/src/WindowCredits.js +++ b/src/WindowCredits.js @@ -101,6 +101,7 @@ export default class WindowCredts extends Overlay { .addUl() .addLi({'textContent': 'Espresso'}).buildElement() .addLi({'textContent': 'BEST FAN'}).buildElement() + .addLi({'textContent': 'FuchsDresden'}).buildElement() .addLi({'textContent': 'Jack'}).buildElement() .addLi({'textContent': 'raiken_au'}).buildElement() .addLi({'textContent': 'Jacob'}).buildElement() From 5dd45cae7ae8cb8da8b5c0d2e83e48a6d307ef5e Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Thu, 5 Mar 2026 20:31:53 -0500 Subject: [PATCH 12/15] Trans Pixels Now Highlightable --- dist/BlueMarble-For-GreasyFork.user.js | 49 +++++++++++++----- dist/BlueMarble-Standalone.user.js | 4 +- dist/BlueMarble.user.js | 4 +- docs/README.md | 2 +- package-lock.json | 4 +- package.json | 2 +- src/BlueMarble.meta.js | 2 +- src/settingsManager.js | 34 +++++++++++- src/templateManager.js | 72 +++++++++++++++----------- 9 files changed, 118 insertions(+), 55 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index 4f164ff..0833991 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.91.59 +// @version 0.91.65 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -1606,9 +1606,11 @@ * @since 0.91.11 */ constructor(name2, version2, userSettings2) { + var _a; super(name2, version2); __privateAdd(this, _SettingsManager_instances); this.userSettings = userSettings2; + (_a = this.userSettings).flags ?? (_a.flags = []); this.userSettingsOld = structuredClone(this.userSettings); this.userSettingsSaveLocation = "bmUserSettings"; this.updateFrequency = 5e3; @@ -1628,6 +1630,21 @@ console.log(userSettingsCurrent); } } + /** Toggles a boolean flag to the state that was passed in. + * If no state was passed in, the flag will flip to the opposite state. + * The existence of the flag determines its state. If it exists, it is `true`. + * @param {string} flagName - The name of the flag to toggle + * @param {boolean} [state=undefined] - (Optional) The state to change the flag to + * @since 0.91.60 + */ + toggleFlag(flagName, state = void 0) { + const flagIndex = this.userSettings?.flags?.indexOf(flagName) ?? -1; + if (flagIndex != -1 && state !== true) { + this.userSettings?.flags?.splice(flagIndex, 1); + } else if (flagIndex == -1 && state !== false) { + this.userSettings?.flags?.push(flagName); + } + } // This is one of the most insane OOP setups I have ever laid my eyes on /** Builds the "highlight" category of the settings window * @since 0.91.18 @@ -1637,7 +1654,10 @@ const highlightPresetOff = ''; const highlightPresetCross = ''; const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; - this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:" }).buildElement().addDiv({ "class": "bm-container bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addCheckbox({ "textContent": "Highlight transparent pixels" }, (instance, label, checkbox) => { + checkbox.checked = !this.userSettings?.flags?.includes("hl-noTrans"); + checkbox.onchange = (event) => this.toggleFlag("hl-noTrans", !event.target.checked); + }).buildElement().addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:" }).buildElement().addDiv({ "class": "bm-container bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "None"); }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Cross" }).buildElement().addButton({ "innerHTML": highlightPresetCross, "aria-label": 'Preset "Cross Shape"' }, (instance, button) => { button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Cross"); @@ -2041,7 +2061,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); 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({ "role": "img", "aria-label": this.name }).addSpan({ "innerHTML": ascii, "class": "bm-ascii", "aria-hidden": "true" }).buildElement().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": 'cfp for creating the template overlay that Blue Marble was based on!' }).buildElement().addLi({ "innerHTML": 'Force Network for hosting the telemetry server!' }).buildElement().addLi({ "innerHTML": 'TheBlueCorner for getting me interested in online pixel canvases!' }).buildElement().buildElement().addBr().buildElement().addSpan({ "innerHTML": 'Donators:' }).buildElement().addUl().addLi({ "textContent": "Espresso" }).buildElement().addLi({ "textContent": "BEST FAN" }).buildElement().addLi({ "textContent": "Jack" }).buildElement().addLi({ "textContent": "raiken_au" }).buildElement().addLi({ "textContent": "Jacob" }).buildElement().addLi({ "textContent": "StupidOne" }).buildElement().addLi({ "textContent": "2 Anonymous Supporters" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); + }).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({ "role": "img", "aria-label": this.name }).addSpan({ "innerHTML": ascii, "class": "bm-ascii", "aria-hidden": "true" }).buildElement().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": 'cfp for creating the template overlay that Blue Marble was based on!' }).buildElement().addLi({ "innerHTML": 'Force Network for hosting the telemetry server!' }).buildElement().addLi({ "innerHTML": 'TheBlueCorner for getting me interested in online pixel canvases!' }).buildElement().buildElement().addBr().buildElement().addSpan({ "innerHTML": 'Donators:' }).buildElement().addUl().addLi({ "textContent": "Espresso" }).buildElement().addLi({ "textContent": "BEST FAN" }).buildElement().addLi({ "textContent": "FuchsDresden" }).buildElement().addLi({ "textContent": "Jack" }).buildElement().addLi({ "textContent": "raiken_au" }).buildElement().addLi({ "textContent": "Jacob" }).buildElement().addLi({ "textContent": "StupidOne" }).buildElement().addLi({ "textContent": "2 Anonymous Supporters" }).buildElement().buildElement().buildElement().buildElement().buildElement().buildOverlay(this.windowParent); this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); } }; @@ -3320,6 +3340,7 @@ Use Blue Marble version ${scriptVersion} or load a new template.`); /** Calculates the correct pixels on this tile. * In addition, this function filters colors based on user input. * In addition, this function modifies colors to properly display (#deface). + * In addition, this function modifies incorrect pixels to display highlighting. * This function has multiple purposes only to reduce iterations of scans over every pixel on the template. * @param {Object} params - Object containing all parameters * @param {Uint32Array} params.tile - The tile without templates as a Uint32Array @@ -3346,6 +3367,7 @@ Use Blue Marble version ${scriptVersion} or load a new template.`); const templateWidth = templateInformation[2]; const templateHeight = templateInformation[3]; const tolerance = this.paletteTolerance; + const shouldTransparentTilePixelsBeHighlighted = !this.settingsManager?.userSettings?.flags?.includes("hl-noTrans"); const { palette: _, LUT: lookupTable } = this.paletteBM; const _colorpalette = /* @__PURE__ */ new Map(); for (let templateRow = 1; templateRow < templateHeight; templateRow += pixelSize) { @@ -3357,6 +3379,7 @@ Use Blue Marble version ${scriptVersion} or load a new template.`); const templatePixelAlpha = templatePixel >>> 24 & 255; const tilePixelAlpha = tilePixelAbove >>> 24 & 255; const bestTemplateColorID = lookupTable.get(templatePixel) ?? -2; + const bestTileColorID = lookupTable.get(tilePixelAbove) ?? -2; if (this.shouldFilterColor.get(bestTemplateColorID)) { template32[templateRow * templateWidth + templateColumn] = tilePixelAbove; } @@ -3380,6 +3403,16 @@ Use Blue Marble version ${scriptVersion} or load a new template.`); } } } + if (!highlightDisabled && templatePixelAlpha > tolerance && bestTileColorID != bestTemplateColorID) { + if (shouldTransparentTilePixelsBeHighlighted || tilePixelAlpha > tolerance) { + const templatePixelColor = template32[templateRow * templateWidth + templateColumn]; + for (const subpixelPattern of highlightPattern) { + const [subpixelState, subpixelColumnDelta, subpixelRowDelta] = subpixelPattern; + const subpixelColor = subpixelState != 0 ? subpixelState != 1 ? templatePixelColor : 4278190335 : 0; + template32[(templateRow + subpixelRowDelta) * templateWidth + (templateColumn + subpixelColumnDelta)] = subpixelColor; + } + } + } if (bestTemplateColorID == -1 && tilePixelAbove <= tolerance) { const colorIDcount2 = _colorpalette.get(bestTemplateColorID); _colorpalette.set(bestTemplateColorID, colorIDcount2 ? colorIDcount2 + 1 : 1); @@ -3388,17 +3421,7 @@ Use Blue Marble version ${scriptVersion} or load a new template.`); if (templatePixelAlpha <= tolerance || tilePixelAlpha <= tolerance) { continue; } - const bestTileColorID = lookupTable.get(tilePixelAbove) ?? -2; if (bestTileColorID != bestTemplateColorID) { - if (highlightDisabled) { - continue; - } - const templatePixelColor = template32[templateRow * templateWidth + templateColumn]; - for (const subpixelPattern of highlightPattern) { - const [subpixelState, subpixelColumnDelta, subpixelRowDelta] = subpixelPattern; - const subpixelColor = subpixelState != 0 ? subpixelState != 1 ? templatePixelColor : 4278190335 : 0; - template32[(templateRow + subpixelRowDelta) * templateWidth + (templateColumn + subpixelColumnDelta)] = subpixelColor; - } continue; } const colorIDcount = _colorpalette.get(bestTemplateColorID); diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index 5203fb1..2e2e735 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.91.59 +// @version 0.91.65 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,_,F,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D()._().D().V().D()._().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D()._().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D()._().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D()._().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D()._().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D()._().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ft="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D()._().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D()._().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D()._().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D()._().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ft}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ft});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ft}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,_).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,F).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},_=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},F=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,x=f>>>24&255,y=u.get(g)??-2;if(this.re.get(y)&&(e[i*c+h]=f),-1==y){const t=536870912;this.re.get(y)?e[i*c+h]=0:(d/o&1)==(p/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(-1==y&&f<=m){const t=b.get(y);b.set(y,t?t+1:1);continue}if(w<=m||x<=m)continue;if((u.get(f)??-2)!=y){if(s)continue;const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}continue}const $=b.get(y);b.set(y,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(b),{Te:b,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9TVEFUSACE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0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP//AAAAAAAAubU+IZJzuMAAAAtoSURBVFhHlZZ3fJSFGce/NzKOhITL4kJCEgmJ7D2UXQKJghVBFEWkLC3ioNWigFrhg9ZRKBZUWigtcTBEQUEgBDAESEJCQvYk+7LnZV4u6+2TV8unfqRqnz9yd2/unvF7fs/veTT8HxaXVKBk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FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D()._().D().B({id:"bm-k",textContent:"Next level in..."}).D()._().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Fe(){}async Ue(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){super(t,i),e(this,C),this.St=n,this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.ci=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.ci);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOyn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2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBd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>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index c22b4b0..43dc703 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.91.59 +// @version 0.91.65 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,_,F,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D()._().D().V().D()._().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D()._().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D()._().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D()._().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D()._().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D()._().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ft="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D()._().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D()._().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D()._().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D()._().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ft}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ft});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ft}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,_).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,F).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},_=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},F=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,x=f>>>24&255,y=u.get(g)??-2;if(this.re.get(y)&&(e[i*c+h]=f),-1==y){const t=536870912;this.re.get(y)?e[i*c+h]=0:(d/o&1)==(p/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(-1==y&&f<=m){const t=b.get(y);b.set(y,t?t+1:1);continue}if(w<=m||x<=m)continue;if((u.get(f)??-2)!=y){if(s)continue;const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}continue}const $=b.get(y);b.set(y,$?$+1:1)}return console.log("List of template pixels that match the tile:"),console.log(b),{Te:b,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D()._().D().B({id:"bm-k",textContent:"Next level in..."}).D()._().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Fe(){}async Ue(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){super(t,i),e(this,C),this.St=n,this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.ci=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.ci);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index ab694ef..380ebf2 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 9cb7e3b..3f34ed1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.59", + "version": "0.91.65", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.59", + "version": "0.91.65", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index b4a1e6a..18fd7d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.59", + "version": "0.91.65", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 41f1893..ded1532 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.91.59 +// @version 0.91.65 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/settingsManager.js b/src/settingsManager.js index a161771..c24c3ac 100644 --- a/src/settingsManager.js +++ b/src/settingsManager.js @@ -4,13 +4,17 @@ import WindowSettings from "./WindowSettings"; /** SettingsManager class for handling user settings and making them persist between sessions. * Logic for {@link WindowSettings} is managed here. * "Flags" should follow the same styling as `.classList()` and should not contain spaces. + * A flag should always be false by default. + * When a flag is false, it will not exist in the "flags" Array. + * (Therefore, "flags" should be `[]` by default) + * If it exists in the "flags" Array, then the flag is `true`. * @class SettingsManager * @since 0.91.11 - * @examples + * @example * { * "uuid": "497dcba3-ecbf-4587-a2dd-5eb0665e6880", * "telemetry": 1, - * "flags": ["willHighlight", "openWindowed"], + * "flags": ["hl-noTrans", "ftr-oWin"], * "highlight": [[1,0,-1],[1,-1,0],[2,1,0],[1,0,1]], * "filter": [-2,0,4,5,6,29,63] * } @@ -27,6 +31,7 @@ export default class SettingsManager extends WindowSettings { super(name, version); // Executes WindowSettings constructor this.userSettings = userSettings; // User settings as an Object + this.userSettings.flags ??= []; // Makes sure the key "flags" always exists this.userSettingsOld = structuredClone(this.userSettings); // Creates a duplicate of the user settings to store the old version of user settings from 5+ seconds ago this.userSettingsSaveLocation = 'bmUserSettings'; // Storage save location @@ -54,6 +59,27 @@ export default class SettingsManager extends WindowSettings { } } + /** Toggles a boolean flag to the state that was passed in. + * If no state was passed in, the flag will flip to the opposite state. + * The existence of the flag determines its state. If it exists, it is `true`. + * @param {string} flagName - The name of the flag to toggle + * @param {boolean} [state=undefined] - (Optional) The state to change the flag to + * @since 0.91.60 + */ + toggleFlag(flagName, state = undefined) { + + const flagIndex = this.userSettings?.flags?.indexOf(flagName) ?? -1; // Is the flag `true`? + + // If the flag is enabled, AND the user does not want to force the flag to be true... + if ((flagIndex != -1) && (state !== true)) { + + this.userSettings?.flags?.splice(flagIndex, 1); // Remove the flag (makes it false) + } else if ((flagIndex == -1) && (state !== false)) { + // Else if the flag is disabled, AND the user does not want to force the flag to be false... + this.userSettings?.flags?.push(flagName); // Add the flag (makes it true) + } + } + // This is one of the most insane OOP setups I have ever laid my eyes on /** Builds the "highlight" category of the settings window @@ -73,6 +99,10 @@ export default class SettingsManager extends WindowSettings { .addHeader(2, {'textContent': 'Pixel Highlight'}).buildElement() .addHr().buildElement() .addDiv({'style': 'margin-left: 1.5ch;'}) + .addCheckbox({'textContent': 'Highlight transparent pixels'}, (instance, label, checkbox) => { + checkbox.checked = !this.userSettings?.flags?.includes('hl-noTrans'); // Makes the checkbox match the last stored user setting + checkbox.onchange = (event) => this.toggleFlag('hl-noTrans', !event.target.checked); // Forces the flag to be the opposite state as the checkbox. E.g. "Checked" means 'hl-noTrans' is false (does not exist). + }).buildElement() .addP({'id': 'bm-highlight-preset-label', 'textContent': 'Choose a preset:'}).buildElement() .addDiv({'class': 'bm-container bm-flex-center', 'style': 'width: 50%;', 'role': 'group', 'aria-labelledby': 'bm-highlight-preset-label'}) .addDiv({'class': 'bm-highlight-preset-container'}) diff --git a/src/templateManager.js b/src/templateManager.js index 7c4c19c..fb26984 100644 --- a/src/templateManager.js +++ b/src/templateManager.js @@ -801,6 +801,7 @@ export default class TemplateManager { /** Calculates the correct pixels on this tile. * In addition, this function filters colors based on user input. * In addition, this function modifies colors to properly display (#deface). + * In addition, this function modifies incorrect pixels to display highlighting. * This function has multiple purposes only to reduce iterations of scans over every pixel on the template. * @param {Object} params - Object containing all parameters * @param {Uint32Array} params.tile - The tile without templates as a Uint32Array @@ -836,6 +837,10 @@ export default class TemplateManager { //console.log(`TemplateX: ${templateCoordX}\nTemplateY: ${templateCoordY}\nStarting Row:${templateCoordY+tilePixelOffsetY}\nStarting Column:${templateCoordX+tilePixelOffsetX}`); + // Obtains if the user wants to highlight tile pixels that are transparent, but the template pixel is not + const shouldTransparentTilePixelsBeHighlighted = !this.settingsManager?.userSettings?.flags?.includes('hl-noTrans'); + // The actual logic of this boolean is "should all pixels be highlighted" + const { palette: _, LUT: lookupTable } = this.paletteBM; // Obtains the palette and LUT // Makes a copy of the color palette Blue Marble uses, turns it into a Map, and adds data to count the amount of each color @@ -864,6 +869,9 @@ export default class TemplateManager { // Finds the best matching color ID for the template pixel. If none is found, default to "-2" const bestTemplateColorID = lookupTable.get(templatePixel) ?? -2; + // Finds the best matching color ID for the tile pixel. If none is found, default to "-2" + const bestTileColorID = lookupTable.get(tilePixelAbove) ?? -2; + // ----- COLOR FILTER ----- // If this pixel on the template is a color the user wants to hide on the canvas... if (this.shouldFilterColor.get(bestTemplateColorID)) { @@ -909,6 +917,39 @@ export default class TemplateManager { } // ----- END OF ERASED ----- + // ----- HIGHLIGHTING ----- + + // If highlighting is enabled, AND the template pixel is NOT transparent AND the template pixel does NOT match the tile pixel + if (!highlightDisabled && (templatePixelAlpha > tolerance) && (bestTileColorID != bestTemplateColorID)) { + + // If the tile pixel is NOT transparent, OR the user wants to highlight transparent pixels + if (shouldTransparentTilePixelsBeHighlighted || (tilePixelAlpha > tolerance)) { + + // Obtains the template color of this pixel + const templatePixelColor = template32[(templateRow * templateWidth) + templateColumn]; + // This will retrieve the tile background instead if the color is filtered! + + // For each of the 9 subpixels inside the pixel... + for (const subpixelPattern of highlightPattern) { + + // Deconstructs the sub pixel + const [subpixelState, subpixelColumnDelta, subpixelRowDelta] = subpixelPattern; + // "Delta" because the coordinate of the sub-pixel is relative to the center of the pixel + + // Obtains the subpixel color to use + const subpixelColor = (subpixelState != 0) ? ((subpixelState != 1) ? templatePixelColor : 0xFF0000FF) : 0x00000000; + // 0 = Transparent (black) + // 1 = Red (#FF0000) + // 2 = Template (matches template or hides if filtered) + + // Sets the subpixel to match the color on the highlight pattern + template32[((templateRow + subpixelRowDelta) * templateWidth) + (templateColumn + subpixelColumnDelta)] = subpixelColor; + } + } + } + + // ----- END OF HIGHLIGHTING ----- + // If the template pixel is Erased, and the tile pixel is transparent... if ((bestTemplateColorID == -1) && (tilePixelAbove <= tolerance)) { @@ -926,39 +967,8 @@ export default class TemplateManager { } // If the code passes this point, both pixels are opaque & not Erased. - // Finds the best matching color ID for the tile pixel. If none is found, default to "-2" - const bestTileColorID = lookupTable.get(tilePixelAbove) ?? -2; - // If the template pixel does not match the tile pixel, then the pixel is skipped after highlighting. if (bestTileColorID != bestTemplateColorID) { - - // ----- HIGHLIGHTING ----- - - // If highlighting is disabled, then we skip highlighting - if (highlightDisabled) {continue;} - - // Obtains the template color of this pixel - const templatePixelColor = template32[(templateRow * templateWidth) + templateColumn]; - // This will retrieve the tile background instead if the color is filtered! - - for (const subpixelPattern of highlightPattern) { - - // Deconstructs the sub pixel - const [subpixelState, subpixelColumnDelta, subpixelRowDelta] = subpixelPattern; - // "Delta" because the coordinate of the sub-pixel is relative to the center of the pixel - - // Obtains the subpixel color to use - const subpixelColor = (subpixelState != 0) ? ((subpixelState != 1) ? templatePixelColor : 0xFF0000FF) : 0x00000000; - // 0 = Transparent (black) - // 1 = Red (#FF0000) - // 2 = Template (matches template or hides if filtered) - - // Sets the subpixel to match the color on the highlight pattern - template32[((templateRow + subpixelRowDelta) * templateWidth) + (templateColumn + subpixelColumnDelta)] = subpixelColor; - } - - // ----- END OF HIGHLIGHTING ----- - continue; } // If the code passes this point, the template pixel matches the tile pixel. From 077131d07b16bd2618f5ec9ec536ce948df4c6c4 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Thu, 5 Mar 2026 20:42:30 -0500 Subject: [PATCH 13/15] Fixed Settings Window styling bugs --- dist/BlueMarble-For-GreasyFork.user.css | 2 +- dist/BlueMarble-For-GreasyFork.user.js | 8 ++++---- 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.css | 2 +- src/settingsManager.js | 8 ++++---- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 4a1abe1..5cfaef8 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -279,7 +279,7 @@ input[type=file] { font-size: 1.6em; font-family: monospace; } -.bm-container:not(#bm-window-main .bm-container) { +.bm-windowed .bm-container:not(#bm-window-main .bm-container) { margin-top: 0.25em; margin-bottom: 0.25em; } diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index 0833991..ace8157 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.91.65 +// @version 0.91.67 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -1654,10 +1654,10 @@ const highlightPresetOff = ''; const highlightPresetCross = ''; const storedHighlight = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; - this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "style": "margin-left: 1.5ch;" }).addCheckbox({ "textContent": "Highlight transparent pixels" }, (instance, label, checkbox) => { + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "class": "bm-container", "style": "margin-left: 1.5ch;" }).addCheckbox({ "textContent": "Highlight transparent pixels" }, (instance, label, checkbox) => { checkbox.checked = !this.userSettings?.flags?.includes("hl-noTrans"); checkbox.onchange = (event) => this.toggleFlag("hl-noTrans", !event.target.checked); - }).buildElement().addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:" }).buildElement().addDiv({ "class": "bm-container bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { + }).buildElement().addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:", "style": "font-weight: 700;" }).buildElement().addDiv({ "class": "bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "None"); }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Cross" }).buildElement().addButton({ "innerHTML": highlightPresetCross, "aria-label": 'Preset "Cross Shape"' }, (instance, button) => { button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Cross"); @@ -1665,7 +1665,7 @@ button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "X"); }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Full" }).buildElement().addButton({ "innerHTML": highlightPresetOff.replace("#fff", "#2f4f4f"), "aria-label": 'Preset "Full Template"' }, (instance, button) => { button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Full"); - }).buildElement().buildElement().buildElement().addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }); + }).buildElement().buildElement().buildElement().addP({ "id": "bm-highlight-grid-label", "textContent": "Create a custom pattern:", "style": "font-weight: 700;" }).buildElement().addDiv({ "class": "bm-highlight-grid", "role": "group", "aria-labelledby": "bm-highlight-grid-label" }); for (let buttonY = -1; buttonY <= 1; buttonY++) { for (let buttonX = -1; buttonX <= 1; buttonX++) { const buttonState = storedHighlight[storedHighlight.findIndex(([, x, y]) => x == buttonX && y == buttonY)]?.[0] ?? 0; diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index 2e2e735..c964e8f 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.91.65 +// @version 0.91.67 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0g0J/d40/5oG0OtRBAwc6XSWGItIJZo8IJg5jPBC+B01EUEffgsggea4pIfj/1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CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcE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rfu27HvX0VN7Y2U1ZSK4pVw+dHD7N+/Vr0ej0h8+/H0bFPYisYM2Y8v//DJpxEft95b5squ2ZzKTnZ6WTKUbrl5dfYvHmzzPsBQegqrq5Gurt71ZugsaGR+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHDQGYD9TVEFUSACEThEICoGbAPoCC4NKAAE2AiQDg0oEIAWEWA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XqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP//AAAAAAAAubU+IZJzuMAAAAtoSURBVFhHlZZ3fJSFGce/NzKOhITL4kJCEgmJ7D2UXQKJghVBFEWkLC3ioNWigFrhg9ZRKBZUWigtcTBEQUEgBDAESEJCQvYk+7LnZV4u6+2TV8unfqRqnz9yd2/unvF7fs/veTT8HxaXVKBk52QSNGQSN65dxeThTktbG0tWPkhWtpmq8ho65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N0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 8d1d342..30f1025 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index 43dc703..c33f911 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.91.65 +// @version 0.91.67 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:"}).D().H({class:"bm-E bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 380ebf2..8f107a2 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 3f34ed1..4c265a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.65", + "version": "0.91.67", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.65", + "version": "0.91.67", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 18fd7d6..7d65e52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.65", + "version": "0.91.67", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index ded1532..5800592 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.91.65 +// @version 0.91.67 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/overlay.css b/src/overlay.css index 4382bb9..69320ab 100644 --- a/src/overlay.css +++ b/src/overlay.css @@ -347,7 +347,7 @@ input[type="file"] { /* Containers for "sections" of elements in windowed mode */ /* Does not apply to the main window */ -.bm-container:not(#bm-window-main .bm-container) { +.bm-windowed .bm-container:not(#bm-window-main .bm-container) { margin-top: 0.25em; margin-bottom: 0.25em; /* Do not use 'margin' shorthand, as it will override left/right margin */ diff --git a/src/settingsManager.js b/src/settingsManager.js index c24c3ac..c4fbefb 100644 --- a/src/settingsManager.js +++ b/src/settingsManager.js @@ -98,13 +98,13 @@ export default class SettingsManager extends WindowSettings { this.window = this.addDiv({'class': 'bm-container'}) .addHeader(2, {'textContent': 'Pixel Highlight'}).buildElement() .addHr().buildElement() - .addDiv({'style': 'margin-left: 1.5ch;'}) + .addDiv({'class': 'bm-container', 'style': 'margin-left: 1.5ch;'}) .addCheckbox({'textContent': 'Highlight transparent pixels'}, (instance, label, checkbox) => { checkbox.checked = !this.userSettings?.flags?.includes('hl-noTrans'); // Makes the checkbox match the last stored user setting checkbox.onchange = (event) => this.toggleFlag('hl-noTrans', !event.target.checked); // Forces the flag to be the opposite state as the checkbox. E.g. "Checked" means 'hl-noTrans' is false (does not exist). }).buildElement() - .addP({'id': 'bm-highlight-preset-label', 'textContent': 'Choose a preset:'}).buildElement() - .addDiv({'class': 'bm-container bm-flex-center', 'style': 'width: 50%;', 'role': 'group', 'aria-labelledby': 'bm-highlight-preset-label'}) + .addP({'id': 'bm-highlight-preset-label', 'textContent': 'Choose a preset:', 'style': 'font-weight: 700;'}).buildElement() + .addDiv({'class': 'bm-flex-center', 'style': 'width: 50%;', 'role': 'group', 'aria-labelledby': 'bm-highlight-preset-label'}) .addDiv({'class': 'bm-highlight-preset-container'}) .addSpan({'textContent': 'None'}).buildElement() .addButton({'innerHTML': highlightPresetOff, 'aria-label': 'Preset "None"'}, (instance, button) => {button.onclick = () => this.#updateHighlightToPreset('None')}).buildElement() @@ -122,7 +122,7 @@ export default class SettingsManager extends WindowSettings { .addButton({'innerHTML': highlightPresetOff.replace('#fff', '#2f4f4f'), 'aria-label': 'Preset "Full Template"'}, (instance, button) => {button.onclick = () => this.#updateHighlightToPreset('Full')}).buildElement() .buildElement() .buildElement() - .addP({'id': 'bm-highlight-grid-label', 'textContent': 'Create a custom pattern:'}).buildElement() + .addP({'id': 'bm-highlight-grid-label', 'textContent': 'Create a custom pattern:', 'style': 'font-weight: 700;'}).buildElement() .addDiv({'class': 'bm-highlight-grid', 'role': 'group', 'aria-labelledby': 'bm-highlight-grid-label'}); // We leave this open so we can add buttons From faeb67717f680adfa4773cabb3cd6c404da510fa Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Thu, 5 Mar 2026 23:03:25 -0500 Subject: [PATCH 14/15] Added settings UI for template creation trans skip --- dist/BlueMarble-For-GreasyFork.user.css | 11 +++++-- dist/BlueMarble-For-GreasyFork.user.js | 42 +++++++++++++++++++------ 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 | 20 ++++++++++-- src/WindowSettings.css | 13 ++++++-- src/WindowSettings.js | 10 ++++++ src/settingsManager.js | 36 ++++++++++++++------- 13 files changed, 113 insertions(+), 39 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.css b/dist/BlueMarble-For-GreasyFork.user.css index 5cfaef8..51f4238 100644 --- a/dist/BlueMarble-For-GreasyFork.user.css +++ b/dist/BlueMarble-For-GreasyFork.user.css @@ -390,9 +390,14 @@ input[type=file] { } /* src/WindowSettings.css */ +#bm-window-settings div:has(> .bm-highlight-preset-container) { + width: fit-content; + justify-content: flex-start; +} #bm-window-settings .bm-highlight-preset-container { display: flex; flex-direction: column; + width: 13%; } #bm-window-settings .bm-highlight-preset-container span { width: fit-content; @@ -408,8 +413,8 @@ input[type=file] { stroke: #333; stroke-width: 0.02px; width: 100%; - min-width: 1ch; - max-width: 10ch; + min-width: 1.5ch; + max-width: 14.5ch; } #bm-window-settings .bm-highlight-preset-container button:hover svg, #bm-window-settings .bm-highlight-preset-container button:focus svg { @@ -420,7 +425,7 @@ input[type=file] { grid-template-columns: 1fr 1fr 1fr; width: 25%; min-width: 3ch; - max-width: 30ch; + max-width: 15ch; } #bm-window-settings .bm-highlight-grid > button { width: 100%; diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index ace8157..cbfd0ab 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.91.67 +// @version 0.91.74 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -713,8 +713,15 @@ addCheckbox(additionalProperties = {}, callback = () => { }) { const properties = { "type": "checkbox" }; - const label = __privateMethod(this, _Overlay_instances, createElement_fn).call(this, "label", { "textContent": additionalProperties["textContent"] ?? "" }); - delete additionalProperties["textContent"]; + const labelContent = {}; + if (!!additionalProperties["textContent"]) { + labelContent["textContent"] = additionalProperties["textContent"]; + delete additionalProperties["textContent"]; + } else if (!!additionalProperties["innerHTML"]) { + labelContent["innerHTML"] = additionalProperties["innerHTML"]; + delete additionalProperties["textContent"]; + } + const label = __privateMethod(this, _Overlay_instances, createElement_fn).call(this, "label", labelContent); const checkbox = __privateMethod(this, _Overlay_instances, createElement_fn).call(this, "input", properties, additionalProperties); label.insertBefore(checkbox, label.firstChild); this.buildElement(); @@ -1577,6 +1584,7 @@ }; }).buildElement().buildElement().buildElement().addDiv({ "class": "bm-window-content" }).addDiv({ "class": "bm-container bm-center-vertically" }).addHeader(1, { "textContent": "Settings" }).buildElement().buildElement().addHr().buildElement().addP({ "textContent": "Settings take 5 seconds to save." }).buildElement().addDiv({ "class": "bm-container bm-scrollable" }, (instance, div) => { this.buildHighlight(); + this.buildTemplate(); }).buildElement().buildElement().buildElement().buildOverlay(this.windowParent); this.handleDrag(`#${this.windowID}.bm-window`, `#${this.windowID} .bm-dragbar`); } @@ -1587,10 +1595,18 @@ buildHighlight() { __privateMethod(this, _WindowSettings_instances, errorOverrideFailure_fn).call(this, "Pixel Highlight"); } + /** Builds the template section of the window. + * This should be overriden by {@link SettingsManager} + * @since 0.91.68 + */ + buildTemplate() { + __privateMethod(this, _WindowSettings_instances, errorOverrideFailure_fn).call(this, "Template"); + } }; _WindowSettings_instances = new WeakSet(); /** Displays an error when a settings category fails to load. * @param {string} name - The name of the category + * @since 0.91.11 */ errorOverrideFailure_fn = function(name2) { this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": name2 }).buildElement().addHr().buildElement().addP({ "innerHTML": `An error occured loading the ${name2} category. SettingsManager failed to override the ${name2} function inside WindowSettings.` }).buildElement().buildElement(); @@ -1657,7 +1673,7 @@ this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "class": "bm-container", "style": "margin-left: 1.5ch;" }).addCheckbox({ "textContent": "Highlight transparent pixels" }, (instance, label, checkbox) => { checkbox.checked = !this.userSettings?.flags?.includes("hl-noTrans"); checkbox.onchange = (event) => this.toggleFlag("hl-noTrans", !event.target.checked); - }).buildElement().addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:", "style": "font-weight: 700;" }).buildElement().addDiv({ "class": "bm-flex-center", "style": "width: 50%;", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { + }).buildElement().addP({ "id": "bm-highlight-preset-label", "textContent": "Choose a preset:", "style": "font-weight: 700;" }).buildElement().addDiv({ "class": "bm-flex-center", "role": "group", "aria-labelledby": "bm-highlight-preset-label" }).addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "None" }).buildElement().addButton({ "innerHTML": highlightPresetOff, "aria-label": 'Preset "None"' }, (instance, button) => { button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "None"); }).buildElement().buildElement().addDiv({ "class": "bm-highlight-preset-container" }).addSpan({ "textContent": "Cross" }).buildElement().addButton({ "innerHTML": highlightPresetCross, "aria-label": 'Preset "Cross Shape"' }, (instance, button) => { button.onclick = () => __privateMethod(this, _SettingsManager_instances, updateHighlightToPreset_fn).call(this, "Cross"); @@ -1685,6 +1701,19 @@ } this.window = this.buildElement().buildElement().buildElement(); } + /** Build the "template" category of settings window + * @since 0.91.68 + * @see WindowSettings#buildTemplate + */ + buildTemplate() { + this.window = this.addDiv({ "class": "bm-container" }).addHeader(2, { "textContent": "Pixel Highlight" }).buildElement().addHr().buildElement().addDiv({ "class": "bm-container", "style": "margin-left: 1.5ch;" }).addCheckbox({ "textContent": "Template creation should skip transparent tiles" }, (instance, label, checkbox) => { + checkbox.checked = !this.userSettings?.flags?.includes("hl-noSkip"); + checkbox.onchange = (event) => this.toggleFlag("hl-noSkip", !event.target.checked); + }).buildElement().addCheckbox({ "innerHTML": "Experimental: Template creation should aggressively skip transparent tiles" }, (instance, label, checkbox) => { + checkbox.checked = this.userSettings?.flags?.includes("hl-agSkip"); + checkbox.onchange = (event) => this.toggleFlag("hl-agSkip", event.target.checked); + }).buildElement().buildElement().buildElement(); + } }; _SettingsManager_instances = new WeakSet(); /** Updates the display of the highlight buttons in the settings window. @@ -1694,13 +1723,11 @@ * @since 0.91.46 */ updateHighlightSettings_fn = function(button, coords2) { - console.log(coords2); button.disabled = true; const status = button.dataset["status"]; const userStorageOld = this.userSettings?.highlight ?? [[1, 0, 1], [2, 0, 0], [1, -1, 0], [1, 1, 0], [1, 0, -1]]; let userStorageChange = [2, 0, 0]; const userStorageNew = userStorageOld; - console.log(userStorageOld); switch (status) { // If the button was in the "Disabled" state case "Disabled": @@ -1721,9 +1748,7 @@ userStorageChange = [0, ...coords2]; break; } - console.log(userStorageChange); const indexOfChange = userStorageOld.findIndex(([, x, y]) => x == userStorageChange[1] && y == userStorageChange[2]); - console.log(indexOfChange); if (userStorageChange[0] != 0) { if (indexOfChange != -1) { userStorageNew[indexOfChange] = userStorageChange; @@ -1733,7 +1758,6 @@ } else if (indexOfChange != -1) { userStorageNew.splice(indexOfChange, 1); } - console.log(userStorageNew); this.userSettings["highlight"] = userStorageNew; button.disabled = false; }; diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index c964e8f..09f6f74 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.91.67 +// @version 0.91.74 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CK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dTb0emtIOpYd/q8NbHSblCJe+/n+0jnNSyKcIrbDjWJrSn3iCdT5taXWpGH7Vdllyh5HfPUiwgjP/PRDgUZeFDCGqQibxhUvECgnE4sc2DbtmIFYEbhECq0+ItPwpB7LuTOwTQK3D/GHxiZt4LhVUeRHSLQKhuRqsT/mvXPm7+kqv1xRpcL4NrV/3LijKmRA3CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3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UdREcn8cG+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"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function g(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var f,w,x,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]}],M=class{constructor(t,i){e(this,f),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,f,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n={};t.textContent?(n.textContent=t.textContent,delete t.textContent):t.innerHTML&&(n.innerHTML=t.innerHTML,delete t.textContent);const s=i(this,f,w).call(this,"label",n),o=i(this,f,w).call(this,"input",{type:"checkbox"},t);return s.insertBefore(o,s.firstChild),this.D(),e(this,s,o),this}j(t={},e=()=>{}){const n=i(this,f,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,f,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,f,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,f,w).call(this,"div"),o=i(this,f,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,f,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"textarea",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{class:"bm-L"},t)),this}ft(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,f,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",g),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},g=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},f=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};f=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,f,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,f,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt(),this.St()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}St(){i(this,y,$).call(this,"Template")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){t.disabled=!0;const i=t.dataset.status,n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),this.kt.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.zt=Math.ceil(80/1300*window.innerWidth),this.Ft=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ut="bm-y",this.Mt=document.body,this.Gt=t.p?.Gt,this.Rt='',this.jt='';const{palette:i,Vt:n}=this.Gt.Et;this.palette=i,this.Yt=0,this.Jt=0,this.Xt=new Map,this.qt=new Map,this.Zt=0,this.Qt=0,this.timeRemaining=0,this.Kt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.te()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Rt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Yt)} / ${s(this.Jt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.Zt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Qt)}`),this.ht("#bm-4",`Remaining: ${s((this.Qt||0)-(this.Zt||0))} (${o(((this.Qt||0)-(this.Zt||0))/(this.Qt||1))})`),this.ht("#bm-5",`Completed at: `)}te(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ee(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ut}`),e={};for(const t of this.palette){const i=this.Xt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.qt.get(t.id)??"???","number"!=typeof a&&this.Yt==this.Jt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ie:i,ne:n,se:a,oe:r,ae:l,re:c}}if(document.querySelector("#bm-X")){const t=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString(),e=this.Qt.toString().length>7?this.Qt.toString().slice(0,2)+"…"+this.Qt.toString().slice(-3):this.Qt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{se:n,oe:s,ae:o,ie:a,ne:r,re:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ut});const n=this.ee();for(const t of this.palette){const s="#"+g(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{se:l,oe:c,ae:h,ie:m,ne:d,re:u}=n[t.id],b=!!this.Gt.le.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ut}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Qt=0,this.Zt=0,this.qt=new Map,this.Xt=new Map;for(const t of this.Gt.ce){const e=t.Bt?.total??0;this.Qt+=e??0;const i=t.Bt?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Xt.get(t)??0;this.Xt.set(t,n+i)}const n=t.Bt?.correct??{};this.Yt+=Object.keys(n).length,this.Jt+=Object.keys(t.Ht).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.Zt+=t;const n=this.qt.get(e)??0;this.qt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Yt} / ${this.Jt}`),this.Zt>=this.Qt&&this.Qt&&this.Yt==this.Jt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Qt-this.Zt)*1e3+Date.now()),this.Kt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.he=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.he?.scriptVersion,this.schemaVersion=this.he?.schemaVersion,this.me=void 0,this.de=n,this.Gt=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.de.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.me="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.me="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.me="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.me="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.de)}.
Wplace was last updated on ${l}.${"Good"!=this.me?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.me&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Gt.ue().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.me&&"Bad"!=this.me||c.lt({textContent:`Update template storage to ${this.de}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.he?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Gt.be),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.he?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Ht:i.tiles});t.Wt();const e=await this.Gt.pe(t);await this.Gt.ge(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.de,this.Gt).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.ce=await async function({Ot:t,we:i,ce:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,Dt:s||this.ce?.length||0,Lt:r||""});p.Bt=c,p.Ht=m,p.Nt=d,n.push(p),console.log(this.ce),console.log("^^^ This ^^^")}}return n}({Ot:this.Ot,we:this.we,ce:this.ce})):n[0]>>24&255,y=f>>>24&255,$=b.get(w)??-2,v=b.get(f)??-2;if(this.le.get($)&&(e[i*c+h]=f),-1==$){const t=536870912;this.le.get($)?e[i*c+h]=0:(u/o&1)==(g/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&f<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Se:p,ke:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings div:has(>.bm-Y){width:fit-content;justify-content:flex-start}#bm-N-settings .bm-Y{display:flex;flex-direction:column;width:13%}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1.5ch;max-width:14.5ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:15ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0g0J/d40/5oG0OtRB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HSLQKhuRqsT/mvXPm7+kqv1xRpcL4NrV/3LijKmRA3CedrFRYZpy6ONqtKgjlJdmkr/BxobvD0mVI+c9let+8y/K0fpftfg2umCelzEp5G3J3CNDjbibNkZLBWMCxMiV0SklUt70WK2CgYewhT77qqrvtvFwVhgj8nlDOqOSSmlLVW5AoVUrBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.De=null,this.Le=null,this.He="#bm-j"}Ne(t){return this.Le=t,this.De=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.He)}),this}Oe(){return this.De}observe(t,e=!1,i=!1){t.observe(this.Le,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAA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jLp58cFq14leXLH+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"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).ft(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Be=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Ie;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Gt?.Pe(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Gt?.Pe(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Gt.ge(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Gt;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.xe=null,this.$=null,this.schemaVersion="2.0.0",this.Ae=null,this.be="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Ot=1e3,this.we=3,this.Te=3,this.Et=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Vt:i}}(this.Te),this.$e=null,this.We="",this.ce=[],this.fe=null,this.Ve=!0,this.ze=null,this.le=new Map}Fe(t){this.xe=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async ge(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.xe.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,Dt:0,Lt:m(this.Ae||0,this.be),file:t,coords:n}),{Pt:o,At:a}=await s.It(this.Ot,this.Et);s.Ht=o;const r={total:s.Bt.total,colors:Object.fromEntries(s.Bt.colors)};this.fe.templates[`${s.Dt} ${s.Lt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.ce=[],this.ce.push(s),this.xe.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.ce),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Ue(){}async Ge(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Re(){l("Downloading all templates..."),console.log(this.ce);for(const t of this.ce)await this.je(t),await n(500)}async ue(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.je(new H({displayName:i.name,Dt:e.split(" ")?.[0],Lt:e.split(" ")?.[1],Ht:i.tiles})),await n(500))}async je(t){t.Wt();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.pe(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ee:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async pe(t){console.log(t);const e=t.Ht,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Ot+c,u=l*this.Ot+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.we),r=Math.max(r,u+m.height/this.we)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.we,m=c*this.we;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Ot+r,m=a*this.Ot+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.we,(m-o)*this.we,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.we,c*this.we,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ye(t,e){if(!this.Ve)return t;const n=this.Ot*this.we;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.ce;console.log(o),o.sort((t,e)=>t.Dt-e.Dt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Ht).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Je:t,Xe:t.Ht[e],Nt:t.Nt?.[e],qe:[i[0],i[1]],Ze:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.xe.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Ht).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Bt.total||0),0));this.xe.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.kt?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Je.Bt?.colors?.get(-1);let s=t.Nt.slice();const o=Number(t.Ze[0])*this.we,a=Number(t.Ze[1])*this.we;if(0!=this.le.size||n||h.drawImage(t.Xe,o,a),!s){const e=h.getImageData(o,a,t.Xe.width,t.Xe.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Se:l,ke:c}=i(this,J,Z).call(this,{ye:d,$e:s,ve:[o,a,t.Xe.width,t.Xe.height],Me:u,Ce:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.le.size&&!n&&p||(console.log("Colors to filter: ",this.le),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Xe.width,t.Xe.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Je.Bt.correct&&(t.Je.Bt.correct={}),t.Je.Bt.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Qe(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Pe(t){this.Ve=t}}(et,it),ct=new class{constructor(t){this.Gt=t,this.Ke=!1,this.Be="",this.Ie=[],this.ti=[]}ei(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Gt.Ae=n.id,0!=this.Be.length){const t=document.querySelector("#"+this.Be);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Ie.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Ie=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,g=Date.now(),f=await this.Gt.Ye(p,u);console.log(`Finished loading the tile in ${(Date.now()-g)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:f,blink:i.blink});break;case"robots":this.Ke="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ii(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ni(i),s=this.si(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ni(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}si(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.kt=n,(s=this.kt).flags??(s.flags=[]),this.oi=structuredClone(this.kt),this.ai="bmUserSettings",this.ri=5e3,this.li=0,setInterval(this.ci.bind(this),this.ri)}async ci(){const t=JSON.stringify(this.kt);t!=JSON.stringify(this.oi)&&Date.now()-this.li>this.ri&&(await GM.setValue(this.ai,t),this.oi=structuredClone(this.kt),this.li=Date.now(),console.log(t))}hi(t,e=void 0){const i=this.kt?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.kt?.flags?.splice(i,1):-1==i&&!1!==e&&this.kt?.flags?.push(t)}Tt(){const t='',e='',n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noTrans"),i.onchange=t=>this.hi("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}St(){this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Template creation should skip transparent tiles"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noSkip"),i.onchange=t=>this.hi("hl-noSkip",!t.target.checked)}).D().R({innerHTML:"Experimental: Template creation should aggressively skip transparent tiles"},(t,e,i)=>{i.checked=this.kt?.flags?.includes("hl-agSkip"),i.onchange=t=>this.hi("hl-agSkip",t.target.checked)}).D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.Fe(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Qe(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ii(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.mi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ni(navigator.userAgent),e=this.p.si(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.mi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ei(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.css b/dist/BlueMarble.user.css index 30f1025..6fa35d6 100644 --- a/dist/BlueMarble.user.css +++ b/dist/BlueMarble.user.css @@ -1 +1 @@ -div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings .bm-Y{display:flex;flex-direction:column}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1ch;max-width:10ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:30ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} +div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings div:has(>.bm-Y){width:fit-content;justify-content:flex-start}#bm-N-settings .bm-Y{display:flex;flex-direction:column;width:13%}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1.5ch;max-width:14.5ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:15ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0} diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index c33f911..f3f4dd9 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.91.67 +// @version 0.91.74 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function f(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var g,w,x,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]}],M=class{constructor(t,i){e(this,g),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,g,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??""});delete t.textContent;const s=i(this,g,w).call(this,"input",{type:"checkbox"},t);return n.insertBefore(s,n.firstChild),this.D(),e(this,n,s),this}j(t={},e=()=>{}){const n=i(this,g,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,g,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,g,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,g,w).call(this,"div"),o=i(this,g,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,g,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"textarea",{},t)),this}ft(t={},e=()=>{}){return e(this,i(this,g,w).call(this,"div",{class:"bm-L"},t)),this}gt(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,g,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",f),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",f),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},f=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},g=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};g=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,g,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,g,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){console.log(e),t.disabled=!0;const i=t.dataset.status,n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(console.log(n),i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}console.log(s);const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);console.log(a),0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),console.log(o),this.St.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.Vt=Math.ceil(80/1300*window.innerWidth),this.zt=v.slice(1)}Ft(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this._t="bm-y",this.Mt=document.body,this.Ut=t.p?.Ut,this.Gt='',this.Rt='';const{palette:i,Wt:n}=this.Ut.jt;this.palette=i,this.Et=0,this.Yt=0,this.Jt=new Map,this.Xt=new Map,this.qt=0,this.Zt=0,this.timeRemaining=0,this.Qt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Kt()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Gt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Et)} / ${s(this.Yt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.qt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Zt)}`),this.ht("#bm-4",`Remaining: ${s((this.Zt||0)-(this.qt||0))} (${o(((this.Zt||0)-(this.qt||0))/(this.Zt||1))})`),this.ht("#bm-5",`Completed at: `)}Kt(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.te(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}te(){i(this,B,W).call(this);const t=document.querySelector(`#${this._t}`),e={};for(const t of this.palette){const i=this.Jt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.Xt.get(t.id)??"???","number"!=typeof a&&this.Et==this.Yt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ee:i,ie:n,ne:a,se:r,oe:l,ae:c}}if(document.querySelector("#bm-X")){const t=this.qt.toString().length>7?this.qt.toString().slice(0,2)+"…"+this.qt.toString().slice(-3):this.qt.toString(),e=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{ne:n,se:s,oe:o,ee:a,ie:r,ae:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this._t});const n=this.te();for(const t of this.palette){const s="#"+f(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{ne:l,se:c,oe:h,ee:m,ie:d,ae:u}=n[t.id],b=!!this.Ut.re.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Rt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Rt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this._t}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Zt=0,this.qt=0,this.Xt=new Map,this.Jt=new Map;for(const t of this.Ut.le){const e=t.Ot?.total??0;this.Zt+=e??0;const i=t.Ot?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Jt.get(t)??0;this.Jt.set(t,n+i)}const n=t.Ot?.correct??{};this.Et+=Object.keys(n).length,this.Yt+=Object.keys(t.Lt).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.qt+=t;const n=this.Xt.get(e)??0;this.Xt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Et} / ${this.Yt}`),this.qt>=this.Zt&&this.Zt&&this.Et==this.Yt&&(new N).Ft(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Zt-this.qt)*1e3+Date.now()),this.Qt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.ce=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.ce?.scriptVersion,this.schemaVersion=this.ce?.schemaVersion,this.he=void 0,this.me=n,this.Ut=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.me.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.he="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.he="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.he="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.he="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.me)}.
Wplace was last updated on ${l}.${"Good"!=this.he?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.he&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Ut.de().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.he&&"Bad"!=this.he||c.lt({textContent:`Update template storage to ${this.me}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.ce?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Ut.ue),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.ce?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Lt:i.tiles});t.At();const e=await this.Ut.be(t);await this.Ut.pe(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.me,this.Ut).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.le=await async function({Nt:t,ge:i,le:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,kt:s||this.le?.length||0,Dt:r||""});p.Ot=c,p.Lt=m,p.Ht=d,n.push(p),console.log(this.le),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,ge:this.ge,le:this.le})):n[0]>>24&255,y=g>>>24&255,$=b.get(w)??-2,v=b.get(g)??-2;if(this.re.get($)&&(e[i*c+h]=g),-1==$){const t=536870912;this.re.get($)?e[i*c+h]=0:(u/o&1)==(f/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&g<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Te:p,Se:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.ke=null,this.De=null,this.Le="#bm-j"}He(t){return this.De=t,this.ke=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.Le)}),this}Ne(){return this.ke}observe(t,e=!1,i=!1){t.observe(this.De,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).ft().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N).Ft(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).gt(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Oe=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Be;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Ut?.Ie(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Ut?.Ie(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Ut.pe(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Ut;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.we=null,this.$=null,this.schemaVersion="2.0.0",this.Pe=null,this.ue="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.ge=3,this.Ce=3,this.jt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Wt:i}}(this.Ce),this.ye=null,this.Ae="",this.le=[],this.fe=null,this.We=!0,this.Ve=null,this.re=new Map}ze(t){this.we=t}k(t){this.$=t}async Fe(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async pe(t,e,n){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON...")),this.we.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,kt:0,Dt:m(this.Pe||0,this.ue),file:t,coords:n}),{It:o,Pt:a}=await s.Bt(this.Nt,this.jt);s.Lt=o;const r={total:s.Ot.total,colors:Object.fromEntries(s.Ot.colors)};this.fe.templates[`${s.kt} ${s.Dt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.le=[],this.le.push(s),this.we.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.le),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}_e(){}async Ue(){this.fe||(this.fe=await this.Fe(),console.log("Creating JSON..."))}async Ge(){l("Downloading all templates..."),console.log(this.le);for(const t of this.le)await this.Re(t),await n(500)}async de(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Re(new H({displayName:i.name,kt:e.split(" ")?.[0],Dt:e.split(" ")?.[1],Lt:i.tiles})),await n(500))}async Re(t){t.At();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.be(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",je:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async be(t){console.log(t);const e=t.Lt,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.ge),r=Math.max(r,u+m.height/this.ge)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.ge,m=c*this.ge;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.ge,(m-o)*this.ge,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.ge,c*this.ge,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ee(t,e){if(!this.We)return t;const n=this.Nt*this.ge;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.le;console.log(o),o.sort((t,e)=>t.kt-e.kt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Lt).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Ye:t,Je:t.Lt[e],Ht:t.Ht?.[e],Xe:[i[0],i[1]],qe:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.we.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Lt).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Ot.total||0),0));this.we.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.St?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Ye.Ot?.colors?.get(-1);let s=t.Ht.slice();const o=Number(t.qe[0])*this.ge,a=Number(t.qe[1])*this.ge;if(0!=this.re.size||n||h.drawImage(t.Je,o,a),!s){const e=h.getImageData(o,a,t.Je.width,t.Je.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Te:l,Se:c}=i(this,J,Z).call(this,{xe:d,ye:s,$e:[o,a,t.Je.width,t.Je.height],ve:u,Me:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.re.size&&!n&&p||(console.log("Colors to filter: ",this.re),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Je.width,t.Je.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Ye.Ot.correct&&(t.Ye.Ot.correct={}),t.Ye.Ot.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Ze(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ie(t){this.We=t}}(et,it),ct=new class{constructor(t){this.Ut=t,this.Qe=!1,this.Oe="",this.Be=[],this.Ke=[]}ti(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Ut.Pe=n.id,0!=this.Oe.length){const t=document.querySelector("#"+this.Oe);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Be.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Be=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,f=Date.now(),g=await this.Ut.Ee(p,u);console.log(`Finished loading the tile in ${(Date.now()-f)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:g,blink:i.blink});break;case"robots":this.Qe="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ei(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ii(i),s=this.ni(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ii(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}ni(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.St=n,(s=this.St).flags??(s.flags=[]),this.si=structuredClone(this.St),this.oi="bmUserSettings",this.ai=5e3,this.ri=0,setInterval(this.li.bind(this),this.ai)}async li(){const t=JSON.stringify(this.St);t!=JSON.stringify(this.si)&&Date.now()-this.ri>this.ai&&(await GM.setValue(this.oi,t),this.si=structuredClone(this.St),this.ri=Date.now(),console.log(t))}ci(t,e=void 0){const i=this.St?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.St?.flags?.splice(i,1):-1==i&&!1!==e&&this.St?.flags?.push(t)}Tt(){const t='',e='',n=this.St?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.St?.flags?.includes("hl-noTrans"),i.onchange=t=>this.ci("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",style:"width: 50%;",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.ze(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Ze(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ei(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.hi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ii(navigator.userAgent),e=this.p.ni(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.hi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ti(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function g(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var f,w,x,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]}],M=class{constructor(t,i){e(this,f),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,f,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n={};t.textContent?(n.textContent=t.textContent,delete t.textContent):t.innerHTML&&(n.innerHTML=t.innerHTML,delete t.textContent);const s=i(this,f,w).call(this,"label",n),o=i(this,f,w).call(this,"input",{type:"checkbox"},t);return s.insertBefore(o,s.firstChild),this.D(),e(this,s,o),this}j(t={},e=()=>{}){const n=i(this,f,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,f,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,f,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,f,w).call(this,"div"),o=i(this,f,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,f,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"textarea",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{class:"bm-L"},t)),this}ft(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,f,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",g),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},g=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},f=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};f=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,f,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,f,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt(),this.St()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}St(){i(this,y,$).call(this,"Template")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){t.disabled=!0;const i=t.dataset.status,n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),this.kt.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.zt=Math.ceil(80/1300*window.innerWidth),this.Ft=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ut="bm-y",this.Mt=document.body,this.Gt=t.p?.Gt,this.Rt='',this.jt='';const{palette:i,Vt:n}=this.Gt.Et;this.palette=i,this.Yt=0,this.Jt=0,this.Xt=new Map,this.qt=new Map,this.Zt=0,this.Qt=0,this.timeRemaining=0,this.Kt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.te()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Rt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Yt)} / ${s(this.Jt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.Zt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Qt)}`),this.ht("#bm-4",`Remaining: ${s((this.Qt||0)-(this.Zt||0))} (${o(((this.Qt||0)-(this.Zt||0))/(this.Qt||1))})`),this.ht("#bm-5",`Completed at: `)}te(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ee(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ut}`),e={};for(const t of this.palette){const i=this.Xt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.qt.get(t.id)??"???","number"!=typeof a&&this.Yt==this.Jt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ie:i,ne:n,se:a,oe:r,ae:l,re:c}}if(document.querySelector("#bm-X")){const t=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString(),e=this.Qt.toString().length>7?this.Qt.toString().slice(0,2)+"…"+this.Qt.toString().slice(-3):this.Qt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{se:n,oe:s,ae:o,ie:a,ne:r,re:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ut});const n=this.ee();for(const t of this.palette){const s="#"+g(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{se:l,oe:c,ae:h,ie:m,ne:d,re:u}=n[t.id],b=!!this.Gt.le.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ut}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Qt=0,this.Zt=0,this.qt=new Map,this.Xt=new Map;for(const t of this.Gt.ce){const e=t.Bt?.total??0;this.Qt+=e??0;const i=t.Bt?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Xt.get(t)??0;this.Xt.set(t,n+i)}const n=t.Bt?.correct??{};this.Yt+=Object.keys(n).length,this.Jt+=Object.keys(t.Ht).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.Zt+=t;const n=this.qt.get(e)??0;this.qt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Yt} / ${this.Jt}`),this.Zt>=this.Qt&&this.Qt&&this.Yt==this.Jt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Qt-this.Zt)*1e3+Date.now()),this.Kt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.he=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.he?.scriptVersion,this.schemaVersion=this.he?.schemaVersion,this.me=void 0,this.de=n,this.Gt=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.de.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.me="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.me="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.me="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.me="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.de)}.
Wplace was last updated on ${l}.${"Good"!=this.me?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.me&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Gt.ue().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.me&&"Bad"!=this.me||c.lt({textContent:`Update template storage to ${this.de}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.he?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Gt.be),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.he?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Ht:i.tiles});t.Wt();const e=await this.Gt.pe(t);await this.Gt.ge(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.de,this.Gt).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.ce=await async function({Ot:t,we:i,ce:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,Dt:s||this.ce?.length||0,Lt:r||""});p.Bt=c,p.Ht=m,p.Nt=d,n.push(p),console.log(this.ce),console.log("^^^ This ^^^")}}return n}({Ot:this.Ot,we:this.we,ce:this.ce})):n[0]>>24&255,y=f>>>24&255,$=b.get(w)??-2,v=b.get(f)??-2;if(this.le.get($)&&(e[i*c+h]=f),-1==$){const t=536870912;this.le.get($)?e[i*c+h]=0:(u/o&1)==(g/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&f<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Se:p,ke:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.De=null,this.Le=null,this.He="#bm-j"}Ne(t){return this.Le=t,this.De=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.He)}),this}Oe(){return this.De}observe(t,e=!1,i=!1){t.observe(this.Le,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).ft(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Be=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Ie;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Gt?.Pe(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Gt?.Pe(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Gt.ge(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Gt;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.xe=null,this.$=null,this.schemaVersion="2.0.0",this.Ae=null,this.be="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Ot=1e3,this.we=3,this.Te=3,this.Et=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Vt:i}}(this.Te),this.$e=null,this.We="",this.ce=[],this.fe=null,this.Ve=!0,this.ze=null,this.le=new Map}Fe(t){this.xe=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async ge(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.xe.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,Dt:0,Lt:m(this.Ae||0,this.be),file:t,coords:n}),{Pt:o,At:a}=await s.It(this.Ot,this.Et);s.Ht=o;const r={total:s.Bt.total,colors:Object.fromEntries(s.Bt.colors)};this.fe.templates[`${s.Dt} ${s.Lt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.ce=[],this.ce.push(s),this.xe.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.ce),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Ue(){}async Ge(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Re(){l("Downloading all templates..."),console.log(this.ce);for(const t of this.ce)await this.je(t),await n(500)}async ue(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.je(new H({displayName:i.name,Dt:e.split(" ")?.[0],Lt:e.split(" ")?.[1],Ht:i.tiles})),await n(500))}async je(t){t.Wt();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.pe(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ee:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async pe(t){console.log(t);const e=t.Ht,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Ot+c,u=l*this.Ot+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.we),r=Math.max(r,u+m.height/this.we)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.we,m=c*this.we;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Ot+r,m=a*this.Ot+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.we,(m-o)*this.we,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.we,c*this.we,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ye(t,e){if(!this.Ve)return t;const n=this.Ot*this.we;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.ce;console.log(o),o.sort((t,e)=>t.Dt-e.Dt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Ht).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Je:t,Xe:t.Ht[e],Nt:t.Nt?.[e],qe:[i[0],i[1]],Ze:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.xe.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Ht).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Bt.total||0),0));this.xe.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.kt?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Je.Bt?.colors?.get(-1);let s=t.Nt.slice();const o=Number(t.Ze[0])*this.we,a=Number(t.Ze[1])*this.we;if(0!=this.le.size||n||h.drawImage(t.Xe,o,a),!s){const e=h.getImageData(o,a,t.Xe.width,t.Xe.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Se:l,ke:c}=i(this,J,Z).call(this,{ye:d,$e:s,ve:[o,a,t.Xe.width,t.Xe.height],Me:u,Ce:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.le.size&&!n&&p||(console.log("Colors to filter: ",this.le),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Xe.width,t.Xe.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Je.Bt.correct&&(t.Je.Bt.correct={}),t.Je.Bt.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Qe(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Pe(t){this.Ve=t}}(et,it),ct=new class{constructor(t){this.Gt=t,this.Ke=!1,this.Be="",this.Ie=[],this.ti=[]}ei(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Gt.Ae=n.id,0!=this.Be.length){const t=document.querySelector("#"+this.Be);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Ie.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Ie=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,g=Date.now(),f=await this.Gt.Ye(p,u);console.log(`Finished loading the tile in ${(Date.now()-g)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:f,blink:i.blink});break;case"robots":this.Ke="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ii(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ni(i),s=this.si(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ni(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}si(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.kt=n,(s=this.kt).flags??(s.flags=[]),this.oi=structuredClone(this.kt),this.ai="bmUserSettings",this.ri=5e3,this.li=0,setInterval(this.ci.bind(this),this.ri)}async ci(){const t=JSON.stringify(this.kt);t!=JSON.stringify(this.oi)&&Date.now()-this.li>this.ri&&(await GM.setValue(this.ai,t),this.oi=structuredClone(this.kt),this.li=Date.now(),console.log(t))}hi(t,e=void 0){const i=this.kt?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.kt?.flags?.splice(i,1):-1==i&&!1!==e&&this.kt?.flags?.push(t)}Tt(){const t='',e='',n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noTrans"),i.onchange=t=>this.hi("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}St(){this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Template creation should skip transparent tiles"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noSkip"),i.onchange=t=>this.hi("hl-noSkip",!t.target.checked)}).D().R({innerHTML:"Experimental: Template creation should aggressively skip transparent tiles"},(t,e,i)=>{i.checked=this.kt?.flags?.includes("hl-agSkip"),i.onchange=t=>this.hi("hl-agSkip",t.target.checked)}).D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.Fe(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Qe(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ii(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.mi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ni(navigator.userAgent),e=this.p.si(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.mi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ei(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 8f107a2..bcbdad0 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 4c265a4..1cca385 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.67", + "version": "0.91.74", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.67", + "version": "0.91.74", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 7d65e52..9ddb937 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.67", + "version": "0.91.74", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 5800592..9eba468 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.91.67 +// @version 0.91.74 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/Overlay.js b/src/Overlay.js index 336bc7b..96ceb2a 100644 --- a/src/Overlay.js +++ b/src/Overlay.js @@ -517,8 +517,24 @@ export default class Overlay { const properties = {'type': 'checkbox'}; // Shared checkbox DOM properties - const label = this.#createElement('label', {'textContent': additionalProperties['textContent'] ?? ''}); // Creates the label element - delete additionalProperties['textContent']; // Deletes 'textContent' DOM property before adding the properties to the checkbox + // Stores the label content from the additional property + const labelContent = {}; + + // If the label content was passed in as 'textContent'... + if (!!additionalProperties['textContent']) { + + // Store the information, then delete it from additionalProperties + labelContent['textContent'] = additionalProperties['textContent']; + delete additionalProperties['textContent']; // Deletes 'textContent' DOM property before adding the properties to the checkbox + } else if (!!additionalProperties['innerHTML']) { + // Else if the label content was passed in as 'innerHTML'... + + // Store the information, then delete it from additionalProperties + labelContent['innerHTML'] = additionalProperties['innerHTML']; + delete additionalProperties['textContent']; + } + + const label = this.#createElement('label', labelContent); // Creates the label element const checkbox = this.#createElement('input', properties, additionalProperties); // Creates the checkbox element label.insertBefore(checkbox, label.firstChild); // Makes the checkbox the first child of the label (before the text content) this.buildElement(); // Signifies that we are done adding children to the checkbox diff --git a/src/WindowSettings.css b/src/WindowSettings.css index 6b87be7..53765e4 100644 --- a/src/WindowSettings.css +++ b/src/WindowSettings.css @@ -1,9 +1,16 @@ /* @since 0.91.22 */ +/* Highlight preset group container */ +#bm-window-settings div:has(> .bm-highlight-preset-container) { + width: fit-content; + justify-content: flex-start; +} + /* Highlight preset container */ #bm-window-settings .bm-highlight-preset-container { display: flex; flex-direction: column; + width: 13%; } /* Highlight preset title */ @@ -25,8 +32,8 @@ stroke: #333; stroke-width: 0.02px; width: 100%; - min-width: 1ch; - max-width: 10ch; + min-width: 1.5ch; + max-width: 14.5ch; } /* Highlight preset SVG on hover/focus */ @@ -41,7 +48,7 @@ grid-template-columns: 1fr 1fr 1fr; width: 25%; min-width: 3ch; - max-width: 30ch; + max-width: 15ch; } /* Highlight pattern button */ diff --git a/src/WindowSettings.js b/src/WindowSettings.js index 168bbc9..a478e7b 100644 --- a/src/WindowSettings.js +++ b/src/WindowSettings.js @@ -58,6 +58,7 @@ export default class WindowSettings extends Overlay { .addDiv({'class': 'bm-container bm-scrollable'}, (instance, div) => { // Each category in the settings window this.buildHighlight(); + this.buildTemplate(); }).buildElement() .buildElement() .buildElement().buildOverlay(this.windowParent); @@ -68,6 +69,7 @@ export default class WindowSettings extends Overlay { /** Displays an error when a settings category fails to load. * @param {string} name - The name of the category + * @since 0.91.11 */ #errorOverrideFailure(name) { this.window = this.addDiv({'class': 'bm-container'}) @@ -84,4 +86,12 @@ export default class WindowSettings extends Overlay { buildHighlight() { this.#errorOverrideFailure('Pixel Highlight'); } + + /** Builds the template section of the window. + * This should be overriden by {@link SettingsManager} + * @since 0.91.68 + */ + buildTemplate() { + this.#errorOverrideFailure('Template'); + } } \ No newline at end of file diff --git a/src/settingsManager.js b/src/settingsManager.js index c4fbefb..849e999 100644 --- a/src/settingsManager.js +++ b/src/settingsManager.js @@ -14,7 +14,7 @@ import WindowSettings from "./WindowSettings"; * { * "uuid": "497dcba3-ecbf-4587-a2dd-5eb0665e6880", * "telemetry": 1, - * "flags": ["hl-noTrans", "ftr-oWin"], + * "flags": ["hl-noTrans", "ftr-oWin", "te-noSkip"], * "highlight": [[1,0,-1],[1,-1,0],[2,1,0],[1,0,1]], * "filter": [-2,0,4,5,6,29,63] * } @@ -104,7 +104,7 @@ export default class SettingsManager extends WindowSettings { checkbox.onchange = (event) => this.toggleFlag('hl-noTrans', !event.target.checked); // Forces the flag to be the opposite state as the checkbox. E.g. "Checked" means 'hl-noTrans' is false (does not exist). }).buildElement() .addP({'id': 'bm-highlight-preset-label', 'textContent': 'Choose a preset:', 'style': 'font-weight: 700;'}).buildElement() - .addDiv({'class': 'bm-flex-center', 'style': 'width: 50%;', 'role': 'group', 'aria-labelledby': 'bm-highlight-preset-label'}) + .addDiv({'class': 'bm-flex-center', 'role': 'group', 'aria-labelledby': 'bm-highlight-preset-label'}) .addDiv({'class': 'bm-highlight-preset-container'}) .addSpan({'textContent': 'None'}).buildElement() .addButton({'innerHTML': highlightPresetOff, 'aria-label': 'Preset "None"'}, (instance, button) => {button.onclick = () => this.#updateHighlightToPreset('None')}).buildElement() @@ -159,8 +159,6 @@ export default class SettingsManager extends WindowSettings { */ #updateHighlightSettings(button, coords) { - console.log(coords); - button.disabled = true; // Disabled the button until we are done const status = button.dataset['status']; // Obtains the current status of the button @@ -172,8 +170,6 @@ export default class SettingsManager extends WindowSettings { const userStorageNew = userStorageOld; // The old storage with the new change - console.log(userStorageOld); - // For each different type of status... switch (status) { @@ -205,13 +201,9 @@ export default class SettingsManager extends WindowSettings { break; } - console.log(userStorageChange); - // Finds the index of the pixel to change const indexOfChange = userStorageOld.findIndex(([, x, y]) => ((x == userStorageChange[1]) && (y == userStorageChange[2]))); - console.log(indexOfChange); - // If the new sub-pixel state is NOT disabled if (userStorageChange[0] != 0) { @@ -226,8 +218,6 @@ export default class SettingsManager extends WindowSettings { userStorageNew.splice(indexOfChange, 1); // Removes 1 index from the array at the index of the pixel change } - console.log(userStorageNew); - this.userSettings['highlight'] = userStorageNew; // TODO: Add timer update here @@ -316,4 +306,26 @@ export default class SettingsManager extends WindowSettings { button.disabled = false; // Re-enables the button } } + + /** Build the "template" category of settings window + * @since 0.91.68 + * @see WindowSettings#buildTemplate + */ + buildTemplate() { + + this.window = this.addDiv({'class': 'bm-container'}) + .addHeader(2, {'textContent': 'Pixel Highlight'}).buildElement() + .addHr().buildElement() + .addDiv({'class': 'bm-container', 'style': 'margin-left: 1.5ch;'}) + .addCheckbox({'textContent': 'Template creation should skip transparent tiles'}, (instance, label, checkbox) => { + checkbox.checked = !this.userSettings?.flags?.includes('hl-noSkip'); // Makes the checkbox match the last stored user setting + checkbox.onchange = (event) => this.toggleFlag('hl-noSkip', !event.target.checked); // If the user wants to skip, then the checkbox is NOT checked + }).buildElement() + .addCheckbox({'innerHTML': 'Experimental: Template creation should aggressively skip transparent tiles'}, (instance, label, checkbox) => { + checkbox.checked = this.userSettings?.flags?.includes('hl-agSkip'); // Makes the checkbox match the last stored user setting + checkbox.onchange = (event) => this.toggleFlag('hl-agSkip', event.target.checked); // If the user wants to aggressively skip, then the checkbox is checked + }).buildElement() + .buildElement() + .buildElement() + } } \ No newline at end of file From bb5b54b061adf07b4ae53e1ba52829008a7176a2 Mon Sep 17 00:00:00 2001 From: SwingTheVine Date: Sat, 7 Mar 2026 22:32:36 -0500 Subject: [PATCH 15/15] Added option to skip transparent tiles when loading templates --- dist/BlueMarble-For-GreasyFork.user.js | 137 ++++++++++++++++++++++- dist/BlueMarble-Standalone.user.js | 4 +- dist/BlueMarble.user.js | 4 +- docs/README.md | 2 +- package-lock.json | 4 +- package.json | 2 +- src/BlueMarble.meta.js | 2 +- src/Template.js | 149 ++++++++++++++++++++++++- src/templateManager.js | 10 +- 9 files changed, 298 insertions(+), 16 deletions(-) diff --git a/dist/BlueMarble-For-GreasyFork.user.js b/dist/BlueMarble-For-GreasyFork.user.js index cbfd0ab..f86342c 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.91.74 +// @version 0.91.102 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -1843,15 +1843,21 @@ this.chunked32 = chunked32; this.tileSize = tileSize; this.pixelCount = { total: 0, colors: /* @__PURE__ */ new Map() }; + this.shouldSkipTransTiles = true; + this.shouldAggSkipTransTiles = false; } /** Creates chunks of the template for each tile. * @param {Number} tileSize - Size of the tile as determined by templateManager * @param {Object} paletteBM - An collection of Uint32Arrays containing the palette BM uses + * @param {boolean} shouldSkipTransTiles - Should transparent tiles be skipped over when creating the template? + * @param {boolean} shouldAggSkipTransTiles - Should transparent tiles be aggressively skipped over when creating the template? * @returns {Object} Collection of template bitmaps & buffers organized by tile coordinates * @since 0.65.4 */ - async createTemplateTiles(tileSize, paletteBM) { + async createTemplateTiles(tileSize, paletteBM, shouldSkipTransTiles, shouldAggSkipTransTiles) { console.log("Template coordinates:", this.coords); + this.shouldSkipTransTiles = shouldSkipTransTiles; + this.shouldAggSkipTransTiles = shouldAggSkipTransTiles; const shreadSize = 3; const bitmap = await createImageBitmap(this.file); const imageWidth = bitmap.width; @@ -1861,6 +1867,9 @@ const templateTilesBuffers = {}; const canvas = new OffscreenCanvas(this.tileSize, this.tileSize); const context = canvas.getContext("2d", { willReadFrequently: true }); + const transCanvas = new OffscreenCanvas(this.tileSize, this.tileSize); + const transContext = transCanvas.getContext("2d", { willReadFrequently: true }); + transContext.globalCompositeOperation = "destination-over"; canvas.width = imageWidth; canvas.height = imageHeight; context.imageSmoothingEnabled = false; @@ -1890,6 +1899,20 @@ console.log(`Pixel X: ${pixelX} Pixel Y: ${pixelY}`); const drawSizeX = Math.min(this.tileSize - pixelX % this.tileSize, imageWidth - (pixelX - this.coords[2])); + if (shouldSkipTransTiles) { + const isTemplateTileTransparent = !this.calculateCanvasTransparency({ + bitmap, + bitmapParams: [pixelX - this.coords[2], pixelY - this.coords[3], drawSizeX, drawSizeY], + // Top left X, Top left Y, Width, Height + transCanvas, + transContext + }); + console.log(`Tile contains template: ${!isTemplateTileTransparent}`); + if (isTemplateTileTransparent) { + pixelX += drawSizeX; + continue; + } + } console.log(`Math.min(${this.tileSize} - (${pixelX} % ${this.tileSize}), ${imageWidth} - (${pixelX - this.coords[2]}))`); console.log(`Draw Size X: ${drawSizeX} Draw Size Y: ${drawSizeY}`); @@ -1927,6 +1950,7 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); ); context.save(); context.globalCompositeOperation = "destination-in"; + console.log(`Should Skip: ${shouldSkipTransTiles}; Should Agg Skip: ${shouldAggSkipTransTiles}`); context.fillStyle = context.createPattern(canvasMask, "repeat"); context.fillRect(0, 0, canvasWidth, canvasHeight); context.restore(); @@ -1950,6 +1974,110 @@ Getting Y ${pixelY}-${pixelY + drawSizeY}`); console.log("Template Tiles Uint32Array: ", this.chunked32); return { templateTiles, templateTilesBuffers }; } + /** Detects if the canvas is transparent. + * @param {Object} param - Object that contains the parameters for the function + * @param {ImageBitmap} param.bitmap - The bitmap template image + * @param {Array} param.bitmapParams - The parameters to obtain the template tile image from the bitmap + * @param {OffscreenCanvas | HTMLCanvasElement} param.transCanvas - The canvas to draw to in order to calculate this + * @param {OffscreenCanvasRenderingContext2D} param.transContext - The context for the transparent canvas to draw to + * @return {boolean} Is the canvas transparent? If transparent, then `true` is returned. Otherwise, `false`. + * @since 0.91.75 + */ + calculateCanvasTransparency({ + bitmap, + bitmapParams, + transCanvas, + transContext + }) { + console.log(`Calculating template tile transparency...`); + console.log(`Should Skip: ${this.shouldSkipTransTiles}; Should Agg: ${this.shouldAggSkipTransTiles}`); + const timer = Date.now(); + const duplicationCoordinateArray = [ + [0, 1], + // E.g. move 0 on the x axis, and 1 down on the y axis + [1, 0], + [0, -2], + // E.g. move 0 on the x axis, and 2 up on the y axis + [-2, 0], + [0, 4], + [4, 0], + [0, -8], + [-8, 0], + [0, 16], + [16, 0], + [0, -32], + [-32, 0] + ]; + const transCanvasWidth = bitmapParams[2]; + const transCanvasHeight = bitmapParams[3]; + transCanvas.width = transCanvasWidth; + transCanvas.height = transCanvasHeight; + transContext.clearRect(0, 0, transCanvasWidth, transCanvasHeight); + if (this.shouldAggSkipTransTiles) { + transContext.drawImage( + bitmap, + ...bitmapParams, + // Bitmap image parameters (x, y, width, height) + 0, + 0, + // The coordinate draw the output *at* + 10, + 10 + // The width and height of the output + ); + } else { + transContext.drawImage( + bitmap, + ...bitmapParams, + // Bitmap image parameters (x, y, width, height) + 0, + 0, + // The coordinate draw the output *at* + transCanvasWidth, + transCanvasHeight + // Stretch to canvas (the canvas should already be the same size as the template image) + ); + for (const [relativeX, relativeY] of duplicationCoordinateArray) { + transContext.drawImage( + transCanvas, + // The canvas we are drawing to *is* the source image + 0, + 0, + transCanvasWidth, + transCanvasHeight, + // The entire canvas (as a source image) + relativeX, + relativeY, + transCanvasWidth, + transCanvasHeight + // The output coordinates and size on the same canvas + ); + } + transContext.drawImage( + transCanvas, + // The canvas we are drawing to *is* the source image + 0, + 0, + transCanvasWidth, + transCanvasHeight, + // The entire canvas (as a source image) + 0, + 0, + 10, + 10 + // The output coordinates and size on the same canvas + ); + } + const shunkCanvas = transContext.getImageData(0, 0, 10, 10); + const shunkCanvas32 = new Uint32Array(shunkCanvas.data.buffer); + console.log(`Calculated canvas transparency in ${(Date.now() - timer) / 1e3} seconds.`); + for (const pixel of shunkCanvas32) { + if (!!pixel) { + return true; + } + } + return false; + } /** Calculates top left coordinate of template. * It uses `Template.chunked` to update `Template.coords` * @since 0.88.504 @@ -2950,7 +3078,10 @@ Version: ${this.version}`, "readOnly": true }).buildElement().buildElement().add file: blob, coords: coords2 }); - const { templateTiles, templateTilesBuffers } = await template.createTemplateTiles(this.tileSize, this.paletteBM); + const shouldSkipTransTiles = !this.settingsManager?.userSettings?.flags?.includes("hl-noSkip"); + const shouldAggSkipTransTiles = this.settingsManager?.userSettings?.flags?.includes("hl-agSkip"); + console.log(`Should Skip: ${shouldSkipTransTiles}; Should Agg Skip: ${shouldAggSkipTransTiles}`); + const { templateTiles, templateTilesBuffers } = await template.createTemplateTiles(this.tileSize, this.paletteBM, shouldSkipTransTiles, shouldAggSkipTransTiles); template.chunked = templateTiles; const _pixels = { "total": template.pixelCount.total, "colors": Object.fromEntries(template.pixelCount.colors) }; this.templatesJSON.templates[`${template.sortID} ${template.authorID}`] = { diff --git a/dist/BlueMarble-Standalone.user.js b/dist/BlueMarble-Standalone.user.js index 09f6f74..2fec5be 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.91.74 +// @version 0.91.102 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -38,4 +38,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function g(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var f,w,x,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]}],M=class{constructor(t,i){e(this,f),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,f,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n={};t.textContent?(n.textContent=t.textContent,delete t.textContent):t.innerHTML&&(n.innerHTML=t.innerHTML,delete t.textContent);const s=i(this,f,w).call(this,"label",n),o=i(this,f,w).call(this,"input",{type:"checkbox"},t);return s.insertBefore(o,s.firstChild),this.D(),e(this,s,o),this}j(t={},e=()=>{}){const n=i(this,f,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,f,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,f,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,f,w).call(this,"div"),o=i(this,f,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,f,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"textarea",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{class:"bm-L"},t)),this}ft(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,f,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",g),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},g=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},f=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};f=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,f,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,f,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt(),this.St()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}St(){i(this,y,$).call(this,"Template")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){t.disabled=!0;const i=t.dataset.status,n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),this.kt.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.zt=Math.ceil(80/1300*window.innerWidth),this.Ft=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ut="bm-y",this.Mt=document.body,this.Gt=t.p?.Gt,this.Rt='',this.jt='';const{palette:i,Vt:n}=this.Gt.Et;this.palette=i,this.Yt=0,this.Jt=0,this.Xt=new Map,this.qt=new Map,this.Zt=0,this.Qt=0,this.timeRemaining=0,this.Kt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.te()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Rt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Yt)} / ${s(this.Jt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.Zt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Qt)}`),this.ht("#bm-4",`Remaining: ${s((this.Qt||0)-(this.Zt||0))} (${o(((this.Qt||0)-(this.Zt||0))/(this.Qt||1))})`),this.ht("#bm-5",`Completed at: `)}te(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ee(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ut}`),e={};for(const t of this.palette){const i=this.Xt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.qt.get(t.id)??"???","number"!=typeof a&&this.Yt==this.Jt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ie:i,ne:n,se:a,oe:r,ae:l,re:c}}if(document.querySelector("#bm-X")){const t=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString(),e=this.Qt.toString().length>7?this.Qt.toString().slice(0,2)+"…"+this.Qt.toString().slice(-3):this.Qt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{se:n,oe:s,ae:o,ie:a,ne:r,re:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ut});const n=this.ee();for(const t of this.palette){const s="#"+g(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{se:l,oe:c,ae:h,ie:m,ne:d,re:u}=n[t.id],b=!!this.Gt.le.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ut}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Qt=0,this.Zt=0,this.qt=new Map,this.Xt=new Map;for(const t of this.Gt.ce){const e=t.Bt?.total??0;this.Qt+=e??0;const i=t.Bt?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Xt.get(t)??0;this.Xt.set(t,n+i)}const n=t.Bt?.correct??{};this.Yt+=Object.keys(n).length,this.Jt+=Object.keys(t.Ht).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.Zt+=t;const n=this.qt.get(e)??0;this.qt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Yt} / ${this.Jt}`),this.Zt>=this.Qt&&this.Qt&&this.Yt==this.Jt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Qt-this.Zt)*1e3+Date.now()),this.Kt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.he=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.he?.scriptVersion,this.schemaVersion=this.he?.schemaVersion,this.me=void 0,this.de=n,this.Gt=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.de.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.me="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.me="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.me="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.me="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.de)}.
Wplace was last updated on ${l}.${"Good"!=this.me?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.me&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Gt.ue().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.me&&"Bad"!=this.me||c.lt({textContent:`Update template storage to ${this.de}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.he?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Gt.be),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.he?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Ht:i.tiles});t.Wt();const e=await this.Gt.pe(t);await this.Gt.ge(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.de,this.Gt).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.ce=await async function({Ot:t,we:i,ce:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,Dt:s||this.ce?.length||0,Lt:r||""});p.Bt=c,p.Ht=m,p.Nt=d,n.push(p),console.log(this.ce),console.log("^^^ This ^^^")}}return n}({Ot:this.Ot,we:this.we,ce:this.ce})):n[0]>>24&255,y=f>>>24&255,$=b.get(w)??-2,v=b.get(f)??-2;if(this.le.get($)&&(e[i*c+h]=f),-1==$){const t=536870912;this.le.get($)?e[i*c+h]=0:(u/o&1)==(g/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&f<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Se:p,ke:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings div:has(>.bm-Y){width:fit-content;justify-content:flex-start}#bm-N-settings .bm-Y{display:flex;flex-direction:column;width:13%}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1.5ch;max-width:14.5ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:15ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@font-face{font-family:'Roboto Mono';font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAADGIAA4AAAAAWngAADEuAAEAAAAAAAAA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GJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.De=null,this.Le=null,this.He="#bm-j"}Ne(t){return this.Le=t,this.De=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.He)}),this}Oe(){return this.De}observe(t,e=!1,i=!1){t.observe(this.Le,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP//AAAAAAAAubU+IZJzuMAAAAtoSURBVFhHlZZ3fJSFGce/NzKOhITL4kJCEgmJ7D2UXQKJghVBFEWkLC3ioNWigFrhg9ZRKBZUWigtcTBEQUEgBDAESEJCQvYk+7LnZV4u6+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rcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).ft(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Be=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Ie;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Gt?.Pe(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Gt?.Pe(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Gt.ge(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Gt;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.xe=null,this.$=null,this.schemaVersion="2.0.0",this.Ae=null,this.be="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Ot=1e3,this.we=3,this.Te=3,this.Et=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Vt:i}}(this.Te),this.$e=null,this.We="",this.ce=[],this.fe=null,this.Ve=!0,this.ze=null,this.le=new Map}Fe(t){this.xe=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async ge(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.xe.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,Dt:0,Lt:m(this.Ae||0,this.be),file:t,coords:n}),{Pt:o,At:a}=await s.It(this.Ot,this.Et);s.Ht=o;const r={total:s.Bt.total,colors:Object.fromEntries(s.Bt.colors)};this.fe.templates[`${s.Dt} ${s.Lt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.ce=[],this.ce.push(s),this.xe.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.ce),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Ue(){}async Ge(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Re(){l("Downloading all templates..."),console.log(this.ce);for(const t of this.ce)await this.je(t),await n(500)}async ue(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.je(new H({displayName:i.name,Dt:e.split(" ")?.[0],Lt:e.split(" ")?.[1],Ht:i.tiles})),await n(500))}async je(t){t.Wt();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.pe(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ee:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async pe(t){console.log(t);const e=t.Ht,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Ot+c,u=l*this.Ot+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.we),r=Math.max(r,u+m.height/this.we)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.we,m=c*this.we;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Ot+r,m=a*this.Ot+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.we,(m-o)*this.we,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.we,c*this.we,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ye(t,e){if(!this.Ve)return t;const n=this.Ot*this.we;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.ce;console.log(o),o.sort((t,e)=>t.Dt-e.Dt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Ht).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Je:t,Xe:t.Ht[e],Nt:t.Nt?.[e],qe:[i[0],i[1]],Ze:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.xe.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Ht).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Bt.total||0),0));this.xe.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.kt?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Je.Bt?.colors?.get(-1);let s=t.Nt.slice();const o=Number(t.Ze[0])*this.we,a=Number(t.Ze[1])*this.we;if(0!=this.le.size||n||h.drawImage(t.Xe,o,a),!s){const e=h.getImageData(o,a,t.Xe.width,t.Xe.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Se:l,ke:c}=i(this,J,Z).call(this,{ye:d,$e:s,ve:[o,a,t.Xe.width,t.Xe.height],Me:u,Ce:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.le.size&&!n&&p||(console.log("Colors to filter: ",this.le),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Xe.width,t.Xe.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Je.Bt.correct&&(t.Je.Bt.correct={}),t.Je.Bt.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Qe(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Pe(t){this.Ve=t}}(et,it),ct=new class{constructor(t){this.Gt=t,this.Ke=!1,this.Be="",this.Ie=[],this.ti=[]}ei(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Gt.Ae=n.id,0!=this.Be.length){const t=document.querySelector("#"+this.Be);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Ie.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Ie=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,g=Date.now(),f=await this.Gt.Ye(p,u);console.log(`Finished loading the tile in ${(Date.now()-g)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:f,blink:i.blink});break;case"robots":this.Ke="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ii(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ni(i),s=this.si(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ni(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}si(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.kt=n,(s=this.kt).flags??(s.flags=[]),this.oi=structuredClone(this.kt),this.ai="bmUserSettings",this.ri=5e3,this.li=0,setInterval(this.ci.bind(this),this.ri)}async ci(){const t=JSON.stringify(this.kt);t!=JSON.stringify(this.oi)&&Date.now()-this.li>this.ri&&(await GM.setValue(this.ai,t),this.oi=structuredClone(this.kt),this.li=Date.now(),console.log(t))}hi(t,e=void 0){const i=this.kt?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.kt?.flags?.splice(i,1):-1==i&&!1!==e&&this.kt?.flags?.push(t)}Tt(){const t='',e='',n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noTrans"),i.onchange=t=>this.hi("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}St(){this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Template creation should skip transparent tiles"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noSkip"),i.onchange=t=>this.hi("hl-noSkip",!t.target.checked)}).D().R({innerHTML:"Experimental: Template creation should aggressively skip transparent tiles"},(t,e,i)=>{i.checked=this.kt?.flags?.includes("hl-agSkip"),i.onchange=t=>this.hi("hl-agSkip",t.target.checked)}).D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.Fe(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Qe(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ii(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.mi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ni(navigator.userAgent),e=this.p.si(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.mi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ei(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function g(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var f,w,x,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]}],M=class{constructor(t,i){e(this,f),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"p",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,f,w).call(this,"h"+t,{},e)),this}F(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"hr",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n={};t.textContent?(n.textContent=t.textContent,delete t.textContent):t.innerHTML&&(n.innerHTML=t.innerHTML,delete t.textContent);const s=i(this,f,w).call(this,"label",n),o=i(this,f,w).call(this,"input",{type:"checkbox"},t);return s.insertBefore(o,s.firstChild),this.D(),e(this,s,o),this}j(t={},e=()=>{}){const n=i(this,f,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,f,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,f,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,f,w).call(this,"div"),o=i(this,f,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,f,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"textarea",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{class:"bm-L"},t)),this}ft(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,f,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",g),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},g=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},f=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};f=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,f,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,f,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().F().D().O({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt(),this.St()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}St(){i(this,y,$).call(this,"Template")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().F().D().O({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){t.disabled=!0;const i=t.dataset.status,n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),this.kt.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var O=class{constructor(){this.Et=Math.ceil(80/1300*window.innerWidth),this.Yt=v.slice(1)}Jt(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)}},N=class extends HTMLElement{};customElements.define("confetti-piece",N);var B,I,P,A,W,F,V,z,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().F().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().V().D().F().D().V().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().V().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().V().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().V().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().V().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().V().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Xt="bm-y",this.Mt=document.body,this.qt=t.p?.qt,this.Zt='',this.Qt='';const{palette:i,jt:n}=this.qt.Kt;this.palette=i,this.te=0,this.ee=0,this.ie=new Map,this.ne=new Map,this.se=0,this.oe=0,this.timeRemaining=0,this.ae="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.re()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().F().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.le(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().V().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().V().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().V().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().V().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).O({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Zt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.te)} / ${s(this.ee)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.se)}`),this.ht("#bm-f",`Total Pixels: ${s(this.oe)}`),this.ht("#bm-4",`Remaining: ${s((this.oe||0)-(this.se||0))} (${o(((this.oe||0)-(this.se||0))/(this.oe||1))})`),this.ht("#bm-5",`Completed at: `)}re(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().F().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.le(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}le(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Xt}`),e={};for(const t of this.palette){const i=this.ie.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.ne.get(t.id)??"???","number"!=typeof a&&this.te==this.ee&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ce:i,he:n,me:a,de:r,ue:l,be:c}}if(document.querySelector("#bm-X")){const t=this.se.toString().length>7?this.se.toString().slice(0,2)+"…"+this.se.toString().slice(-3):this.se.toString(),e=this.oe.toString().length>7?this.oe.toString().slice(0,2)+"…"+this.oe.toString().slice(-3):this.oe.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{me:n,de:s,ue:o,ce:a,he:r,be:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Xt});const n=this.le();for(const t of this.palette){const s="#"+g(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{me:l,de:c,ue:h,ce:m,he:d,be:u}=n[t.id],b=!!this.qt.pe.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Qt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Qt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Qt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Qt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Xt}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.oe=0,this.se=0,this.ne=new Map,this.ie=new Map;for(const t of this.qt.ge){const e=t.Bt?.total??0;this.oe+=e??0;const i=t.Bt?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ie.get(t)??0;this.ie.set(t,n+i)}const n=t.Bt?.correct??{};this.te+=Object.keys(n).length,this.ee+=Object.keys(t.Ht).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.se+=t;const n=this.ne.get(e)??0;this.ne.set(e,n+t)}}console.log(`Tiles loaded: ${this.te} / ${this.ee}`),this.se>=this.oe&&this.oe&&this.te==this.ee&&(new O).Jt(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.oe-this.se)*1e3+Date.now()),this.ae=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,F),this.window=null,this.vt="bm-m",this.Mt=document.body,this.fe=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.fe?.scriptVersion,this.schemaVersion=this.fe?.schemaVersion,this.we=void 0,this.xe=n,this.qt=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().F().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().O({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,F,V).call(this),i(this,F,z).call(this)}};F=new WeakSet,V=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.xe.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.we="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.we="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.we="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.we="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.xe)}.
Wplace was last updated on ${l}.${"Good"!=this.we?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.we&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.qt.ye().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.we&&"Bad"!=this.we||c.lt({textContent:`Update template storage to ${this.xe}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,F,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},z=function(){const t=this.fe?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.qt.$e),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().N({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().F().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().O({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.fe?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Ht:i.tiles});t.Rt();const e=await this.qt.ve(t);await this.qt.Me(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.xe,this.qt).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ce))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.ge=await async function({Nt:t,Te:i,ge:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,Dt:s||this.ge?.length||0,Lt:r||""});p.Bt=c,p.Ht=m,p.Ot=d,n.push(p),console.log(this.ge),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,Te:this.Te,ge:this.ge})):n[0]>>24&255,y=f>>>24&255,$=b.get(w)??-2,v=b.get(f)??-2;if(this.pe.get($)&&(e[i*c+h]=f),-1==$){const t=536870912;this.pe.get($)?e[i*c+h]=0:(u/o&1)==(g/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&f<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Be:p,Ie:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=`div:has(>confetti-piece){position:absolute;inset:0;overflow:hidden;pointer-events:none}confetti-piece{position:absolute;top:-10px;width:var(--size);height:var(--size);background:currentColor;transform:translate3d(var(--x),-10vh,0) rotate(var(--rot));animation:fall var(--duration) linear var(--delay);will-change:transform;pointer-events:none}@keyframes fall{to{transform:translate3d(var(--x),110vh,0) rotate(calc(var(--rot) + 720deg))}}.bm-screenreader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.bm-N{position:fixed;background-color:#153063e6;color:#fff;padding:10px;border-radius:8px;z-index:9000;transition:all .3s ease,transform 0s;top:75px;left:60px;width:auto;max-height:fit-content;max-width:calc(100% - 135px);font-family:Roboto Mono,Courier New,Monaco,DejaVu Sans Mono,monospace,Arial;letter-spacing:.05em}.bm-N.bm-G{max-width:300px}.bm-L{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5ch;background:url('data:image/svg+xml;utf8,') repeat;cursor:grab;width:100%;height:fit-content}.bm-L.bm-F{cursor:grabbing}.bm-N:has(.bm-L.bm-F){pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.bm-L.bm-F{pointer-events:auto}.bm-M{display:inline-block;height:2.5em;margin-right:1ch;vertical-align:middle}.bm-N h1{display:inline-block;font-size:x-large;font-weight:700;vertical-align:middle}.bm-L h1,.bm-L-text{font-size:1.2em;user-select:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;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-L div:has(h1){display:contents}.bm-N h2{display:inline-block;font-size:larger;font-weight:700;vertical-align:middle}.bm-N h3{display:inline-block;font-size:large;font-weight:700}.bm-E.bm-d{width:fit-content;margin-left:auto;margin-right:auto}.bm-E{margin:.5em 0}.bm-N button{background-color:#144eb9;border-radius:1em;padding:0 .75ch}.bm-N button:hover,.bm-N button:focus-visible{background-color:#1061e5}.bm-N button:active,.bm-N button:disabled{background-color:#2e97ff}.bm-N button:disabled{text-decoration:line-through;cursor:not-allowed}.bm-n{border:white 1px solid;height:1.5em;width:1.5em;margin-top:2px;text-align:center;line-height:1em;padding:0!important}.bm-C{vertical-align:middle}.bm-C svg{width:50%;margin:0 auto;fill:#111}.bm-N button.bm-u{background-color:unset}.bm-u.bm-b:hover,.bm-u.bm-b:focus{background-color:#ffffff2b}.bm-u.bm-b:active{background-color:#ffffff38}.bm-u.bm-c:hover,.bm-u.bm-c:focus{background-color:#0000002b}.bm-u.bm-c:active{background-color:#00000038}input[type=number].bm-v{appearance:auto;-moz-appearance:textfield;width:5.5ch;margin-left:1ch;background-color:#0003;padding:0 .5ch;font-size:small}input[type=number].bm-v::-webkit-outer-spin-button,input[type=number].bm-v::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}div:has(>.bm-D)>button{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bm-D,input[type=file]{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-N select{color:#fff;background-color:#144eb9;border-radius:1em;padding:0 .5ch}.bm-N label:has(input[type=checkbox]){display:flex;width:fit-content;gap:1ch}.bm-N input[type=checkbox]{width:1em}.bm-h{overflow:hidden;transition:height .3s cubic-bezier(.4,0,.2,1)}.bm-N textarea{font-size:small;background-color:#0003;padding:0 .5ch;height:5.25em;width:100%}.bm-N a:not(:has(*)){text-decoration:underline}.bm-N small{font-size:x-small;color:#d3d3d3}.bm-N ul li{list-style:disc;margin-left:5ch}.bm-N .bm-E.bm-A{max-height:calc(80vh - 150px);overflow:auto}.bm-s{display:flex;align-content:center;justify-content:space-between;align-items:center;gap:.5ch}.bm-x{display:flex;align-content:center;justify-content:center;align-items:center;gap:.5ch}.bm-Q{white-space:pre;letter-spacing:0;line-height:1!important;font-size:1.6em;font-family:monospace}.bm-G .bm-E:not(#bm-w .bm-E){margin-top:.25em;margin-bottom:.25em}.bm-G h1:not(#bm-w h1){font-size:1em}#bm-p p svg{display:inline;height:1em;fill:#fff}#bm-y{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1em 3ch}#bm-p .bm-t{width:fit-content;max-width:35ch;background-color:#153063e6;border-radius:1em;padding:.5em;gap:1ch;transition:background-color .3s ease}#bm-p .bm-t:hover,#bm-p.bm-t:focus-within{background-color:#112855e6}#bm-p .bm-7{display:block;border:thick double darkslategray;width:fit-content;height:fit-content;padding:1ch}#bm-p .bm-t[data-id="-2"] .bm-7{background:conic-gradient(#a00,#aa0 16.6%,#0a0,#0aa 50%,#00a 66.6%,#a0a,#a00)}#bm-p .bm-t[data-id="-1"] .bm-7{background:url('data:image/svg+xml;utf8,') repeat;background-color:transparent!important}#bm-p .bm-t[data-id="-1"] .bm-7 svg{fill:#fff!important}#bm-p .bm-t[data-id="0"] .bm-7{background-color:transparent!important}#bm-p .bm-7 button{padding:.75em .5ch}#bm-p .bm-7 svg{width:4ch}#bm-p .bm-t>.bm-s{flex-direction:column;align-items:flex-start;gap:0}#bm-p .bm-t small{font-size:.75em}#bm-p .bm-t.bm-B{display:none}#bm-p.bm-G #bm-y{flex-direction:column;gap:.25em}#bm-p.bm-G .bm-t{width:auto;margin:0;padding:0}#bm-p.bm-G .bm-7{display:flex;width:100%;gap:.5ch;align-items:center;padding:.1em .5ch;border:none;border-radius:1em}#bm-p.bm-G .bm-7 button{padding:.5em .25ch}#bm-p.bm-G .bm-7 svg{width:3ch}#bm-p.bm-G .bm-t h2{font-size:.75em}#bm-p #bm-X{font-size:1em}#bm-N-settings div:has(>.bm-Y){width:fit-content;justify-content:flex-start}#bm-N-settings .bm-Y{display:flex;flex-direction:column;width:13%}#bm-N-settings .bm-Y span{width:fit-content;margin:auto;font-size:.7em}#bm-N-settings .bm-Y button{width:fit-content;padding:0;border-radius:0}#bm-N-settings .bm-Y svg{stroke:#333;stroke-width:.02px;width:100%;min-width:1.5ch;max-width:14.5ch}#bm-N-settings .bm-Y button:hover svg,#bm-N-settings .bm-Y button:focus svg{opacity:.9}#bm-N-settings .bm-1g{display:grid;grid-template-columns:1fr 1fr 1fr;width:25%;min-width:3ch;max-width:15ch}#bm-N-settings .bm-1g>button{width:100%;padding:0;aspect-ratio:1 / 1;background-color:#fff;border:#333 1px solid;border-radius:0;box-sizing:border-box}#bm-N-settings .bm-1g>button[data-status=Incorrect]{background-color:brown}#bm-N-settings .bm-1g>button[data-status=Template]{background-color:#2f4f4f}#bm-N-settings .bm-1g>button:hover,#bm-N-settings .bm-1g>button:focus{opacity:.8}#bm-r{display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start}#bm-r>.bm-E{width:100%;justify-content:flex-start;background-color:#153063e6;border-radius:1em;padding:.5em;transition:background-color .3s ease}#bm-r>.bm-E:hover,#bm-r>.bm-E:focus-within{background-color:#112855e6}#bm-r .bm-1{height:100%;font-size:xxx-large}#bm-r .bm-0{flex-direction:column;align-items:flex-start;gap:0}`;GM_addStyle(nt);var st,ot="@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+MzbbQxeN55AxRPykXkQdo6t7c6XysPaJR4AuryOynFyPSwYBK3+VxcBn491YBHx2z6pLgQ8ABADND6LF5vWqFysQH8cogOrrvfw7uRngSlumfQL3+G3WBQU35hQiwLYw/Sv01TXAvggLWwCQFwcCEEaiSZ1CKnpCm3SkQCuJg/v8agg872ppgDgDBqZZMmE0MnDeqzLFHLS0yV4BhERKR3RU0A5n7xP7pLBZIdIr6NjSaNVr8gOSVZLN2y922+46xDTNpPnEggWihehGjCB8EAEIJAKDiEIwEPzgzsYw0g0J/d40/5oG0OtRBAwc6XSWGItIJZo8IJg5jPBC+B01EUEffgsggea4pIfj/1ht+/7P9+Dv8dv/t7ffblTXq0vVLtHD38MrDy8/VDxce7j6sPmQ+pDxMFrXEx8Y74vWe8hDRvHEc2VTMjfM2y3yoQH3M1pcRqskaLNajlJlVloklU6aZukyNFiikUanci0q9ND6X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rBu7FKeeYVvWSqGTlTquCSYowoNe8mdCqpO1NJC9SqEKK+ckoCgsgAYn4giGS9r3o0EQUFkWgCRmEqVinP47o6lRGJIRCZQiZKsoOMqRGuSlCJ1kJGBgMxjpqY0jLPrxkBG99YngLF3jX08Az5AalSJpS8FDBGXqnyzZX2tZJZUwgL3Gk2hXLQzjhc1SehYQTDChEqTDgcvAgf/zQjikJCRkFFQ8cQLQYTn4CQiJiElEwcuXgKCZQSJUmmoqaRIlWadBkyufMABePJizcfvvy8894HI0Z99MlnvcaY7PaHv722ko0/deh3hKUdkDZzluUvwLSTluNyscde9mynHXTKPvv9HBZoAhM+xpZF6ydHOfnXOm8dggAXaCs3LPNsNXpptVU6tVsoJukJy6zAofO7X+ntYjAjh9FvTjvjlbPOOe+CXBddkueKNWZddU2+6/5UoEixQqVKlClXqUqFaovUqrFYnSUa1BvXqEmLVs3+Moeny0233NbtXljC3yzsM2DKjbDCGMYxgUkkZBQoMQUHwxkz6auEfNafqNNkm/Ne/fU4c9r9BxG3FS/R2+muY0SwdfVjcc5Iy/z3siKbmreCL48SZxxd5w796Bvsm4QCoRC4qHw4CAQOfnUkt38If1yYQhc=)format('woff2');}";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.Pe=null,this.Ae=null,this.We="#bm-j"}Fe(t){return this.Ae=t,this.Pe=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.We)}),this}Ve(){return this.Pe}observe(t,e=!1,i=!1){t.observe(this.Ae,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALEQa0zv0AAAACBjSFJNAACHDwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAABF2lDQ1BJQ0MgUHJvZmlsZQAAKM9jYGDiyUnOLWYSYGDIzSspCnJ3UoiIjFJgv8PAyCDJwMygyWCZmFxc4BgQ4MOAE3y7BlQNBJd1QWYxkAa4UlKLk4H0HyCOSy4oKmFgYIwBsrnLSwpA7AwgWyQpG8yuAbGLgA4EsieA2OkQ9hKwGgh7B1hNSJAzkH0GyHZIR2InIbGh9oIAc7IRA9VBSWpFCYh2c2JgAIUpelghxJjFgNgYGBdLEGL5ixgYLL4CxScgxJJmMjBsb2VgkLiFEFNZwMDA38LAsO18cmlRGdRqKSA+zXiSOZl1Ekc29zcBe9FAaRPFj5oTjCSsJ7mxBpbHvs0uqGLt3DirZk3m/trLh18a/P8PAN5BU32YWvgkAAAACXBIWXMAAA7BAAAOwQG4kWvtAAAAGHRFWHRTb2Z0d2FyZQBQYWludC5ORVQgNS4xLjgbaeqoAAAAjGVYSWZJSSoACAAAAAUAGgEFAAEAAABKAAAAGwEFAAEAAABSAAAAKAEDAAEAAAACAAAAMQECABAAAABaAAAAaYcEAAEAAABqAAAAAAAAANl2AQDoAwAA2XYBAOgDAABQYWludC5ORVQgNS4xLjgAAgAAkAcABAAAADAyMzABoAMAAQAAAP//AAAAAAAAubU+IZJzuMAAAAtoSURBVFhHlZZ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+IREiSRj9F92O5M+O3e1SPngrx/xzLpVjBoeQHFpGa/+8TXOfvM5WmnWgX3HGDduNK5GV+GJK0Z3J24mpaki5D14IPvlUhou7auqrcNPtp4ok/r5auw1GurrcHPz4u1tT/0g5g8+9FlWoaLs/eDPFOYX4T/YW86uFzj55XF1scyfN0NgN1ApatnT06PefFpZzyXFZpKS06VlZZSUFLN69TpsNhtNMrI1VdWUV9RIZ7Ukxl8k8uxnP51An52KKFCKi7JEt++RSvUoIihGo5sEKMfHx0fOMRGUFgtNcrL3wdvb262qodXWwwDhyIVz0XJHDqGisk5dyc1CvLyCdL48/NGP4t0xgT775ny6YudgwMEOhgT4S0VWGTeNVKLB3l4r46PBJrIrkiYHrCLP7KmptshysoladtHR3ibPHLgUFS0ciSbi9LE7xvqfCfzHXt56QBk/ZYK0w0cNanDSy8WrCLm61Tb09blVBKTvBLN1dFHbYJHv6UTrq8gTBd2968WfjPGzCfzHPj6aoJi8B1JfU42Laz/Z8U4qIl0dNiFhG1qZ84aGeiFbm2zTUnbt3PCLfP/iBP7b/nbwjOLq6isEq5XrqQ9+PfWibq9uXf5/+oN/A9GVF7dbp9A3AAAAAElFTkSuQmCC"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new O).Jt(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().F().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().V().D().B({id:"bm-k",textContent:"Next level in..."}).D().V().D().B({textContent:"Charges: "}).ft(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.ze=e.id}).D().D().D().F().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?._e;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.qt?.Ue(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.qt?.Ue(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.qt.Me(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.qt;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().N({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.Se=null,this.$=null,this.schemaVersion="2.0.0",this.Ge=null,this.$e="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.Te=3,this.Ne=3,this.Kt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,jt:i}}(this.Ne),this.De=null,this.Re="",this.ge=[],this.Ce=null,this.je=!0,this.Ee=null,this.pe=new Map}Ye(t){this.Se=t}k(t){this.$=t}async Je(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Me(t,e,n){this.Ce||(this.Ce=await this.Je(),console.log("Creating JSON...")),this.Se.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,Dt:0,Lt:m(this.Ge||0,this.$e),file:t,coords:n}),o=!this.$?.kt?.flags?.includes("hl-noSkip"),a=this.$?.kt?.flags?.includes("hl-agSkip");console.log(`Should Skip: ${o}; Should Agg Skip: ${a}`);const{Ut:r,Gt:l}=await s.At(this.Nt,this.Kt,o,a);s.Ht=r;const c={total:s.Bt.total,colors:Object.fromEntries(s.Bt.colors)};this.Ce.templates[`${s.Dt} ${s.Lt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:c,tiles:l},this.ge=[],this.ge.push(s),this.Se.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.Ce.templates).length),console.log(this.Ce),console.log(this.ge),console.log(JSON.stringify(this.Ce)),await i(this,J,X).call(this)}Xe(){}async qe(){this.Ce||(this.Ce=await this.Je(),console.log("Creating JSON..."))}async Ze(){l("Downloading all templates..."),console.log(this.ge);for(const t of this.ge)await this.Qe(t),await n(500)}async ye(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Qe(new H({displayName:i.name,Dt:e.split(" ")?.[0],Lt:e.split(" ")?.[1],Ht:i.tiles})),await n(500))}async Qe(t){t.Rt();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.ve(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ke:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async ve(t){console.log(t);const e=t.Ht,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Te),r=Math.max(r,u+m.height/this.Te)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Te,m=c*this.Te;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Te,(m-o)*this.Te,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Te,c*this.Te,0,0,l,c),b.convertToBlob({type:"image/png"})}async ti(t,e){if(!this.je)return t;const n=this.Nt*this.Te;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.ge;console.log(o),o.sort((t,e)=>t.Dt-e.Dt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Ht).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{ei:t,Ft:t.Ht[e],Ot:t.Ot?.[e],ii:[i[0],i[1]],ni:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.Se.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Ht).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Bt.total||0),0));this.Se.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.kt?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.ei.Bt?.colors?.get(-1);let s=t.Ot.slice();const o=Number(t.ni[0])*this.Te,a=Number(t.ni[1])*this.Te;if(0!=this.pe.size||n||h.drawImage(t.Ft,o,a),!s){const e=h.getImageData(o,a,t.Ft.width,t.Ft.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Be:l,Ie:c}=i(this,J,Z).call(this,{ke:d,De:s,Le:[o,a,t.Ft.width,t.Ft.height],He:u,Oe:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.pe.size&&!n&&p||(console.log("Colors to filter: ",this.pe),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ft.width,t.Ft.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.ei.Bt.correct&&(t.ei.Bt.correct={}),t.ei.Bt.correct[e]=l}return await c.convertToBlob({type:"image/png"})}si(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ue(t){this.je=t}}(et,it),ct=new class{constructor(t){this.qt=t,this.oi=!1,this.ze="",this._e=[],this.ai=[]}ri(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.qt.Ge=n.id,0!=this.ze.length){const t=document.querySelector("#"+this.ze);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this._e.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this._e=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,g=Date.now(),f=await this.qt.ti(p,u);console.log(`Finished loading the tile in ${(Date.now()-g)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:f,blink:i.blink});break;case"robots":this.oi="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async li(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ci(i),s=this.hi(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ci(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}hi(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.kt=n,(s=this.kt).flags??(s.flags=[]),this.mi=structuredClone(this.kt),this.di="bmUserSettings",this.ui=5e3,this.bi=0,setInterval(this.pi.bind(this),this.ui)}async pi(){const t=JSON.stringify(this.kt);t!=JSON.stringify(this.mi)&&Date.now()-this.bi>this.ui&&(await GM.setValue(this.di,t),this.mi=structuredClone(this.kt),this.bi=Date.now(),console.log(t))}gi(t,e=void 0){const i=this.kt?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.kt?.flags?.splice(i,1):-1==i&&!1!==e&&this.kt?.flags?.push(t)}Tt(){const t='',e='',n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().F().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noTrans"),i.onchange=t=>this.gi("hl-noTrans",!t.target.checked)}).D().O({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().O({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}St(){this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().F().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Template creation should skip transparent tiles"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noSkip"),i.onchange=t=>this.gi("hl-noSkip",!t.target.checked)}).D().R({innerHTML:"Experimental: Template creation should aggressively skip transparent tiles"},(t,e,i)=>{i.checked=this.kt?.flags?.includes("hl-agSkip"),i.onchange=t=>this.gi("hl-agSkip",t.target.checked)}).D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.Ye(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.si(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.li(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.fi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ci(navigator.userAgent),e=this.p.hi(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().F().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.fi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().O({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 ${this.name}!`}).D().D().F().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().O({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().O({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ri(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js index f3f4dd9..8c300a1 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.91.74 +// @version 0.91.102 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine @@ -39,4 +39,4 @@ The "Blue Marble" image is owned by NASA. */ -(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function g(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var f,w,x,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]}],M=class{constructor(t,i){e(this,f),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"p",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,f,w).call(this,"h"+t,{},e)),this}V(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"hr",{},t)),this}F(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n={};t.textContent?(n.textContent=t.textContent,delete t.textContent):t.innerHTML&&(n.innerHTML=t.innerHTML,delete t.textContent);const s=i(this,f,w).call(this,"label",n),o=i(this,f,w).call(this,"input",{type:"checkbox"},t);return s.insertBefore(o,s.firstChild),this.D(),e(this,s,o),this}j(t={},e=()=>{}){const n=i(this,f,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,f,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,f,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,f,w).call(this,"div"),o=i(this,f,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,f,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"textarea",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{class:"bm-L"},t)),this}ft(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,f,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",g),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},g=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},f=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};f=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,f,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,f,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().V().D().N({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt(),this.St()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}St(){i(this,y,$).call(this,"Template")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().V().D().N({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){t.disabled=!0;const i=t.dataset.status,n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),this.kt.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var N=class{constructor(){this.zt=Math.ceil(80/1300*window.innerWidth),this.Ft=v.slice(1)}_t(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)}},O=class extends HTMLElement{};customElements.define("confetti-piece",O);var B,I,P,A,W,V,z,F,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().V().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().F().D().V().D().F().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().F().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().F().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().F().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().F().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().F().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Ut="bm-y",this.Mt=document.body,this.Gt=t.p?.Gt,this.Rt='',this.jt='';const{palette:i,Vt:n}=this.Gt.Et;this.palette=i,this.Yt=0,this.Jt=0,this.Xt=new Map,this.qt=new Map,this.Zt=0,this.Qt=0,this.timeRemaining=0,this.Kt="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.te()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().F().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().F().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().F().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().F().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).N({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Rt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.Yt)} / ${s(this.Jt)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.Zt)}`),this.ht("#bm-f",`Total Pixels: ${s(this.Qt)}`),this.ht("#bm-4",`Remaining: ${s((this.Qt||0)-(this.Zt||0))} (${o(((this.Qt||0)-(this.Zt||0))/(this.Qt||1))})`),this.ht("#bm-5",`Completed at: `)}te(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().V().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.ee(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}ee(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Ut}`),e={};for(const t of this.palette){const i=this.Xt.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.qt.get(t.id)??"???","number"!=typeof a&&this.Yt==this.Jt&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ie:i,ne:n,se:a,oe:r,ae:l,re:c}}if(document.querySelector("#bm-X")){const t=this.Zt.toString().length>7?this.Zt.toString().slice(0,2)+"…"+this.Zt.toString().slice(-3):this.Zt.toString(),e=this.Qt.toString().length>7?this.Qt.toString().slice(0,2)+"…"+this.Qt.toString().slice(-3):this.Qt.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{se:n,oe:s,ae:o,ie:a,ne:r,re:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Ut});const n=this.ee();for(const t of this.palette){const s="#"+g(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{se:l,oe:c,ae:h,ie:m,ne:d,re:u}=n[t.id],b=!!this.Gt.le.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.jt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.jt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Ut}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.Qt=0,this.Zt=0,this.qt=new Map,this.Xt=new Map;for(const t of this.Gt.ce){const e=t.Bt?.total??0;this.Qt+=e??0;const i=t.Bt?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.Xt.get(t)??0;this.Xt.set(t,n+i)}const n=t.Bt?.correct??{};this.Yt+=Object.keys(n).length,this.Jt+=Object.keys(t.Ht).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.Zt+=t;const n=this.qt.get(e)??0;this.qt.set(e,n+t)}}console.log(`Tiles loaded: ${this.Yt} / ${this.Jt}`),this.Zt>=this.Qt&&this.Qt&&this.Yt==this.Jt&&(new N)._t(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.Qt-this.Zt)*1e3+Date.now()),this.Kt=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,V),this.window=null,this.vt="bm-m",this.Mt=document.body,this.he=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.he?.scriptVersion,this.schemaVersion=this.he?.schemaVersion,this.me=void 0,this.de=n,this.Gt=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,V,z).call(this),i(this,V,F).call(this)}};V=new WeakSet,z=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.de.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.me="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.me="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.me="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.me="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.de)}.
Wplace was last updated on ${l}.${"Good"!=this.me?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.me&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.Gt.ue().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.me&&"Bad"!=this.me||c.lt({textContent:`Update template storage to ${this.de}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,V,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},F=function(){const t=this.he?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.Gt.be),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().O({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().N({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.he?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Ht:i.tiles});t.Wt();const e=await this.Gt.pe(t);await this.Gt.ge(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.de,this.Gt).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.fe))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.ce=await async function({Ot:t,we:i,ce:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,Dt:s||this.ce?.length||0,Lt:r||""});p.Bt=c,p.Ht=m,p.Nt=d,n.push(p),console.log(this.ce),console.log("^^^ This ^^^")}}return n}({Ot:this.Ot,we:this.we,ce:this.ce})):n[0]>>24&255,y=f>>>24&255,$=b.get(w)??-2,v=b.get(f)??-2;if(this.le.get($)&&(e[i*c+h]=f),-1==$){const t=536870912;this.le.get($)?e[i*c+h]=0:(u/o&1)==(g/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&f<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Se:p,ke:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.De=null,this.Le=null,this.He="#bm-j"}Ne(t){return this.Le=t,this.De=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.He)}),this}Oe(){return this.De}observe(t,e=!1,i=!1){t.observe(this.Le,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new N)._t(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().V().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().F().D().B({id:"bm-k",textContent:"Next level in..."}).D().F().D().B({textContent:"Charges: "}).ft(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.Be=e.id}).D().D().D().V().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?.Ie;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.Gt?.Pe(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.Gt?.Pe(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.Gt.ge(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.Gt;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().O({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.xe=null,this.$=null,this.schemaVersion="2.0.0",this.Ae=null,this.be="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Ot=1e3,this.we=3,this.Te=3,this.Et=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,Vt:i}}(this.Te),this.$e=null,this.We="",this.ce=[],this.fe=null,this.Ve=!0,this.ze=null,this.le=new Map}Fe(t){this.xe=t}k(t){this.$=t}async _e(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async ge(t,e,n){this.fe||(this.fe=await this._e(),console.log("Creating JSON...")),this.xe.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,Dt:0,Lt:m(this.Ae||0,this.be),file:t,coords:n}),{Pt:o,At:a}=await s.It(this.Ot,this.Et);s.Ht=o;const r={total:s.Bt.total,colors:Object.fromEntries(s.Bt.colors)};this.fe.templates[`${s.Dt} ${s.Lt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:r,tiles:a},this.ce=[],this.ce.push(s),this.xe.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.fe.templates).length),console.log(this.fe),console.log(this.ce),console.log(JSON.stringify(this.fe)),await i(this,J,X).call(this)}Ue(){}async Ge(){this.fe||(this.fe=await this._e(),console.log("Creating JSON..."))}async Re(){l("Downloading all templates..."),console.log(this.ce);for(const t of this.ce)await this.je(t),await n(500)}async ue(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.je(new H({displayName:i.name,Dt:e.split(" ")?.[0],Lt:e.split(" ")?.[1],Ht:i.tiles})),await n(500))}async je(t){t.Wt();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.pe(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ee:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async pe(t){console.log(t);const e=t.Ht,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Ot+c,u=l*this.Ot+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.we),r=Math.max(r,u+m.height/this.we)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.we,m=c*this.we;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Ot+r,m=a*this.Ot+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.we,(m-o)*this.we,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.we,c*this.we,0,0,l,c),b.convertToBlob({type:"image/png"})}async Ye(t,e){if(!this.Ve)return t;const n=this.Ot*this.we;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.ce;console.log(o),o.sort((t,e)=>t.Dt-e.Dt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Ht).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{Je:t,Xe:t.Ht[e],Nt:t.Nt?.[e],qe:[i[0],i[1]],Ze:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.xe.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Ht).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Bt.total||0),0));this.xe.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.kt?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.Je.Bt?.colors?.get(-1);let s=t.Nt.slice();const o=Number(t.Ze[0])*this.we,a=Number(t.Ze[1])*this.we;if(0!=this.le.size||n||h.drawImage(t.Xe,o,a),!s){const e=h.getImageData(o,a,t.Xe.width,t.Xe.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Se:l,ke:c}=i(this,J,Z).call(this,{ye:d,$e:s,ve:[o,a,t.Xe.width,t.Xe.height],Me:u,Ce:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.le.size&&!n&&p||(console.log("Colors to filter: ",this.le),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Xe.width,t.Xe.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.Je.Bt.correct&&(t.Je.Bt.correct={}),t.Je.Bt.correct[e]=l}return await c.convertToBlob({type:"image/png"})}Qe(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Pe(t){this.Ve=t}}(et,it),ct=new class{constructor(t){this.Gt=t,this.Ke=!1,this.Be="",this.Ie=[],this.ti=[]}ei(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.Gt.Ae=n.id,0!=this.Be.length){const t=document.querySelector("#"+this.Be);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this.Ie.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this.Ie=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,g=Date.now(),f=await this.Gt.Ye(p,u);console.log(`Finished loading the tile in ${(Date.now()-g)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:f,blink:i.blink});break;case"robots":this.Ke="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async ii(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ni(i),s=this.si(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ni(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}si(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.kt=n,(s=this.kt).flags??(s.flags=[]),this.oi=structuredClone(this.kt),this.ai="bmUserSettings",this.ri=5e3,this.li=0,setInterval(this.ci.bind(this),this.ri)}async ci(){const t=JSON.stringify(this.kt);t!=JSON.stringify(this.oi)&&Date.now()-this.li>this.ri&&(await GM.setValue(this.ai,t),this.oi=structuredClone(this.kt),this.li=Date.now(),console.log(t))}hi(t,e=void 0){const i=this.kt?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.kt?.flags?.splice(i,1):-1==i&&!1!==e&&this.kt?.flags?.push(t)}Tt(){const t='',e='',n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noTrans"),i.onchange=t=>this.hi("hl-noTrans",!t.target.checked)}).D().N({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().N({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}St(){this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().V().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Template creation should skip transparent tiles"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noSkip"),i.onchange=t=>this.hi("hl-noSkip",!t.target.checked)}).D().R({innerHTML:"Experimental: Template creation should aggressively skip transparent tiles"},(t,e,i)=>{i.checked=this.kt?.flags?.includes("hl-agSkip"),i.onchange=t=>this.hi("hl-agSkip",t.target.checked)}).D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.Fe(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.Qe(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.ii(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.mi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ni(navigator.userAgent),e=this.p.si(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().V().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.mi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().N({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 ${this.name}!`}).D().D().V().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().N({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().N({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ei(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file +(()=>{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 o(t){return new Intl.NumberFormat(void 0,{style:"percent",t:2,i:2}).format(t)}function a(t){return t.toLocaleString(void 0,{o:"long",l:"numeric",h:"2-digit",m:"2-digit",u:"2-digit"})}function r(t){const e=document.createElement("div");return e.textContent=t,e.innerHTML}function l(...t){(0,console.log)(...t)}function c(...t){(0,console.error)(...t)}function h(...t){(0,console.warn)(...t)}function m(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 d(t,e){let i=0;const n=e.length;for(const s of t){const t=e.indexOf(s);-1==t&&c(`Invalid character '${s}' encountered whilst decoding! Is the decode alphabet/base incorrect?`),i=i*n+t}return i}function u(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]}function g(t,e,i){return Array.isArray(t)&&([t,e,i]=t),(1<<24|t<<16|e<<8|i).toString(16).slice(1)}var f,w,x,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]}],M=class{constructor(t,i){e(this,f),this.name=t,this.version=i,this.p=null,this.$=null,this.v="bm-l",this.M=null,this.C=null,this.T=[]}S(t){this.p=t}k(t){this.$=t}D(){return this.T.length>0&&(this.C=this.T.pop()),this}L(t){t?.appendChild(this.M),this.M=null,this.C=null,this.T=[]}H(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{},t)),this}O(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"p",{},t)),this}N(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"small",{},t)),this}B(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"span",{},t)),this}I(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"details",{},t)),this}P(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"summary",{},t)),this}A(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"img",{},t)),this}W(t,e={},n=()=>{}){return n(this,i(this,f,w).call(this,"h"+t,{},e)),this}F(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"hr",{},t)),this}V(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"br",{},t)),this}_(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"form",{},t)),this}U(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"fieldset",{},t)),this}G(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"legend",{},t)),this}R(t={},e=()=>{}){const n={};t.textContent?(n.textContent=t.textContent,delete t.textContent):t.innerHTML&&(n.innerHTML=t.innerHTML,delete t.textContent);const s=i(this,f,w).call(this,"label",n),o=i(this,f,w).call(this,"input",{type:"checkbox"},t);return s.insertBefore(o,s.firstChild),this.D(),e(this,s,o),this}j(t={},e=()=>{}){const n=i(this,f,w).call(this,"label",{textContent:t.textContent??"",for:t.id??""});return delete t.textContent,this.D(),e(this,n,i(this,f,w).call(this,"select",{},t)),this}Y(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"option",{},t)),this}J(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ol",{},t)),this}X(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"ul",{},t)),this}q(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"menu",{},t)),this}Z(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"li",{},t)),this}K(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"table",{},t)),this}tt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"caption",{},t)),this}et(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"thead",{},t)),this}it(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tbody",{},t)),this}nt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tfoot",{},t)),this}st(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"tr",{},t)),this}ot(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"th",{},t)),this}rt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"td",{},t)),this}lt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"button",{},t)),this}ct(t={},e=()=>{}){const n=t.title??t.textContent??"Help: No info";delete t.textContent,t.title=`Help: ${n}`;const s={textContent:"?",className:"bm-R",onclick:()=>{this.ht(this.v,n)}};return e(this,i(this,f,w).call(this,"button",s,t)),this}dt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"input",{},t)),this}ut(t={},e=()=>{}){const n=t.textContent??"";delete t.textContent;const s=i(this,f,w).call(this,"div"),o=i(this,f,w).call(this,"input",{type:"file",tabindex:"-1","aria-hidden":"true"},t);this.D();const a=i(this,f,w).call(this,"button",{textContent:n});return this.D(),this.D(),a.addEventListener("click",()=>{o.click()}),o.addEventListener("change",()=>{a.style.maxWidth=`${a.offsetWidth}px`,o.files.length>0?a.textContent=o.files[0].name:a.textContent=n}),e(this,s,o,a),this}bt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"textarea",{},t)),this}gt(t={},e=()=>{}){return e(this,i(this,f,w).call(this,"div",{class:"bm-L"},t)),this}ft(t=Date.now(),e=500,n={},s=()=>{}){const o="bm-P",a=n?.id||o+"-"+crypto.randomUUID().slice(0,8),r={class:o},l=i(this,f,w).call(this,"time",r,n);return l.id=a,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}ht(t,e,i=!1){const n=document.getElementById(t.replace(/^#/,""));n&&(n instanceof HTMLInputElement?n.value=e:i?n.textContent=e:n.innerHTML=e)}wt(t){if(t.disabled)return;t.disabled=!0,t.style.textDecoration="none";const e=t.closest(".bm-N"),i=t.closest(".bm-L"),n=e.querySelector("h1"),s=e.querySelector(".bm-h");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),o=i.textContent;t.nextElementSibling.appendChild(i),t.textContent="ā–¶",t.dataset.buttonStatus="collapsed",t.ariaLabel=`Unminimize window "${o}"`}else{const n=i.querySelector("h1"),o=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 "${o}"`}}xt(t,e){const i=document.querySelector(t),n=document.querySelector(e);if(!i||!n)return void this.yt(`Can not drag! ${i?"":"moveMe"} ${i||n?"":"and "}${n?"":"iMoveThings "}was not found!`);let s,o=!1,a=0,r=null,l=0,c=0,h=0,m=0,d=null;const u=()=>{if(o){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)=>{o=!0,d=i.getBoundingClientRect(),s=t-d.left,a=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-F"),document.addEventListener("mousemove",g),document.addEventListener("touchmove",f,{passive:!1}),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchcancel",p),r&&cancelAnimationFrame(r),u()},p=()=>{o=!1,r&&(cancelAnimationFrame(r),r=null),document.body.style.userSelect="",n.classList.remove("bm-F"),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",f),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),document.removeEventListener("touchcancel",p)},g=t=>{o&&d&&(h=t.clientX-s,m=t.clientY-a)},f=t=>{if(o&&d){const e=t.touches[0];if(!e)return;h=e.clientX-s,m=e.clientY-a,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})}$t(t){(0,console.info)(`${this.name}: ${t}`),this.ht(this.v,"Status: "+t,!0)}yt(t){(0,console.error)(`${this.name}: ${t}`),this.ht(this.v,"Error: "+t,!0)}};f=new WeakSet,w=function(t,e={},n={}){const s=document.createElement(t);this.M?(this.C?.appendChild(s),this.T.push(this.C),this.C=s):(this.M=s,this.C=s);for(const[t,n]of Object.entries(e))i(this,f,x).call(this,s,t,n);for(const[t,e]of Object.entries(n))i(this,f,x).call(this,s,t,e);return s},x=function(t,e,i){"class"==e?t.classList.add(...i.split(/\s+/)):"for"==e?t.htmlFor=i:"tabindex"==e?t.tabIndex=Number(i):"readonly"==e?t.readOnly="true"==i||"1"==i:"maxlength"==e?t.maxLength=Number(i):e.startsWith("data")?t.dataset[e.slice(5).split("-").map((t,e)=>0==e?t:t[0].toUpperCase()+t.slice(1)).join("")]=i:e.startsWith("aria")?t.setAttribute(e,i):t[e]=i};var C,T,S,k,D,L=class extends M{constructor(t,i){super(t,i),e(this,y),this.window=null,this.vt="bm-N-settings",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Settings"}).D().D().F().D().O({textContent:"Settings take 5 seconds to save."}).D().H({class:"bm-E bm-A"},(t,e)=>{this.Tt(),this.St()}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}Tt(){i(this,y,$).call(this,"Pixel Highlight")}St(){i(this,y,$).call(this,"Template")}};y=new WeakSet,$=function(t){this.window=this.H({class:"bm-E"}).W(2,{textContent:t}).D().F().D().O({innerHTML:`An error occured loading the ${t} category. SettingsManager failed to override the ${t} function inside WindowSettings.`}).D().D()},C=new WeakSet,T=function(t,e){t.disabled=!0;const i=t.dataset.status,n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];let s=[2,0,0];const o=n;switch(i){case"Disabled":t.dataset.status="Incorrect",t.ariaLabel="Sub-pixel incorrect",s=[1,...e];break;case"Incorrect":t.dataset.status="Template",t.ariaLabel="Sub-pixel template",s=[2,...e];break;case"Template":t.dataset.status="Disabled",t.ariaLabel="Sub-pixel disabled",s=[0,...e];break}const a=n.findIndex(([,t,e])=>t==s[1]&&e==s[2]);0!=s[0]?-1!=a?o[a]=s:o.push(s):-1!=a&&o.splice(a,1),this.kt.highlight=o,t.disabled=!1},S=async function(t){const e=document.querySelectorAll(".bm-Y button");for(const t of e)t.disabled=!0;let i=[0,0,0,0,2,0,0,0,0];switch(t){case"Cross":i=[0,1,0,1,2,1,0,1,0];break;case"X":i=[1,0,1,0,2,0,1,0,1];break;case"Full":i=[2,2,2,2,2,2,2,2,2];break}const s=document.querySelector(".bm-1g")?.childNodes??[];for(let t=0;t{const[n,s,o,a]=e.split(",").map(Number);(s>>24==0?0:s.get(e)??-2;const a=o.get(n);o.set(n,a?a+1:1)}return console.log(o),o};var O=class{constructor(){this.Et=Math.ceil(80/1300*window.innerWidth),this.Yt=v.slice(1)}Jt(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)}},N=class extends HTMLElement{};customElements.define("confetti-piece",N);var B,I,P,A,W,F,V,z,_,U=class extends M{constructor(t,e){super(t,e),this.window=null,this.vt="bm-i",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?document.querySelector(`#${this.vt}`).remove():(this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Credits"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Credits"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Credits"}).D().D().F().D().H({class:"bm-E bm-A"}).B({role:"img","aria-label":this.name}).B({innerHTML:"\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•\n\nā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā•ā•ā•\nā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā–ˆā–ˆā–ˆā–ˆā–ˆā•— \nā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•”ā•ā•ā• \nā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—\nā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā• ā•šā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā•ā•\n",class:"bm-Q","aria-hidden":"true"}).D().D().V().D().F().D().V().D().B({textContent:'"Blue Marble" userscript is made by SwingTheVine.'}).D().V().D().B({innerHTML:'The Blue Marble Website is made by crqch.'}).D().V().D().B({textContent:`The Blue Marble Website used until ${a(new Date(175606932e4))} was made by Camille Daguin.`}).D().V().D().B({textContent:'The favicon "Blue Marble" is owned by NASA. (The image of the Earth is owned by NASA)'}).D().V().D().B({textContent:"Special Thanks:"}).D().X().Z({textContent:"Espresso, Meqa, and Robot for moderating SwingTheVine's community."}).D().Z({innerHTML:'nof, darkness for creating similar userscripts!'}).D().Z({innerHTML:'Wonda for the Blue Marble banner image!'}).D().Z({innerHTML:'BullStein, allanf181 for being early beta testers!'}).D().Z({innerHTML:'guidu_ and Nick-machado for the original "Minimize" Button code!'}).D().Z({innerHTML:'Nomad and Gustav for the tutorials!'}).D().Z({innerHTML:'cfp for creating the template overlay that Blue Marble was based on!'}).D().Z({innerHTML:'Force Network for hosting the telemetry server!'}).D().Z({innerHTML:'TheBlueCorner for getting me interested in online pixel canvases!'}).D().D().V().D().B({innerHTML:'Donators:'}).D().X().Z({textContent:"Espresso"}).D().Z({textContent:"BEST FAN"}).D().Z({textContent:"FuchsDresden"}).D().Z({textContent:"Jack"}).D().Z({textContent:"raiken_au"}).D().Z({textContent:"Jacob"}).D().Z({textContent:"StupidOne"}).D().Z({textContent:"2 Anonymous Supporters"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}},G=class extends M{constructor(t){super(t.name,t.version),e(this,B),this.window=null,this.vt="bm-p",this.Xt="bm-y",this.Mt=document.body,this.qt=t.p?.qt,this.Zt='',this.Qt='';const{palette:i,jt:n}=this.qt.Kt;this.palette=i,this.te=0,this.ee=0,this.ie=new Map,this.ne=new Map,this.se=0,this.oe=0,this.timeRemaining=0,this.ae="",this.sortPrimary="id",this.sortSecondary="ascending",this.showUnused=!1}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ——","aria-label":'Switch to windowed mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.re()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().F().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"Hide All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh Data"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.le(),e.disabled=!1}}).D().lt({textContent:"Show All Colors"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E",style:"margin-left: 2.5ch; margin-right: 2.5ch;"}).H({class:"bm-E"}).B({id:"bm-e",innerHTML:"Tiles Loaded: 0 / ???"}).D().V().D().B({id:"bm-9",innerHTML:"Correct Pixels: ???"}).D().V().D().B({id:"bm-f",innerHTML:"Total Pixels: ???"}).D().V().D().B({id:"bm-4",innerHTML:"Complete: ??? (???)"}).D().V().D().B({id:"bm-5",innerHTML:"??? ???"}).D().D().H({class:"bm-E"}).O({innerHTML:`Press the šŸ—— button to make this window smaller. Colors with the icon ${this.Zt.replace("{e.onclick=t=>{t.preventDefault();const e=new FormData(document.querySelector(`#${this.vt} form`)),n={};for(const[t,i]of e)n[t]=i;console.log(`Primary: ${n.sortPrimary}; Secondary: ${n.sortSecondary}; Unused: ${"on"==n.showUnused}`),i(this,B,P).call(this,n.sortPrimary,n.sortSecondary,"on"==n.showUnused)}}).D().D().D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused),this.ht("#bm-e",`Tiles Loaded: ${s(this.te)} / ${s(this.ee)}`),this.ht("#bm-9",`Correct Pixels: ${s(this.se)}`),this.ht("#bm-f",`Total Pixels: ${s(this.oe)}`),this.ht("#bm-4",`Remaining: ${s((this.oe||0)-(this.se||0))} (${o(((this.oe||0)-(this.se||0))/(this.oe||1))})`),this.ht("#bm-5",`Completed at: `)}re(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();this.window=this.H({id:this.vt,class:"bm-N bm-G"}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Color Filter"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>{const i=document.querySelector("#bm-X");i&&(i.style.display="expanded"==e.dataset.buttonStatus?"none":""),t.wt(e)},e.ontouchend=()=>{e.click()}}).D().H().B({id:"bm-X",class:"bm-L-text",style:"font-weight: 700;"}).D().D().H({class:"bm-x"}).lt({class:"bm-n",textContent:"šŸ—–","aria-label":'Switch to fullscreen mode for "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove(),this.Ct()},e.ontouchend=()=>{e.click()}}).D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Color Filter"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Color Filter"}).D().D().F().D().H({class:"bm-E bm-s bm-d",style:"gap: 1.5ch;"}).lt({textContent:"None"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!1)}).D().lt({textContent:"Refresh"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.le(),e.disabled=!1}}).D().lt({textContent:"All"},(t,e)=>{e.onclick=()=>i(this,B,A).call(this,!0)}).D().D().H({class:"bm-E bm-A"}).D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`);const t=document.querySelector(`#${this.vt} .bm-E.bm-A`);i(this,B,I).call(this,t),i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}le(){i(this,B,W).call(this);const t=document.querySelector(`#${this.Xt}`),e={};for(const t of this.palette){const i=this.ie.get(t.id)??0,n=s(i);let a=0,r="0",l=o(1);0!=i&&(a=this.ne.get(t.id)??"???","number"!=typeof a&&this.te==this.ee&&t.id&&(a=0),r="string"==typeof a?a:s(a),l=isNaN(a/i)?"???":o(a/i));const c=parseInt(i)-parseInt(a);e[t.id]={ce:i,he:n,me:a,de:r,ue:l,be:c}}if(document.querySelector("#bm-X")){const t=this.se.toString().length>7?this.se.toString().slice(0,2)+"…"+this.se.toString().slice(-3):this.se.toString(),e=this.oe.toString().length>7?this.oe.toString().slice(0,2)+"…"+this.oe.toString().slice(-3):this.oe.toString();this.ht("#bm-X",`${t}/${e}`,!0)}if(!t)return e;const n=Array.from(t.children);for(const t of n){const i=parseInt(t.dataset.id),{me:n,de:s,ue:o,ce:a,he:r,be:l}=e[i];t.dataset.correct=Number.isNaN(parseInt(n))?"0":n,t.dataset.total=a,t.dataset.percent="%"==o.slice(-1)?o.slice(0,-1):"0",t.dataset.incorrect=l||0;const c=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-6`);c&&(c.textContent=`${s} / ${r}`);const h=document.querySelector(`#${this.vt} .bm-t[data-id="${i}"] .bm-3`);h&&(h.textContent=`${"number"!=typeof l||isNaN(l)?"???":l} incorrect pixel${1==l?"":"s"}. Completed: ${o}`)}i(this,B,P).call(this,this.sortPrimary,this.sortSecondary,this.showUnused)}};B=new WeakSet,I=function(t){const e=t.closest(`#${this.vt}`)?.classList.contains("bm-G");console.log(`Is Windowed Mode: ${e}`);const i=new M(this.name,this.version);i.H({id:this.Xt});const n=this.le();for(const t of this.palette){const s="#"+g(t.rgb).toUpperCase(),o=p(t.rgb);let a=1.05/(o+.05)>(o+.05)/.05?"white":"black";t.id||(a="transparent");const r="white"==a?"bm-b":"bm-c",{me:l,de:c,ue:h,ce:m,he:d,be:u}=n[t.id],b=!!this.qt.pe.get(t.id);if(e){const e=`background-size: auto 100%; background-repeat: repeat-x; background-image: url("data:image/svg+xml;utf8,");`;i.H({class:"bm-E bm-t bm-s","data-id":t.id,"data-name":t.name,"data-premium":+t.premium,"data-correct":Number.isNaN(parseInt(l))?"0":l,"data-total":m,"data-percent":"%"==h.slice(-1)?h.slice(0,-1):"0","data-incorrect":u||0}).H({class:"bm-7",style:`background-color: rgb(${t.rgb?.map(t=>Number(t)||0).join(",")});${t.premium?e:""}`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Qt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Qt.replace("Number(t)||0).join(",")});`}).lt({class:"bm-u "+r,"data-state":b?"hidden":"shown","aria-label":b?`Show the color ${t.name||""} on templates.`:`Hide the color ${t.name||""} on templates.`,innerHTML:b?this.Qt.replace("{i.onclick=()=>{i.style.textDecoration="none",i.disabled=!0,"shown"==i.dataset.state?(i.innerHTML=this.Qt.replace("{const o=n.getAttribute("data-"+t),a=s.getAttribute("data-"+t),r=parseFloat(o),l=parseFloat(a),c=!isNaN(r),h=!isNaN(l);if(i?n.classList.remove("bm-B"):Number(n.getAttribute("data-total"))||n.classList.add("bm-B"),c&&h)return"ascending"===e?r-l:l-r;{const t=o.toLowerCase(),i=a.toLowerCase();return ti?"ascending"===e?1:-1:0}}),s.forEach(t=>n.appendChild(t))},A=function(t){const e=document.querySelector(`#${this.Xt}`),i=Array.from(e.children);for(const e of i){if(e.classList?.contains("bm-B"))continue;const i=e.querySelector(".bm-7 button");("hidden"!=i.dataset.state||t)&&("shown"==i.dataset.state&&t||i.click())}},W=function(){this.oe=0,this.se=0,this.ne=new Map,this.ie=new Map;for(const t of this.qt.ge){const e=t.Bt?.total??0;this.oe+=e??0;const i=t.Bt?.colors??new Map;for(const[t,e]of i){const i=Number(e)||0,n=this.ie.get(t)??0;this.ie.set(t,n+i)}const n=t.Bt?.correct??{};this.te+=Object.keys(n).length,this.ee+=Object.keys(t.Ht).length;for(const t of Object.values(n))for(const[e,i]of t){const t=Number(i)||0;this.se+=t;const n=this.ne.get(e)??0;this.ne.set(e,n+t)}}console.log(`Tiles loaded: ${this.te} / ${this.ee}`),this.se>=this.oe&&this.oe&&this.te==this.ee&&(new O).Jt(document.querySelector(`#${this.vt}`)),this.timeRemaining=new Date(30*(this.oe-this.se)*1e3+Date.now()),this.ae=a(this.timeRemaining)};var R=class extends M{constructor(t,i,n,s=void 0){super(t,i),e(this,F),this.window=null,this.vt="bm-m",this.Mt=document.body,this.fe=JSON.parse(GM_getValue("bmTemplates","{}")),this.scriptVersion=this.fe?.scriptVersion,this.schemaVersion=this.fe?.schemaVersion,this.we=void 0,this.xe=n,this.qt=s}Ct(){if(document.querySelector(`#${this.vt}`))return void document.querySelector(`#${this.vt}`).remove();let t="";document.querySelector("#bm-w")||(t=t.concat("z-index: 9001;").trim()),this.window=this.H({id:this.vt,class:"bm-N",style:t},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Template Wizard"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().lt({class:"bm-n",textContent:"āœ–","aria-label":'Close window "Template Wizard"'},(t,e)=>{e.onclick=()=>{document.querySelector(`#${this.vt}`)?.remove()},e.ontouchend=()=>{e.click()}}).D().D().H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().F().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().O({id:"bm-o",textContent:"Loading template storage status..."}).D().D().H({class:"bm-E bm-A"}).W(2,{textContent:"Detected templates:"}).D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`),i(this,F,V).call(this),i(this,F,z).call(this)}};F=new WeakSet,V=function(){const t=this.schemaVersion.split(/[-\.\+]/),e=this.xe.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.we="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.we="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.we="Bad"):(n='Template storage health: Dead!
Blue Marble can not load the template storage. (Reason: MAJOR version unknown)',this.we="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 ${r(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.`,o=function(){const t=[...document.querySelectorAll("body > div > .hidden")].filter(t=>/version:/i.test(t.textContent));if(t[0]){const e=t[0].textContent?.match(/\d+/);return e?new Date(Number(e[0])):void 0}}();let l=o?a(o):"???";this.ht("#bm-o",`${n}
Your templates were created during Blue Marble version ${r(this.scriptVersion)} with schema version ${r(this.schemaVersion)}.
The current Blue Marble version is ${r(this.version)} and requires schema version ${r(this.xe)}.
Wplace was last updated on ${l}.${"Good"!=this.we?s:""}`);const c=new M(this.name,this.version);"Dead"!=this.we&&(c.H({class:"bm-E bm-x bm-d",style:"gap: 1.5ch;"}),c.lt({textContent:"Download all templates"},(t,e)=>{e.onclick=()=>{e.disabled=!0,this.qt.ye().then(()=>{e.disabled=!1})}}).D()),"Poor"!=this.we&&"Bad"!=this.we||c.lt({textContent:`Update template storage to ${this.xe}`},(t,e)=>{e.onclick=()=>{e.disabled=!0,i(this,F,_).call(this,!0)}}).D(),c.D().L(document.querySelector("#bm-o").parentNode)},z=function(){const t=this.fe?.templates;if(Object.keys(t).length>0){const e=document.querySelector(`#${this.vt} .bm-A`),i=new M(this.name,this.version);i.H({id:"bm-r",class:"bm-E"});for(const e in t){const n=e,o=t[e];if(t.hasOwnProperty(e)){const t=n.split(" "),e=Number(t?.[0]),a=d(t?.[1]||"0",this.qt.$e),r=o.name||`Template ${e||""}`,l=o?.coords?.split(",").map(Number),c=o.pixels?.total??void 0,h=void 0,m="number"==typeof e?s(e):"???",u="number"==typeof a?s(a):"???",b="number"==typeof c?s(c):"???";i.H({class:"bm-E bm-x"}).H({class:"bm-x",style:"flex-direction: column; gap: 0;"}).H({class:"bm-1",textContent:h||"šŸ–¼ļø"}).D().N({textContent:`#${m}`}).D().D().H({class:"bm-x bm-0"}).W(3,{textContent:r}).D().B({textContent:`Uploaded by user #${u}`}).D().B({textContent:`Coordinates: ${l.join(", ")}`}).D().B({textContent:`Total Pixels: ${b}`}).D().D().D()}}i.D().L(e)}},_=async function(t){if(t){const t=document.querySelector(`#${this.vt} .bm-h`);t.innerHTML="",new M(this.name,this.version).H({class:"bm-E"}).H({class:"bm-E bm-d"}).W(1,{textContent:"Template Wizard"}).D().D().F().D().H({class:"bm-E"}).W(2,{textContent:"Status"}).D().O({textContent:"Updating template storage. Please wait..."}).D().D().D().L(t)}GM_deleteValue("bmCoords");const e=this.fe?.templates;if(Object.keys(e).length>0)for(const[t,i]of Object.entries(e))if(e.hasOwnProperty(t)){const t=new H({displayName:i.name,Ht:i.tiles});t.Rt();const e=await this.qt.ve(t);await this.qt.Me(e,t.displayName,t.coords)}t&&(console.log("Restarting Template Wizard..."),document.querySelector(`#${this.vt}`).remove(),new R(this.name,this.version,this.xe,this.qt).Ct())};var j,E,Y,J,X,q,Z,Q,K,tt=R;j=new WeakSet,E=function(){new G(this).Ct()},Y=async function(t,e,i){i.preventDefault();const n=await async function(t){let e="";return t&&(e=t.clipboardData.getData("text/plain")),0!=e.length||(await navigator.clipboard.readText().then(t=>{e=t}).catch(t=>{l("Failed to retrieve clipboard data using navigator! Using fallback methods...")}),0!=e.length||(e=window.clipboardData?.getData("Text"))),e}(i),s=n.split(/[^a-zA-Z0-9]+/).filter(t=>t).map(Number).filter(t=>!isNaN(t));2==s.length&&"bm-H"==e.id?(t.ht("bm-H",s?.[0]||""),t.ht("bm-I",s?.[1]||"")):1==s.length?t.ht(e.id,s?.[0]||""):(t.ht("bm-J",s?.[0]||""),t.ht("bm-K",s?.[1]||""),t.ht("bm-H",s?.[2]||""),t.ht("bm-I",s?.[3]||""))},J=new WeakSet,X=async function(){GM.setValue("bmTemplates",JSON.stringify(this.Ce))},q=async function(t){console.log("Parsing BlueMarble...");const e=t.templates;console.log(`BlueMarble length: ${Object.keys(e).length}`);const i=t?.schemaVersion,n=i.split(/[-\.\+]/),s=this.schemaVersion.split(/[-\.\+]/),o=t?.scriptVersion;console.log(`BlueMarble Template Schema: ${i}; Script Version: ${o}`),n[0]==s[0]?(n[1]!=s[1]&&new tt(this.name,this.version,this.schemaVersion,this).Ct(),this.ge=await async function({Nt:t,Te:i,ge:n}){if(Object.keys(e).length>0)for(const s in e){const o=s,a=e[s];if(console.log(`Template Key: ${o}`),e.hasOwnProperty(s)){const e=o.split(" "),s=Number(e?.[0]),r=e?.[1]||"0",l=a.name||`Template ${s||""}`,c={total:a.pixels?.total,colors:new Map(Object.entries(a.pixels?.colors||{}).map(([t,e])=>[Number(t),e]))},h=a.tiles,m={},d={},u=t*i;for(const t in h)if(console.log(t),h.hasOwnProperty(t)){const e=b(h[t]),i=new Blob([e],{type:"image/png"}),n=await createImageBitmap(i);m[t]=n;const s=new OffscreenCanvas(u,u).getContext("2d");s.drawImage(n,0,0);const o=s.getImageData(0,0,n.width,n.height);d[t]=new Uint32Array(o.data.buffer)}const p=new H({displayName:l,Dt:s||this.ge?.length||0,Lt:r||""});p.Bt=c,p.Ht=m,p.Ot=d,n.push(p),console.log(this.ge),console.log("^^^ This ^^^")}}return n}({Nt:this.Nt,Te:this.Te,ge:this.ge})):n[0]>>24&255,y=f>>>24&255,$=b.get(w)??-2,v=b.get(f)??-2;if(this.pe.get($)&&(e[i*c+h]=f),-1==$){const t=536870912;this.pe.get($)?e[i*c+h]=0:(u/o&1)==(g/o&1)?(e[i*c+h]=t,e[(i-1)*c+(h-1)]=t,e[(i-1)*c+(h+1)]=t,e[(i+1)*c+(h-1)]=t,e[(i+1)*c+(h+1)]=t):(e[i*c+h]=0,e[(i-1)*c+h]=t,e[(i+1)*c+h]=t,e[i*c+(h-1)]=t,e[i*c+(h+1)]=t)}if(!s&&x>m&&v!=$&&(d||y>m)){const t=e[i*c+h];for(const s of n){const[n,o,a]=s,r=0!=n?1!=n?t:4278190335:0;e[(i+a)*c+(h+o)]=r}}if(-1==$&&f<=m){const t=p.get($);p.set($,t?t+1:1);continue}if(x<=m||y<=m)continue;if(v!=$)continue;const M=p.get($);p.set($,M?M+1:1)}return console.log("List of template pixels that match the tile:"),console.log(p),{Be:p,Ie:e}},Q=new WeakSet,K=function(t){const e=JSON.parse(GM_getValue("bmUserSettings","{}"));e.telemetry=t,GM.setValue("bmUserSettings",JSON.stringify(e))};var et=GM_info.script.name.toString(),it=GM_info.script.version.toString();!function(t){const e=document.createElement("script");e.setAttribute("bm-S",et),e.setAttribute("bm-O","color: cornflowerblue;"),e.textContent=`(${t})();`,document.documentElement?.appendChild(e),e.remove()}(()=>{const t=document.currentScript,e=t?.getAttribute("bm-S")||"Blue Marble",i=t?.getAttribute("bm-O")||"",n=new Map;window.addEventListener("message",t=>{const{source:s,endpoint:o,blobID:a,blobData:r,blink:l}=t.data,c=Date.now()-l;if(console.groupCollapsed(`%c${e}%c: ${n.size} Recieved IMAGE message about blob "${a}"`,i,""),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`,i,""),console.log(n),console.groupEnd(),"blue-marble"==s&&a&&r&&!o){const t=n.get(a);"function"==typeof t?t(r):h(`%c${e}%c: Attempted to retrieve a blob (%s) from queue, but the blobID was not a function! Skipping...`,i,"",a),n.delete(a)}});const s=window.fetch;window.fetch=async function(...t){const o=await s.apply(this,t),a=o.clone(),r=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore",l=a.headers.get("content-type")||"";if(l.includes("application/json"))console.log(`%c${e}%c: Sending JSON message about endpoint "${r}"`,i,""),a.json().then(t=>{window.postMessage({source:"blue-marble",endpoint:r,jsonData:t},"*")}).catch(t=>{console.error(`%c${e}%c: Failed to parse JSON: `,i,"",t)});else if(l.includes("image/")&&!r.includes("openfreemap")&&!r.includes("maps")){const t=Date.now(),s=await a.blob();return console.log(`%c${e}%c: ${n.size} Sending IMAGE message about endpoint "${r}"`,i,""),new Promise(o=>{const l=crypto.randomUUID();n.set(l,t=>{o(new Response(t,{headers:a.headers,status:a.status,statusText:a.statusText})),console.log(`%c${e}%c: ${n.size} Processed blob "${l}"`,i,"")}),window.postMessage({source:"blue-marble",endpoint:r,blobID:l,blobData:s,blink:t})}).catch(s=>{const o=Date.now();console.error(`%c${e}%c: Failed to Promise blob!`,i,""),console.groupCollapsed(`%c${e}%c: Details of failed blob Promise:`,i,""),console.log(`Endpoint: ${r}\nThere are ${n.size} blobs processing...\nBlink: ${t.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 nt=GM_getResourceText("CSS-BM-File");GM_addStyle(nt);var st,ot="robotoMonoInjectionPoint";ot.indexOf("@font-face")+1?(console.log("Loading Roboto Mono as a file..."),GM_addStyle(ot)):((st=document.createElement("link")).href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap",st.rel="preload",st.as="style",st.onload=function(){this.onload=null,this.rel="stylesheet"},document.head?.appendChild(st));var at=JSON.parse(GM_getValue("bmUserSettings","{}")),rt=(new class{constructor(){this.Pe=null,this.Ae=null,this.We="#bm-j"}Fe(t){return this.Ae=t,this.Pe=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)t instanceof HTMLElement&&t.matches?.(this.We)}),this}Ve(){return this.Pe}observe(t,e=!1,i=!1){t.observe(this.Ae,{childList:e,subtree:i})}},new class extends M{constructor(t,i){super(t,i),e(this,j),this.window=null,this.vt="bm-w",this.Mt=document.body}Ct(){document.querySelector(`#${this.vt}`)?this.yt("Main window already exists!"):(this.window=this.H({id:this.vt,class:"bm-N bm-G",style:"top: 10px; left: unset; right: 75px;"},(t,e)=>{}).gt().lt({class:"bm-n",textContent:"ā–¼","aria-label":'Minimize window "Blue Marble"',"data-button-status":"expanded"},(t,e)=>{e.onclick=()=>t.wt(e),e.ontouchend=()=>{e.click()}}).D().H().D().D().H({class:"bm-h"}).H({class:"bm-E"}).A({class:"bm-M",src:"https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/dist/assets/Favicon.png"},(t,e)=>{const i=new Date;204==Math.floor((i.getTime()-new Date(i.getFullYear(),0,1))/864e5)+1&&(e.parentNode.style.position="relative",e.parentNode.innerHTML=e.parentNode.innerHTML+'',e.onload=()=>{(new O).Jt(document.querySelector(`#${this.vt}`))})}).D().W(1,{textContent:this.name}).D().D().F().D().H({class:"bm-E"}).B({id:"bm-q",textContent:"Droplets:"}).D().V().D().B({id:"bm-k",textContent:"Next level in..."}).D().V().D().B({textContent:"Charges: "}).ft(Date.now(),1e3,{style:"font-weight: 700;"},(t,e)=>{t.p.ze=e.id}).D().D().D().F().D().H({class:"bm-E"}).H({class:"bm-E"}).lt({class:"bm-n bm-C",style:"margin-top: 0;",innerHTML:''},(t,e)=>{e.onclick=()=>{const e=t.p?._e;e?.[0]?(t.ht("bm-J",e?.[0]||""),t.ht("bm-K",e?.[1]||""),t.ht("bm-H",e?.[2]||""),t.ht("bm-I",e?.[3]||"")):t.yt("Coordinates are malformed! Did you try clicking on the canvas first?")}}).D().dt({type:"number",id:"bm-J",class:"bm-v",placeholder:"Tl X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-K",class:"bm-v",placeholder:"Tl Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-H",class:"bm-v",placeholder:"Px X",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().dt({type:"number",id:"bm-I",class:"bm-v",placeholder:"Px Y",min:0,max:2047,step:1,required:!0},(t,e)=>{e.addEventListener("paste",n=>i(this,j,Y).call(this,t,e,n))}).D().D().H({class:"bm-E"}).ut({class:"bm-D",textContent:"Upload Template",accept:"image/png, image/jpeg, image/webp, image/bmp, image/gif"}).D().D().H({class:"bm-E bm-s"}).lt({textContent:"Disable","data-button-status":"shown"},(t,e)=>{e.onclick=()=>{e.disabled=!0,"shown"==e.dataset.buttonStatus?(t.p?.qt?.Ue(!1),e.dataset.buttonStatus="hidden",e.textContent="Enable",t.$t("Disabled templates!")):(t.p?.qt?.Ue(!0),e.dataset.buttonStatus="shown",e.textContent="Disable",t.$t("Enabled templates!")),e.disabled=!1}}).D().lt({textContent:"Create"},(t,e)=>{e.onclick=()=>{const e=document.querySelector(`#${this.vt} .bm-D`),i=document.querySelector("#bm-J");if(!i.checkValidity())return i.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const n=document.querySelector("#bm-K");if(!n.checkValidity())return n.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const s=document.querySelector("#bm-H");if(!s.checkValidity())return s.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");const o=document.querySelector("#bm-I");if(!o.checkValidity())return o.reportValidity(),void t.yt("Coordinates are malformed! Did you try clicking on the canvas first?");e?.files[0]?(t?.p?.qt.Me(e.files[0],e.files[0]?.name.replace(/\.[^/.]+$/,""),[Number(i.value),Number(n.value),Number(s.value),Number(o.value)]),t.$t("Drew to canvas!")):t.yt("No file selected!")}}).D().lt({textContent:"Filter"},(t,e)=>{e.onclick=()=>i(this,j,E).call(this)}).D().D().H({class:"bm-E"}).bt({id:this.v,placeholder:`Status: Sleeping...\nVersion: ${this.version}`,readOnly:!0}).D().D().H({class:"bm-E bm-s",style:"margin-bottom: 0; flex-direction: column;"}).H({class:"bm-s"}).lt({class:"bm-n",innerHTML:"āš™ļø",title:"Settings"},(t,e)=>{e.onclick=()=>{t.$.Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸ§™",title:"Template Wizard"},(t,e)=>{e.onclick=()=>{const e=t.p?.qt;new tt(this.name,this.version,e?.schemaVersion,e).Ct()}}).D().lt({class:"bm-n",innerHTML:"šŸŽØ",title:"Template Color Converter"},(t,e)=>{e.onclick=()=>{window.open("https://pepoafonso.github.io/color_converter_wplace/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"🌐",title:"Official Blue Marble Website"},(t,e)=>{e.onclick=()=>{window.open("https://bluemarble.lol/","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",title:"Donate to SwingTheVine",innerHTML:''},(t,e)=>{e.onclick=()=>{window.open("https://ko-fi.com/swingthevine","_blank","noopener noreferrer")}}).D().lt({class:"bm-n",innerHTML:"šŸ¤",title:"Credits"},(t,e)=>{e.onclick=()=>{new U(this.name,this.version).Ct()}}).D().D().N({textContent:"Made by SwingTheVine",style:"margin-top: auto;"}).D().D().D().D().D().L(this.Mt),this.xt(`#${this.vt}.bm-N`,`#${this.vt} .bm-L`))}}(et,it)),lt=new class{constructor(t,i){e(this,J),this.name=t,this.version=i,this.Se=null,this.$=null,this.schemaVersion="2.0.0",this.Ge=null,this.$e="!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",this.Nt=1e3,this.Te=3,this.Ne=3,this.Kt=function(t){const e=v;e.unshift({id:-1,premium:!1,name:"Erased",rgb:[222,250,206]}),e.unshift({id:-2,premium:!1,name:"Other",rgb:[0,0,0]});const i=new Map;for(const n of e){if(0==n.id||-2==n.id)continue;const e=n.rgb[0],s=n.rgb[1],o=n.rgb[2];for(let a=-t;a<=t;a++)for(let r=-t;r<=t;r++)for(let l=-t;l<=t;l++){const t=e+a,c=s+r,h=o+l;if(t<0||t>255||c<0||c>255||h<0||h>255)continue;const m=(255<<24|h<<16|c<<8|t)>>>0;i.has(m)||i.set(m,n.id)}}return{palette:e,jt:i}}(this.Ne),this.De=null,this.Re="",this.ge=[],this.Ce=null,this.je=!0,this.Ee=null,this.pe=new Map}Ye(t){this.Se=t}k(t){this.$=t}async Je(){return{whoami:this.name.replace(" ",""),scriptVersion:this.version,schemaVersion:this.schemaVersion,templates:{}}}async Me(t,e,n){this.Ce||(this.Ce=await this.Je(),console.log("Creating JSON...")),this.Se.$t(`Creating template at ${n.join(", ")}...`);const s=new H({displayName:e,Dt:0,Lt:m(this.Ge||0,this.$e),file:t,coords:n}),o=!this.$?.kt?.flags?.includes("hl-noSkip"),a=this.$?.kt?.flags?.includes("hl-agSkip");console.log(`Should Skip: ${o}; Should Agg Skip: ${a}`);const{Ut:r,Gt:l}=await s.At(this.Nt,this.Kt,o,a);s.Ht=r;const c={total:s.Bt.total,colors:Object.fromEntries(s.Bt.colors)};this.Ce.templates[`${s.Dt} ${s.Lt}`]={name:s.displayName,coords:n.join(", "),enabled:!0,pixels:c,tiles:l},this.ge=[],this.ge.push(s),this.Se.$t(`Template created at ${n.join(", ")}!`),console.log(Object.keys(this.Ce.templates).length),console.log(this.Ce),console.log(this.ge),console.log(JSON.stringify(this.Ce)),await i(this,J,X).call(this)}Xe(){}async qe(){this.Ce||(this.Ce=await this.Je(),console.log("Creating JSON..."))}async Ze(){l("Downloading all templates..."),console.log(this.ge);for(const t of this.ge)await this.Qe(t),await n(500)}async ye(){const t=JSON.parse(GM_getValue("bmTemplates","{}"))?.templates;if(console.log(t),Object.keys(t).length>0)for(const[e,i]of Object.entries(t))t.hasOwnProperty(e)&&(await this.Qe(new H({displayName:i.name,Dt:e.split(" ")?.[0],Lt:e.split(" ")?.[1],Ht:i.tiles})),await n(500))}async Qe(t){t.Rt();const e=`${t.coords.join("-")}_${t.displayName.replaceAll(" ","-")}`,i=await this.ve(t);await GM.download({url:URL.createObjectURL(i),name:e+".png",Ke:"uniquify",onload:()=>{l(`Download of template '${e}' complete!`)},onerror:(t,i)=>{c(`Download of template '${e}' failed because ${t}! Details: ${i}`)},ontimeout:()=>{h(`Download of template '${e}' has timed out!`)}})}async ve(t){console.log(t);const e=t.Ht,i=Object.keys(e).sort(),n=await Promise.all(i.map(t=>{return i=e[t],new Promise((t,e)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e,n.src="data:image/png;base64,"+i});var i}));let s=1/0,o=1/0,a=0,r=0;i.forEach((t,e)=>{const[i,l,c,h]=t.split(",").map(Number),m=n[e],d=i*this.Nt+c,u=l*this.Nt+h;s=Math.min(s,d),o=Math.min(o,u),a=Math.max(a,d+m.width/this.Te),r=Math.max(r,u+m.height/this.Te)}),console.log(`Absolute coordinates: (${s}, ${o}) and (${a}, ${r})`);const l=a-s,c=r-o,h=l*this.Te,m=c*this.Te;console.log(`Template Width: ${l}\nTemplate Height: ${c}\nCanvas Width: ${h}\nCanvas Height: ${m}`);const d=new OffscreenCanvas(h,m),u=d.getContext("2d");i.forEach((t,e)=>{const[i,a,r,l]=t.split(",").map(Number),c=n[e],h=i*this.Nt+r,m=a*this.Nt+l;console.log(`Drawing tile (${i}, ${a}, ${r}, ${l}) (${h}, ${m}) at (${h-s}, ${m-o}) on the canvas...`),u.drawImage(c,(h-s)*this.Te,(m-o)*this.Te,c.width,c.height)}),u.globalCompositeOperation="destination-over",u.drawImage(d,0,-1),u.drawImage(d,0,1),u.drawImage(d,-1,0),u.drawImage(d,1,0);const b=new OffscreenCanvas(l,c),p=b.getContext("2d");return p.imageSmoothingEnabled=!1,p.drawImage(d,0,0,l*this.Te,c*this.Te,0,0,l,c),b.convertToBlob({type:"image/png"})}async ti(t,e){if(!this.je)return t;const n=this.Nt*this.Te;e=e[0].toString().padStart(4,"0")+","+e[1].toString().padStart(4,"0"),console.log(`Searching for templates in tile: "${e}"`);const o=this.ge;console.log(o),o.sort((t,e)=>t.Dt-e.Dt),console.log(o);const a=o.map(t=>{const i=Object.keys(t.Ht).filter(t=>t.startsWith(e));if(0===i.length)return null;const n=i.map(e=>{const i=e.split(",");return{ei:t,Ft:t.Ht[e],Ot:t.Ot?.[e],ii:[i[0],i[1]],ni:[i[2],i[3]]}});return n?.[0]}).filter(Boolean);console.log(a);const r=a?.length||0;if(console.log(`templateCount = ${r}`),!(r>0))return this.Se.$t(`Sleeping\nVersion: ${this.version}`),t;{const t=s(o.filter(t=>Object.keys(t.Ht).filter(t=>t.startsWith(e)).length>0).reduce((t,e)=>t+(e.Bt.total||0),0));this.Se.$t(`Displaying ${r} template${1==r?"":"s"}.\nTotal pixels: ${t}`)}const l=await createImageBitmap(t),c=new OffscreenCanvas(n,n),h=c.getContext("2d");h.imageSmoothingEnabled=!1,h.beginPath(),h.rect(0,0,n,n),h.clip(),h.clearRect(0,0,n,n),h.drawImage(l,0,0,n,n);const m=h.getImageData(0,0,n,n),d=new Uint32Array(m.data.buffer),u=this.$?.kt?.highlight||[[2,0,0]],b=u?.[0],p=1==u?.length&&2==b?.[0]&&0==b?.[1]&&0==b?.[2];for(const t of a){console.log("Template:"),console.log(t);const n=!!t.ei.Bt?.colors?.get(-1);let s=t.Ot.slice();const o=Number(t.ni[0])*this.Te,a=Number(t.ni[1])*this.Te;if(0!=this.pe.size||n||h.drawImage(t.Ft,o,a),!s){const e=h.getImageData(o,a,t.Ft.width,t.Ft.height);s=new Uint32Array(e.data.buffer)}const r=Date.now(),{Be:l,Ie:c}=i(this,J,Z).call(this,{ke:d,De:s,Le:[o,a,t.Ft.width,t.Ft.height],He:u,Oe:p});let m=0;const b=0;for(const[t,e]of l)t!=b&&(m+=e);0==this.pe.size&&!n&&p||(console.log("Colors to filter: ",this.pe),h.drawImage(await createImageBitmap(new ImageData(new Uint8ClampedArray(c.buffer),t.Ft.width,t.Ft.height)),o,a)),console.log(`Finished calculating correct pixels & filtering colors for the tile ${e} in ${(Date.now()-r)/1e3} seconds!\nThere are ${m} correct pixels.`),void 0===t.ei.Bt.correct&&(t.ei.Bt.correct={}),t.ei.Bt.correct[e]=l}return await c.convertToBlob({type:"image/png"})}si(t){console.log("Importing JSON..."),console.log(t),"BlueMarble"==t?.whoami&&i(this,J,q).call(this,t)}Ue(t){this.je=t}}(et,it),ct=new class{constructor(t){this.qt=t,this.oi=!1,this.ze="",this._e=[],this.ai=[]}ri(t){window.addEventListener("message",async e=>{const i=e.data,n=i.jsonData;if(!i||"blue-marble"!==i.source)return;if(!i.endpoint)return;const o=i.endpoint?.split("?")[0].split("/").filter(t=>t&&isNaN(Number(t))).filter(t=>t&&!t.includes(".")).pop();switch(console.log('%cBlue Marble%c: Recieved message about "%s"',"color: cornflowerblue;","",o),o){case"me":if(n.status&&"2"!=n.status?.toString()[0])return void t.yt("You are not logged in or Wplace is offline!\nCould not fetch userdata.");const e=Math.ceil(Math.pow(Math.floor(n.level)*Math.pow(30,.65),1/.65)-n.pixelsPainted);if(console.log(n.id),(n.id||0===n.id)&&console.log(m(n.id,"!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~")),this.qt.Ge=n.id,0!=this.ze.length){const t=document.querySelector("#"+this.ze);if(t){const e=n.charges;t.dataset.endDate=Date.now()+(e.max-e.count)*e.cooldownMs}}t.ht("bm-q",`Droplets: ${s(n.droplets)}`),t.ht("bm-k",`Next level in ${s(e)} pixel${1==e?"":"s"}`);break;case"pixel":const o=i.endpoint.split("?")[0].split("/").filter(t=>t&&!isNaN(Number(t))),l=new URLSearchParams(i.endpoint.split("?")[1]),c=[l.get("x"),l.get("y")];if(this._e.length&&(!o.length||!c.length))return void t.yt("Coordinates are malformed!\nDid you try clicking the canvas first?");this._e=[...o,...c];const h=(a=o,r=c,[parseInt(a[0])%4*1e3+parseInt(r[0]),parseInt(a[1])%4*1e3+parseInt(r[1])]),d=document.querySelectorAll("span");for(const t of d)if(t.textContent.trim().includes(`${h[0]}, ${h[1]}`)){let e=document.querySelector("#bm-j");const i=`(Tl X: ${o[0]}, Tl Y: ${o[1]}, Px X: ${c[0]}, Px Y: ${c[1]})`;e?e.textContent=i:(e=document.createElement("span"),e.id="bm-j",e.textContent=i,e.style="margin-left: calc(var(--spacing)*3); font-size: small;",t.parentNode.parentNode.insertAdjacentElement("afterend",e))}break;case"tile":case"tiles":let u=i.endpoint.split("/");u=[parseInt(u[u.length-2]),parseInt(u[u.length-1].replace(".png",""))];const b=i.blobID,p=i.blobData,g=Date.now(),f=await this.qt.ti(p,u);console.log(`Finished loading the tile in ${(Date.now()-g)/1e3} seconds!`),window.postMessage({source:"blue-marble",blobID:b,blobData:f,blink:i.blink});break;case"robots":this.oi="false"==n.userscript?.toString().toLowerCase();break}var a,r})}async li(t){console.log("Sending heartbeat to telemetry server...");let e=GM_getValue("bmUserSettings","{}");if(e=JSON.parse(e),!e||!e.telemetry||!e.uuid)return void console.log("Telemetry is disabled, not sending heartbeat.");const i=navigator.userAgent;let n=await this.ci(i),s=this.hi(i);GM_xmlhttpRequest({method:"POST",url:"https://telemetry.thebluecorner.net/heartbeat",headers:{"Content-Type":"application/json"},data:JSON.stringify({uuid:e.uuid,version:t,browser:n,os:s}),onload:t=>{200!==t.status&&c("Failed to send heartbeat:",t.statusText)},onerror:t=>{c("Error sending heartbeat:",t)}})}async ci(t=navigator.userAgent){return(t=t||"").includes("OPR/")||t.includes("Opera")?"Opera":t.includes("Edg/")?"Edge":t.includes("Vivaldi")?"Vivaldi":t.includes("YaBrowser")?"Yandex":t.includes("Kiwi")?"Kiwi":t.includes("Brave")?"Brave":t.includes("Firefox/")?"Firefox":t.includes("Chrome/")?"Chrome":t.includes("Safari/")?"Safari":navigator.brave&&"function"==typeof navigator.brave.isBrave&&await navigator.brave.isBrave()?"Brave":"Unknown"}hi(t=navigator.userAgent){return/Windows NT 11/i.test(t=t||"")?"Windows 11":/Windows NT 10/i.test(t)?"Windows 10":/Windows NT 6\.3/i.test(t)?"Windows 8.1":/Windows NT 6\.2/i.test(t)?"Windows 8":/Windows NT 6\.1/i.test(t)?"Windows 7":/Windows NT 6\.0/i.test(t)?"Windows Vista":/Windows NT 5\.1|Windows XP/i.test(t)?"Windows XP":/Mac OS X 10[_\.]15/i.test(t)?"macOS Catalina":/Mac OS X 10[_\.]14/i.test(t)?"macOS Mojave":/Mac OS X 10[_\.]13/i.test(t)?"macOS High Sierra":/Mac OS X 10[_\.]12/i.test(t)?"macOS Sierra":/Mac OS X 10[_\.]11/i.test(t)?"OS X El Capitan":/Mac OS X 10[_\.]10/i.test(t)?"OS X Yosemite":/Mac OS X 10[_\.]/i.test(t)?"macOS":/Android/i.test(t)?"Android":/iPhone|iPad|iPod/i.test(t)?"iOS":/Linux/i.test(t)?"Linux":"Unknown"}}(lt),ht=new class extends L{constructor(t,i,n){var s;super(t,i),e(this,C),this.kt=n,(s=this.kt).flags??(s.flags=[]),this.mi=structuredClone(this.kt),this.di="bmUserSettings",this.ui=5e3,this.bi=0,setInterval(this.pi.bind(this),this.ui)}async pi(){const t=JSON.stringify(this.kt);t!=JSON.stringify(this.mi)&&Date.now()-this.bi>this.ui&&(await GM.setValue(this.di,t),this.mi=structuredClone(this.kt),this.bi=Date.now(),console.log(t))}gi(t,e=void 0){const i=this.kt?.flags?.indexOf(t)??-1;-1!=i&&!0!==e?this.kt?.flags?.splice(i,1):-1==i&&!1!==e&&this.kt?.flags?.push(t)}Tt(){const t='',e='',n=this.kt?.highlight??[[1,0,1],[2,0,0],[1,-1,0],[1,1,0],[1,0,-1]];this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().F().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Highlight transparent pixels"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noTrans"),i.onchange=t=>this.gi("hl-noTrans",!t.target.checked)}).D().O({id:"bm-Z",textContent:"Choose a preset:",style:"font-weight: 700;"}).D().H({class:"bm-x",role:"group","aria-labelledby":"bm-Z"}).H({class:"bm-Y"}).B({textContent:"None"}).D().lt({innerHTML:t,"aria-label":'Preset "None"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"None")}).D().D().H({class:"bm-Y"}).B({textContent:"Cross"}).D().lt({innerHTML:e,"aria-label":'Preset "Cross Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Cross")}).D().D().H({class:"bm-Y"}).B({textContent:"X"}).D().lt({innerHTML:e.replace('d="M1,0H2V1H3V2H2V3H1V2H0V1H1Z"','d="M0,0V1H3V0H2V3H3V2H0V3H1V0Z"'),"aria-label":'Preset "X Shape"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"X")}).D().D().H({class:"bm-Y"}).B({textContent:"Full"}).D().lt({innerHTML:t.replace("#fff","#2f4f4f"),"aria-label":'Preset "Full Template"'},(t,e)=>{e.onclick=()=>i(this,C,S).call(this,"Full")}).D().D().D().O({id:"bm-14",textContent:"Create a custom pattern:",style:"font-weight: 700;"}).D().H({class:"bm-1g",role:"group","aria-labelledby":"bm-14"});for(let t=-1;t<=1;t++)for(let e=-1;e<=1;e++){const s=n[n.findIndex(([,i,n])=>i==e&&n==t)]?.[0]??0;let o="Disabled";1==s?o="Incorrect":2==s&&(o="Template"),this.window=this.lt({"data-status":o,"aria-label":`Sub-pixel ${o.toLowerCase()}`},(n,s)=>{s.onclick=()=>i(this,C,T).call(this,s,[e,t])}).D()}this.window=this.D().D().D()}St(){this.window=this.H({class:"bm-E"}).W(2,{textContent:"Pixel Highlight"}).D().F().D().H({class:"bm-E",style:"margin-left: 1.5ch;"}).R({textContent:"Template creation should skip transparent tiles"},(t,e,i)=>{i.checked=!this.kt?.flags?.includes("hl-noSkip"),i.onchange=t=>this.gi("hl-noSkip",!t.target.checked)}).D().R({innerHTML:"Experimental: Template creation should aggressively skip transparent tiles"},(t,e,i)=>{i.checked=this.kt?.flags?.includes("hl-agSkip"),i.onchange=t=>this.gi("hl-agSkip",t.target.checked)}).D().D().D()}}(et,it,at);rt.k(ht),rt.S(ct),lt.Ye(rt),lt.k(ht);var mt=JSON.parse(GM_getValue("bmTemplates","{}"));if(console.log(mt),lt.si(mt),console.log(at),console.log(Object.keys(at).length),0==Object.keys(at).length){const t=crypto.randomUUID();console.log(t),GM.setValue("bmUserSettings",JSON.stringify({uuid:t}))}setInterval(()=>ct.li(it),18e5);var dt=at?.telemetry;if(console.log(`Telemetry is ${!(null==dt)}`),null==dt||dt>1){const t=new class extends M{constructor(t,i,n,s){super(t,i),e(this,Q),this.window=null,this.vt="bm-g",this.Mt=document.body,this.fi=n,this.uuid=s}async Ct(){if(document.querySelector(`#${this.vt}`))return void this.yt("Telemetry window already exists!");const t=await this.p.ci(navigator.userAgent),e=this.p.hi(navigator.userAgent);this.window=this.H({id:this.vt,class:"bm-N",style:"height: 80vh; z-index: 9998;"}).H({class:"bm-h"}).H({class:"bm-E bm-d"}).W(1,{textContent:`${this.name} Telemetry`}).D().D().F().D().H({class:"bm-E bm-x",style:"gap: 1.5ch; flex-wrap: wrap;"}).lt({textContent:"Enable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,this.fi);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"Disable Telemetry"},(t,e)=>{e.onclick=()=>{i(this,Q,K).call(this,0);const t=document.getElementById(this.vt);t?.remove()}}).D().lt({textContent:"More Information"},(t,e)=>{e.onclick=()=>{window.open("https://github.com/SwingTheVine/Wplace-TelemetryServer#telemetry-data","_blank","noopener noreferrer")}}).D().D().H({class:"bm-E bm-A"}).H({class:"bm-E"}).W(2,{textContent:"Legal"}).D().O({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 ${this.name}!`}).D().D().F().D().H({class:"bm-E"}).W(2,{textContent:"Non-Legal Summary"}).D().O({innerHTML:'You can disable telemetry by pressing the "Disable" button. If you would like to read more about what information we collect, press the "More Information" button.
This is the data stored on our servers:'}).D().X().Z({innerHTML:`A unique identifier (UUIDv4) generated by Blue Marble. This enables our telemetry to function without tracking your actual user ID.
Your UUID is: ${r(this.uuid)}`}).D().Z({innerHTML:`The version of Blue Marble you are using.
Your version is: ${r(this.version)}`}).D().Z({innerHTML:`Your browser type, which is used to determine Blue Marble outages and browser popularity.
Your browser type is: ${r(t)}`}).D().Z({innerHTML:`Your OS type, which is used to determine Blue Marble outages and OS popularity.
Your OS type is: ${r(e)}`}).D().Z({innerHTML:"The date and time that Blue Marble sent the telemetry information."}).D().D().O({innerHTML:'All of the data mentioned above is aggregated every hour. This means every hour, anything that could even remotly be considered "personal data" is deleted from our server. Here, "aggregated" data means things like "42 people used Blue Marble on Google Chrome this hour", which can\'t be used to identify anyone in particular.'}).D().D().D().D().D().L(this.Mt)}}(et,it,1,at?.uuid);t.S(ct),t.Ct()}rt.Ct(),ct.ri(rt),new MutationObserver((t,e)=>{const i=document.querySelector("#color-1");if(!i)return;let n=document.querySelector("#bm-z");if(!n){n=document.createElement("button"),n.id="bm-z",n.textContent="Move ↑",n.className="btn btn-soft",n.onclick=function(){const t=this.parentNode.parentNode.parentNode.parentNode,e="Move ↑"==this.textContent;t.parentNode.className=t.parentNode.className.replace(e?"bottom":"top",e?"top":"bottom"),t.style.borderTopLeftRadius=e?"0px":"var(--radius-box)",t.style.borderTopRightRadius=e?"0px":"var(--radius-box)",t.style.borderBottomLeftRadius=e?"var(--radius-box)":"0px",t.style.borderBottomRightRadius=e?"var(--radius-box)":"0px",this.textContent=e?"Move ↓":"Move ↑"};const t=i.parentNode.parentNode.parentNode.parentNode.querySelector("h2");t.parentNode?.appendChild(n)}}).observe(document.body,{childList:!0,subtree:!0}),l(`%c${et}%c (${it}) userscript has loaded!`,"color: cornflowerblue;","")})(); \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index bcbdad0..12c728b 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 1cca385..bb8c31c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wplace-bluemarble", - "version": "0.91.74", + "version": "0.91.102", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wplace-bluemarble", - "version": "0.91.74", + "version": "0.91.102", "devDependencies": { "esbuild": "^0.25.0", "jsdoc": "^4.0.5", diff --git a/package.json b/package.json index 9ddb937..d427e0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wplace-bluemarble", - "version": "0.91.74", + "version": "0.91.102", "type": "module", "homepage": "https://bluemarble.lol/", "repository": { diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js index 9eba468..4cf1d4e 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.91.74 +// @version 0.91.102 // @description A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @description:en A userscript to enhance the user experience on Wplace.live. This includes, but is not limited to: uploading images to display locally on a canvas, adding a button to move the Wplace color palette menu, and other QoL features. // @author SwingTheVine diff --git a/src/Template.js b/src/Template.js index 50f0d63..4fc7671 100644 --- a/src/Template.js +++ b/src/Template.js @@ -1,4 +1,4 @@ -import { uint8ToBase64 } from "./utils"; +import { sleep, uint8ToBase64, viewCanvasInNewTab } from "./utils"; /** An instance of a template. * Handles all mathematics, manipulation, and analysis regarding a single template. @@ -43,17 +43,26 @@ export default class Template { this.tileSize = tileSize; /** Total pixel count in template @type {{total: number, colors: Map, correct?: { [key: string]: Map }}} */ this.pixelCount = { total: 0, colors: new Map() }; + + this.shouldSkipTransTiles = true; // Should transparent template tiles be skipped during template creation? + this.shouldAggSkipTransTiles = false; // Should transparent template tiles be aggressively skipped during tempalte creation? } /** Creates chunks of the template for each tile. * @param {Number} tileSize - Size of the tile as determined by templateManager * @param {Object} paletteBM - An collection of Uint32Arrays containing the palette BM uses + * @param {boolean} shouldSkipTransTiles - Should transparent tiles be skipped over when creating the template? + * @param {boolean} shouldAggSkipTransTiles - Should transparent tiles be aggressively skipped over when creating the template? * @returns {Object} Collection of template bitmaps & buffers organized by tile coordinates * @since 0.65.4 */ - async createTemplateTiles(tileSize, paletteBM) { + async createTemplateTiles(tileSize, paletteBM, shouldSkipTransTiles, shouldAggSkipTransTiles) { console.log('Template coordinates:', this.coords); + // Updates the class instance variable with the new information + this.shouldSkipTransTiles = shouldSkipTransTiles; + this.shouldAggSkipTransTiles = shouldAggSkipTransTiles; + const shreadSize = 3; // Scale image factor for pixel art enhancement (must be odd) const bitmap = await createImageBitmap(this.file); // Create efficient bitmap from uploaded file const imageWidth = bitmap.width; @@ -64,8 +73,16 @@ export default class Template { const templateTiles = {}; // Holds the template tiles const templateTilesBuffers = {}; // Holds the buffers of the template tiles + // The main canvas used during template creation const canvas = new OffscreenCanvas(this.tileSize, this.tileSize); const context = canvas.getContext('2d', { willReadFrequently: true }); + + // The canvas used to check if a specific template tile is transparent or not + const transCanvas = new OffscreenCanvas(this.tileSize, this.tileSize); + const transContext = transCanvas.getContext('2d', { willReadFrequently: true }); + + // Makes it so that `.drawImage()` calls on the canvas used to calculate transparency always draw below what is already on the canvas + transContext.globalCompositeOperation = "destination-over"; // Prep the canvas for drawing the entire template (so we can find total pixels) canvas.width = imageWidth; @@ -101,7 +118,7 @@ export default class Template { contextMask.fillRect(1, 1, 1, 1); // For every tile... - for (let pixelY = this.coords[3]; pixelY < imageHeight + this.coords[3]; ) { + for (let pixelY = this.coords[3]; pixelY < imageHeight + this.coords[3];) { // Draws the partial tile first, if any // This calculates the size based on which is smaller: @@ -121,6 +138,26 @@ export default class Template { // B. The top left corner of the current tile to the bottom right corner of the image const drawSizeX = Math.min(this.tileSize - (pixelX % this.tileSize), imageWidth - (pixelX - this.coords[2])); + // If the user wants to skip any tiles where the template is transparent... + if (shouldSkipTransTiles) { + + // Detects if the canvas is fully transparent + const isTemplateTileTransparent = !this.calculateCanvasTransparency({ + bitmap: bitmap, + bitmapParams: [pixelX - this.coords[2], pixelY - this.coords[3], drawSizeX, drawSizeY], // Top left X, Top left Y, Width, Height + transCanvas: transCanvas, + transContext: transContext + }); + + console.log(`Tile contains template: ${!isTemplateTileTransparent}`); + + // If the template in this tile is transparent... + if (isTemplateTileTransparent) { + pixelX += drawSizeX; // If you remove this, it will get stuck forever processing the template + continue; // ...the user does not want to save this tile, so we skip to the next tile + } + } + console.log(`Math.min(${this.tileSize} - (${pixelX} % ${this.tileSize}), ${imageWidth} - (${pixelX - this.coords[2]}))`); console.log(`Draw Size X: ${drawSizeX}\nDraw Size Y: ${drawSizeY}`); @@ -155,6 +192,8 @@ export default class Template { context.globalCompositeOperation = "destination-in"; // The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. // For our purposes, this means any non-transparent pixels on the mask will be kept + console.log(`Should Skip: ${shouldSkipTransTiles}; Should Agg Skip: ${shouldAggSkipTransTiles}`); + // Fills the canvas with the mask context.fillStyle = context.createPattern(canvasMask, "repeat"); context.fillRect(0, 0, canvasWidth, canvasHeight); @@ -197,6 +236,110 @@ export default class Template { return { templateTiles, templateTilesBuffers }; } + /** Detects if the canvas is transparent. + * @param {Object} param - Object that contains the parameters for the function + * @param {ImageBitmap} param.bitmap - The bitmap template image + * @param {Array} param.bitmapParams - The parameters to obtain the template tile image from the bitmap + * @param {OffscreenCanvas | HTMLCanvasElement} param.transCanvas - The canvas to draw to in order to calculate this + * @param {OffscreenCanvasRenderingContext2D} param.transContext - The context for the transparent canvas to draw to + * @return {boolean} Is the canvas transparent? If transparent, then `true` is returned. Otherwise, `false`. + * @since 0.91.75 + */ + calculateCanvasTransparency({ + bitmap: bitmap, + bitmapParams: bitmapParams, + transCanvas: transCanvas, + transContext: transContext + }) { + + console.log(`Calculating template tile transparency...`); + + console.log(`Should Skip: ${this.shouldSkipTransTiles}; Should Agg: ${this.shouldAggSkipTransTiles}`); + + const timer = Date.now(); // Starts the timer + + // Contains the directions to move the canvas when duplicating, in the unit of pixels + const duplicationCoordinateArray = [ + [ 0, 1], // E.g. move 0 on the x axis, and 1 down on the y axis + [ 1, 0], + [ 0, -2], // E.g. move 0 on the x axis, and 2 up on the y axis + [ -2, 0], + [ 0, 4], + [ 4, 0], + [ 0, -8], + [ -8, 0], + [ 0, 16], + [ 16, 0], + [ 0, -32], + [-32, 0] + ]; + + // Changes the size of the canvas so that it equals the template tile + const transCanvasWidth = bitmapParams[2]; + const transCanvasHeight = bitmapParams[3]; + transCanvas.width = transCanvasWidth; + transCanvas.height = transCanvasHeight; + + transContext.clearRect(0, 0, transCanvasWidth, transCanvasHeight); // Clear any previous drawing (only runs when canvas size does not change) + + // If the user does want to aggressively skip transparent template tiles... + if (this.shouldAggSkipTransTiles) { + // (This code will only run if `this.shouldSkipTransTiles` is `true`) + + // Draw the template tile onto the canvas scaled down to 10x10 + transContext.drawImage( + bitmap, // The bitmap image + ...bitmapParams, // Bitmap image parameters (x, y, width, height) + 0, 0, // The coordinate draw the output *at* + 10, 10 // The width and height of the output + ); + } else { + // Else, the user wants to skip transparent template tiles normally... + + // Draw the template tile onto the canvas + transContext.drawImage( + bitmap, // The bitmap image + ...bitmapParams, // Bitmap image parameters (x, y, width, height) + 0, 0, // The coordinate draw the output *at* + transCanvasWidth, transCanvasHeight // Stretch to canvas (the canvas should already be the same size as the template image) + ) + + // For each canvas duplication... + for (const [relativeX, relativeY] of duplicationCoordinateArray) { + + // Duplicate the canvas onto itself, but shifted slightly + transContext.drawImage( + transCanvas, // The canvas we are drawing to *is* the source image + 0, 0, transCanvasWidth, transCanvasHeight, // The entire canvas (as a source image) + relativeX, relativeY, transCanvasWidth, transCanvasHeight // The output coordinates and size on the same canvas + ) + } + + // Scale down the image to 10x10, and store it between (0, 0) and (9, 9) on the canvas + transContext.drawImage( + transCanvas, // The canvas we are drawing to *is* the source image + 0, 0, transCanvasWidth, transCanvasHeight, // The entire canvas (as a source image) + 0, 0, 10, 10 // The output coordinates and size on the same canvas + ); + } + + const shunkCanvas = transContext.getImageData(0, 0, 10, 10); + const shunkCanvas32 = new Uint32Array(shunkCanvas.data.buffer); + + console.log(`Calculated canvas transparency in ${(Date.now() - timer) / 1000} seconds.`); + + // For every pixel in the `shrunkCanvas32` array... + for (const pixel of shunkCanvas32) { + + // If the pixel is NOT 100% transparent + if (!!pixel) { + return true; // Return `true` early since we confirmed a template exists in the tile + } + } + + return false; // Since we could not confirm any template exists, we assume no template eixsts in this tile + } + /** Calculates top left coordinate of template. * It uses `Template.chunked` to update `Template.coords` * @since 0.88.504 diff --git a/src/templateManager.js b/src/templateManager.js index fb26984..1a7ce13 100644 --- a/src/templateManager.js +++ b/src/templateManager.js @@ -166,8 +166,16 @@ export default class TemplateManager { file: blob, coords: coords }); + + // Does the user want to skip transparent tiles while creating templates? + const shouldSkipTransTiles = !this.settingsManager?.userSettings?.flags?.includes('hl-noSkip'); + + // Does the user want to aggressively skip transparent tiles while creating templates? + const shouldAggSkipTransTiles = this.settingsManager?.userSettings?.flags?.includes('hl-agSkip'); + + console.log(`Should Skip: ${shouldSkipTransTiles}; Should Agg Skip: ${shouldAggSkipTransTiles}`); - const { templateTiles, templateTilesBuffers } = await template.createTemplateTiles(this.tileSize, this.paletteBM); // Chunks the tiles + const { templateTiles, templateTilesBuffers } = await template.createTemplateTiles(this.tileSize, this.paletteBM, shouldSkipTransTiles, shouldAggSkipTransTiles); // Chunks the tiles template.chunked = templateTiles; // Stores the chunked tile bitmaps