r in 3D");for(var n=this.infos.length-1;0<=n;--n){var s=this.infos[n];if(s.index+e<o){r=(t=s).imageData;break}}if(!t){try{r=new ImageData(this.width,this.height)}catch(e){var i=document.getElementsByTagName("canvas")[0],a=!i,l=(i||((i=document.createElement("canvas")).style.display="none",document.body.appendChild(i)),i.getContext("2d"));l&&(r=l.createImageData(this.width,this.height)),a&&document.body.removeChild(i)}this.infos.push(t={index:0,imageData:r})}l=t.index;return t.index+=e,r._dirty=!0,{imageData:r,index:l}}}]),r}();function z(e,t,r,o,n){var s=e.imageData.data,e=4*e.index++;s[e++]=t,s[e++]=r,s[e++]=o,s[+e]=n}var H=Math.sqrt(3),M=function(){function t(e){G(this,t),this.font=e,this.strokeImageInfos=new l(64,64),this.colDimImageInfos=new l(64,64),this.rowDimImageInfos=new l(64,64),this.colCellImageInfos=new l(64,64),this.rowCellImageInfos=new l(64,64),this.glyphInfos={}}return V(t,[{key:"getGlyphInfo",value:function(e){var t=this.glyphInfos[e.index];if(!t){var r=e.getBoundingBox(),o=r.x1,n=r.y1,s=r.x2-o,i=r.y2-n,a=e.path.commands;if(0==s||0==i||!a.length)return this.glyphInfos[e.index]={};for(var u=[],c=[],d=[],l=8;0<=l;--l)d.push([]);for(l=8;0<=l;--l)c.push([]);var h,f,p,m,D=function(){function n(e,t,r,o){G(this,n),this.p0=e,this.c0=t,this.c1=r,this.p1=o}return V(n,[{key:"toQuadratic",value:function(){return{x:this.p0.x,y:this.p0.y,x1:this.p1.x,y1:this.p1.y,cx:(3*(this.c0.x+this.c1.x)-(this.p0.x+this.p1.x))/4,cy:(3*(this.c0.y+this.c1.y)-(this.p0.y+this.p1.y))/4}}},{key:"quadError",value:function(){return B.default.Vector.sub(B.default.Vector.sub(this.p1,this.p0),B.default.Vector.mult(B.default.Vector.sub(this.c1,this.c0),3)).mag()/2}},{key:"split",value:function(e){var t=B.default.Vector.lerp(this.p0,this.c0,e),r=B.default.Vector.lerp(this.c0,this.c1,e),o=B.default.Vector.lerp(t,r,e),r=(this.c1=B.default.Vector.lerp(this.c1,this.p1,e),this.c0=B.default.Vector.lerp(r,this.c1,e),B.default.Vector.lerp(o,this.c0,e)),e=new n(this.p0,t,o,r);return this.p0=r,e}},{key:"splitInflections",value:function(){var e=B.default.Vector.sub(this.c0,this.p0),t=B.default.Vector.sub(B.default.Vector.sub(this.c1,this.c0),e),r=B.default.Vector.sub(B.default.Vector.sub(B.default.Vector.sub(this.p1,this.c1),e),B.default.Vector.mult(t,2)),o=[],n=t.x*r.y-t.y*r.x;return 0!==n&&0<=(e=(r=e.x*r.y-e.y*r.x)*r-4*n*(e.x*t.y-e.y*t.x))&&(n<0&&(n=-n,r=-r,0),e=(-r+(t=Math.sqrt(e)))/(2*n),0<(r=(-r-t)/(2*n))&&r<1&&(o.push(this.split(r)),e=1-(1-e)/(1-r)),0<e&&e<1&&o.push(this.split(e))),o.push(this),o}}]),n}(),y=!0,g=!1,v=void 0;try{for(var b,_=a[Symbol.iterator]();!(y=(b=_.next()).done);y=!0){var j=b.value,x=(j.x-o)/s,w=(j.y-n)/i;if(!U(h,f,x,w)){switch(j.type){case"M":p=x,m=w;break;case"L":I(h,f,x,w);break;case"Q":var S=(j.x1-o)/s,T=(j.y1-n)/i;L([h,x,S],[f,w,T],{x:h,y:f,cx:S,cy:T});break;case"Z":U(h,f,p,m)?u.push({x:h,y:f}):(I(h,f,p,m),u.push({x:p,y:m}));break;case"C":for(var E=function(e,t,r,o,n,s,i,a){var e=new D(new B.default.Vector(e,t),new B.default.Vector(r,o),new B.default.Vector(n,s),new B.default.Vector(i,a)).splitInflections(),l=[],u=30/H,c=!0,t=!1,r=void 0;try{for(var d,h=e[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){for(var f=d.value,p=[],m=void 0;!(.125<=(m=u/f.quadError()));){var y=Math.pow(m,1/3),g=f.split(y),v=f.split(1-y/(1-y));l.push(g),p.push(f),f=v}m<1&&l.push(f.split(.5)),l.push(f),Array.prototype.push.apply(l,p.reverse())}}catch(e){t=!0,r=e}finally{try{c||null==h.return||h.return()}finally{if(t)throw r}}return l}(h,f,(j.x1-o)/s,(j.y1-n)/i,(j.x2-o)/s,(j.y2-n)/i,x,w),M=0;M<E.length;M++){var k=E[M].toQuadratic();L([k.x,k.x1,k.cx],[k.y,k.y1,k.cy],k)}break;default:throw new Error("unknown command type: ".concat(j.type))}h=x,f=w}}}catch(e){g=!0,v=e}finally{try{y||null==_.return||_.return()}finally{if(g)throw v}}for(var O=u.length,C=this.strokeImageInfos.findImage(O),F=C.index,P=0;P<O;++P){var A=u[P];z(C,R(A.x),R(A.y),R(A.cx),R(A.cy))}(t=this.glyphInfos[e.index]={glyph:e,uGlyphRect:[r.x1,-r.y1,r.x2,-r.y2],strokeImageInfo:C,strokes:u,colInfo:N(d,this.colDimImageInfos,this.colCellImageInfos),rowInfo:N(c,this.rowDimImageInfos,this.rowCellImageInfos)}).uGridOffset=[t.colInfo.dimOffset,t.rowInfo.dimOffset]}return t;function L(e,t,r){var o=u.length;function n(e,t,r){for(var o=e.length;0<o--;){var n=e[o];n<t&&(t=n),r<n&&(r=n)}return{min:t,max:r}}u.push(r);for(var r=n(e,1,0),e=Math.max(Math.floor(9*r.min-.5),0),s=Math.min(Math.ceil(9*r.max+.5),9),i=e;i<s;++i)d[i].push(o);for(var r=n(t,1,0),e=Math.max(Math.floor(9*r.min-.5),0),a=Math.min(Math.ceil(9*r.max+.5),9),l=e;l<a;++l)c[l].push(o)}function R(e){return(e=(r=255)*e)<(t=0)?t:r<e?r:e;var t,r}function I(e,t,r,o){L([e,r],[t,o],{x:e,y:t,cx:(e+r)/2,cy:(t+o)/2})}function U(e,t,r,o){return Math.abs(r-e)<1e-5&&Math.abs(o-t)<1e-5}function N(e,t,r){for(var o=e.length,n=t.findImage(o),t=n.index,s=0,i=0;i<o;++i)s+=e[i].length;for(var a=r.findImage(s),l=0;l<o;++l){var u=e[l],c=u.length,d=a.index;z(n,d>>7,127&d,c>>7,127&c);for(var h=0;h<c;++h){var f=u[h]+F;z(a,f>>7,127&f,0,0)}}return{cellImageInfo:a,dimOffset:t,dimImageInfo:n}}}}]),t}();B.default.RendererGL.prototype._renderText=function(e,t,r,o,n){if(this._textFont&&"string"!=typeof this._textFont){if(!(n<=o)&&this._doFill){if(this._isOpenType()){e.push();var n=this._doStroke,s=this.drawMode,i=(this._doStroke=!1,this.drawMode=E.TEXTURE,this._textFont.font),a=(a=this._textFont._fontInfo)||(this._textFont._fontInfo=new M(i)),r=this._textFont._handleAlignment(this,t,r,o),o=this._textSize/i.unitsPerEm,l=(this.translate(r.x,r.y,0),this.scale(o,o,1),this.GL),r=!this._defaultFontShader,u=this._getFontShader(),c=(u.init(),u.bindShader(),r&&(u.setUniform("uGridImageSize",[64,64]),u.setUniform("uCellsImageSize",[64,64]),u.setUniform("uStrokeImageSize",[64,64]),u.setUniform("uGridSize",[9,9])),this._applyColorBlend(this.curFillColor),this.retainedMode.geometry.glyph),d=(c||((o=this._textGeom=new B.default.Geometry(1,1,function(){for(var e=0;e<=1;e++)for(var t=0;t<=1;t++)this.vertices.push(new B.default.Vector(t,e,0)),this.uvs.push(t,e)})).computeFaces().computeNormals(),c=this.createBuffers("glyph",o)),!0),r=!1,o=void 0;try{for(var h,f=this.retainedMode.buffers.text[Symbol.iterator]();!(d=(h=f.next()).done);d=!0)h.value._prepareBuffer(c,u)}catch(e){r=!0,o=e}finally{try{d||null==f.return||f.return()}finally{if(r)throw o}}this._bindBuffer(c.indexBuffer,l.ELEMENT_ARRAY_BUFFER),u.setUniform("uMaterialColor",this.curFillColor),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{var p=0,m=null,y=i.stringToGlyphs(t),g=!0,v=!1,b=void 0;try{for(var _,j=y[Symbol.iterator]();!(g=(_=j.next()).done);g=!0){var x,w,S=_.value,T=(m&&(p+=i.getKerningValue(m,S)),a.getGlyphInfo(S));T.uGlyphRect&&(x=T.rowInfo,w=T.colInfo,u.setUniform("uSamplerStrokes",T.strokeImageInfo.imageData),u.setUniform("uSamplerRowStrokes",x.cellImageInfo.imageData),u.setUniform("uSamplerRows",x.dimImageInfo.imageData),u.setUniform("uSamplerColStrokes",w.cellImageInfo.imageData),u.setUniform("uSamplerCols",w.dimImageInfo.imageData),u.setUniform("uGridOffset",T.uGridOffset),u.setUniform("uGlyphRect",T.uGlyphRect),u.setUniform("uGlyphOffset",p),u.bindTextures(),l.drawElements(l.TRIANGLES,6,this.GL.UNSIGNED_SHORT,0)),p+=S.advanceWidth,m=S}}catch(e){v=!0,b=e}finally{try{g||null==j.return||j.return()}finally{if(v)throw b}}}finally{u.unbindShader(),this._doStroke=n,this.drawMode=s,l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.pop()}}else console.log("WEBGL: only Opentype (.otf) and Truetype (.ttf) fonts are supported. Make sure to set the font using textFont() before drawing text.");return e}}else console.log("WEBGL: you must load and set a font before drawing text. See `loadFont` and `textFont` for more details.")}},{"../core/constants":272,"../core/main":283,"./p5.RendererGL.Retained":340,"./p5.Shader":342,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.regexp.exec":195,"core-js/modules/es.string.iterator":200,"core-js/modules/es.string.split":206,"core-js/modules/es.string.sub":208,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}]},{},[267])(267)});</script>
<!-- 2. tl-gen-art: window.$art, seeded synchronously at load from URL mint params -->
<script>/**
* Generative art random helpers with p5-style configurable seeding.
*
* Reads mint params from the URL: tokenId, blockhash, txHash, minter
* (each falls back to a random value so the script runs locally).
*
* tokenId + blockhash are ALWAYS part of the seed (uniqueness +
* unpredictability). minter, txHash, gasPrice, and gasUsed are opt-in.
* Re-seeding resets the random stream deterministically, like p5's randomSeed().
*
* $art.seedFrom(); // tokenId + blockhash (default)
* $art.seedFrom("minter"); // + minter
* $art.seedFrom("gasPrice", "gasUsed"); // + gas fields
*
* A `seed` URL param is a curated, full override: when present it becomes the
* complete seed verbatim and seedFrom(...) defers to it (contract-injected for
* collector-curated drops). Absent locally, seeding composes from the fields.
*
* Snapshot + traits (for Cloudflare Browser Rendering):
* $art.setTraits({ Palette: "Sunset", Layers: 5 }); // hidden #art-traits JSON
* $art.snapshot(); // hidden #art-snapshot-ready marker
* $art.snapshot(() => noLoop()); // + freeze the frame under capture
*
* For animated pieces, pass snapshot() a freeze callback. It runs ONLY under the
* snapshot capture user agent (live collector views never freeze), letting the
* screenshot grab the frame that was live at call time. Making that frame
* reproducible is the artist's job: call snapshot() at a deterministic point.
*/
const $art = (function () {
const params = new URLSearchParams(window.location.search);
const get = (key, fb) => {
const v = params.get(key);
return v === null || v === "" ? fb : v;
};
const randHex = (len) =>
"0x" + Array.from({ length: len }, () => "0123456789abcdef"[(Math.random() * 16) | 0]).join("");
// Raw mint values (with local-dev fallbacks). "0" tokenId is preserved.
const mint = {
tokenId: get("tokenId", Math.floor(Math.random() * 10000).toString()),
blockhash: get("blockhash", randHex(64)),
txHash: get("txHash", randHex(64)),
minter: get("minter", randHex(40)),
gasPrice: get("gasPrice", Math.floor(Math.random() * 1e11).toString()), // ~wei
gasUsed: get("gasUsed", (21000 + Math.floor(Math.random() * 1e6)).toString()),
seed: get("seed", null), // curated full-seed override; null = compose from fields
};
// ---- seed -> PRNG ----
function xmur3(str) {
let h = 1779033703 ^ str.length;
for (let i = 0; i < str.length; i++) {
h = Math.imul(h ^ str.charCodeAt(i), 3432918353);
h = (h << 13) | (h >>> 19);
}
return function () {
h = Math.imul(h ^ (h >>> 16), 2246822507);
h = Math.imul(h ^ (h >>> 13), 3266489909);
return (h ^= h >>> 16) >>> 0;
};
}
function sfc32(a, b, c, d) {
return function () {
a |= 0; b |= 0; c |= 0; d |= 0;
const t = (((a + b) | 0) + d) | 0;
d = (d + 1) | 0;
a = b ^ (b >>> 9);
b = (c + (c << 3)) | 0;
c = (c << 21) | (c >>> 11);
c = (c + t) | 0;
return (t >>> 0) / 4294967296; // [0, 1)
};
}
// ---- seed composition ----
const FIELD_TAGS = {
tokenId: "tid", blockhash: "blk", txHash: "tx", minter: "min",
gasPrice: "gp", gasUsed: "gu",
};
const REQUIRED = ["tokenId", "blockhash"];
function composeSeed(extraFields) {
// required fields first, then opt-ins; de-duplicated, order preserved
const ordered = [...new Set([...REQUIRED, ...extraFields])];
return ordered
.map((f) => {
if (!(f in FIELD_TAGS)) throw new Error("$art: unknown seed field '" + f + "'");
return FIELD_TAGS[f] + ":" + String(mint[f]).toLowerCase();
})
.join("|");
}
// Mutable generator so re-seeding resets the stream (p5 semantics).
let rand;
let currentSeed;
function applySeed(seedString) {
currentSeed = seedString;
const next = xmur3(seedString);
rand = sfc32(next(), next(), next(), next());
for (let i = 0; i < 15; i++) rand(); // warm-up
}
// ---- p5-style seeding ----
// Curated full-seed override from the `seed` URL param (null when absent).
const seedOverride = mint.seed;
// Seed from chosen mint fields (tokenId + blockhash always included).
// If a `seed` URL param is present it is the complete seed verbatim and
// wins over the field composition (curated drops). Resets the random stream.
// Returns the seed string used.
function seedFrom(...extraFields) {
const composed = composeSeed(extraFields); // validates fields, may throw
applySeed(seedOverride !== null ? seedOverride : composed);
return currentSeed;
}
// Default seed on load: the two required fields.
seedFrom();
// ---- random helpers (draw from the current stream) ----
// random() -> [0,1) | random(max) -> [0,max) | random(min,max) -> [min,max)
function random(...args) {
let min = 0, max = 1;
if (args.length === 1) max = args[0];
else if (args.length >= 2) { min = args[0]; max = args[1]; }
return min + (max - min) * rand();
}
// Inclusive of both ends. randomInt(max) -> [0,max] | randomInt(min,max) -> [min,max]
function randomInt(...args) {
let min = 0, max = 1;
if (args.length === 1) max = args[0];
else if (args.length >= 2) { min = args[0]; max = args[1]; }
return Math.floor(random(min, max + 1));
}
function randomBool(p = 0.5) {
return random() < p;
}
function randomElement(array) {
if (!array || array.length === 0) return undefined;
return array[randomInt(0, array.length - 1)];
}
// ---- snapshot + traits (hidden DOM, survives in the HTML snapshot) ----
// Write a hidden, non-rendered JSON element (idempotent by id).
function writeHiddenJSON(id, data) {
let el = document.getElementById(id);
if (!el) {
el = document.createElement("script");
el.type = "application/json"; // not executed, not rendered, survives in HTML
el.id = id;
(document.body || document.documentElement).appendChild(el);
}
el.textContent = JSON.stringify(data);
return el;
}
let currentTraits = null;
// { Palette: "Sunset", Layers: 5 } -> OpenSea [{trait_type, value}, ...]
// Emitted into a hidden #art-traits element for the snapshot HTML.
function setTraits(traits) {
if (!traits || typeof traits !== "object" || Array.isArray(traits))
throw new Error("$art.setTraits: expects a plain object of { name: value }");
currentTraits = Object.keys(traits).map((k) => ({ trait_type: k, value: traits[k] }));
writeHiddenJSON("art-traits", currentTraits);
return currentTraits;
}
// Capture environment detection. Cloudflare Browser Rendering is configured to
// send this sentinel user agent; live collector views never match. Keep in sync
// with the snapshot infra's userAgent setting.
const CAPTURE_UA = "tl-gen-art";
const captureMode =
typeof navigator !== "undefined" &&
new RegExp(CAPTURE_UA).test(navigator.userAgent || "");
// Signal that the canvas is fully drawn: append a hidden marker so Cloudflare's
// Browser Rendering API can waitForSelector("#art-snapshot-ready"). Idempotent.
//
// For animated pieces, pass a freeze callback (e.g. () => noLoop(), or one that
// cancels your rAF loop). It runs ONLY under the capture user agent, so the
// screenshot captures the frame live at call time while collectors keep their
// animation. Reproducibility of that frame is the artist's responsibility.
function snapshot(onCapture) {
if (captureMode && typeof onCapture === "function") onCapture();
let el = document.getElementById("art-snapshot-ready");
if (!el) {
el = document.createElement("div");
el.id = "art-snapshot-ready";
el.style.display = "none";
(document.body || document.documentElement).appendChild(el);
}
return el;
}
return {
mint,
seedFrom,
getSeed: () => currentSeed,
random,
randomInt,
randomBool,
randomElement,
setTraits,
getTraits: () => currentTraits,
snapshot,
captureMode,
};
})();
window.$art = $art;
</script>
<!-- 3. Cinética engine (bundled ES modules, single scope) -->
<script>
const CinéticaEngine = (function(){
/* ===== engine/lib/prng.js ===== */
// Deterministic pseudo-random number generation.
//
// The whole collection is reproducible from a single seed: same seed -> same
// artwork, forever. We use the well-known, fast, public-domain sfc32 generator,
// seeded by hashing an arbitrary string with xmur3. Both are standard ~15-line
// snippets used widely in generative-art / Art Blocks scripts.
// xmur3: string -> a function that emits successive 32-bit hash values.
// Used to derive the four 32-bit seeds sfc32 needs from any input string.
function xmur3(str) {
let h = 1779033703 ^ str.length
for (let i = 0; i < str.length; i++) {
h = Math.imul(h ^ str.charCodeAt(i), 3432918353)
h = (h << 13) | (h >>> 19)
}
return function () {
h = Math.imul(h ^ (h >>> 16), 2246822507)
h = Math.imul(h ^ (h >>> 13), 3266489909)
h ^= h >>> 16
return h >>> 0
}
}
// Derive four 32-bit unsigned integer seeds from a string.
function seedFromString(str) {
const next = xmur3(String(str))
return [next(), next(), next(), next()]
}
// sfc32 (Simple Fast Counter): four 32-bit seeds -> a () => float in [0, 1).
function sfc32(a, b, c, d) {
a >>>= 0
b >>>= 0
c >>>= 0
d >>>= 0
return function () {
a |= 0
b |= 0
c |= 0
d |= 0
const t = (((a + b) | 0) + d) | 0
d = (d + 1) | 0
a = b ^ (b >>> 9)
b = (c + (c << 3)) | 0
c = (c << 21) | (c >>> 11)
c = (c + t) | 0
return (t >>> 0) / 4294967296
}
}
/* ===== engine/lib/hash.js ===== */
// Hash normalization.
//
// Mint platforms inject a seed in different shapes: Art Blocks provides a
// `tokenData.hash` like "0x7c9f..."; other platforms may pass a plain string or
// a VRF-derived value. We normalize any of them into a single canonical seed
// string that feeds the PRNG. Normalization must be stable: the same logical
// input always yields the same canonical string, so the artwork never changes.
function normalizeHash(input) {
if (input === null || input === undefined) {
throw new Error('normalizeHash: seed is required')
}
const s = String(input).trim().toLowerCase()
if (s.length === 0) {
throw new Error('normalizeHash: seed must not be empty')
}
return s
}
/* ===== engine/lib/rng-stream.js ===== */
// The RNG stream — the single source of all randomness for one artwork.
//
// `makeRng(hash)` builds one sfc32 generator from the normalized hash and wraps
// it with convenience helpers. Every decision in the engine (traits, palette,
// composition, motion) draws from this one ordered stream, so the entire piece
// is reproducible from its hash. IMPORTANT for determinism: draws must always
// happen in the same order across runs — never branch the draw order on
// non-deterministic input.
function makeRng(hashInput) {
const seed = normalizeHash(hashInput)
const rand = sfc32(...seedFromString(seed))
const api = {
// Raw float in [0, 1).
next() {
return rand()
},
// Float in [a, b).
range(a, b) {
return a + rand() * (b - a)
},
// Integer in [a, b] inclusive.
int(a, b) {
return a + Math.floor(rand() * (b - a + 1))
},
// Uniform pick from an array.
pick(arr) {
return arr[Math.floor(rand() * arr.length)]
},
// Weighted pick. `table` is an array of [value, weight] pairs.
weighted(table) {
let total = 0
for (const [, w] of table) total += w
let r = rand() * total
for (const [value, w] of table) {
r -= w
if (r < 0) return value
}
return table[table.length - 1][0]
},
// True with probability p (default 0.5).
bool(p = 0.5) {
return rand() < p
},
// Alias for bool, reads naturally as a rarity gate: rng.chance(0.05).
chance(p) {
return rand() < p
},
}
return api
}
/* ===== engine/lib/color.js ===== */
// Small pure color helpers shared by the renderers. Kept dependency-free so the
// on-chain sketch stays self-contained.
function hexToRgb(hex) {
const h = hex.replace('#', '')
return {
r: parseInt(h.slice(0, 2), 16),
g: parseInt(h.slice(2, 4), 16),
b: parseInt(h.slice(4, 6), 16),
}
}
/* ===== engine/lib/palettes.js ===== */
// The Venezuelan Heritage Palette Family.
//
// Each palette is rooted in a real Venezuelan place, creature, tradition, or
// natural feature. The flag tricolor is ONE palette among many — the collection
// salutes the country without becoming a flag poster. Palette is a headline
// trait; `weight` controls how often each appears (iconic ones common, the
// more specialized studies rarer, so a palette becomes something to collect).
//
// `colors` are the blade/line hues. `bg` is the ground the kinetic structure
// sits on — it matters as much as the colors, because Cruz-Diez's optical
// effect comes from how narrow bands interact with each other and the field.
// ELEGANCE RULE (the palette family's reason): every palette is a chromatic
// homage — to a kinetic master or to Venezuela itself — and ALL obey one rule so
// the collection reads as a single refined body of work:
// • a DEEP, slightly-tinted ground (never flat black) for richness + depth
// • a restrained set of hues with a clear VALUE LADDER (lights / mids / darks)
// so every piece has dimension, not just flat poster color
// • saturated primaries pulled a touch toward painterly (silk, pigment, dusk)
// rather than screen-RGB — gallery-grade harmony, and it lets the holographic
// lenticular shift read as luminous rather than garish.
// Tricolor (the flag) is the hero anchor; the rest are a TIGHT curated family.
// Curated to 6 — cohesion (Tricolor dominant = unmistakably Venezuelan) plus the
// variety worth keeping (the master's own colors, a crisp B&W op study, the
// magenta bloom, a cool range, modernist energy). Every palette earns its place.
const PALETTES = [
{
key: 'tricolor',
name: 'Tricolor',
// THE HERO / ANCHOR — Venezuela's flag refined into silk. Weighted highest so
// the collection reads unmistakably Venezuelan. amber-gold / royal cobalt /
// carmine / cream, on midnight blue + near-black for depth.
weight: 30,
bg: '#070a16',
colors: ['#e8b73a', '#1442a6', '#c0303a', '#f0ead6', '#0e1b3c', '#121214'],
},
{
key: 'cruzdiez',
name: 'Cruz-Díez',
// The master's own vocabulary (red+green pair, yellow/red/blue triad, black +
// white as essential elements), pulled toward painterly pigment. The homage,
// made literal in color.
weight: 16,
bg: '#0a0a0b',
colors: ['#d23a2e', '#138a5a', '#1f5fae', '#e8b43c', '#efece2', '#16161a'],
},
{
key: 'tinta',
name: 'Tinta',
// Pure black & white op-art study (ink). The most austere, gallery-severe
// colorway — Soto's monochrome vibration / Cruz-Diez's black-white-as-essential.
// Crisp value ladder of greys for depth; reads as the "fine print" of the set.
weight: 14,
bg: '#0a0a0a',
colors: ['#f7f7f4', '#0d0d0d', '#cfcfca', '#3a3a3a', '#9a9a96', '#1c1c1c'],
},
{
key: 'caribe',
name: 'Caribe',
// Caribbean coast — refined teal/sea with a coral accent. The cool range.
weight: 14,
bg: '#04181f',
colors: ['#2aa7b3', '#0e6a7d', '#e87a63', '#ecdcc0', '#0a3a45', '#86d8cf'],
},
{
key: 'orquidea',
name: 'Orquídea',
// Flor de mayo — magenta/lilac/cream over deep plum. The bloom.
weight: 14,
bg: '#140a13',
colors: ['#c0457f', '#9069ac', '#e6c8d8', '#f1ebe2', '#5e3760', '#2a1426'],
},
{
key: 'canaima',
name: 'Canaima',
// Amazon / jungle / Salto Ángel — deep greens & blacks. Tannin-dark river,
// canopy emerald, light-through-leaves moss, waterfall mist/cream, a warm
// jasper-ochre of the tepui rock face. The deep-nature register of the set.
weight: 12,
bg: '#050b07',
colors: ['#0f5132', '#3f8f4e', '#cfe0c4', '#b07a2e', '#0a2a1a', '#020503'],
},
]
const BY_KEY = new Map(PALETTES.map((p) => [p.key, p]))
function getPalette(key) {
const p = BY_KEY.get(key)
if (!p) throw new Error(`getPalette: unknown palette "${key}"`)
return p
}
// Weighted deterministic pick from the family, driven by the artwork's rng.
function pickPalette(rng) {
const table = PALETTES.map((p) => [p.key, p.weight])
return getPalette(rng.weighted(table))
}
/* ===== engine/lib/noise.js ===== */
// Fractal noise (fBm) — the math behind the collection's signature warp.
//
// A small, dependency-free 1D value-noise + fractional Brownian motion. Pure and
// deterministic: noise1(x) and fbm1(x, ...) always return the same value for the
// same input, so the warped artwork is reproducible from its hash. Smooth
// (smoothstep-interpolated) so the warp flows without kinks.
// hash a number -> pseudo-random value in [0,1), stable across machines.
function hash1(n) {
const s = Math.sin(n * 127.1) * 43758.5453
return s - Math.floor(s)
}
// smooth 1D value noise in [0,1).
function noise1(x) {
const xi = Math.floor(x)
const xf = x - xi
const u = xf * xf * (3 - 2 * xf) // smoothstep
return hash1(xi) * (1 - u) + hash1(xi + 1) * u
}
// fractional Brownian motion: sum of `octaves` noise layers at doubling
// frequency and halving amplitude. Returns ~[0,1).
function fbm1(x, octaves = 5) {
let v = 0
let amp = 0.5
let freq = 1
let norm = 0
for (let o = 0; o < octaves; o++) {
v += amp * noise1(x * freq)
norm += amp
freq *= 2
amp *= 0.5
}
return v / norm
}
/* ===== engine/lib/traits.js ===== */
// Trait derivation — the hash becomes the artwork's DNA.
//
// deriveTraits(hash) builds ONE rng stream and draws the HEADLINE traits in a
// FIXED ORDER (order is part of the contract — append new traits at the end,
// never insert in the middle). These headline traits drive the composition and
// are what the platform reads for rarity (see features.js). Finer per-cell
// decisions (which master fills each cell, its sub-type, density, etc.) are
// derived deterministically inside the renderer from per-cell sub-seeds, so the
// whole piece is still a pure function of the hash.
//
// Identity: an homage to Venezuelan kinetic art (Cruz-Diez / Soto / Gego), with
// JN Silva's sacred-geometry composition as the signature. Hybrid-dominant.
// MODE = which master (or hybrid). Hybrid is the STAR (most common); pure
// single-master homages are the rarer, special tier.
const MODE_WEIGHTS = [
['hybrid', 58], // the star — masters in dialogue across the cells
['cruzdiez', 18],
['soto', 14],
['gego', 10],
]
// GEOMETRY ENGINE = the JN Silva compositional signature (quiet background
// variety — how the canvas is divided).
const ENGINE_WEIGHTS = [
['medium', 40], // golden cells (nested), depth 4
['deep', 26], // deeper golden nesting
['mandala', 18], // 4-quadrant mirror symmetry
['single', 16], // single field (no subdivision)
]
// FOCAL EVENT (per piece; many get none). Radial-fill events (singularity,
// interference, spiral) are GATED to nested compositions at render time so they
// never become a full-canvas sunburst — see compose.js.
const EVENT_WEIGHTS = [
['none', 26],
['singularity', 14],
['interference', 10],
['rings', 12],
['squares', 12],
['implosion', 12],
['spiral', 8],
['moire', 6],
]
// Events that read badly when they fill a canvas-dominating cell.
const RADIAL_FILL_EVENTS = ['singularity', 'interference', 'spiral']
// What a radial-fill event downgrades to when it can't nest safely.
const SAFE_EVENT_WEIGHTS = [
['none', 30],
['rings', 22],
['squares', 22],
['implosion', 16],
['moire', 10],
]
// Soto color treatment (only meaningful for Soto cells): authentic monochrome
// field (color reserved for floating element) vs full color.
const SOTO_COLOR_WEIGHTS = [
['color', 64],
['mono', 24],
['trait', 12], // mixed per cell
]
function deriveTraits(hash) {
const rng = makeRng(hash)
// --- FIXED DRAW ORDER (do not reorder) ---
const mode = rng.weighted(MODE_WEIGHTS)
const engine = rng.weighted(ENGINE_WEIGHTS)
const paletteObj = pickPalette(rng)
// headline event (gated later in the renderer once cell sizes are known)
const event = rng.weighted(EVENT_WEIGHTS)
// global continuous render params (continuous = key to uniqueness)
const iridescence = Math.round(rng.range(0.35, 0.7) * 1000) / 1000
const geo = Math.round(rng.range(0.55, 0.9) * 1000) / 1000 // geometry strength
const phase = rng.range(0, 1) // global color-sequence phase
const sweepSpeed = Math.round(rng.range(3.4, 5.6) * 100) / 100 // lenticular tempo
const sotoColor = rng.weighted(SOTO_COLOR_WEIGHTS)
return {
mode,
engine,
palette: paletteObj.key,
event,
iridescence,
geo,
phase,
sweepSpeed,
sotoColor,
}
}
// Re-pick a safe event when a radial-fill event would dominate the canvas. Pure
// + deterministic from the same hash (uses a distinct sub-stream).
function safeEvent(hash) {
return makeRng(hash + ':event2').weighted(SAFE_EVENT_WEIGHTS)
}
/* ===== engine/lib/features.js ===== */
// Platform features / rarity output.
//
// Mint platforms (Art Blocks, Transient Labs, fxhash) read a `features` object
// to compute and display trait rarity. Their contract: every value must be a
// STRING. This maps the headline traits into the human-readable labels collectors
// see ("Master: Hybrid", "Palette: Tricolor", "Composition: Mandala").
const MODE_LABEL = {
hybrid: 'Hybrid',
cruzdiez: 'Cruz-Díez',
soto: 'Soto',
gego: 'Gego',
}
const ENGINE_LABEL = {
medium: 'Golden Cells',
deep: 'Deep Nesting',
mandala: 'Mandala',
single: 'Single Field',
}
const EVENT_LABEL = {
none: 'None',
singularity: 'Singularity',
interference: 'Interference',
rings: 'Concentric Rings',
spiral: 'Spiral',
squares: 'Nested Squares',
implosion: 'Implosion',
moire: 'Moiré',
}
// Bucket the continuous lenticular tempo into a coarse, collectible label.
function tempoLabel(speed) {
if (speed < 4.0) return 'Calm'
if (speed < 4.9) return 'Living'
return 'Vivid'
}
function buildFeatures(traits) {
return {
Master: MODE_LABEL[traits.mode] || traits.mode,
Palette: getPalette(traits.palette).name,
Composition: ENGINE_LABEL[traits.engine] || traits.engine,
Event: EVENT_LABEL[traits.event] || traits.event,
Tempo: tempoLabel(traits.sweepSpeed),
Iridescence: traits.iridescence < 0.5 ? 'Subtle' : 'Luminous',
}
}
/* ===== engine/compose.js ===== */
// engine/compose.js — the FULL Cinetica composition system, framework-free.
//
// SINGLE SOURCE OF TRUTH ported from the approved Composition Studio
// (gallery/compose.html, tag studio-v1). Imported by engine/render.js.
// Given a p5 instance, the piece traits, its palette, the hash, and time t, it
// renders the complete artwork: geometry engine -> cells -> per-cell master
// (Cruz-Diez/Soto/Gego/hybrid) -> holographic lenticular + sheen -> gated event.
// Pure & deterministic: same hash + same t -> identical frame.
const PHI = 1.6180339887, INVPHI = 0.6180339887
const FIB = [1,1,2,3,5,8,13,21,34]
// The golden "power points": where the phi-lines of a cell cross. Picking the
// radial-event epicenter from these (per-hash) gives variety while keeping the
// placement sacred-geometry-justified (never an arbitrary spot). Includes the
// 4 corners-of-phi + the center.
function goldenNode(w, h, rng){
const xs=[w*INVPHI, w*(1-INVPHI), w*0.5]
const ys=[h*INVPHI, h*(1-INVPHI), h*0.5]
// anchor on a golden power point...
let x = rng.weighted([[xs[0],5],[xs[1],5],[xs[2],2]])
let y = rng.weighted([[ys[0],5],[ys[1],5],[ys[2],2]])
// ...then continuous jitter around it so the epicenter is effectively
// never identical between pieces (kills the "only ~9 positions" bug) while
// staying near the sacred-geometry anchor.
x += (rng.next()-0.5)*w*0.18
y += (rng.next()-0.5)*h*0.18
return {cx:x, cy:y}
}
// Pick the focal cell. For RADIAL events (singularity/interference/spiral/rings/
// squares) prefer a cell that does NOT dominate the canvas (<=45%), nearest the
// golden node among those — so the event has a real nested home and the gate
// rarely needs to downgrade it. Falls back to nearest-node if none qualify.
function pickFocal(cells, W, H, preferSmall){
const gx=W*INVPHI, gy=H*INVPHI
const near=(c)=>Math.hypot(c.x+c.w/2-gx, c.y+c.h/2-gy)
let pool=cells.map((c,idx)=>({c,idx}))
if(preferSmall){
const small=pool.filter(({c})=>c.w*c.h <= W*H*0.45)
if(small.length) pool=small
}
let best=1e9, focal=pool.length?pool[0].idx:0
pool.forEach(({c,idx})=>{ const d=near(c); if(d<best){best=d;focal=idx} })
return focal
}
function rgb2hsl({r,g,b}){r/=255;g/=255;b/=255;const mx=Math.max(r,g,b),mn=Math.min(r,g,b);let h,s,l=(mx+mn)/2;if(mx===mn){h=s=0;}else{const d=mx-mn;s=l>0.5?d/(2-mx-mn):d/(mx+mn);switch(mx){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;default:h=(r-g)/d+4;}h/=6;}return{h:h*360,s,l};}
function hsl2rgb(h,s,l){ h=(((h%360)+360)%360)/360;s=Math.max(0,Math.min(1,s));l=Math.max(0,Math.min(1,l));
if(s===0){const v=Math.round(l*255);return[v,v,v];}
const q=l<0.5?l*(1+s):l+s-l*s,p=2*l-q,f=(t)=>{if(t<0)t+=1;if(t>1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*(2/3-t)*6;return p;};
return[Math.round(f(h+1/3)*255),Math.round(f(h)*255),Math.round(f(h-1/3)*255)]; }
function goldenCells(x,y,w,h,depth,rng,geo){
if(depth<=0 || w<24 || h<24) return [{x,y,w,h,depth}]
// probability of splitting scales with geometry strength
if(rng.next() > 0.45 + geo*0.5) return [{x,y,w,h,depth}]
const horizontalCut = (w>=h) // cut the longer axis -> golden rectangles
const ratio = rng.bool() ? INVPHI : 1-INVPHI
const cells=[]
if(horizontalCut){
const wl=w*ratio
cells.push(...goldenCells(x,y,wl,h,depth-1,rng,geo))
cells.push(...goldenCells(x+wl,y,w-wl,h,depth-1,rng,geo))
} else {
const ht=h*ratio
cells.push(...goldenCells(x,y,w,ht,depth-1,rng,geo))
cells.push(...goldenCells(x,y+ht,w,h-ht,depth-1,rng,geo))
}
return cells
}
// MANDALA (mirror): build golden cells in one quadrant, then mirror to all
// four — radial bilateral symmetry, the most overtly 'sacred' layout.
function mandalaCells(W,H,rng,geo){
const hw=W/2, hh=H/2
const q=goldenCells(0,0,hw,hh,3,rng,geo)
const out=[]
q.forEach(c=>{
out.push({x:c.x, y:c.y, w:c.w, h:c.h}) // TL
out.push({x:W-c.x-c.w, y:c.y, w:c.w, h:c.h}) // TR (mirror x)
out.push({x:c.x, y:H-c.y-c.h, w:c.w, h:c.h}) // BL (mirror y)
out.push({x:W-c.x-c.w, y:H-c.y-c.h, w:c.w, h:c.h}) // BR (mirror xy)
})
return out
}
// Fibonacci-spaced band edges across length L: band widths follow a slice of
// the Fibonacci sequence (the rhythm itself is sacred-geometric), repeated.
function fibEdges(L, baseCount, rng, geo){
// geo=0 -> near-uniform; geo=1 -> strong fibonacci rhythm
const start = Math.floor(rng.next()*3)
const pattern = FIB.slice(start, start+4) // e.g. [2,3,5,8]
const patSum = pattern.reduce((a,c)=>a+c,0)
const uniformW = L/baseCount
const edges=[0]; let x=0, idx=0
const cycleW = uniformW * 4 // a full fib cycle ~ 4 uniform bands wide
while(x < L){
const fibW = (pattern[idx%pattern.length]/patSum) * cycleW
const w = uniformW*(1-geo) + fibW*geo
x += Math.max(2, w); edges.push(Math.min(L,x)); idx++
}
return edges
}
function renderCell(p, c, o){
const {horizontal,event}=o
p.push(); p.translate(c.x,c.y)
// CLIP to this cell: radial events overscan past the cell; clipping stops
// them bleeding into neighbors (which is what made neighbor grid-lines
// appear to cross the event). drawingContext is the raw 2D ctx; we MUST
// restore() it on the single exit path below so the clip never leaks.
const dc=p.drawingContext, clipped = event!=='none'
if(clipped){ dc.save(); dc.beginPath(); dc.rect(0,0,c.w,c.h); dc.clip() }
// FOCAL EVENTS are STRUCTURAL — they change how the cell's own blades are
// generated, never drawn over the top.
if(event==='implosion') drawImplosion(p, c, o)
else if(event==='singularity') drawSingularity(p, c, o, false)
else if(event==='interference') drawSingularity(p, c, o, true)
else if(event==='rings' || event==='squares'){
// EMBEDDED medallion: rings/squares never dominate. Draw the cell's own
// kinetic blade field first, then a small rings/squares medallion within
// it (sized to a fraction of the cell) so it reads as an accent that
// belongs to the piece, not a standalone target/box.
drawBands(p, c, o, {})
const med = Math.min(c.w,c.h) * (0.32 + makeRng(o.cellSeed+':med').next()*0.18) // 32-50%
const mo = {...o, medallion: med}
if(event==='rings') drawRings(p, c, mo); else drawSquares(p, c, mo)
}
else if(event==='spiral') drawSpiral(p, c, o)
else {
drawBands(p, c, o, {})
if(event==='moire'){
// SOTO homage: a second, slightly-offset blade field -> optical moiré.
drawBands(p, c, {...o, phase:o.phase+0.5, horizontal:!horizontal},
{alpha: 150, freqMul: 1.07})
}
}
if(clipped) dc.restore()
p.pop()
}
// Standard band fill for a cell (vertical or horizontal), holographic color.
function drawBands(p, c, o, opt={}){
const {baseHues,seqLen,phase,irid,t,sweepSpeed,horizontal}=o
const negative=opt.negative, alpha=opt.alpha??255, freqMul=opt.freqMul??1
const L = horizontal ? c.h : c.w
const baseCount = Math.max(6, Math.round(L/(6+ (o.cellDensity||10))) * freqMul)
const edges = fibEdges(L, baseCount, makeRng(o.cellSeed+':bands'), o.geo)
const cycle = baseHues.length
for(let b=0;b<edges.length-1;b++){
const a0=edges[b], a1=edges[b+1]
const slot=Math.floor(b + phase*seqLen)
let A=baseHues[((slot%cycle)+cycle)%cycle], B=baseHues[((slot+1)%cycle+cycle)%cycle]
if(negative){ // invert lightness + rotate hue 180 -> the "void" cell
A={h:A.h+180,s:A.s,l:1-A.l}; B={h:B.h+180,s:B.s,l:1-B.l}
}
const [ar,ag,ab]=hsl2rgb(A.h,A.s,A.l), [br,bg,bb]=hsl2rgb(B.h,B.s,B.l)
const along=(a0/Math.max(1,L))
const wave=Math.sin(t*sweepSpeed*0.16 + along*3.2 + phase*6.28)*0.5+0.5
const k=wave*wave*(3-2*wave); const m=Math.max(0,Math.min(1,0.5+(k-0.5)*(0.6+1.4*irid)))
p.fill(Math.round(ar*(1-m)+br*m),Math.round(ag*(1-m)+bg*m),Math.round(ab*(1-m)+bb*m), alpha)
if(horizontal){ p.rect(0,a0,c.w,a1-a0) } else { p.rect(a0,0,a1-a0,c.h) }
const r=Math.max(0.5,(a1-a0)*0.10)
p.fill(0,0,0,55*alpha/255); if(horizontal)p.rect(0,a0,c.w,r); else p.rect(a0,0,r,c.h)
p.fill(255,255,255,38*alpha/255); if(horizontal)p.rect(0,a0+r,c.w,r*0.6); else p.rect(a0+r,0,r*0.6,c.h)
}
}
// EVENT: recursive implosion — the cell subdivides (golden) into ever-smaller
// sub-cells toward a golden node, each filled with blades. A fractal vortex of
// escalating density, built entirely from cells+blades.
function drawImplosion(p, c, o){
;(function rec(x,y,w,h,d,idx){
if(d<=0 || w<6 || h<6){
const sub={x,y,w,h}; const so={...o, horizontal:(d%2===0), phase:o.phase+idx*0.12, cellSeed:o.cellSeed+':i'+idx, cellDensity:4+d}
p.push(); p.translate(x,y); drawBands(p,{x:0,y:0,w,h},so,{}); p.pop(); return
}
// keep one golden sub-rect, recurse into the other (the vortex)
const cutW = w>=h
const keep = INVPHI
if(cutW){ const wl=w*keep
const sub={x,y,w:wl,h}; const so={...o,horizontal:(d%2===0),phase:o.phase+d*0.15,cellSeed:o.cellSeed+':k'+d,cellDensity:3+d}
p.push(); p.translate(x,y); drawBands(p,{x:0,y:0,w:wl,h},so,{}); p.pop()
rec(x+wl,y,w-wl,h,d-1,idx+1)
} else { const ht=h*keep
const so={...o,horizontal:(d%2===0),phase:o.phase+d*0.15,cellSeed:o.cellSeed+':k'+d,cellDensity:3+d}
p.push(); p.translate(x,y); drawBands(p,{x:0,y:0,w,h:ht},so,{}); p.pop()
rec(x,y+ht,w,h-ht,d-1,idx+1)
}
})(0,0,c.w,c.h,7,0)
}
// EVENT: orientation singularity — blades fan radially from a golden node.
// Filled wedges (not stroked lines). interference=true overlays a second
// counter-rotating fan -> radial moiré buzz (a kinetic Soto-flavored burst).
function drawSingularity(p, c, o, interference){
const sr=makeRng(o.cellSeed+':sing') // per-piece structural entropy
const {cx,cy}=goldenNode(c.w,c.h,makeRng(o.cellSeed+':node'))
// Per-piece structural params (this is what makes every singularity unique,
// not one of ~9 fixed looks): ray count, color cadence, rotation dir/speed,
// color start, and wedge-width rhythm.
const rays = 48 + Math.floor(sr.next()*200) // 48..248
const cadence = 1 + Math.floor(sr.next()*4) // colors step every 1-4 rays
const colStart = Math.floor(sr.next()*4)
const rotDir = sr.bool()?1:-1
const rotSpd = 0.025 + sr.next()*0.06
const pulse = sr.next()<0.45 ? (1+Math.floor(sr.next()*4)) : 0 // 0 = even wedges, else fib-ish pulse
const fan=(rot,alpha)=>{
const {baseHues,seqLen,phase,irid,t,sweepSpeed}=o
const R=Math.hypot(Math.max(cx,c.w-cx),Math.max(cy,c.h-cy))*1.15
const cycle=baseHues.length
p.noStroke()
for(let i=0;i<rays;i++){
// optional uneven wedge widths (a slow sinusoidal pulse around the dial)
const wmul = pulse? (0.6 + 0.5*(0.5+0.5*Math.sin(i/rays*Math.PI*2*pulse))) : 1
const a0=(i/rays)*Math.PI*2+rot, a1=((i+wmul)/rays)*Math.PI*2+rot
const slot=Math.floor(i/cadence + colStart + phase*seqLen)
const A=baseHues[((slot%cycle)+cycle)%cycle]
const wave=Math.sin(t*sweepSpeed*0.16+i*0.3+phase*6.28)*0.5+0.5
const [cr,cg,cb]=hsl2rgb(A.h,A.s,Math.min(1,A.l+wave*0.18*irid))
p.fill(cr,cg,cb,alpha)
p.triangle(cx,cy,cx+Math.cos(a0)*R,cy+Math.sin(a0)*R,cx+Math.cos(a1)*R,cy+Math.sin(a1)*R)
p.fill(0,0,0,40*alpha/255)
p.triangle(cx,cy,cx+Math.cos(a0)*R,cy+Math.sin(a0)*R,cx+Math.cos(a0+0.004)*R,cy+Math.sin(a0+0.004)*R)
}
}
fan(o.t*rotSpd*rotDir, 255)
if(interference) fan(-o.t*rotSpd*rotDir + 0.013, 140) // counter-rotating -> radial moiré
}
// EVENT: concentric rings — color bands radiating from a golden node (target).
// MOTION: the color sequence flows continuously INWARD over time (each ring
// takes the next color), so the target appears to pulse toward the center.
// Drawn largest-first as filled circles; each smaller circle covers the
// previous, leaving a ring. Continuous flow = perfectly smooth.
function drawRings(p, c, o){
const {baseHues,seqLen,phase,irid,t}=o
const {cx,cy}=goldenNode(c.w,c.h,makeRng(o.cellSeed+':node'))
// EMBEDDED: when o.medallion is set, the target is a small disc of that
// radius centered on the golden node (drawn over the cell's blade field),
// not the whole cell. Otherwise fill the cell (legacy/full).
const sr=makeRng(o.cellSeed+':rings') // per-piece entropy
const R = o.medallion ? o.medallion/2 : Math.hypot(Math.max(cx,c.w-cx),Math.max(cy,c.h-cy))*1.2
const cycle=baseHues.length; p.noStroke()
const NR = 6 + Math.floor(sr.next()*16) // 6..22 rings (per-piece)
const cadence = 1 + Math.floor(sr.next()*3) // color steps every 1-3 rings
const colStart = Math.floor(sr.next()*4)
const dir = sr.bool()?1:-1 // flow in or out
const ringW=R/NR
const g = t*0.5*dir, gi=Math.floor(g), gf=g-gi
if(o.medallion){ // clip to the medallion disc so it has a crisp circular edge
const dc=p.drawingContext; dc.save(); dc.beginPath(); dc.arc(cx,cy,R,0,Math.PI*2); dc.clip()
}
for(let i=0;i<=NR+1;i++){
const rr = R - (i - gf)*ringW
if(rr<=0 || rr>R+ringW) continue
const band=i+gi; const slot=Math.floor(band/cadence + colStart + phase*seqLen)
const A=baseHues[((slot%cycle)+cycle)%cycle]
const lift=(0.5+0.5*Math.sin(band*0.7 + phase*6.28))*0.16*irid
const [cr,cg,cb]=hsl2rgb(A.h,A.s,Math.min(1,A.l+lift))
p.fill(cr,cg,cb); p.circle(cx,cy, rr*2)
p.fill(0,0,0,45); p.circle(cx,cy, (rr-Math.max(0.6,ringW*0.12))*2)
}
if(o.medallion){ p.drawingContext.restore()
// crisp rim so the medallion reads as an inset element
p.noFill(); p.stroke(0,0,0,120); p.strokeWeight(2); p.circle(cx,cy,R*2)
p.stroke(255,255,255,50); p.strokeWeight(1); p.circle(cx,cy,R*2-2); p.noStroke()
}
}
// EVENT: spiral blade-flow — wedges whose angular width + hue progress along a
// golden spiral (a kinetic swirl), built from filled wedges rotating outward.
function drawSpiral(p, c, o){
const {baseHues,seqLen,phase,irid,t,sweepSpeed}=o
const sr=makeRng(o.cellSeed+':spiral') // per-piece entropy
const {cx,cy}=goldenNode(c.w,c.h,makeRng(o.cellSeed+':node'))
const R=Math.hypot(Math.max(cx,c.w-cx),Math.max(cy,c.h-cy))*1.2
const cycle=baseHues.length; p.noStroke()
const arms=2+Math.floor(sr.next()*5) // 2..6 arms
const turns=2+sr.next()*3 // 2..5 turns
const growth=1.05+sr.next()*0.5 // spiral tightness
const steps=200
const dir=sr.bool()?1:-1
const rot=t*(0.04+sr.next()*0.05)*dir
for(let a=0;a<arms;a++){
for(let s=0;s<steps;s++){
const u=s/steps
const ang = u*Math.PI*2*turns + a*(Math.PI*2/arms) + rot
const rad = R*Math.pow(u,1/growth)
const slot=Math.floor(s*0.12 + a + phase*seqLen); const A=baseHues[((slot%cycle)+cycle)%cycle]
const wave=Math.sin(t*sweepSpeed*0.16 + s*0.1 + phase*6.28)*0.5+0.5
const [cr,cg,cb]=hsl2rgb(A.h,A.s,Math.min(1,A.l+wave*0.18*irid))
const w=Math.max(2, R*0.05*(1-u)+3)
p.fill(cr,cg,cb)
p.circle(cx+Math.cos(ang)*rad, cy+Math.sin(ang)*rad, w)
}
}
}
// EVENT: nested squares — concentric squares receding to the center (the
// light-box, Cruz-Diez ref 2). MOTION: colors flow inward over time so the
// box appears to recede/pulse. Even steps for more depth layers.
function drawSquares(p, c, o){
const {baseHues,seqLen,phase,irid,t}=o
const sr=makeRng(o.cellSeed+':squares') // per-piece entropy
const {cx,cy}=goldenNode(c.w,c.h,makeRng(o.cellSeed+':node'))
const cycle=baseHues.length; p.noStroke()
const NL=7+Math.floor(sr.next()*14) // 7..21 layers (per-piece)
const cadence=1+Math.floor(sr.next()*3)
const colStart=Math.floor(sr.next()*4)
const dir=sr.bool()?1:-1
// EMBEDDED: medallion -> a small nested-square box centered on the node,
// over the cell's blade field. Otherwise fill the cell.
const maxR = o.medallion ? o.medallion/2 : Math.max(cx,c.w-cx,cy,c.h-cy)*1.1
const step=maxR/NL
const ar = o.medallion?1:c.w/Math.max(c.w,c.h), arh = o.medallion?1:c.h/Math.max(c.w,c.h)
const g=t*0.5*dir, gi=Math.floor(g), gf=g-gi
if(o.medallion){ const dc=p.drawingContext; dc.save(); dc.beginPath()
dc.rect(cx-maxR,cy-maxR,maxR*2,maxR*2); dc.clip() }
for(let i=NL+1;i>=0;i--){
const r=(i - gf)*step; const w=r*2*ar, h=r*2*arh
if(w<=2||h<=2) continue
const band=i+gi; const slot=Math.floor(band/cadence + colStart + phase*seqLen)
const A=baseHues[((slot%cycle)+cycle)%cycle]
const lift=(0.5+0.5*Math.sin(band*0.7 + phase*6.28))*0.16*irid
const [cr,cg,cb]=hsl2rgb(A.h,A.s,Math.min(1,A.l+lift))
p.fill(cr,cg,cb); p.rect(cx-w/2, cy-h/2, w, h)
p.fill(0,0,0,40); p.rect(cx-w/2, cy-h/2, w, Math.max(1,step*0.12))
}
if(o.medallion){ p.drawingContext.restore()
p.noFill(); p.stroke(0,0,0,
HA);break;case n.ADD:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE);break;case n.REMOVE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_ALPHA);break;case n.MULTIPLY:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA);break;case n.SCREEN:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_COLOR);break;case n.EXCLUSION:e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE_MINUS_DST_COLOR,e.ONE_MINUS_SRC_COLOR,e.ONE,e.ONE);break;case n.REPLACE:e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO);break;case n.SUBTRACT:e.blendEquationSeparate(e.FUNC_REVERSE_SUBTRACT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case n.DARKEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MIN||this.blendExt.MIN_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(DARKEST) does not work in your browser in WEBGL mode.");break;case n.LIGHTEST:this.blendExt?(e.blendEquationSeparate(this.blendExt.MAX||this.blendExt.MAX_EXT,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):console.warn("blendMode(LIGHTEST) does not work in your browser in WEBGL mode.");break;default:console.error("Oops! Somehow RendererGL set curBlendMode to an unsupported mode.")}this._isErasing||(this._cachedBlendMode=this.curBlendMode)}};var s=u.default;r.default=s},{"../core/constants":272,"../core/main":283,"./p5.Texture":343,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.join":166,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.to-string":190,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],332:[function(e,t,r){"use strict";e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.hypot"),e("core-js/modules/es.string.sub"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var j=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}j.default.prototype.camera=function(){var e;this._assert3d("camera");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return j.default._validateParameters("camera",r),(e=this._renderer._curCamera).camera.apply(e,r),this},j.default.prototype.perspective=function(){var e;this._assert3d("perspective");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return j.default._validateParameters("perspective",r),(e=this._renderer._curCamera).perspective.apply(e,r),this},j.default.prototype.linePerspective=function(e){if(j.default._validateParameters("linePerspective",arguments),!(this._renderer instanceof j.default.RendererGL))throw new Error("linePerspective() must be called in WebGL mode.");if(void 0===e)return this._renderer._curCamera.useLinePerspective;this._renderer._curCamera.useLinePerspective=e},j.default.prototype.ortho=function(){var e;this._assert3d("ortho");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return j.default._validateParameters("ortho",r),(e=this._renderer._curCamera).ortho.apply(e,r),this},j.default.prototype.frustum=function(){var e;this._assert3d("frustum");for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return j.default._validateParameters("frustum",r),(e=this._renderer._curCamera).frustum.apply(e,r),this},j.default.prototype.createCamera=function(){this._assert3d("createCamera");var e=new j.default.Camera(this._renderer);return e._computeCameraDefaultSettings(),e._setDefaultCamera(),this._renderer._curCamera=e},j.default.Camera=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this._renderer=e,this.cameraType="default",this.useLinePerspective=!0,this.cameraMatrix=new j.default.Matrix,this.projMatrix=new j.default.Matrix,this.yScale=1}var e,r,o;return e=t,(r=[{key:"perspective",value:function(e,t,r,o){this.cameraType=0<arguments.length?"custom":"default",void 0===e?(e=this.defaultCameraFOV,this.cameraFOV=e):this.cameraFOV=this._renderer._pInst._toRadians(e),void 0===t&&(t=this.defaultAspectRatio),void 0===r&&(r=this.defaultCameraNear),void 0===o&&(o=this.defaultCameraFar),r<=1e-4&&(r=.01,console.log("Avoid perspective near plane values close to or below 0. Setting value to 0.01.")),o<r&&console.log("Perspective far plane value is less than near plane value. Nothing will be shown."),this.aspectRatio=t,this.cameraNear=r,this.cameraFar=o,this.projMatrix=j.default.Matrix.identity();var e=1/Math.tan(this.cameraFOV/2),n=1/(this.cameraNear-this.cameraFar);this.projMatrix.set(e/t,0,0,0,0,-e*this.yScale,0,0,0,0,(o+r)*n,-1,0,0,2*o*r*n,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix)}},{key:"ortho",value:function(e,t,r,o,n,s){var i=this.fbo||this._renderer,i=(void 0===e&&(e=-i.width/2),void 0===t&&(t=+i.width/2),void 0===r&&(r=-i.height/2),void 0===o&&(o=+i.height/2),void 0===n&&(n=0),void 0===s&&(s=Math.max(i.width,i.height)+800),this.cameraNear=n,t-e),a=o-r,l=(this.cameraFar=s)-n,u=2/i,c=2/a*this.yScale,d=-2/l,t=-(t+e)/i,e=-(o+r)/a,i=-(s+n)/l;this.projMatrix=j.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,-c,0,0,0,0,d,0,t,e,i,1),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix),this.cameraType="custom"}},{key:"frustum",value:function(e,t,r,o,n,s){void 0===e&&(e=.05*-this._renderer.width),void 0===t&&(t=.05*+this._renderer.width),void 0===r&&(r=.05*+this._renderer.height),void 0===o&&(o=.05*-this._renderer.height),void 0===n&&(n=this.defaultCameraNear),void 0===s&&(s=this.defaultCameraFar),this.cameraNear=n;var i=t-e,a=o-r,l=(this.cameraFar=s)-n,u=2*n/i,c=2*n/a*this.yScale,d=-2*s*n/l,t=(t+e)/i,e=(o+r)/a,i=-(s+n)/l;this.projMatrix=j.default.Matrix.identity(),this.projMatrix.set(u,0,0,0,0,-c,0,0,t,e,i,-1,0,0,d,0),this._isActive()&&this._renderer.uPMatrix.set(this.projMatrix),this.cameraType="custom"}},{key:"_rotateView",value:function(e,t,r,o){var n=this.centerX,s=this.centerY,i=this.centerZ,a=(n-=this.eyeX,s-=this.eyeY,i-=this.eyeZ,j.default.Matrix.identity(this._renderer._pInst)),e=(a.rotate(this._renderer._pInst._toRadians(e),t,r,o),[n*a.mat4[0]+s*a.mat4[4]+i*a.mat4[8],n*a.mat4[1]+s*a.mat4[5]+i*a.mat4[9],n*a.mat4[2]+s*a.mat4[6]+i*a.mat4[10]]),t=(e[0]+=this.eyeX,e[1]+=this.eyeY,e[2]+=this.eyeZ,this.upX*a.mat4[0]+this.upY*a.mat4[4]+this.upZ*a.mat4[8]),r=this.upX*a.mat4[1]+this.upY*a.mat4[5]+this.upZ*a.mat4[9],o=this.upX*a.mat4[2]+this.upY*a.mat4[6]+this.upZ*a.mat4[10];this.camera(this.eyeX,this.eyeY,this.eyeZ,e[0],e[1],e[2],t,r,o)}},{key:"roll",value:function(e){var t=this._getLocalAxes(),e=j.default.Quat.fromAxisAngle(this._renderer._pInst._toRadians(e),t.z[0],t.z[1],t.z[2]).rotateVector(new j.default.Vector(this.upX,this.upY,this.upZ));this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,e.x,e.y,e.z)}},{key:"pan",value:function(e){var t=this._getLocalAxes();this._rotateView(e,t.y[0],t.y[1],t.y[2])}},{key:"tilt",value:function(e){var t=this._getLocalAxes();this._rotateView(e,t.x[0],t.x[1],t.x[2])}},{key:"lookAt",value:function(e,t,r){this.camera(this.eyeX,this.eyeY,this.eyeZ,e,t,r,this.upX,this.upY,this.upZ)}},{key:"camera",value:function(e,t,r,o,n,s,i,a,l){void 0===e&&(e=this.defaultEyeX,t=this.defaultEyeY,r=this.defaultEyeZ,o=e,n=t,a=1,l=i=s=0),this.eyeX=e,this.eyeY=t,this.eyeZ=r,void 0!==o&&(this.centerX=o,this.centerY=n,this.centerZ=s),void 0!==i&&(this.upX=i,this.upY=a,this.upZ=l);o=this._getLocalAxes(),this.cameraMatrix.set(o.x[0],o.y[0],o.z[0],0,o.x[1],o.y[1],o.z[1],0,o.x[2],o.y[2],o.z[2],0,0,0,0,1),n=-e;return this.cameraMatrix.translate([n,-t,-r]),this._isActive()&&this._renderer.uViewMatrix.set(this.cameraMatrix),this}},{key:"move",value:function(e,t,r){var o=this._getLocalAxes(),e=[o.x[0]*e,o.x[1]*e,o.x[2]*e],t=[o.y[0]*t,o.y[1]*t,o.y[2]*t],o=[o.z[0]*r,o.z[1]*r,o.z[2]*r];this.camera(this.eyeX+e[0]+t[0]+o[0],this.eyeY+e[1]+t[1]+o[1],this.eyeZ+e[2]+t[2]+o[2],this.centerX+e[0]+t[0]+o[0],this.centerY+e[1]+t[1]+o[1],this.centerZ+e[2]+t[2]+o[2],this.upX,this.upY,this.upZ)}},{key:"setPosition",value:function(e,t,r){var o=e-this.eyeX,n=t-this.eyeY,s=r-this.eyeZ;this.camera(e,t,r,this.centerX+o,this.centerY+n,this.centerZ+s,this.upX,this.upY,this.upZ)}},{key:"set",value:function(e){for(var t=0,r=["eyeX","eyeY","eyeZ","centerX","centerY","centerZ","upX","upY","upZ","cameraFOV","aspectRatio","cameraNear","cameraFar","cameraType","yScale","useLinePerspective"];t<r.length;t++){var o=r[t];this[o]=e[o]}this.cameraMatrix=e.cameraMatrix.copy(),this.projMatrix=e.projMatrix.copy(),this._isActive()&&(this._renderer.uModelMatrix.reset(),this._renderer.uViewMatrix.set(this.cameraMatrix),this._renderer.uPMatrix.set(this.projMatrix))}},{key:"slerp",value:function(e,t,r){var o,n,s,i,a,l,u,c,d,h,f,p,m,y,g,v,b,_;0===r?this.set(e):1===r?this.set(t):(0!==this.projMatrix.mat4[15]&&(this.projMatrix.mat4[0]=e.projMatrix.mat4[0]*Math.pow(t.projMatrix.mat4[0]/e.projMatrix.mat4[0],r),this.projMatrix.mat4[5]=e.projMatrix.mat4[5]*Math.pow(t.projMatrix.mat4[5]/e.projMatrix.mat4[5],r),this._isActive()&&(this._renderer.uPMatrix.mat4=this.projMatrix.mat4.slice())),i=new j.default.Vector(e.eyeX,e.eyeY,e.eyeZ),a=new j.default.Vector(t.eyeX,t.eyeY,t.eyeZ),v=new j.default.Vector(e.centerX,e.centerY,e.centerZ),_=new j.default.Vector(t.centerX,t.centerY,t.centerZ),s=j.default.Vector.dist(i,v),o=j.default.Vector.dist(a,_),o=s*Math.pow(o/s,r),s=j.default.Vector.sub(i,a),n=1,1e-6<(b=(y=i.copy().sub(a).sub(v).add(_)).magSq())&&(n=j.default.Vector.dot(s,y)/b,n=Math.max(0,Math.min(n,1))),s=j.default.Vector.lerp(j.default.Vector.lerp(i,v,n),j.default.Vector.lerp(a,_,n),r),y=e.cameraMatrix.createSubMatrix3x3(),b=t.cameraMatrix.createSubMatrix3x3(),i=y.row(2),v=b.row(2),a=y.row(1),_=b.row(1),e=new j.default.Vector,t=new j.default.Vector,l=new j.default.Vector,u=new j.default.Vector,1-(c=.5*((y=(b=b.mult3x3(y.copy().transpose3x3())).diagonal())[0]+y[1]+y[2]-1))<1e-7?(e.set(j.default.Vector.lerp(i,v,r)).normalize(),l.set(e).mult(n*o).add(s),u.set(e).mult((n-1)*o).add(s),t.set(j.default.Vector.lerp(a,_,r)).normalize()):(v=1/(1-c),_=Math.max(y[0],y[1],y[2]),p=b.mat3[1]+b.mat3[3],m=b.mat3[2]+b.mat3[6],g=b.mat3[5]+b.mat3[7],_=_===y[0]?(h=.5*p*(v/=d=Math.sqrt((y[0]-c)*v)),f=.5*m*v,.5*(b.mat3[7]-b.mat3[5])/d):_===y[1]?(f=.5*g*(v/=h=Math.sqrt((y[1]-c)*v)),d=.5*p*v,.5*(b.mat3[2]-b.mat3[6])/h):(d=.5*m*(v/=f=Math.sqrt((y[2]-c)*v)),h=.5*g*v,.5*(b.mat3[3]-b.mat3[1])/f),p=r*Math.atan2(_,c),m=Math.cos(p),y=Math.sin(p),(_=new j.default.Matrix("mat3",[m+(g=1-m)*d*d,g*(v=d*h)+y*f,g*(b=f*d)-y*h,g*v-y*f,m+g*h*h,g*(r=h*f)+y*d,g*b+y*h,g*r-y*d,m+g*f*f])).multiplyVec3(i,e),l.set(e).mult(n*o).add(s),u.set(e).mult((n-1)*o).add(s),_.multiplyVec3(a,t)),this.camera(l.x,l.y,l.z,u.x,u.y,u.z,t.x,t.y,t.z))}},{key:"_computeCameraDefaultSettings",value:function(){this.defaultAspectRatio=this._renderer.width/this._renderer.height,this.defaultEyeX=0,this.defaultEyeY=0,this.defaultEyeZ=800,this.defaultCameraFOV=2*Math.atan(this._renderer.height/2/this.defaultEyeZ),this.defaultCenterX=0,this.defaultCenterY=0,this.defaultCenterZ=0,this.defaultCameraNear=.1*this.defaultEyeZ,this.defaultCameraFar=10*this.defaultEyeZ}},{key:"_setDefaultCamera",value:function(){this.cameraFOV=this.defaultCameraFOV,this.aspectRatio=this.defaultAspectRatio,this.eyeX=this.defaultEyeX,this.eyeY=this.defaultEyeY,this.eyeZ=this.defaultEyeZ,this.centerX=this.defaultCenterX,this.centerY=this.defaultCenterY,this.centerZ=this.defaultCenterZ,this.upX=0,this.upY=1,this.upZ=0,this.cameraNear=this.defaultCameraNear,this.cameraFar=this.defaultCameraFar,this.perspective(),this.camera(),this.cameraType="default"}},{key:"_resize",value:function(){"default"===this.cameraType&&(this._computeCameraDefaultSettings(),this.cameraFOV=this.defaultCameraFOV,this.aspectRatio=this.defaultAspectRatio,this.perspective())}},{key:"copy",value:function(){var e=new j.default.Camera(this._renderer);return e.cameraFOV=this.cameraFOV,e.aspectRatio=this.aspectRatio,e.eyeX=this.eyeX,e.eyeY=this.eyeY,e.eyeZ=this.eyeZ,e.centerX=this.centerX,e.centerY=this.centerY,e.centerZ=this.centerZ,e.upX=this.upX,e.upY=this.upY,e.upZ=this.upZ,e.cameraNear=this.cameraNear,e.cameraFar=this.cameraFar,e.cameraType=this.cameraType,e.useLinePerspective=this.useLinePerspective,e.cameraMatrix=this.cameraMatrix.copy(),e.projMatrix=this.projMatrix.copy(),e.yScale=this.yScale,e}},{key:"_getLocalAxes",value:function(){var e=this.eyeX-this.centerX,t=this.eyeY-this.centerY,r=this.eyeZ-this.centerZ,o=Math.sqrt(e*e+t*t+r*r),o=(0!==o&&(e/=o,t/=o,r/=o),this.upX),n=(a=this.upY)*r-(l=this.upZ)*t,s=-o*r+l*e,i=o*t-a*e,o=t*i-r*s,a=-e*i+r*n,l=e*s-t*n,u=Math.sqrt(n*n+s*s+i*i),u=(0!==u&&(n/=u,s/=u,i/=u),Math.sqrt(o*o+a*a+l*l));return 0!==u&&(o/=u,a/=u,l/=u),{x:[n,s,i],y:[o,a,l],z:[e,t,r]}}},{key:"_orbit",value:function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.hypot(o,n,s),o=new j.default.Vector(o,n,s).normalize(),n=new j.default.Vector(this.upX,this.upY,this.upZ).normalize(),s=j.default.Vector.cross(n,o).normalize(),a=j.default.Vector.cross(s,n),r=((i=(i*=Math.pow(10,r))<this.cameraNear?this.cameraNear:i)>this.cameraFar&&(i=this.cameraFar),Math.acos(Math.max(-1,Math.min(1,j.default.Vector.dot(o,n))))+t),t=e;(r<=0||r>=Math.PI)&&(this.upX*=-1,this.upY*=-1,this.upZ*=-1),n.mult(Math.cos(r)),a.mult(Math.cos(t)*Math.sin(r)),s.mult(Math.sin(t)*Math.sin(r)),o.set(n).add(a).add(s),this.eyeX=i*o.x+this.centerX,this.eyeY=i*o.y+this.centerY,this.eyeZ=i*o.z+this.centerZ,this.camera(this.eyeX,this.eyeY,this.eyeZ,this.centerX,this.centerY,this.centerZ,this.upX,this.upY,this.upZ)}},{key:"_orbitFree",value:function(e,t,r){var o=this.eyeX-this.centerX,n=this.eyeY-this.centerY,s=this.eyeZ-this.centerZ,i=Math.hypot(o,n,s),o=new j.default.Vector(o,n,s).normalize(),n=new j.default.Vector(this.upX,this.upY,this.upZ),s=j.default.Vector.cross(n,o).normalize(),a=j.default.Vector.cross(o,s),l=Math.atan2(t,e),l=(a.mult(Math.sin(l)),s.mult(Math.cos(l)).add(a),Math.sqrt(e*e+t*t)),a=j.default.Vector.cross(o,s),e=((i=(i*=Math.pow(10,r))<this.cameraNear?this.cameraNear:i)>this.cameraFar&&(i=this.cameraFar),Math.cos(l)),t=Math.sin(l),r=n.dot(o),l=n.dot(s),u=r*e+l*t,r=-r*t+l*e,l=n.dot(a);n.x=u*o.x+r*s.x+l*a.x,n.y=u*o.y+r*s.y+l*a.y,n.z=u*o.z+r*s.z+l*a.z,s.mult(-t),o.mult(e).add(s).mult(i),this.camera(o.x+this.centerX,o.y+this.centerY,o.z+this.centerZ,this.centerX,this.centerY,this.centerZ,n.x,n.y,n.z)}},{key:"_isActive",value:function(){return this===this._renderer._curCamera}}])&&n(e.prototype,r),o&&n(e,o),t}(),j.default.prototype.setCamera=function(e){this._renderer._curCamera=e,this._renderer.uPMatrix.set(e.projMatrix),this._renderer.uViewMatrix.set(e.cameraMatrix)};e=j.default.Camera;r.default=e},{"../core/main":283,"core-js/modules/es.array.slice":169,"core-js/modules/es.math.hypot":176,"core-js/modules/es.string.sub":208}],333:[function(e,t,r){"use strict";e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.math.log2"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;e=(e=e("../core/main"))&&e.__esModule?e:{default:e};function n(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.default.DataArray=function(){function o(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:128,t=this,r=o;if(!(t instanceof r))throw new TypeError("Cannot call a class as a function");this.length=0,this.data=new Float32Array(e),this.initialLength=e}var e,t,r;return e=o,(t=[{key:"dataArray",value:function(){return this.subArray(0,this.length)}},{key:"clear",value:function(){this.length=0}},{key:"rescale",value:function(){var e;this.length<this.data.length/2&&(e=1<<Math.ceil(Math.log2(this.length)),(e=new Float32Array(e)).set(this.data.subarray(0,this.length),0),this.data=e)}},{key:"reset",value:function(){this.clear(),this.data=new Float32Array(this.initialLength)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.ensureLength(this.length+t.length),this.data.set(t,this.length),this.length+=t.length}},{key:"slice",value:function(e,t){return this.data.slice(e,Math.min(t,this.length))}},{key:"subArray",value:function(e,t){return this.data.subarray(e,Math.min(t,this.length))}},{key:"ensureLength",value:function(e){for(;this.data.length<e;){var t=new Float32Array(2*this.data.length);t.set(this.data,0),this.data=t}}}])&&n(e.prototype,t),r&&n(e,r),o}();e=e.default.DataArray;r.default=e},{"../core/main":283,"core-js/modules/es.array.iterator":165,"core-js/modules/es.array.slice":169,"core-js/modules/es.math.log2":177,"core-js/modules/es.object.to-string":190,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.float32-array":219,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239}],334:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.reflect.construct"),e("core-js/modules/es.reflect.get"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.array.fill"),e("core-js/modules/es.array.includes"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.object.get-prototype-of"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.string.includes"),e("core-js/modules/es.typed-array.float32-array"),e("core-js/modules/es.typed-array.uint8-array"),e("core-js/modules/es.typed-array.uint8-clamped-array"),e("core-js/modules/es.typed-array.copy-within"),e("core-js/modules/es.typed-array.every"),e("core-js/modules/es.typed-array.fill"),e("core-js/modules/es.typed-array.filter"),e("core-js/modules/es.typed-array.find"),e("core-js/modules/es.typed-array.find-index"),e("core-js/modules/es.typed-array.for-each"),e("core-js/modules/es.typed-array.includes"),e("core-js/modules/es.typed-array.index-of"),e("core-js/modules/es.typed-array.iterator"),e("core-js/modules/es.typed-array.join"),e("core-js/modules/es.typed-array.last-index-of"),e("core-js/modules/es.typed-array.map"),e("core-js/modules/es.typed-array.reduce"),e("core-js/modules/es.typed-array.reduce-right"),e("core-js/modules/es.typed-array.reverse"),e("core-js/modules/es.typed-array.set"),e("core-js/modules/es.typed-array.slice"),e("core-js/modules/es.typed-array.some"),e("core-js/modules/es.typed-array.sort"),e("core-js/modules/es.typed-array.subarray"),e("core-js/modules/es.typed-array.to-locale-string"),e("core-js/modules/es.typed-array.to-string"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var f=(j=e("../core/main"))&&j.__esModule?j:{default:j},a=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants")),n=e("./p5.Texture"),p=e("./p5.RendererGL");function l(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,l=function(){return e},e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function h(e,t,r){t&&s(e.prototype,t),r&&s(e,r)}function m(e,t,r){return(m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var e=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=v(e)););return e}(e,t);if(e)return(e=Object.getOwnPropertyDescriptor(e,t)).get?e.get.call(r):e.value})(e,t,r||e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(r){return function(){var e,t=v(r),t=(e=function(){if("undefined"!=typeof Reflect&&Reflect.construct&&!Reflect.construct.sham){if("function"==typeof Proxy)return 1;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),1}catch(e){}}}()?(e=v(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),this);if(!e||"object"!==i(e)&&"function"!=typeof e){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){var t=o;if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e);var r=g(o);function o(e){var t;return d(this,o),(t=r.call(this,e.target._renderer)).fbo=e,t.yScale=-1,t}return h(o,[{key:"_computeCameraDefaultSettings",value:function(){m(v(o.prototype),"_computeCameraDefaultSettings",this).call(this),this.defaultAspectRatio=this.fbo.width/this.fbo.height,this.defaultCameraFOV=2*Math.atan(this.fbo.height/2/this.defaultEyeZ)}}]),o}(f.default.Camera),_=(f.default.FramebufferCamera=b,function(){function r(e,t){d(this,r),this.framebuffer=e,this.property=t}return h(r,[{key:"rawTexture",value:function(){return this.framebuffer[this.property]}},{key:"width",get:function(){return this.framebuffer.width*this.framebuffer.density}},{key:"height",get:function(){return this.framebuffer.height*this.framebuffer.density}}]),r}()),j=(f.default.FramebufferTexture=_,function(){function s(e){var t=this,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},o=(d(this,s),this.target=e,this.target._renderer.framebuffers.add(this),this._isClipApplied=!1,this.pixels=[],this.format=r.format||a.UNSIGNED_BYTE,this.channels=r.channels||(e._renderer._pInst._glAttributes.alpha?a.RGBA:a.RGB),this.useDepth=void 0===r.depth||r.depth,this.depthFormat=r.depthFormat||a.FLOAT,this.textureFiltering=r.textureFiltering||a.LINEAR,void 0===r.antialias?this.antialiasSamples=e._renderer._pInst._glAttributes.antialias?2:0:"number"==typeof r.antialias?this.antialiasSamples=r.antialias:this.antialiasSamples=r.antialias?2:0,this.antialias=0<this.antialiasSamples,this.antialias&&e.webglVersion!==a.WEBGL2&&(console.warn("Antialiasing is unsupported in a WebGL 1 context"),this.antialias=!1),this.density=r.density||e.pixelDensity(),e._renderer.GL);if(this.gl=o,r.width&&r.height?(n=e._renderer._adjustDimensions(r.width,r.height),this.width=n.adjustedWidth,this.height=n.adjustedHeight,this._autoSized=!1):(void 0===r.width!=(void 0===r.height)&&console.warn("Please supply both width and height for a framebuffer to give it a size. Only one was given, so the framebuffer will match the size of its canvas."),this.width=e.width,this.height=e.height,this._autoSized=!0),this._checkIfFormatsAvailable(),r.stencil&&!this.useDepth&&console.warn("A stencil buffer can only be used if also using depth. Since the framebuffer has no depth buffer, the stencil buffer will be ignored."),this.useStencil=this.useDepth&&(void 0===r.stencil||r.stencil),this.framebuffer=o.createFramebuffer(),!this.framebuffer)throw new Error("Unable to create a framebuffer");if(this.antialias&&(this.aaFramebuffer=o.createFramebuffer(),!this.aaFramebuffer))throw new Error("Unable to create a framebuffer for antialiasing");this._recreateTextures();var n=this.target._renderer._curCamera;this.defaultCamera=this.createCamera(),this.filterCamera=this.createCamera(),this.target._renderer._curCamera=n,this.draw(function(){return t.target.clear()})}return h(s,[{key:"resize",value:function(e,t){this._autoSized=!1;var r=this.target._renderer._adjustDimensions(e,t);e=r.adjustedWidth,t=r.adjustedHeight,this.width=e,this.height=t,this._handleResize()}},{key:"pixelDensity",value:function(e){if(!e)return this.density;this._autoSized=!1,this.density=e,this._handleResize()}},{key:"autoSized",value:function(e){if(void 0===e)return this._autoSized;this._autoSized=e,this._handleResize()}},{key:"_checkIfFormatsAvailable",value:function(){var e=this.gl,e=(this.useDepth&&this.target.webglVersion===a.WEBGL&&!e.getExtension("WEBGL_depth_texture")&&(console.warn("Unable to create depth textures in this environment. Falling back to a framebuffer without depth."),this.useDepth=!1),this.useDepth&&this.target.webglVersion===a.WEBGL&&this.depthFormat===a.FLOAT&&(console.warn("FLOAT depth format is unavailable in WebGL 1. Defaulting to UNSIGNED_INT."),this.depthFormat=a.UNSIGNED_INT),[a.UNSIGNED_BYTE,a.FLOAT,a.HALF_FLOAT].includes(this.format)||(console.warn("Unknown Framebuffer format. Please use UNSIGNED_BYTE, FLOAT, or HALF_FLOAT. Defaulting to UNSIGNED_BYTE."),this.format=a.UNSIGNED_BYTE),this.useDepth&&![a.UNSIGNED_INT,a.FLOAT].includes(this.depthFormat)&&(console.warn("Unknown Framebuffer depth format. Please use UNSIGNED_INT or FLOAT. Defaulting to FLOAT."),this.depthFormat=a.FLOAT),(0,n.checkWebGLCapabilities)(this.target._renderer));e.float||this.format!==a.FLOAT||(console.warn("This environment does not support FLOAT textures. Falling back to UNSIGNED_BYTE."),this.format=a.UNSIGNED_BYTE),this.useDepth&&!e.float&&this.depthFormat===a.FLOAT&&(console.warn("This environment does not support FLOAT depth textures. Falling back to UNSIGNED_INT."),this.depthFormat=a.UNSIGNED_INT),e.halfFloat||this.format!==a.HALF_FLOAT||(console.warn("This environment does not support HALF_FLOAT textures. Falling back to UNSIGNED_BYTE."),this.format=a.UNSIGNED_BYTE),this.channels===a.RGB&&[a.FLOAT,a.HALF_FLOAT].includes(this.format)&&(console.warn("FLOAT and HALF_FLOAT formats do not work cross-platform with only RGB channels. Falling back to RGBA."),this.channels=a.RGBA)}},{key:"_recreateTextures",value:function(){var e=this.gl,t=(this._updateSize(),e.getParameter(e.TEXTURE_BINDING_2D)),r=e.getParameter(e.FRAMEBUFFER_BINDING),o=e.createTexture();if(!o)throw new Error("Unable to create color texture");e.bindTexture(e.TEXTURE_2D,o);var n=this._glColorFormat();if(e.texImage2D(e.TEXTURE_2D,0,n.internalFormat,this.width*this.density,this.height*this.density,0,n.format,n.type,null),this.colorTexture=o,e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,o,0),this.useDepth){var o=e.createTexture();if(!o)throw new Error("Unable to create depth texture");var s=this._glDepthFormat();e.bindTexture(e.TEXTURE_2D,o),e.texImage2D(e.TEXTURE_2D,0,s.internalFormat,this.width*this.density,this.height*this.density,0,s.format,s.type,null),e.framebufferTexture2D(e.FRAMEBUFFER,this.useStencil?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0),this.depthTexture=o}this.antialias&&(this.colorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.colorRenderbuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,Math.max(0,Math.min(this.antialiasSamples,e.getParameter(e.MAX_SAMPLES))),n.internalFormat,this.width*this.density,this.height*this.density),this.useDepth&&(s=this._glDepthFormat(),this.depthRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.depthRenderbuffer),e.renderbufferStorageMultisample(e.RENDERBUFFER,Math.max(0,Math.min(this.antialiasSamples,e.getParameter(e.MAX_SAMPLES))),s.internalFormat,this.width*this.density,this.height*this.density)),e.bindFramebuffer(e.FRAMEBUFFER,this.aaFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,this.colorRenderbuffer),this.useDepth&&e.framebufferRenderbuffer(e.FRAMEBUFFER,this.useStencil?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthRenderbuffer)),this.useDepth&&(this.depth=new _(this,"depthTexture"),o=e.NEAREST,this.depthP5Texture=new f.default.Texture(this.target._renderer,this.depth,{minFilter:o,magFilter:o}),this.target._renderer.textures.set(this.depth,this.depthP5Texture)),this.color=new _(this,"colorTexture");n=this.textureFiltering===a.LINEAR?e.LINEAR:e.NEAREST;this.colorP5Texture=new f.default.Texture(this.target._renderer,this.color,{minFilter:n,magFilter:n}),this.target._renderer.textures.set(this.color,this.colorP5Texture),e.bindTexture(e.TEXTURE_2D,t),e.bindFramebuffer(e.FRAMEBUFFER,r)}},{key:"_glColorFormat",value:function(){var e,t,r=this.gl,o=this.format===a.FLOAT?r.FLOAT:this.format===a.HALF_FLOAT?this.target.webglVersion===a.WEBGL2?r.HALF_FLOAT:r.getExtension("OES_texture_half_float").HALF_FLOAT_OES:r.UNSIGNED_BYTE,n=this.channels===a.RGBA?r.RGBA:r.RGB;return{internalFormat:this.target.webglVersion===a.WEBGL2?(c(t={},r.FLOAT,c({},r.RGBA,r.RGBA32F)),c(t,r.HALF_FLOAT,c({},r.RGBA,r.RGBA16F)),c(t,r.UNSIGNED_BYTE,(c(e={},r.RGBA,r.RGBA8),c(e,r.RGB,r.RGB8),e)),t[o][n]):this.format===a.HALF_FLOAT?r.RGBA:n,format:n,type:o}}},{key:"_glDepthFormat",value:function(){var e=this.gl,t=this.useStencil?this.depthFormat===a.FLOAT?e.FLOAT_32_UNSIGNED_INT_24_8_REV:this.target.webglVersion===a.WEBGL2?e.UNSIGNED_INT_24_8:e.getExtension("WEBGL_depth_texture").UNSIGNED_INT_24_8_WEBGL:this.depthFormat===a.FLOAT?e.FLOAT:e.UNSIGNED_INT,r=this.useStencil?e.DEPTH_STENCIL:e.DEPTH_COMPONENT,e=this.useStencil?this.depthFormat===a.FLOAT?e.DEPTH32F_STENCIL8:this.target.webglVersion===a.WEBGL2?e.DEPTH24_STENCIL8:e.DEPTH_STENCIL:this.target.webglVersion===a.WEBGL2?this.depthFormat===a.FLOAT?e.DEPTH_COMPONENT32F:e.DEPTH_COMPONENT24:e.DEPTH_COMPONENT;return{internalFormat:e,format:r,type:t}}},{key:"_updateSize",value:function(){this._autoSized&&(this.width=this.target.width,this.height=this.target.height,this.density=this.target.pixelDensity())}},{key:"_canvasSizeChanged",value:function(){this._autoSized&&this._handleResize()}},{key:"_handleResize",value:function(){var e=this.color,t=this.depth,r=this.colorRenderbuffer,o=this.depthRenderbuffer,e=(this._deleteTexture(e),t&&this._deleteTexture(t),this.gl);r&&e.deleteRenderbuffer(r),o&&e.deleteRenderbuffer(o),this._recreateTextures(),this.defaultCamera._resize()}},{key:"createCamera",value:function(){var e=new b(this);return e._computeCameraDefaultSettings(),e._setDefaultCamera(),this.target._renderer._curCamera=e}},{key:"_deleteTexture",value:function(e){this.gl.deleteTexture(e.rawTexture()),this.target._renderer.textures.delete(e)}},{key:"remove",value:function(){var e=this.gl;this._deleteTexture(this.color),this.depth&&this._deleteTexture(this.depth),e.deleteFramebuffer(this.framebuffer),this.aaFramebuffer&&e.deleteFramebuffer(this.aaFramebuffer),this.depthRenderbuffer&&e.deleteRenderbuffer(this.depthRenderbuffer),this.colorRenderbuffer&&e.deleteRenderbuffer(this.colorRenderbuffer),this.target._renderer.framebuffers.delete(this)}},{key:"begin",value:function(){this.prevFramebuffer=this.target._renderer.activeFramebuffer(),this.prevFramebuffer&&this.prevFramebuffer._beforeEnd(),this.target._renderer.activeFramebuffers.push(this),this._beforeBegin(),this.target.push(),this.target.setCamera(this.defaultCamera),this.target.resetMatrix(),this.target._renderer.uViewMatrix.set(this.target._renderer._curCamera.cameraMatrix),this.target._renderer.uModelMatrix.reset(),this.target._renderer._applyStencilTestIfClipping()}},{key:"_framebufferToBind",value:function(){return this.antialias?this.aaFramebuffer:this.framebuffer}},{key:"_beforeBegin",value:function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebufferToBind()),this.target._renderer.viewport(this.width*this.density,this.height*this.density)}},{key:"_beforeEnd",value:function(){if(this.antialias){var e=this.gl,t=(e.bindFramebuffer(e.READ_FRAMEBUFFER,this.aaFramebuffer),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.framebuffer),[[e.COLOR_BUFFER_BIT,this.colorP5Texture.glMagFilter]]);this.useDepth&&t.push([e.DEPTH_BUFFER_BIT,this.depthP5Texture.glMagFilter]);for(var r=0,o=t;r<o.length;r++){var n=u(o[r],2),s=n[0],n=n[1];e.blitFramebuffer(0,0,this.width*this.density,this.height*this.density,0,0,this.width*this.density,this.height*this.density,s,n)}}}},{key:"end",value:function(){var e=this.gl;if(this.target.pop(),this.target._renderer.activeFramebuffers.pop()!==this)throw new Error("It looks like you've called end() while another Framebuffer is active.");this._beforeEnd(),this.prevFramebuffer?this.prevFramebuffer._beforeBegin():(e.bindFramebuffer(e.FRAMEBUFFER,null),this.target._renderer.viewport(this.target._renderer._origViewport.width,this.target._renderer._origViewport.height)),this.target._renderer._applyStencilTestIfClipping()}},{key:"draw",value:function(e){this.begin(),e(),this.end()}},{key:"loadPixels",value:function(){var e=this.gl,t=this.target._renderer.activeFramebuffer(),r=(e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),this._glColorFormat());this.pixels=(0,p.readPixelsWebGL)(this.pixels,e,this.framebuffer,0,0,this.width*this.density,this.height*this.density,r.format,r.type),t?e.bindFramebuffer(e.FRAMEBUFFER,t._framebufferToBind()):e.bindFramebuffer(e.FRAMEBUFFER,null)}},{key:"get",value:function(e,t,r,o){f.default._validateParameters("p5.Framebuffer.get",arguments);var n=this._glColorFormat();if(void 0===e&&void 0===t)t=e=0,r=this.width,o=this.height;else if(void 0===r&&void 0===o)return(e<0||t<0||e>=this.width||t>=this.height)&&(console.warn("The x and y values passed to p5.Framebuffer.get are outside of its range and will be clamped."),e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1)),(0,p.readPixelWebGL)(this.gl,this.framebuffer,e*this.density,t*this.density,n.format,n.type);e=this.target.constrain(e,0,this.width-1),t=this.target.constrain(t,0,this.height-1),r=this.target.constrain(r,1,this.width-e),o=this.target.constrain(o,1,this.height-t);for(var s=(0,p.readPixelsWebGL)(void 0,this.gl,this.framebuffer,e*this.density,t*this.density,r*this.density,o*this.density,n.format,n.type),i=new Uint8ClampedArray(r*o*this.density*this.density*4),a=(i.fill(255),n.type===this.gl.RGB?3:4),l=0;l<o*this.density;l++)for(var u=0;u<r*this.density;u++)for(var c=0;c<4;c++){var d,h=4*(l*r*this.density+u)+c;c<a&&(d=4==a?h:(l*r*this.density+u)*a+c,i[h]=s[d])}e=new f.default.Image(r*this.density,o*this.density);return e.imageData=e.canvas.getContext("2d").createImageData(e.width,e.height),e.imageData.data.set(i),e.pixels=e.imageData.data,e.updatePixels(),1!==this.density&&e.resize(r,o),e}},{key:"updatePixels",value:function(){var e=this.gl,t=(this.colorP5Texture.bindTexture(),this._glColorFormat()),r=t.format===e.RGBA?4:3,r=this.width*this.height*this.density*this.density*r,o=t.type===e.UNSIGNED_BYTE?Uint8Array:Float32Array;if(!(this.pixels instanceof o)||this.pixels.length!==r)throw new Error("The pixels array has not been set correctly. Please call loadPixels() before updatePixels().");e.texImage2D(e.TEXTURE_2D,0,t.internalFormat,this.width*this.density,this.height*this.density,0,t.format,t.type,this.pixels),this.colorP5Texture.unbindTexture();o=this.target._renderer.activeFramebuffer();this.antialias?(this.begin(),this.target.push(),this.target.imageMode(this.target.CENTER),this.target.resetMatrix(),this.target.noStroke(),this.target.clear(),this.target.image(this,0,0),this.target.pop(),this.useDepth&&(e.clearDepth(1),e.clear(e.DEPTH_BUFFER_BIT)),this.end()):(e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer),this.useDepth&&(e.clearDepth(1),e.clear(e.DEPTH_BUFFER_BIT)),o?e.bindFramebuffer(e.FRAMEBUFFER,o._framebufferToBind()):e.bindFramebuffer(e.FRAMEBUFFER,null))}}]),s}()),e=f.default.Framebuffer=j;r.default=e},{"../core/constants":272,"../core/main":283,"./p5.RendererGL":341,"./p5.Texture":343,"core-js/modules/es.array.fill":156,"core-js/modules/es.array.includes":163,"core-js/modules/es.array.iterator":165,"core-js/modules/es.object.get-own-property-descriptor":186,"core-js/modules/es.object.get-prototype-of":188,"core-js/modules/es.object.to-string":190,"core-js/modules/es.reflect.construct":192,"core-js/modules/es.reflect.get":193,"core-js/modules/es.regexp.to-string":196,"core-js/modules/es.string.includes":199,"core-js/modules/es.string.iterator":200,"core-js/modules/es.symbol":212,"core-js/modules/es.symbol.description":210,"core-js/modules/es.symbol.iterator":211,"core-js/modules/es.typed-array.copy-within":213,"core-js/modules/es.typed-array.every":214,"core-js/modules/es.typed-array.fill":215,"core-js/modules/es.typed-array.filter":216,"core-js/modules/es.typed-array.find":218,"core-js/modules/es.typed-array.find-index":217,"core-js/modules/es.typed-array.float32-array":219,"core-js/modules/es.typed-array.for-each":221,"core-js/modules/es.typed-array.includes":222,"core-js/modules/es.typed-array.index-of":223,"core-js/modules/es.typed-array.iterator":226,"core-js/modules/es.typed-array.join":227,"core-js/modules/es.typed-array.last-index-of":228,"core-js/modules/es.typed-array.map":229,"core-js/modules/es.typed-array.reduce":231,"core-js/modules/es.typed-array.reduce-right":230,"core-js/modules/es.typed-array.reverse":232,"core-js/modules/es.typed-array.set":233,"core-js/modules/es.typed-array.slice":234,"core-js/modules/es.typed-array.some":235,"core-js/modules/es.typed-array.sort":236,"core-js/modules/es.typed-array.subarray":237,"core-js/modules/es.typed-array.to-locale-string":238,"core-js/modules/es.typed-array.to-string":239,"core-js/modules/es.typed-array.uint8-array":242,"core-js/modules/es.typed-array.uint8-clamped-array":243,"core-js/modules/es.weak-map":244,"core-js/modules/web.dom-collections.iterator":246}],335:[function(e,t,r){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i="function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?function(e){return o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":o(e)})(e)}e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.flat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.from"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.unscopables.flat"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.entries"),e("core-js/modules/es.object.get-own-property-descriptor"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.regexp.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/es.weak-map"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),e("core-js/modules/es.symbol"),e("core-js/modules/es.symbol.description"),e("core-js/modules/es.symbol.iterator"),e("core-js/modules/es.array.concat"),e("core-js/modules/es.array.flat"),e("core-js/modules/es.array.for-each"),e("core-js/modules/es.array.iterator"),e("core-js/modules/es.array.last-index-of"),e("core-js/modules/es.array.map"),e("core-js/modules/es.array.slice"),e("core-js/modules/es.array.unscopables.flat"),e("core-js/modules/es.array-buffer.constructor"),e("core-js/modules/es.map"),e("core-js/modules/es.number.constructor"),e("core-js/modules/es.object.entries"),e("core-js/modules/es.object.to-string"),e("core-js/modules/es.set"),e("core-js/modules/es.string.iterator"),e("core-js/modules/es.string.sub"),e("core-js/modules/web.dom-collections.for-each"),e("core-js/modules/web.dom-collections.iterator"),Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var F=(s=e("../core/main"))&&s.__esModule?s:{default:s},m=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==i(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var r,o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(r in e){var s;Object.prototype.hasOwnProperty.call(e,r)&&((s=n?Object.getOwnPropertyDescriptor(e,r):null)&&(s.get||s.set)?Object.defineProperty(o,r,s):o[r]=e[r])}o.default=e,t&&t.set(e,o);return o}(e("../core/constants"));function a(){var e;return"function"!=typeof WeakMap?null:(e=new WeakMap,a=function(){return e},e)}function c(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],o=!0,n=!1,s=void 0;try{for(var i,a=e[Symbol.iterator]();!(o=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);o=!0);}catch(e){n=!0,s=e}finally{try{o||null==a.return||a.return()}finally{if(n)throw s}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}F.default.Geometry=function(){function o(e,t,r){if(!(this instanceof o))throw new TypeError("Cannot call a class as a function");this.vertices=[],this.boundingBoxCache=null,this.lineVertices=new F.default.DataArray,this.lineTangentsIn=ne
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Cinética — JN Silva</title>
<style>
html,body{margin:0;height:100%;background:#07080b;display:flex;align-items:center;justify-content:center;overflow:hidden;}
canvas{display:block;}
</style>
</head>
<body>
<script>
/* ============================================================================
Cinética — a generative homage to Venezuelan kinetic art, by JN Silva.
Single-file mint script for Transient Labs. Self-contained: p5.js + the
tl-gen-art randomness library ($art) + the full Cinética engine are inlined
below. Zero network calls at render time. Deterministic from the mint seed.
Load order (determinism-critical): p5 -> art.js -> engine -> sketch.
p5.js: LGPL-2.1 (https://p5js.org). tl-gen-art: MIT (c) 2026 Transient Labs.
============================================================================ */
</script>
<!-- 1. p5.js (vendored) -->
<script>/*! p5.js v1.11.13 April 08, 2026 */
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).p5=e()}(function(){var s,t,r;return function o(n,s,i){function a(t,e){if(!s[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(l)return l(t,!0);throw(e=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",e}r=s[t]={exports:{}},n[t][0].call(r.exports,function(e){return a(n[t][1][e]||e)},r,r.exports,o,n,s,i)}return s[t].exports}for(var l="function"==typeof require&&require,e=0;e<i.length;e++)a(i[e]);return a}({1:[function(e,t,r){"use strict";r.byteLength=function(e){var e=c(e),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(e){var t,r,o=c(e),n=o[0],o=o[1],s=new u(function(e,t){return 3*(e+t)/4-t}(n,o)),i=0,a=0<o?n-4:n;for(r=0;r<a;r+=4)t=l[e.charCodeAt(r)]<<18|l[e.charCodeAt(r+1)]<<12|l[e.charCodeAt(r+2)]<<6|l[e.charCodeAt(r+3)],s[i++]=t>>16&255,s[i++]=t>>8&255,s[i++]=255&t;2===o&&(t=l[e.charCodeAt(r)]<<2|l[e.charCodeAt(r+1)]>>4,s[i++]=255&t);1===o&&(t=l[e.charCodeAt(r)]<<10|l[e.charCodeAt(r+1)]<<4|l[e.charCodeAt(r+2)]>>2,s[i++]=t>>8&255,s[i++]=255&t);return s},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,n=[],s=0,i=r-o;s<i;s+=16383)n.push(function(e,t,r){for(var o,n=[],s=t;s<r;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),n.push(function(e){return a[e>>18&63]+a[e>>12&63]+a[e>>6&63]+a[63&e]}(o));return n.join("")}(e,s,i<s+16383?i:s+16383));1==o?(t=e[r-1],n.push(a[t>>2]+a[t<<4&63]+"==")):2==o&&(t=(e[r-2]<<8)+e[r-1],n.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return n.join("")};for(var a=[],l=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,s=o.length;n<s;++n)a[n]=o[n],l[o.charCodeAt(n)]=n;function c(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("="),t=(e=-1===e?t:e)===t?0:4-e%4;return[e,t]}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],2:[function(e,t,r){},{}],3:[function(e,t,r){},{}],4:[function(A,e,L){!function(d){"use strict";var S=A("base64-js"),s=A("ieee754"),e="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null,t=(L.Buffer=d,L.SlowBuffer=function(e){+e!=e&&(e=0);return d.alloc(+e)},L.INSPECT_MAX_BYTES=50,2147483647);function l(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return Object.setPrototypeOf(e,d.prototype),e}function d(e,t,r){if("number"!=typeof e)return o(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return i(e)}function o(e,t,r){if("string"==typeof e){var o=e,n=t;if(d.isEncoding(n="string"==typeof n&&""!==n?n:"utf8"))return s=0|h(o,n),i=l(s),i=(o=i.write(o,n))!==s?i.slice(0,o):i;throw new TypeError("Unknown encoding: "+n)}if(ArrayBuffer.isView(e))return u(e);if(null!=e){if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)){var s=e,o=t,i=r;if(o<0||s.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<o+(i||0))throw new RangeError('"length" is outside of buffer bounds');return s=void 0===o&&void 0===i?new Uint8Array(s):void 0===i?new Uint8Array(s,o):new Uint8Array(s,o,i),Object.setPrototypeOf(s,d.prototype),s}if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return d.from(n,t,r);var a=function(e){{var t,r;if(d.isBuffer(e))return t=0|c(e.length),0!==(r=l(t)).length&&e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||C(e.length)?l(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function n(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function i(e){return n(e),l(e<0?0:0|c(e))}function u(e){for(var t=e.length<0?0:0|c(e.length),r=l(t),o=0;o<t;o+=1)r[o]=255&e[o];return r}function c(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function h(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,o=2<arguments.length&&!0===arguments[2];if(!o&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return E(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return M(e).length;default:if(n)return o?-1:E(e).length;t=(""+t).toLowerCase(),n=!0}}function r(e,t,r){var o,n=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":var s=this,i=t,a=r,l=s.length;(!a||a<0||l<a)&&(a=l);for(var u="",c=i=!i||i<0?0:i;c<a;++c)u+=P[s[c]];return u;case"utf8":case"utf-8":return T(this,t,r);case"ascii":var d=this,l=t,h=r,f="";h=Math.min(d.length,h);for(var p=l;p<h;++p)f+=String.fromCharCode(127&d[p]);return f;case"latin1":case"binary":var m=this,i=t,y=r,g="";y=Math.min(m.length,y);for(var v=i;v<y;++v)g+=String.fromCharCode(m[v]);return g;case"base64":return b=this,o=r,0===(_=t)&&o===b.length?S.fromByteArray(b):S.fromByteArray(b.slice(_,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=t,_=r,j=this.slice(b,_),x="",w=0;w<j.length;w+=2)x+=String.fromCharCode(j[w]+256*j[w+1]);return x;default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function a(e,t,r){var o=e[t];e[t]=e[r],e[r]=o}function f(e,t,r,o,n){if(0===e.length)return-1;if("string"==typeof r?(o=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=C(r=+r)?n?0:e.length-1:r)<0?e.length+r:r)>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,o)),d.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(n?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):p(e,[t],r,o,n);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,o,n){var s=1,i=e.length,a=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;i/=s=2,a/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n)for(var u=-1,c=r;c<i;c++)if(l(e,c)===l(t,-1===u?0:c-u)){if(c-(u=-1===u?c:u)+1===a)return u*s}else-1!==u&&(c-=c-u),u=-1;else for(c=r=i<r+a?i-a:r;0<=c;c--){for(var d=!0,h=0;h<a;h++)if(l(e,c+h)!==l(t,h)){d=!1;break}if(d)return c}return-1}function y(e,t,r,o){return k(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,o)}function g(e,t,r,o){return k(function(e,t){for(var r,o,n=[],s=0;s<e.length&&!((t-=2)<0);++s)o=e.charCodeAt(s),r=o>>8,o=o%256,n.push(o),n.push(r);return n}(t,e.length-r),e,r,o)}function T(e,t,r){r=Math.min(e.length,r);for(var o=[],n=t;n<r;){var s,i,a,l,u=e[n],c=null,d=239<u?4:223<u?3:191<u?2:1;if(n+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:128==(192&(s=e[n+1]))&&127<(l=(31&u)<<6|63&s)&&(c=l);break;case 3:s=e[n+1],i=e[n+2],128==(192&s)&&128==(192&i)&&2047<(l=(15&u)<<12|(63&s)<<6|63&i)&&(l<55296||57343<l)&&(c=l);break;case 4:s=e[n+1],i=e[n+2],a=e[n+3],128==(192&s)&&128==(192&i)&&128==(192&a)&&65535<(l=(15&u)<<18|(63&s)<<12|(63&i)<<6|63&a)&&l<1114112&&(c=l)}null===c?(c=65533,d=1):65535<c&&(c-=65536,o.push(c>>>10&1023|55296),c=56320|1023&c),o.push(c),n+=d}var h=o,f=h.length;if(f<=v)return String.fromCharCode.apply(String,h);for(var p="",m=0;m<f;)p+=String.fromCharCode.apply(String,h.slice(m,m+=v));return p}L.kMaxLength=t,(d.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&d[Symbol.species]===d&&Object.defineProperty(d,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),d.poolSize=8192,d.from=o,Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(e,t,r){return t=t,r=r,n(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)},d.allocUnsafe=i,d.allocUnsafeSlow=i,d.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==d.prototype},d.compare=function(e,t){if(O(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,o=t.length,n=0,s=Math.min(r,o);n<s;++n)if(e[n]!==t[n]){r=e[n],o=t[n];break}return r<o?-1:o<r?1:0},d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return d.alloc(0);if(void 0===t)for(n=t=0;n<e.length;++n)t+=e[n].length;for(var r=d.allocUnsafe(t),o=0,n=0;n<e.length;++n){var s=e[n];if(O(s,Uint8Array)&&(s=d.from(s)),!d.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},d.byteLength=h,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)a(this,t,t+1);return this},d.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)a(this,t,t+3),a(this,t+1,t+2);return this},d.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)a(this,t,t+7),a(this,t+1,t+6),a(this,t+2,t+5),a(this,t+3,t+4);return this},d.prototype.toLocaleString=d.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):r.apply(this,arguments)},d.prototype.equals=function(e){if(d.isBuffer(e))return this===e||0===d.compare(this,e);throw new TypeError("Argument must be a Buffer")},d.prototype.inspect=function(){var e="",t=L.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},e&&(d.prototype[e]=d.prototype.inspect),d.prototype.compare=function(e,t,r,o,n){if(O(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===n&&(n=this.length),(t=void 0===t?0:t)<0||r>e.length||o<0||n>this.length)throw new RangeError("out of range index");if(n<=o&&r<=t)return 0;if(n<=o)return-1;if(r<=t)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(o>>>=0),i=(r>>>=0)-(t>>>=0),a=Math.min(s,i),l=this.slice(o,n),u=e.slice(t,r),c=0;c<a;++c)if(l[c]!==u[c]){s=l[c],i=u[c];break}return s<i?-1:i<s?1:0},d.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},d.prototype.indexOf=function(e,t,r){return f(this,e,t,r,!0)},d.prototype.lastIndexOf=function(e,t,r){return f(this,e,t,r,!1)},d.prototype.write=function(e,t,r,o){if(void 0===t)o="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)o=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===o&&(o="utf8")):(o=r,r=void 0)}var n=this.length-t;if((void 0===r||n<r)&&(r=n),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o=o||"utf8";for(var s,i,a,l=!1;;)switch(o){case"hex":var u=this,c=e,d=t,h=r,f=(d=Number(d)||0,u.length-d);(!h||f<(h=Number(h)))&&(h=f),(f=c.length)/2<h&&(h=f/2);for(var p=0;p<h;++p){var m=parseInt(c.substr(2*p,2),16);if(C(m))return p;u[d+p]=m}return p;case"utf8":case"utf-8":return f=t,a=r,k(E(e,(i=this).length-f),i,f,a);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return i=this,a=t,s=r,k(M(e),i,a,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,t,r);default:if(l)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),l=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function m(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function b(e,t,r,o,n,s){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n<t||t<s)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}function _(e,t,r,o){if(r+o>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,o,n){return t=+t,r>>>=0,n||_(e,0,r,4),s.write(e,t,r,o,23,4),r+4}function x(e,t,r,o,n){return t=+t,r>>>=0,n||_(e,0,r,8),s.write(e,t,r,o,52,8),r+8}d.prototype.slice=function(e,t){var r=this.length,r=((e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e),this.subarray(e,t));return Object.setPrototypeOf(r,d.prototype),r},d.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s<t&&(n*=256);)o+=this[e+s]*n;return o},d.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e+--t],n=1;0<t&&(n*=256);)o+=this[e+--t]*n;return o},d.prototype.readUInt8=function(e,t){return e>>>=0,t||m(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||m(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=this[e],n=1,s=0;++s<t&&(n*=256);)o+=this[e+s]*n;return(n*=128)<=o&&(o-=Math.pow(2,8*t)),o},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||m(e,t,this.length);for(var o=t,n=1,s=this[e+--o];0<o&&(n*=256);)s+=this[e+--o]*n;return(n*=128)<=s&&(s-=Math.pow(2,8*t)),s},d.prototype.readInt8=function(e,t){return e>>>=0,t||m(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e]|this[e+1]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt16BE=function(e,t){e>>>=0,t||m(e,2,this.length);t=this[e+1]|this[e]<<8;return 32768&t?4294901760|t:t},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||m(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||m(e,4,this.length),s.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||m(e,8,this.length),s.read(this,e,!1,52,8)},d.prototype.writeUIntLE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},d.prototype.writeUIntBE=function(e,t,r,o){e=+e,t>>>=0,r>>>=0,o||b(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;0<=--n&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeIntLE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=0,s=1,i=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===i&&0!==this[t+n-1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeIntBE=function(e,t,r,o){e=+e,t>>>=0,o||b(this,e,t,r,(o=Math.pow(2,8*r-1))-1,-o);var n=r-1,s=1,i=0;for(this[t+n]=255&e;0<=--n&&(s*=256);)e<0&&0===i&&0!==this[t+n+1]&&(i=1),this[t+n]=(e/s>>0)-i&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,1,127,-128),this[t]=255&(e=e<0?255+e+1:e),t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||b(this,e,t,4,2147483647,-2147483648),this[t]=(e=e<0?4294967295+e+1:e)>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return x(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return x(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,o){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,o||0===o||(o=this.length),t>=e.length&&(t=e.length),(o=0<o&&o<r?r:o)===r)return 0;if(0===e.length||0===this.length)return 0;if((t=t||0)<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length);var n=(o=e.length-t<o-r?e.length-t+r:o)-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,o);else if(this===e&&r<t&&t<o)for(var s=n-1;0<=s;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,o),t);return n},d.prototype.fill=function(e,t,r,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!d.isEncoding(o))throw new TypeError("Unknown encoding: "+o);var n;1===e.length&&(n=e.charCodeAt(0),("utf8"===o&&n<128||"latin1"===o)&&(e=n))}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");var s;if(!(r<=t))if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(s=t;s<r;++s)this[s]=e;else{var i=d.isBuffer(e)?e:d.from(e,o),a=i.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=i[s%a]}return this};var w=/[^+/0-9A-Za-z-_]/g;function E(e,t){t=t||1/0;for(var r,o=e.length,n=null,s=[],i=0;i<o;++i){if(55295<(r=e.charCodeAt(i))&&r<57344){if(!n){if(56319<r){-1<(t-=3)&&s.push(239,191,189);continue}if(i+1===o){-1<(t-=3)&&s.push(239,191,189);continue}n=r;continue}if(r<56320){-1<(t-=3)&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&-1<(t-=3)&&s.push(239,191,189);if(n=null,r<128){if(--t<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function M(e){return S.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function k(e,t,r,o){for(var n=0;n<o&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function O(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function C(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var o=16*r,n=0;n<16;++n)t[o+n]=e[r]+e[n];return t}()}.call(this,A("buffer").Buffer)},{"base64-js":1,buffer:4,ieee754:254}],5:[function(e,t,r){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],6:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e)||null===e)return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},{"../internals/is-object":75}],7:[function(e,t,r){var o=e("../internals/well-known-symbol"),n=e("../internals/object-create"),e=e("../internals/object-define-property"),s=o("unscopables"),i=Array.prototype;null==i[s]&&e.f(i,s,{configurable:!0,value:n(null)}),t.exports=function(e){i[s][e]=!0}},{"../internals/object-create":91,"../internals/object-define-property":93,"../internals/well-known-symbol":150}],8:[function(e,t,r){"use strict";var o=e("../internals/string-multibyte").charAt;t.exports=function(e,t,r){return t+(r?o(e,t).length:1)}},{"../internals/string-multibyte":125}],9:[function(e,t,r){t.exports=function(e,t,r){if(e instanceof t)return e;throw TypeError("Incorrect "+(r?r+" ":"")+"invocation")}},{}],10:[function(e,t,r){var o=e("../internals/is-object");t.exports=function(e){if(o(e))return e;throw TypeError(String(e)+" is not an object")}},{"../internals/is-object":75}],11:[function(e,t,r){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},{}],12:[function(e,t,r){"use strict";function o(e){return l(e)&&u(E,c(e))}var n,s=e("../internals/array-buffer-native"),i=e("../internals/descriptors"),a=e("../internals/global"),l=e("../internals/is-object"),u=e("../internals/has"),c=e("../internals/classof"),d=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine"),f=e("../internals/object-define-property").f,p=e("../internals/object-get-prototype-of"),m=e("../internals/object-set-prototype-of"),y=e("../internals/well-known-symbol"),e=e("../internals/uid"),g=a.Int8Array,v=g&&g.prototype,b=a.Uint8ClampedArray,b=b&&b.prototype,_=g&&p(g),j=v&&p(v),x=Object.prototype,w=x.isPrototypeOf,y=y("toStringTag"),S=e("TYPED_ARRAY_TAG"),T=s&&!!m&&"Opera"!==c(a.opera),e=!1,E={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8};for(n in E)a[n]||(T=!1);if((!T||"function"!=typeof _||_===Function.prototype)&&(_=function(){throw TypeError("Incorrect invocation")},T))for(n in E)a[n]&&m(a[n],_);if((!T||!j||j===x)&&(j=_.prototype,T))for(n in E)a[n]&&m(a[n].prototype,j);if(T&&p(b)!==j&&m(b,j),i&&!u(j,y))for(n in e=!0,f(j,y,{get:function(){return l(this)?this[S]:void 0}}),E)a[n]&&d(a[n],S,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:e&&S,aTypedArray:function(e){if(o(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(m){if(w.call(_,e))return e}else for(var t in E)if(u(E,n)){t=a[t];if(t&&(e===t||w.call(t,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var o in E){o=a[o];o&&u(o.prototype,e)&&delete o.prototype[e]}j[e]&&!r||h(j,e,!r&&T&&v[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var o,n;if(i){if(m){if(r)for(o in E)(n=a[o])&&u(n,e)&&delete n[e];if(_[e]&&!r)return;try{return h(_,e,!r&&T&&g[e]||t)}catch(e){}}for(o in E)!(n=a[o])||n[e]&&!r||h(n,e,t)}},isView:function(e){e=c(e);return"DataView"===e||u(E,e)},isTypedArray:o,TypedArray:_,TypedArrayPrototype:j}},{"../internals/array-buffer-native":11,"../internals/classof":29,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/global":60,"../internals/has":61,"../internals/is-object":75,"../internals/object-define-property":93,"../internals/object-get-prototype-of":98,"../internals/object-set-prototype-of":102,"../internals/redefine":110,"../internals/uid":147,"../internals/well-known-symbol":150}],13:[function(e,t,D){"use strict";function r(e){return[255&e]}function o(e){return[255&e,e>>8&255]}function n(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function s(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function i(e){return C(e,23,4)}function F(e){return C(e,52,8)}function a(e,t){H(e[w],t,{get:function(){return b(this)[t]}})}function l(e,t,r,o){if(r=m(r),e=b(e),r+t>e.byteLength)throw O(S);var n=b(e.buffer).bytes,r=r+e.byteOffset,e=n.slice(r,r+t);return o?e:e.reverse()}function u(e,t,r,o,n,s){if(r=m(r),e=b(e),r+t>e.byteLength)throw O(S);for(var i=b(e.buffer).bytes,a=r+e.byteOffset,l=o(+n),u=0;u<t;u++)i[a+u]=l[s?u:t-u-1]}var c=e("../internals/global"),d=e("../internals/descriptors"),U=e("../internals/array-buffer-native"),N=e("../internals/create-non-enumerable-property"),h=e("../internals/redefine-all"),f=e("../internals/fails"),p=e("../internals/an-instance"),B=e("../internals/to-integer"),G=e("../internals/to-length"),m=e("../internals/to-index"),y=e("../internals/ieee754"),V=e("../internals/object-get-prototype-of"),g=e("../internals/object-set-prototype-of"),z=e("../internals/object-get-own-property-names").f,H=e("../internals/object-define-property").f,W=e("../internals/array-fill"),v=e("../internals/set-to-string-tag"),e=e("../internals/internal-state"),b=e.get,_=e.set,j="ArrayBuffer",x="DataView",w="prototype",S="Wrong index",T=c[j],E=T,M=c[x],e=M&&M[w],k=Object.prototype,O=c.RangeError,C=y.pack,P=y.unpack;if(U){if(!f(function(){T(1)})||!f(function(){new T(-1)})||f(function(){return new T,new T(1.5),new T(NaN),T.name!=j})){for(var A,c=(E=function(e){return p(this,E),new T(m(e))})[w]=T[w],L=z(T),R=0;L.length>R;)(A=L[R++])in E||N(E,A,T[A]);c.constructor=E}g&&V(e)!==k&&g(e,k);var y=new M(new E(2)),I=e.setInt8;y.setInt8(0,2147483648),y.setInt8(1,2147483649),!y.getInt8(0)&&y.getInt8(1)||h(e,{setInt8:function(e,t){I.call(this,e,t<<24>>24)},setUint8:function(e,t){I.call(this,e,t<<24>>24)}},{unsafe:!0})}else E=function(e){p(this,E,j);e=m(e);_(this,{bytes:W.call(new Array(e),0),byteLength:e}),d||(this.byteLength=e)},M=function(e,t,r){p(this,M,x),p(e,E,x);var o=b(e).byteLength,t=B(t);if(t<0||o<t)throw O("Wrong offset");if(o<t+(r=void 0===r?o-t:G(r)))throw O("Wrong length");_(this,{buffer:e,byteLength:r,byteOffset:t}),d||(this.buffer=e,this.byteLength=r,this.byteOffset=t)},d&&(a(E,"byteLength"),a(M,"buffer"),a(M,"byteLength"),a(M,"byteOffset")),h(M[w],{getInt8:function(e){return l(this,1,e)[0]<<24>>24},getUint8:function(e){return l(this,1,e)[0]},getInt16:function(e){e=l(this,2,e,1<arguments.length?arguments[1]:void 0);return(e[1]<<8|e[0])<<16>>16},getUint16:function(e){e=l(this,2,e,1<arguments.length?arguments[1]:void 0);return e[1]<<8|e[0]},getInt32:function(e){return s(l(this,4,e,1<arguments.length?arguments[1]:void 0))},getUint32:function(e){return s(l(this,4,e,1<arguments.length?arguments[1]:void 0))>>>0},getFloat32:function(e){return P(l(this,4,e,1<arguments.length?arguments[1]:void 0),23)},getFloat64:function(e){return P(l(this,8,e,1<arguments.length?arguments[1]:void 0),52)},setInt8:function(e,t){u(this,1,e,r,t)},setUint8:function(e,t){u(this,1,e,r,t)},setInt16:function(e,t){u(this,2,e,o,t,2<arguments.length?arguments[2]:void 0)},setUint16:function(e,t){u(this,2,e,o,t,2<arguments.length?arguments[2]:void 0)},setInt32:function(e,t){u(this,4,e,n,t,2<arguments.length?arguments[2]:void 0)},setUint32:function(e,t){u(this,4,e,n,t,2<arguments.length?arguments[2]:void 0)},setFloat32:function(e,t){u(this,4,e,i,t,2<arguments.length?arguments[2]:void 0)},setFloat64:function(e,t){u(this,8,e,F,t,2<arguments.length?arguments[2]:void 0)}});v(E,j),v(M,x),t.exports={ArrayBuffer:E,DataView:M}},{"../internals/an-instance":9,"../internals/array-buffer-native":11,"../internals/array-fill":15,"../internals/create-non-enumerable-property":38,"../internals/descriptors":43,"../internals/fails":51,"../internals/global":60,"../internals/ieee754":66,"../internals/internal-state":71,"../internals/object-define-property":93,"../internals/object-get-own-property-names":96,"../internals/object-get-prototype-of":98,"../internals/object-set-prototype-of":102,"../internals/redefine-all":109,"../internals/set-to-string-tag":119,"../internals/to-index":135,"../internals/to-integer":137,"../internals/to-length":138}],14:[function(e,t,r){"use strict";var l=e("../internals/to-object"),u=e("../internals/to-absolute-index"),c=e("../internals/to-length"),d=Math.min;t.exports=[].copyWithin||function(e,t){var r=l(this),o=c(r.length),n=u(e,o),s=u(t,o),e=2<arguments.length?arguments[2]:void 0,i=d((void 0===e?o:u(e,o))-s,o-n),a=1;for(s<n&&n<s+i&&(a=-1,s+=i-1,n+=i-1);0<i--;)s in r?r[n]=r[s]:delete r[n],n+=a,s+=a;return r}},{"../internals/to-absolute-index":134,"../internals/to-length":138,"../internals/to-object":139}],15:[function(e,t,r){"use strict";var i=e("../internals/to-object"),a=e("../internals/to-absolute-index"),l=e("../internals/to-length");t.exports=function(e){for(var t=i(this),r=l(t.length),o=arguments.length,n=a(1<o?arguments[1]:void 0,r),o=2<o?arguments[2]:void 0,s=void 0===o?r:a(o,r);n<s;)t[n++]=e;return t}},{"../internals/to-absolute-index":134,"../internals/to-length":138,"../internals/to-object":139}],16:[function(e,t,r){"use strict";var o=e("../internals/array-iteration").forEach,n=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),n=n("forEach"),e=e("forEach");t.exports=n&&e?[].forEach:function(e){return o(this,e,1<arguments.length?arguments[1]:void 0)}},{"../internals/array-iteration":19,"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23}],17:[function(e,t,r){"use strict";var f=e("../internals/function-bind-context"),p=e("../internals/to-object"),m=e("../internals/call-with-safe-iteration-closing"),y=e("../internals/is-array-iterator-method"),g=e("../internals/to-length"),v=e("../internals/create-property"),b=e("../internals/get-iterator-method");t.exports=function(e){var t,r,o,n,s,i,a=p(e),e="function"==typeof this?this:Array,l=arguments.length,u=1<l?arguments[1]:void 0,c=void 0!==u,d=b(a),h=0;if(c&&(u=f(u,2<l?arguments[2]:void 0,2)),null==d||e==Array&&y(d))for(r=new e(t=g(a.length));h<t;h++)i=c?u(a[h],h):a[h],v(r,h,i);else for(s=(n=d.call(a)).next,r=new e;!(o=s.call(n)).done;h++)i=c?m(n,u,[o.value,h],!0):o.value,v(r,h,i);return r.length=h,r}},{"../internals/call-with-safe-iteration-closing":26,"../internals/create-property":40,"../internals/function-bind-context":55,"../internals/get-iterator-method":58,"../internals/is-array-iterator-method":72,"../internals/to-length":138,"../internals/to-object":139}],18:[function(e,t,r){function o(a){return function(e,t,r){var o,n=l(e),s=u(n.length),i=c(r,s);if(a&&t!=t){for(;i<s;)if((o=n[i++])!=o)return!0}else for(;i<s;i++)if((a||i in n)&&n[i]===t)return a||i||0;return!a&&-1}}var l=e("../internals/to-indexed-object"),u=e("../internals/to-length"),c=e("../internals/to-absolute-index");t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/to-absolute-index":134,"../internals/to-indexed-object":136,"../internals/to-length":138}],19:[function(e,t,r){function o(h){var f=1==h,p=2==h,m=3==h,y=4==h,g=6==h,v=5==h||g;return function(e,t,r,o){for(var n,s,i=j(e),a=_(i),l=b(t,r,3),u=x(a.length),c=0,t=o||w,d=f?t(e,u):p?t(e,0):void 0;c<u;c++)if((v||c in a)&&(s=l(n=a[c],c,i),h))if(f)d[c]=s;else if(s)switch(h){case 3:return!0;case 5:return n;case 6:return c;case 2:S.call(d,n)}else if(y)return!1;return g?-1:m||y?y:d}}var b=e("../internals/function-bind-context"),_=e("../internals/indexed-object"),j=e("../internals/to-object"),x=e("../internals/to-length"),w=e("../internals/array-species-create"),S=[].push;t.exports={forEach:o(0),map:o(1),filter:o(2),some:o(3),every:o(4),find:o(5),findIndex:o(6)}},{"../internals/array-species-create":25,"../internals/function-bind-context":55,"../internals/indexed-object":67,"../internals/to-length":138,"../internals/to-object":139}],20:[function(e,t,r){"use strict";var n=e("../internals/to-indexed-object"),s=e("../internals/to-integer"),i=e("../internals/to-length"),o=e("../internals/array-method-is-strict"),e=e("../internals/array-method-uses-to-length"),a=Math.min,l=[].lastIndexOf,u=!!l&&1/[1].lastIndexOf(1,-0)<0,o=o("lastIndexOf"),e=e("indexOf",{ACCESSORS:!0,1:0});t.exports=u||!o||!e?function(e){if(u)return l.apply(this,arguments)||0;var t=n(this),r=i(t.length),o=r-1;for((o=1<arguments.length?a(o,s(arguments[1])):o)<0&&(o=r+o);0<=o;o--)if(o in t&&t[o]===e)return o||0;return-1}:l},{"../internals/array-method-is-strict":22,"../internals/array-method-uses-to-length":23,"../internals/to-indexed-object":136,"../internals/to-integer":137,"../internals/to-length":138}],21:[function(e,t,r){var o=e("../internals/fails"),n=e("../internals/well-known-symbol"),s=e("../internals/engine-v8-version"),i=n("species");t.exports=function(t){return 51<=s||!o(function(){var e=[];return(e.constructor={})[i]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},{"../internals/engine-v8-version":48,"../internals/fails":51,"../internals/well-known-symbol":150}],22:[function(e,t,r){"use strict";var o=e("../internals/fails");t.exports=function(e,t){var r=[][e];return!!r&&o(function(){r.call(null,t||function(){throw 1},1)})}},{"../internals/fails":51}],23:[function(e,t,r){function i(e){throw e}var a=e("../internals/descriptors"),l=e("../internals/fails"),u=e("../internals/has"),c=Object.defineProperty,d={};t.exports=function(e,t){var r,o,n,s;return u(d,e)?d[e]:(r=[][e],o=!!u(t=t||{},"ACCESSORS")&&t.ACCESSORS,n=u(t,0)?t[0]:i,s=u(t,1)?t[1]:void 0,d[e]=!!r&&!l(function(){if(o&&!a)return!0;var e={length:-1};o?c(e,1,{enumerable:!0,get:i}):e[1]=1,r.call(e,n,s)}))}},{"../internals/descriptors":43,"../internals/fails":51,"../internals/has":61}],24:[function(e,t,r){function o(u){return function(e,t,r,o){c(t);var n=d(e),s=h(n),i=f(n.length),a=u?i-1:0,l=u?-1:1;if(r<2)for(;;){if(a in s){o=s[a],a+=l;break}if(a+=l,u?a<0:i<=a)throw TypeError("Reduce of empty array with no initial value")}for(;u?0<=a:a<i;a+=l)a in s&&(o=t(o,s[a],a,n));return o}}var c=e("../internals/a-function"),d=e("../internals/to-object"),h=e("../internals/indexed-object"),f=e("../internals/to-length");t.exports={left:o(!1),right:o(!0)}},{"../internals/a-function":5,"../internals/indexed-object":67,"../internals/to-length":138,"../internals/to-object":139}],25:[function(e,t,r){var o=e("../internals/is-object"),n=e("../internals/is-array"),s=e("../internals/well-known-symbol")("species");t.exports=function(e,t){var r;return new(void 0===(r=n(e)&&("function"==typeof(r=e.constructor)&&(r===Array||n(r.prototype))||o(r)&&null===(r=r[s]))?void 0:r)?Array:r)(0===t?0:t)}},{"../internals/is-array":73,"../internals/is-object":75,"../internals/well-known-symbol":150}],26:[function(e,t,r){var n=e("../internals/an-object");t.exports=function(t,e,r,o){try{return o?e(n(r)[0],r[1]):e(r)}catch(e){o=t.return;throw void 0!==o&&n(o.call(t)),e}}},{"../internals/an-object":10}],27:[function(e,t,r){var n=e("../internals/well-known-symbol")("iterator"),s=!1;try{var o=0,i={next:function(){return{done:!!o++}},return:function(){s=!0}};i[n]=function(){return this},Array.from(i,function(){throw 2})}catch(e){}t.exports=function(e,t){if(!t&&!s)return!1;var r=!1;try{var o={};o[n]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r}},{"../internals/well-known-symbol":150}],28:[function(e,t,r){var o={}.toString;t.exports=function(e){return o.call(e).slice(8,-1)}},{}],29:[function(e,t,r){var o=e("../internals/to-string-tag-support"),n=e("../internals/classof-raw"),s=e("../internals/well-known-symbol")("toStringTag"),i="Arguments"==n(function(){return arguments}());t.exports=o?n:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=Object(e),s))?t:i?n(e):"Object"==(t=n(e))&&"function"==typeof e.callee?"Arguments":t}},{"../internals/classof-raw":28,"../internals/to-string-tag-support":143,"../internals/well-known-symbol":150}],30:[function(e,t,r){"use strict";var u=e("../internals/object-define-property").f,c=e("../internals/object-create"),d=e("../internals/redefine-all"),h=e("../internals/function-bind-context"),f=e("../internals/an-instance"),p=e("../internals/iterate"),i=e("../internals/define-iterator"),a=e("../internals/set-species"),m=e("../internals/descriptors"),y=e("../internals/internal-metadata").fastKey,e=e("../internals/internal-state"),g=e.set,v=e.getterFor;t.exports={getConstructor:function(e,r,o,n){function s(e,t,r){var o,n=l(e),s=i(e,t);return s?s.value=r:(n.last=s={index:o=y(t,!0),key:t,value:r,previous:t=n.last,next:void 0,removed:!1},n.first||(n.first=s),t&&(t.next=s),m?n.size++:e.size++,"F"!==o&&(n.index[o]=s)),e}function i(e,t){var r,e=l(e),o=y(t);if("F"!==o)return e.index[o];for(r=e.first;r;r=r.next)if(r.key==t)return r}var a=e(function(e,t){f(e,a,r),g(e,{type:r,index:c(null),first:void 0,last:void 0,size:0}),m||(e.size=0),null!=t&&p(t,e[n],e,o)}),l=v(r);return d(a.prototype,{clear:function(){for(var e=l(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,m?e.size=0:this.size=0},delete:function(e){var t,r,o=l(this),e=i(this,e);return e&&(t=e.next,r=e.previous,delete o.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),o.first==e&&(o.first=t),o.last==e&&(o.last=r),m?o.size--:this.size--),!!e},forEach:function(e){for(var t,r=l(this),o=h(e,1<arguments.length?arguments[1]:void 0,3);t=t?t.next:r.first;)for(o(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!i(this,e)}}),d(a.prototype,o?{get:function(e){e=i(this,e);return e&&e.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),m&&u(a.prototype,"size",{get:function(){return l(this).size}}),a},setStrong:function(e,t,r){var o=t+" Iterator",n=v(t),s=v(o);i(e,t,function(e,t){g(this,{type:o,target:e,state:n(e),kind:t,last:void 0})},function(){for(var e=s(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),a(t)}}},{"../internals/an-instance":9,"../internals/define-iterator":41,"../internals/descriptors":43,"../internals/function-bind-context":55,"../internals/internal-metadata":70,"../internals/internal-state":71,"../internals/iterate":78,"../internals/object-create":91,"../internals/object-define-property":93,"../internals/redefine-all":109,"../internals/set-species":118}],31:[function(e,t,r){"use strict";function l(e){return e.frozen||(e.frozen=new o)}function o(){this.entries=[]}function n(e,t){return i(e.entries,function(e){return e[0]===t})}var u=e("../internals/redefine-all"),c=e("../internals/internal-metadata").getWeakData,d=e("../internals/an-object"),h=e("../internals/is-object"),f=e("../internals/an-instance"),p=e("../internals/iterate"),s=e("../internals/array-iteration"),m=e("../internals/has"),e=e("../internals/internal-state"),y=e.set,g=e.getterFor,i=s.find,a=s.findIndex,v=0;o.prototype={get:function(e){e=n(this,e);if(e)return e[1]},has:function(e){return!!n(this,e)},set:function(e,t){var r=n(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(t){var e=a(this.entries,function(e){return e[0]===t});return~e&&this.entries.splice(e,1),!!~e}},t.exports={getConstructor:function(e,r,o,n){function s(e,t,r){var o=a(e),n=c(d(t),!0);return!0===n?l(o).set(t,r):n[o.id]=r,e}var i=e(function(e,t){f(e,i,r),y(e,{type:r,id:v++,frozen:void 0}),null!=t&&p(t,e[n],e,o)}),a=g(r);return u(i.prototype,{delete:function(e){var t,r=a(this);return!!h(e)&&(!0===(t=c(e))?l(r).delete(e):t&&m(t,r.id)&&delete t[r.id])},has:function(e){var t,r=a(this);return!!h(e)&&(!0===(t=c(e))?l(r).has(e):t&&m(t,r.id))}}),u(i.prototype,o?{get:function(e){var t,r=a(this);if(h(e))return!0===(t=c(e))?l(r).get(e):t?t[r.id]:void 0},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),i}}},{"../internals/an-instance":9,"../internals/an-object":10,"../internals/array-iteration":19,"../internals/has":61,"../internals/internal-metadata":70,"../internals/internal-state":71,"../internals/is-object":75,"../internals/iterate":78,"../internals/redefine-all":109}],32:[function(e,t,r){"use strict";var y=e("../internals/export"),g=e("../internals/global"),v=e("../internals/is-forced"),b=e("../internals/redefine"),_=e("../internals/internal-metadata"),j=e("../internals/iterate"),x=e("../internals/an-instance"),w=e("../internals/is-object"),S=e("../internals/fails"),T=e("../internals/check-correctness-of-iteration"),E=e("../internals/set-to-string-tag"),M=e("../internals/inherit-if-required");t.exports=function(r,e,t){function o(e){var r=f[e];b(f,e,"add"==e?function(e){return r.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(c&&!w(e))&&r.call(this,0===e?0:e)}:"get"==e?function(e){return c&&!w(e)?void 0:r.call(this,0===e?0:e)}:"has"==e?function(e){return!(c&&!w(e))&&r.call(this,0===e?0:e)}:function(e,t){return r.call(this,0===e?0:e,t),this})}var n,s,i,a,l,u=-1!==r.indexOf("Map"),c=-1!==r.indexOf("Weak"),d=u?"set":"add",h=g[r],f=h&&h.prototype,p=h,m={};return v(r,"function"!=typeof h||!(c||f.forEach&&!S(function(){(new h).entries().next()})))?(p=t.getConstructor(e,r,u,d),_.REQUIRED=!0):v(r,!0)&&(s=(n=new p)[d](c?{}:-0,1)!=n,i=S(function(){n.has(1)}),a=T(function(e){new h(e)}),l=!c&&S(function(){for(var e=new h,t=5;t--;)e[d](t,t);return!e.has(-0)}),a||(((p=e(function(e,t){x(e,p,r);e=M(new h,e,p);return null!=t&&j(t,e[d],e,u),e})).prototype=f).constructor=p),(i||l)&&(o("delete"),o("has"),u&&o("get")),(l||s)&&o(d),c&&f.clear&&delete f.clear),m[r]=p,y({global:!0,forced:p!=h},m),E(p,r),c||t.setStrong(p,r,u),p}},{"../internals/an-instance":9,"../internals/check-correctness-of-iteration":27,"../internals/export":50,"../internals/fails":51,"../internals/global":60,"../internals/inherit-if-required":68,"../internals/internal-metadata":70,"../internals/is-forced":74,"../internals/is-object":75,"../internals/iterate":78,"../internals/redefine":110,"../internals/set-to-string-tag":119}],33:[function(e,t,r){var a=e("../internals/has"),l=e("../internals/own-keys"),u=e("../internals/object-get-own-property-descriptor"),c=e("../internals/object-define-property");t.exports=function(e,t){for(var r=l(t),o=c.f,n=u.f,s=0;s<r.length;s++){var i=r[s];a(e,i)||o(e,i,n(t,i))}}},{"../internals/has":61,"../internals/object-define-property":93,"../internals/object-get-own-property-descriptor":94,"../internals/own-keys":105}],34:[function(e,t,r){var o=e("../internals/well-known-symbol")("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[o]=!1,"/./"[t](r)}catch(e){}}return!1}},{"../internals/well-known-symbol":150}],35:[function(e,t,r){e=e("../internals/fails");t.exports=!e(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},{"../internals/fails":51}],36:[function(e,t,r){var s=e("../internals/require-object-coercible"),i=/"/g;t.exports=function(e,t,r,o){var e=String(s(e)),n="<"+t;return""!==r&&(n+=" "+r+'="'+String(o).replace(i,""")+'"'),n+">"+e+"</"+t+">"}},{"../internals/require-object-coercible":115}],37:[function(e,t,r){"use strict";function o(){return this}var n=e("../internals/iterators-core").IteratorPrototype,s=e("../internals/object-create"),i=e("../internals/create-property-descriptor"),a=e("../internals/set-to-string-tag"),l=e("../internals/iterators");t.exports=function(e,t,r){t+=" Iterator";return e.prototype=s(n,{next:i(1,r)}),a(e,t,!1,!0),l[t]=o,e}},{"../internals/create-property-descriptor":39,"../internals/iterators":80,"../internals/iterators-core":79,"../internals/object-create":91,"../internals/set-to-string-tag":119}],38:[function(e,t,r){var o=e("../internals/descriptors"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=o?function(e,t,r){return n.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},{"../internals/create-property-descriptor":39,"../internals/descriptors":43,"../internals/object-define-property":93}],39:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],40:[function(e,t,r){"use strict";var o=e("../internals/to-primitive"),n=e("../internals/object-define-property"),s=e("../internals/create-property-descriptor");t.exports=function(e,t,r){t=o(t);t in e?n.f(e,t,s(0,r)):e[t]=r}},{"../internals/create-property-descriptor":39,"../internals/object-define-property":93,"../internals/to-primitive":142}],41:[function(e,t,r){"use strict";function m(){return this}var y=e("../internals/export"),g=e("../internals/create-iterator-constructor"),v=e("../internals/object-get-prototype-of"),b=e("../internals/object-set-prototype-of"),_=e("../internals/set-to-string-tag"),j=e("../internals/create-non-enumerable-property"),x=e("../internals/redefine"),o=e("../internals/well-known-symbol"),w=e("../internals/is-pure"),S=e("../internals/ite