0x85582125…5972sent to0x99a9b7c1…b069·#18,464,434·view on Etherscan
// Inc a modified version of 2D Simplex Noise by Ian McEwan - MIT License: https://github.com/ashima/webgl-noise/blob/master/LICENSE
const{floor:e,ceil:t,sin:o,cos:r,pow:n,abs:i,min:l,max:a,round:s,sqrt:f,acos:c,log:u,random:d,PI:h}=Math;var p;!function(e){e[e.generative=0]="generative"}(p||(p={}));let g="Calm",m="Assertive",v="Rich",b="Toasty",w="Chilled",x=[{name:"Chalks",theme:g,bg:["#e9e1cc"],highlight:["#e9e1cc"],lowlight:["#070707"],line:["#070707"],stroke:["#e9e1cc"],base:["#e9e1cc"],accent:["#2e5c53","#d69c88","#f8b97c","#e26b48","#9fbfcb"]},{name:"Morning Sun In A Dusty Room",theme:b,bg:["#272125"],line:["#0B090A"],stroke:["#ece1cf"],highlight:["#ece1cf"],lowlight:["#0B090A"],base:["#d1ada9"],accent:["#272125","#7f5076","#de5c4b","#e6922b","#ece1cf","#4f707f","#ece1cf","#ece1cf"]},{name:"Jazz",suitability:p.generative,theme:v,stroke:["#2F2A1E"],bg:["#E9DCCE"],lowlight:["#2F2A1E"],highlight:["#E9DCCE"],base:["#e9e1cc"],line:["#070707"],accent:["#dc5b3d","#08739b","#e69335","#e08572"]},{name:"Beach",bg:["#DDC7B1"],theme:g,stroke:["#F4E8DC"],line:["#131F2A"],highlight:["#ffffff"],lowlight:["#05080B"],base:["#ece1cf"],accent:["#0f2f24","#3c534b","#45525c","#b2780f","#d6966a","#a2b6ad"]},{name:"Beige Box",theme:m,bg:["#1d1e20"],line:["#1d1e20"],highlight:["#ffffff"],lowlight:["#05080B"],base:["#e08f38"],stroke:["#C96997"],accent:["#7f716c","#679e6b","#6889ba","#db6438","#C96997","#E7CB52"]},{name:"Master",theme:v,bg:["#d7d2c9"],line:["#25211d"],highlight:["#ffffff"],lowlight:["#05080B"],base:["#98aea0"],stroke:["#e8dddc"],accent:["#b9792a","#9fc6e1","#7287a4","#25574a","#98aea0","#e35a2e"]},{name:"New York Autumn",theme:g,bg:["#e4d7cb"],stroke:["#EECD91"],line:["#141517"],highlight:["#ffffff"],lowlight:["#000000"],base:["#e6d4c7","#ebe1d1"],accent:["#3e5e57","#bcb174","#4b79a0","#5f4c30","#e0c0b0","#e4af50","#eecc61","#b7555a","#af474a"]},{name:"The Coast",theme:g,bg:["#CDC8C1"],stroke:["#e4c98b"],line:["#1D1C1C"],highlight:["#ffffff"],lowlight:["#000000"],base:["#DFD8CD","#B4B3B1"],accent:["#244a41","#739154","#e4c98b","#e2b8bb","#d3eaf1","#5c93c7","#72a09f","#af474a"]},{name:"Aged",theme:b,bg:["#eadcbb"],stroke:["#F0EBE0"],line:["#282625"],highlight:["#F0EBE0"],lowlight:["#000000"],base:["#EBE5D6","#eadcbb","#DBCCA9","#C0B291"],accent:["#d97142","#447d5b","#AA3631","#e3a841","#d3b29f","#32626f"]},{name:"Ink & Colour",theme:m,bg:["#d0d3d7"],stroke:["#F1F0EE"],line:["#1b201d"],highlight:["#F1F0EE"],lowlight:["#000000"],base:["#DFE0E2"],accent:["#4e4374","#e8abb5","#33584b","#d94c41","#1e2b3b","#b5843c","#C4C9CF"]},{name:"Oranges",theme:v,bg:["#f8ecd2"],stroke:["#fefcf7"],base:["#F3B0AF"],highlight:["#F3B0AF"],lowlight:["#050f0a"],line:["#08170F"],accent:["#1D4249","#7b7432","#E87737","#E39226","#F5EFE0"]},{name:"Henri",theme:w,bg:["#E7DECF"],stroke:["#d78c7a"],line:["#221f20"],highlight:["#f4f3e7"],lowlight:["#221f20"],base:["#f1dfc6"],accent:["#2a646f","#1e4c4a","#e9af5f","#8cacb7","#295d7c"]},{name:"Rand-ey",theme:m,bg:["#d8d2c4"],line:["#151418"],highlight:["#ffffff"],lowlight:["#14171e"],stroke:["#e6e0d2"],base:["#e9d9d2"],accent:["#CB4343","#2B5F8D","#745892","#F0990F","#138161","#686e6e"]},{name:"Olivetti",theme:v,bg:["#1d1e20"],line:["#1d1e20"],highlight:["#f4f3e7"],lowlight:["#231e1a"],stroke:["#e08f38"],base:["#726e6d","#E2DDCD"],accent:["#e08f38","#679e6b","#6889ba","#db6438","#C96997","#e9c835"]},{name:"Toddler",theme:v,bg:["#d5c4be"],line:["#08170F"],highlight:["#ede9e1"],lowlight:["#08170F"],stroke:["#08170F"],base:["#9e9995","#ede9e1"],accent:["#1C3673","#5F4E5A","#CE393A","#767650","#F17941","#E9AB25"]}];const y=[["#066278","#e28a91","#eac4c5","#d94939","#e9aa26","#0b2732","#065773","#e7d4da"],["#F4C1C4","#2963A2","#ECAA13","#DB4D2C","#088969"],["#d14434","#dd924c","#d6a146","#1a4249"],["#F0EDE6","#d8d2c4","#22252A","#2F3237","#62646A"],["#35695f"],["#d9c8af"],["#e4d4ca"],["#894f65","#677885","#e7a33e"]];class C{useA;prngA;prngB;hash;constructor(e){this.useA=!1,this.hash=e;const t=globalThis.parseInt;let o=function(e){let o=t(e.substr(0,8),16),r=t(e.substr(8,8),16),n=t(e.substr(16,8),16),i=t(e.substr(24,8),16);return function(){o|=0,r|=0,n|=0,i|=0;let e=(o+r|0)+i|0;return i=i+1|0,o=r^r>>>9,r=n+(n<<3)|0,n=n<<21|n>>>11,n=n+e|0,(e>>>0)/4294967296}};this.prngA=o(this.hash.substr(2,32)),this.prngB=o(this.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}num(e,t){return e+(t-e)*this.dec()}int(t,o){return e(this.num(t,o+1))}bool(e=50){return this.dec()<e/100}choice(e){return e[this.int(0,e.length-1)]}easedDec(e){return e(this.dec())}easedInt(t,o,r){return e(this.easedNum(t,o,r))}easedNum(e,t,o){return t+(o-t)*this.easedDec(e)}weightedChoice(...e){let t=0,o=[];for(t=0;t<e.length;t++)o[t]=e[t][0]+(o[t-1]||0);const r=this.dec()*o[o.length-1];for(t=0;t<o.length&&!(o[t]>r);t++);return e[t][1]}}let D,S;D="undefined"!=typeof tokenData?"string"==typeof tokenData?tokenData:tokenData.hash:function(){let t=new URLSearchParams(globalThis.location.search).get("hash");if(t)return t;let o="0x";for(var r=0;r<64;r++)o+=e(16*d()).toString(16);return window.tokenData={hash:o},o}();function A(e,t,o){return 1===t.length?(e[t[0]]||(e[t[0]]=o()),e):(e[t[0]]||(e[t[0]]=[]),A(e[t[0]],t.slice(1),o))}function k(t){const o=t.slice();for(let t=o.length-1;t>0;t--){const r=e(S.dec()*(t+1));[o[t],o[r]]=[o[r],o[t]]}return o}function L(e,t="right"){const o=e.slice();if("right"===t){const e=o.pop();void 0!==e&&o.unshift(e)}else if("left"===t){const e=o.shift();void 0!==e&&o.push(e)}return o}function B(e,t,o="right"){let r=e.slice();for(let e=0;e<t;e++)r=L(r,o);return r}const P=(e,t,o,r,n)=>((e,t,o)=>(t-e)*o+e)(r,n,((e,t,o)=>(o-e)/(t-e))(t,o,e)),E=(e,t)=>s(e/t)*t;function W(e,t,o){return l(a(e,t),o)}const R=(e,t,o,r,n)=>W(P(e,t,o,r,n),r,n),I=e=>e,M=e=>-(r(h*e)-1)/2,O=4,F=1<<O,V=8,N=1<<V,z=8190;let U=3,T=.8;const G=e=>.5*(1-r(e*h));let Y;function X(t,o=0,r=0){if(null==Y){Y=new Array(z+1);for(let e=0;e<z+1;e++)Y[e]=S.dec()}t<0&&(t=-t),o<0&&(o=-o),r<0&&(r=-r);let n,i,l,a,s,f=e(t),c=e(o),u=e(r),d=t-f,h=o-c,p=r-u,g=0,m=.5;for(let e=0;e<U;e++){let e=f+(c<<O)+(u<<V);n=G(d),i=G(h),l=Y[e&z],l+=n*(Y[e+1&z]-l),a=Y[e+F&z],a+=n*(Y[e+F+1&z]-a),l+=i*(a-l),e+=N,a=Y[e&z],a+=n*(Y[e+1&z]-a),s=Y[e+F&z],s+=n*(Y[e+F+1&z]-s),a+=i*(s-a),l+=G(p)*(a-l),g+=l*m,m*=T,f<<=1,d*=2,c<<=1,h*=2,u<<=1,p*=2,d>=1&&(f++,d--),h>=1&&(c++,h--),p>=1&&(u++,p--)}return g}function _(e,t){let o=e[0],r=e[1],n=!1;for(let e=0,i=t.length-1;e<t.length;i=e++){let l=t[e][0],a=t[e][1],s=t[i][0],f=t[i][1];a>r!=f>r&&o<(s-l)*(r-a)/(f-a)+l&&(n=!n)}return n}function j(e){const t=e.reduce(((e,t)=>[e[0]+t[0],e[1]+t[1]]),[0,0]);return[t[0]/e.length,t[1]/e.length]}const q=e=>f(e[0]*e[0]+e[1]*e[1]);let H=0;function $(){return H++}var J;!function(e){e[e.none=0]="none",e[e.dots=1]="dots",e[e.lines=2]="lines",e[e.remove=3]="remove",e[e.null=4]="null"}(J||(J={}));const K={up:["up","upLeft","upRight"],down:["down","downLeft","downRight"],left:["left","upLeft","downLeft"],right:["right","upRight","downRight"],upLeft:["up","upLeft","left"],upRight:["up","upRight","right"],downLeft:["down","left","downLeft"],downRight:["down","right","downRight"]},Q=["up","down","left","right","upLeft","upRight","downLeft","downRight"],Z=["downRight","downLeft","upLeft","upRight"],ee=(e,t)=>522133279*e^t,te=(e,t)=>({up:[0,-t],down:[0,t],left:[-t,0],right:[t,0],upLeft:[-t,-t],upRight:[t,-t],downLeft:[-t,t],downRight:[t,t]}[e]),oe=e=>e*Xe,re=e=>e*_e,ne=e=>oe(e)+tt,ie=e=>re(e)+ot,le=()=>({poly:[[0,0],[oe(Ge),0],[oe(Ge),re(Ye)],[0,re(Ye)]],id:$(),label:"bg"}),ae=e=>{let t=le().poly;for(let o of e)if(_(o,t))return!0;return!1},se=e=>{let{gx:t=0,gy:o=0,gw:r=1,gh:n=1,extrusionDirection:i,stepDirection:l="upLeft",extrusionLength:a=1,stepCount:s=3}=e,f={upLeft:["upRight","downLeft"],upRight:["upLeft","downRight"],downLeft:["upLeft","downRight"],downRight:["upRight","downLeft"]};f[l].includes(i)||(i=S.choice(f[l]));const c=we([t,o],r,n,s,l);let u=[];a>0&&(u=De(c.poly,i,a));let d=[...u];return c.extrusionDirection=i,d.push(c),d},fe=e=>{let{gx:t=0,gy:o=0,gw:r=1,gh:n=1,extrusionDirection:i="downLeft",extrusionLength:l=1}=e;const a=xe(t,o,r,n,0,0);let s=[];return l>0&&(s=De(a.poly,i,l)),a.extrusionDirection=i,[...s,a]},ce=e=>{const{gx:t=0,gy:o=0,gw:r=1,gh:n=1,extrusionLength:i=1,extrusionDirection:l="upLeft"}=e;const a=ye(t,o,r,r,l);let s=[];return i>0&&(s=De(a.poly,l,i)),a.extrusionDirection=l,[...s,a]},ue=new Map,de=new Map,he=e=>{let t=[],o=Q.map((e=>te(e,.3))),r=e.flat().filter((e=>!de.get(e.id)));for(let e=-2;e<Ge+2;e++)for(let n=-2;n<Ye+2;n++){let i=!1;if(ue.get(ee(e,n)))i=!0;else e:for(let t of r){let r=0;for(let i of o)_(ge([e+i[0],n+i[1]]),t.poly)&&r++;if(r===o.length){i=!0,ue.set(ee(e,n),!0);break e}}i||t.push([e,n])}return r.map((e=>de.set(e.id,!0))),t},pe=(e=!0,t=ue)=>{const o=[],r=Q.map((e=>({pt:te(e,1),dir:e}))),n=(e,o)=>e>=-2&&o>=-2&&e<Ge+2&&o<Ye+2&&!t.get(ee(e,o));for(let t=-2;t<Ge+2;t++)for(let i=-2;i<Ye+2;i++)if(!n(t,i))e:for(const l of r){let[r,a]=l.pt;if(n(t+r,i+a)){if(!e){o.push({pt:[t,i],dir:l.dir});break e}o.push({pt:[t+r,i+a],dir:l.dir})}}return o},ge=e=>{const[t,o]=e;return[ne(t)+oe(.5),ie(o)+re(.5)]};var me,ve;!function(e){e[e.X=0]="X",e[e.Y=1]="Y"}(me||(me={})),function(e){e[e.noise=0]="noise",e[e.gridCoords=1]="gridCoords"}(ve||(ve={}));const be=(e,t,o=ve.noise,r=[])=>{let n=[],i=Q.map((e=>te(e,.3))),l=io,a=1-no,s=ke(l);e:for(let f of e)t:for(let e of f)if(o==ve.noise)for(let o=0;o<Ye;o++)for(let r=0;r<Ge;r++){if(P(X(ne(r)/l,ie(o)/l),s.min,s.max,0,1)>a)for(let l of i){if(_(ge([r+l[0],o+l[1]]),e.poly)){e.detail=t,n.push(e);continue t}}}else if(o==ve.gridCoords){let t=r[0][0],o=r[1][0],l=r[0][1],a=r[1][1];for(let r=l;r<a;r++)for(let l=t;l<o;l++)for(let t of i){if(_(ge([l+t[0],r+t[1]]),e.poly)){n.push(f);continue e}}}return n},we=(e,t=4,o=2,r=3,n="downRight")=>{let i=[],[l,a]=e,s=ne(l),f=ie(a),c=oe(t),u=re(o),d=n.toLowerCase().endsWith("left"),h=n.startsWith("up"),p=!d&&h,g=d&&h,m=0,v=s,b=f;(d&&!g||p)&&(c=-c);for(let e=0;e<r;e++){i.push([v,b]);let t=0==e?c:c/2;m+=t,v+=t,i.push([v,b]),b+=u,i.push([v,b])}for(let e=0;e<r;e++)v-=0==e?c:c/2,i.push([v,b]),b-=u,i.push([v,b]);return(d&&!g||p)&&(i=i.reverse()),(h||p)&&(i=Se(i,"up",o*(r-1)),i=Se(i,"left",m/Xe)),{poly:i,id:$(),label:"front"}},xe=(e,t,o,r,n=0,i=0)=>{const l=ne(e),a=ie(t),s=oe(o),f=re(r),c=s/2*n,u=f/2*i;return{poly:[[l+c,a+u],[l+c+s,a-u],[l-c+s,a-u+f],[l-c,a+u+f]],id:$(),label:"front"}},ye=(e,t,o,r,n="upLeft")=>{let i=xe(e,t,o,r),l=Z.indexOf(n);return i.poly.splice(l,1),i},Ce=(e,t)=>{const o=te(t,1);return e.map(((t,o)=>[t,e[o+1]||e[0]])).filter((e=>{const[t,r]=e,n=[r[0]-t[0],r[1]-t[1]];return((e,t)=>{const o=((e,t)=>e[0]*t[0]+e[1]*t[1])(e,t),r=q(e)*q(t);return c(o/r)})(o,[n[1],-n[0]])<=.7}))},De=(e,t,o)=>{let r=[];const n=K[t];let l=(e=>{const t={};for(const o of Q)t[o]=Ce(e,o);return t})(e);for(let e of n)l[e].map((n=>{let i=Se(n,t,o).reverse(),l={id:$(),label:e,poly:[...n,...i]};r.push(l)}));return r=r.filter((e=>function(e){let t=0;const o=e.length;for(let r=0;r<o;r++){const[n,i]=e[r],[l,a]=e[(r+1)%o];t+=n*a-l*i}return i(t)/2}(e.poly)>.3)),r},Se=(e,t,o)=>{let r=o*rt,n=e.map((e=>[...e])),i=te(t,r);return n.forEach((e=>{e[0]+=i[0],e[1]+=i[1]})),n};let Ae={};const ke=(t,o=5,r=0,n=I)=>{const i=`${t}-${r}`;if(Ae[i]?.min)return Ae[i];let l=0,a=-1/0,s=1/0,f=0,c=[];for(let e=0;e<Ge;e++)for(let o=0;o<Ye;o++){let i=n(X(ne(e)/t,ie(o)/t,r));l+=i,f+=1,i>a&&(a=i),i<s&&(s=i),c.push(i)}let u={max:a,min:s,mean:l/f,indexValues:[],mostCommonIndex:0,leastCommonIndex:0};return c.map((t=>{let r=e(R(t,u.min,u.max,0,o-1));u.indexValues[r]=u.indexValues[r]?u.indexValues[r]+1:1})),u.mostCommonIndex=u.indexValues.reduce(((e,t,o)=>t>u.indexValues[e]?o:e),0),u.leastCommonIndex=u.indexValues.reduce(((e,t,o)=>t<u.indexValues[e]?o:e),0),Ae[i]=u,u};var Le;!function(e){e[e.h=0]="h",e[e.s=1]="s",e[e.l=2]="l"}(Le||(Le={}));let Be=[];const Pe=e=>function(e){let t,o,r=e[0]/255,n=e[1]/255,i=e[2]/255,s=a(r,n,i),f=l(r,n,i),c=(s+f)/2;if(s==f)t=o=0;else{var u=s-f;switch(o=c>.5?u/(2-s-f):u/(s+f),s){case r:t=(n-i)/u+(n<i?6:0);break;case n:t=(i-r)/u+2;break;case i:t=(r-n)/u+4}t/=6}return[t,o,c]}(function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!t)throw new Error(`${e}`);return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}(e));let Ee=[],We=[];const Re=(e,t,o)=>{const r={h:1,s:0,l:0,...o},n=(e[Le.h]-t[Le.h])*r.h,i=(e[Le.s]-t[Le.s])*r.s,l=(e[Le.l]-t[Le.l])*r.l;return f(n*n+i*i+l*l)},Ie=(e,t,o,r=1)=>{let n=[];for(const i of e){const e=Re(t,i,o);n.length<r?(n.push({color:i,distance:e}),n.sort(((e,t)=>e.distance-t.distance))):e<n[n.length-1].distance&&(n.pop(),n.push({color:i,distance:e}),n.sort(((e,t)=>e.distance-t.distance)))}return n.map((e=>e.color))},Me=(e,t=Le.l,o=.2)=>function(e){const t=e.length,o=e.reduce(((e,t)=>e+t))/t;return f(e.map((e=>n(e-o,2))).reduce(((e,t)=>e+t))/t)}(e.map((e=>e[t])))>=o;let Oe=0;const Fe=e=>{if(!We[e]){let t=We[e]={};for(let e of Object.keys($e))"name"!==e&&"suitability"!==e&&"theme"!==e&&(t[e]=$e[e].map((e=>Pe(e))))}let t=We[e];if(Ee[e])return k(Ee[e]);{let o,r,n=[];if(Ht){let e=x.map((e=>e.name===$e.name?[]:[...e.accent,...e.line,...e.base,...e.bg,...y.flat()])).flat().map(Pe);o=[...t.base,...t.accent,...t.line].map((t=>S.choice(Ie(e,t,Je,4))));let r=x.map((e=>e.name===$e.name?[]:[...e.bg])).flat().map(Pe);We[Ve.base].bg=[S.choice(Ie(r,t.bg[0],Je,2))];let n=x.map((e=>e.name===$e.name?[]:[...e.line])).flat().map(Pe);We[Ve.base].line=[S.choice(Ie(n,t.line[0],Je,2))]}else o=[...t.accent,...t.base,...t.line];r=W(s(o.length/100*$t[e]),3,1e4);for(let e=0;e<r;e++){let t;t=0==e?o[ze(o)]:S.choice(o),t&&n.push(t),o=o.filter((e=>{return r=t,!((o=e)[Le.h]===r[Le.h]&&o[Le.s]===r[Le.s]&&o[Le.l]===r[Le.l]);var o,r}))}let i=Me(n,Le.l,.2);return Oe<=100&&n.length<=3&&!i?(Oe++,Fe(e)):(Ee[e]=n,k(Ee[e]))}};var Ve;!function(e){e[e.base=0]="base",e[e.alt=1]="alt",e[e.alt2=2]="alt2",e[e.alt3=3]="alt3"}(Ve||(Ve={}));const Ne=t=>{let o=M,{pos:r=[0,0],tension:n=50,paletteVariant:i=0,offsetPerVariant:l=50,divisonsX:a=so,divisonsY:s=fo,paletteCategory:f=Ve.base}=t;const c=W(e(r[0]/(Vo/(a+1))),0,a),u=W(e(r[1]/(No/(s+1))),0,s);A(Be,[c,u,f,i],Fe.bind(null,f));let d=Be[c][u][f][i];n-=l,0==n&&(n=.1);let h=ke(n,d.length,0,o);if(Ue(d)==h.mostCommonIndex){let e=k(d),t=Ue(e),o=0;for(;(t==h.mostCommonIndex||t==h.leastCommonIndex)&&o<100;)e=k(d),t=ze(e),o++;Be[c][u][f][i]=e}return d[e(R(o(X(r[0]/n,r[1]/n,0)),h.min,h.max,0,d.length-1))%d.length]},ze=e=>e.reduce(((t,o,r)=>o[Le.l]>e[t][Le.l]?r:t),0),Ue=e=>e.reduce(((t,o,r)=>o[Le.l]<e[t][Le.l]?r:t),0),Te=(e,t,o)=>{let r=!1,n=e.map((e=>{let n;"bg"===e.label&&(r=!0);let i=j(e.poly),l=Ne({pos:o||i,paletteCategory:t,tension:eo,paletteVariant:oo?0:Q.indexOf(e.label)+1});n=r?We[Ve.base].bg[0]:[...l];let a=ke(mt),s=R(X(i[0]/mt,i[1]/mt,0),a.min,a.max,-gt,gt),f=r?0:s;return n[Le.l]+=f,((e,t)=>{let o=[...e];return o[Le.l]+=co[t],o[Le.h]+=S.num(-.01,.01),o[Le.l]+=S.num(-.01,.01),o.map(((e,t)=>{const o=t==Le.l;return W(e,o?.1:0,o?.81:1)}))})(n,e.label)}));return{isBackground:r,palette:n}};let Ge,Ye,Xe,_e,je,qe,He,$e,Je={h:1,s:.9,l:.7},Ke=[[2,0],[4,1],[1,.5],[1,1.5],[2,2],[1,3]],Qe=[[2,10],[1,40],[2,70],[5,100]],Ze=10,et=10,tt=0,ot=0,rt=100,nt=!1,it=[4,6],lt=0,at=!1,st=!1,ft=40,ct=100,ut=1,dt=[],ht=100,pt=.6,gt=.15,mt=50,vt=0,bt=!1,wt=20,xt=10,yt=2,Ct=99.5,Dt=!0,St=2,At=2,kt=5,Lt=!1,Bt=1,Pt=1,Et=!1,Wt=1,Rt=1,It=1e3,Mt=!0,Ot=!1,Ft=!1,Vt=!1,Nt=!1,zt=1,Ut=1,Tt=1,Gt=1,Yt=2,Xt=2,_t=10,jt=0,qt=1,Ht=!1,$t=[100,100],Jt=!1,Kt=1,Qt=.1,Zt=.001,eo=200,to=80,oo=!1,ro=!0,no=.1,io=1,lo=!1,ao=!1,so=2,fo=0,co={up:.1,down:-.12,left:.05,right:-.12,upLeft:.06,upRight:.1,downLeft:-.08,downRight:-.11,front:0,bg:0},uo={up:.1,down:-.12,right:.05,left:-.12,upLeft:.1,upRight:.3,downLeft:-.11,downRight:-.08,front:0,bg:0},ho=()=>{co=uo},po=!0,go=2,mo=10,vo=1;const bo=()=>{if(rt<30)return;let e=S.choice(["Left","Right"]),t=S.bool(50);qe=(t?"up":"down")+e,He=(t?"down":"up")+e},wo=()=>{let t=30,o=65;S.bool(10)?(t=15,o=35,Do(25,35)):Do(t,o),lt=0,Ke=Ke.splice(0,S.int(3,Ke.length-(rt>50?2:1))),S.int(1e3,2e3),S.num(6,10);let r=S.bool(3);at=r,r?(jt=.9,qt=1):(ht=0,jt=0,qt=0),vt=0,Ct=99.5,xt=S.choice([0,30,80]),yt=S.int(2,5),vo=S.num(.7,1),kt=S.int(3,5),St=S.int(2,3),At=S.int(2,rt<=35?6:3),Ze=S.num(150,250),et=S.num(120,220),At>=3&&(St=1),pt=S.bool(80)?S.num(.65,.8):S.num(.2,.65),S.bool(4)&&(pt=.2),Lt=lo||S.bool(r?10:65),Et=S.bool(Lt?80:60),Rt=S.num(.3,.8),Wt=rt<36?S.num(.8,1.1):S.num(.6,1),It=rt>36?Vo/8:Vo/4,wt=Lt||Et?20:50,nt=!(!Lt&&!Et)&&S.bool(20),Bt=R(rt,t,o,1.65,1.8),S.bool(25)?Bt*=1.5:Bt*=S.num(.9,1.1),Pt=S.num(1,1),Jt=S.bool(50),Kt=S.num(.01,.1),Qt=S.num(0,.8),Zt=S.num(0,.001),eo=S.choice([10,50,100]),to=S.choice([0,50,70,80]),S.choice([10,50,100]),S.choice([0,50,80]),so=S.int(0,rt<=35?8:4),fo=S.int(0,rt<=35?8:4),oo=S.bool(70),S.bool(40),_t=S.int(.1,80),ro=!0,no=S.num(rt>50?.16:.2,rt>50?.18:.23),Lt||Et||(no*=.75),io=(80-rt)*S.num(1,1.15),st=!0,ct=rt<=38?1.8*Xe:Xe*S.num(1.1,1.6),ut=rt>50?1:4,ft=S.int(60,150),Lt||Et||(ct=Xe,ut=1),Dt=S.bool(0),mo=30,Ut=1,Ft=!r&&S.bool(Lt||Et?40:90),Ot=!r&&Ft&&S.bool(40),zt=Ut,Tt=Ut,!r&&S.bool(20)&&bo(),it=[e(Ge/S.int(2,4)),e(Ye/S.int(2,6))],bt=S.bool(5),Qe[0]=[1,10],Qe[1]=[0,40]},xo=()=>{S.bool(10)?Do(25,35):Do(70,120),Qe[0]=[0,100],$e.accent.length<=4&&(Qe[1]=[1,50]),nt=S.bool(20),po=S.bool(70),lo=S.bool(35),ao=lo&&S.bool(50),lt=tt>10?tt:ot,lt=tt>100?tt/2:lt,tt<ot&&ot-tt<rt/6&&(lt=ot);let t=S.bool(100);lt<10&&(lt*=4),lt=t?lt:0,ht=100;let o=S.bool(10);if(at=o,o?(jt=1.1,qt=1):(jt=0,qt=0),Lt=S.bool(o?5:15),Bt=S.num(1.8,4),Pt=S.num(.3,2),Et=!Lt&&S.bool(20),Rt=S.num(.6,1.1),rt>90&&(Wt=.7),Et&&S.bool(5)&&(Rt=S.num(1.2,1.6),Wt*=1.1),Ct=99,xt=S.int(0,10),yt=S.int(1,4),pt=S.num(.5,.8),wt=S.int(20,70),vo=S.num(.9,1),Jt=S.bool(50),Kt=S.num(.01,.04),Qt=S.num(0,.4),Zt=S.num(0,.01),st=!0,ct=10*-Xe,vt=10,S.int(600,1200),S.num(3,12),St=rt<=35?S.int(6,12):S.int(1,5),At=rt<=35?S.int(6,12):S.bool(20)?6:S.int(1,6),At>=4&&(St=1),St>=4&&(At=1),Dt=!1,mo=S.int(0,15),eo=S.choice([10,50,100]),to=S.choice(lo||rt>100?[0,50,70]:[0,40,65,80]),S.choice([10,50,100]),S.choice([0,50,80]),oo=S.bool(rt>100?30:60),S.bool(30),rt<=35&&(eo/=2),so=S.int(0,S.weightedChoice([1,0],[2,3])),fo=S.int(0,S.weightedChoice([1,0],[2,3])),ro=!0,no=S.num(.05,.16),io=S.num(.7,1),kt=S.int(2,5),it=[e(Ge/S.int(2,4)),e(Ye/S.int(2,4))],Gt=2,Xt=1,Yt=1,Ut=1,Mt=S.bool(50),o){let e=S.bool(50);Ft=e,Ot=!e}else Ft=S.bool(Lt||Et?80:99),Ot=Ft&&S.bool(60);zt=Ut,Tt=Ut,S.bool(50)&&(Tt*=2),_t=S.int(1,1e3),Ke=[[S.bool(10)?2:S.int(0,1),0],[1,.5],[2,1],[1,1.5],[S.choice([1,0,.5]),2]],S.bool(35)&&bo(),bt=S.bool(5)},yo=()=>{S.bool(5)?Do(25,35):Do(70,95),st=!0,_t=S.int(1,40),ct=1*Xe,St=2,At=S.int(3,rt<=35?6:4),vt=0,wt=30,Et=S.bool(0),Wt=.6,Jt=S.bool(0),Kt=.1,Qt=.1,Zt=.001,S.int(1800,2e3),S.num(8,10),eo=S.int(10,180),to=S.choice([0,50,70,80]),S.int(10,180),S.choice([0,50,80]),oo=S.bool(0),S.bool(30),rt<=35&&(eo/=2);let e=S.bool(50)?2:0;so=S.int(0,rt<=35?8:e),fo=S.int(0,rt<=35?8:e),pt=S.num(.1,.7),mo=30,vo=S.num(.8,1),Lt=S.bool(rt<=80&&rt>=35?20:5),Bt=S.num(2,4),Pt=S.num(.8,1.2);let t=S.bool(30);Lt||Et||!t?(ht=0,jt=0,qt=0):(ht=100,at=!0,jt=1.5,qt=1),Gt=2,kt=S.int(2,rt<=35?4:2),yt=S.int(2,4),ro=!0,no=S.num(.1,.17),io=S.num(.7,1.5),Dt=S.bool(0),Mt=S.bool(30),Nt=Mt&&S.bool(20),Vt=!Nt&&Mt&&S.bool(20),Tt=S.weightedChoice([2,1],[1,2]),Ut=S.choice([.5,1]),zt=Ut,Ft=S.bool(80),Ot=1==Tt&&!t&&S.bool(70),ut=0,Ke=[[1,0],[.25,.5],[1,1],[Dt?.25:0,1.5]],Qe[0]=[0,100]},Co=()=>{let t=S.bool(35);Do(t?130:70,t?150:140),nt=S.bool(20);let o=!t&&S.bool(5);at=o;let r=S.bool(30);_t=S.int(r?1:1e3,r?100:2e3),o?(jt=1.2,qt=1):(jt=0,qt=0),vo=S.num(.8,1.1),Et=S.bool(t?55:40),Wt=t?S.num(1,1.6):S.num(.7,1.1),Rt=S.num(.3,t?.3:1),Et&&S.bool(5)&&(Rt=S.num(1.2,2.7)),Jt=S.bool(30),Kt=S.num(.015,.01),Qt=S.num(0,.4),Zt=S.num(0,.001),wt=70,St=t?2:3,At=rt>90?6:8,Lt=!o&&S.bool(30),Bt=S.num(rt<90?2:3,rt<90?3.2:5),Pt=S.num(.4,1.1),mo=20,eo=S.choice([10,50,100,200]),to=S.choice(rt>100?[10,30,50,60]:[10,50,70,80]),S.choice([10,50,100,200]),S.choice([10,50,70,80]),so=S.int(0,S.weightedChoice([1,0],[2,3])),fo=S.int(0,S.weightedChoice([1,0],[2,3])),oo=S.bool(50),ro=!0,no=S.num(0,rt>120?0:rt>90?.01:.1),io=S.num(.7,1),lt=tt>10?tt:ot,lt=tt>100?tt/2:lt,tt<ot&&ot-tt<rt/6&&(lt=ot),lt<10&&(lt*=4),Gt=2,Mt=S.bool(50),Ut=1,Ft=S.bool(85),Ot=S.bool(60),o&&Ft&&(Ot=!1),zt=Ut,Tt=Ut,lo=S.bool(t?50:30),ao=lo&&S.bool(50),pt=S.bool(70)?S.num(.6,.75):S.num(.3,.6),kt=rt>120?3:4,xt=S.int(90,100),it=[e(Ge/S.int(2,3)),e(Ye/S.int(2,6))],Qe.splice(0,2),Ke=[[2,0],[4,1],[4,2],[!t&&S.bool(90)?1:0,3],[rt<60&&S.bool(50)?1:0,4],[rt<60&&S.bool(50)?1:0,5]],bt=S.bool(5)},Do=(e,t)=>{rt=S.int(e,t),Ge=Vo/rt,Ye=No/rt,Xe=Vo/Ge,_e=No/Ye,tt=Vo%rt/2,ot=No%rt/2},So=()=>(lo&&(Qe[0]=[0,100]),bt&&(Qe=[[1,100]]),S.weightedChoice(...Qe));let Ao,ko,Lo="#fff";const Bo=()=>{Ao=document.createElement("div"),Ao.id="loading";const e=Ao.style;e.position="absolute",e.fontSize="1.25vmin",e.top=e.left="0",e.width="100%",e.height="100%",e.zIndex="1000",ko=document.createElement("div");const t=ko.style;t.backgroundColor="rgba(0, 0, 0, 0.91)",t.textTransform="uppercase",t.position="fixed",t.lineHeight="0",t.top=t.left="0",t.width="100vw",t.height="100vh",t.height="fill-available",t.display="flex",t.justifyContent=t.alignItems="center",t.flexDirection="column",t.color=Lo,t.fontFamily="system-ui",t.fontWeight="400",Ao.appendChild(ko),document.body.appendChild(Ao)},Po=(e,t="Preparing")=>{ko||Bo(),ko.innerHTML=((e,t="Preparing")=>`<p>${t}</p><div style="max-width: 15vmin; margin-top: 1.25em; width: 100%; border: .5px solid ${Lo}"><div style="width: ${e||0}%; height: .75vmin; background-color: ${Lo}; overflow: hidden;"></div>`)(e,t)};let Eo,Wo,Ro,Io=!1,Mo=e=>{Po(0,e),Io=!0};const Oo=window.requestAnimationFrame,Fo=performance.now.bind(performance);let Vo,No,zo=4/6;const Uo=a(window.devicePixelRatio,2);let To,Go;class Yo{gl;renderCount;shaderProgram;positionAttribute;positionBuffer;framebuffer;renderbuffer;setUniform(e,t,o){const r=this.gl,n=r.getUniformLocation(this.shaderProgram.program,e),i="uniform"+t;if(t.endsWith("fv")||t.endsWith("iv"))r[i](n,o);else{const e=[n].concat(o);r[i].apply(r,e)}return this}constructor(e,t,o){this.gl=e,this.renderCount=0,this.shaderProgram=new Xo(e,t,o)}}class Xo{program;constructor(e,t,o){const r=this.compileShader(e,t,e.VERTEX_SHADER),n=this.compileShader(e,o,e.FRAGMENT_SHADER);if(this.program=e.createProgram(),e.attachShader(this.program,r),e.attachShader(this.program,n),e.linkProgram(this.program),!e.getProgramParameter(this.program,e.LINK_STATUS))throw new Error("Error: "+e.getProgramInfoLog(this.program))}compileShader(e,t,o){const r=e.createShader(o);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error("An error occurred compiling the shaders: "+e.getShaderInfoLog(r));return r}}class _o extends Yo{randomValues=dt;render(t){const{polygons:o,paletteByIdx:r,paletteByIdx2:n,backgroundColor:i,gridBleedThrough:l=!1,outerPolygon:a=[[0,0],[Vo,0],[0,No],[Vo,No]],depthInScene:s=0,warpLayer:f=!1,drawFaces:c=!0,detail:u,details:d,drawOutlines:h=!0,shadingStrength:p=1,isBackground:g=!1,strokeBorder:m=!0,randomSeed:v=je,lineColor:b=Pe($e.line[0]),lineContrast:w=.5,lineThickness:x=1,gridWidth:y=Xe,gridMX:C=tt,gridMY:D=ot}=t,S=this.gl,A=this.setUniform.bind(this);this.positionBuffer=this.positionBuffer||S.createBuffer(),S.bindBuffer(S.ARRAY_BUFFER,this.positionBuffer),S.bufferData(S.ARRAY_BUFFER,new Float32Array(a.map((e=>[e[0],e[1]])).flat()),S.STATIC_DRAW),this.positionAttribute=this.positionAttribute||S.getAttribLocation(this.shaderProgram.program,"a_position"),S.bindBuffer(S.ARRAY_BUFFER,this.positionBuffer),S.enableVertexAttribArray(this.positionAttribute),S.vertexAttribPointer(this.positionAttribute,2,S.FLOAT,!1,0,0),0==this.renderCount&&(S.viewport(0,0,To*Uo,Go*Uo),S.useProgram(this.shaderProgram.program),A("resolution","2f",[To*Uo,Go*Uo]),A("scaledResolution","2f",[Vo,No]),A("margin","1f",lt),A("lineContrast","1f",w),A("lineThickness","1f",x),A("backgroundColor","3f",i),A("desaturate","1i",bt?