UNPKG

@hiddentao/clockwork-engine

Version:

A TypeScript/PIXI.js game engine for deterministic, replayable games with built-in rendering

1,462 lines (1,443 loc) 1.23 MB
var __create = Object.create; var __getProtoOf = Object.getPrototypeOf; var __defProp = Object.defineProperty; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __toESM = (mod, isNodeMode, target) => { target = mod != null ? __create(__getProtoOf(mod)) : {}; const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target; for (let key of __getOwnPropNames(mod)) if (!__hasOwnProp.call(to, key)) __defProp(to, key, { get: () => mod[key], enumerable: true }); return to; }; var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true, configurable: true, set: (newValue) => all[name] = () => newValue }); }; var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res); // node_modules/alea/alea.js var require_alea = __commonJS((exports, module) => { (function(root, factory) { if (typeof exports === "object") { module.exports = factory(); } else if (typeof define === "function" && define.amd) { define(factory); } else { root.Alea = factory(); } })(exports, function() { Alea.importState = function(i) { var random = new Alea; random.importState(i); return random; }; return Alea; function Alea() { return function(args) { var s0 = 0; var s1 = 0; var s2 = 0; var c = 1; if (args.length == 0) { args = [+new Date]; } var mash = Mash(); s0 = mash(" "); s1 = mash(" "); s2 = mash(" "); for (var i = 0;i < args.length; i++) { s0 -= mash(args[i]); if (s0 < 0) { s0 += 1; } s1 -= mash(args[i]); if (s1 < 0) { s1 += 1; } s2 -= mash(args[i]); if (s2 < 0) { s2 += 1; } } mash = null; var random = function() { var t = 2091639 * s0 + c * 0.00000000023283064365386963; s0 = s1; s1 = s2; return s2 = t - (c = t | 0); }; random.next = random; random.uint32 = function() { return random() * 4294967296; }; random.fract53 = function() { return random() + (random() * 2097152 | 0) * 0.00000000000000011102230246251565; }; random.version = "Alea 0.9"; random.args = args; random.exportState = function() { return [s0, s1, s2, c]; }; random.importState = function(i2) { s0 = +i2[0] || 0; s1 = +i2[1] || 0; s2 = +i2[2] || 0; c = +i2[3] || 0; }; return random; }(Array.prototype.slice.call(arguments)); } function Mash() { var n = 4022871197; var mash = function(data) { data = data.toString(); for (var i = 0;i < data.length; i++) { n += data.charCodeAt(i); var h = 0.02519603282416938 * n; n = h >>> 0; h -= n; h *= n; n = h >>> 0; h -= n; n += h * 4294967296; } return (n >>> 0) * 0.00000000023283064365386963; }; mash.version = "Mash 0.9"; return mash; } }); }); // node_modules/pixi.js/lib/extensions/Extensions.mjs var ExtensionType, normalizeExtension = (ext) => { if (typeof ext === "function" || typeof ext === "object" && ext.extension) { if (!ext.extension) { throw new Error("Extension class must have an extension object"); } const metadata = typeof ext.extension !== "object" ? { type: ext.extension } : ext.extension; ext = { ...metadata, ref: ext }; } if (typeof ext === "object") { ext = { ...ext }; } else { throw new Error("Invalid extension type"); } if (typeof ext.type === "string") { ext.type = [ext.type]; } return ext; }, normalizeExtensionPriority = (ext, defaultPriority) => normalizeExtension(ext).priority ?? defaultPriority, extensions; var init_Extensions = __esm(() => { ExtensionType = /* @__PURE__ */ ((ExtensionType2) => { ExtensionType2["Application"] = "application"; ExtensionType2["WebGLPipes"] = "webgl-pipes"; ExtensionType2["WebGLPipesAdaptor"] = "webgl-pipes-adaptor"; ExtensionType2["WebGLSystem"] = "webgl-system"; ExtensionType2["WebGPUPipes"] = "webgpu-pipes"; ExtensionType2["WebGPUPipesAdaptor"] = "webgpu-pipes-adaptor"; ExtensionType2["WebGPUSystem"] = "webgpu-system"; ExtensionType2["CanvasSystem"] = "canvas-system"; ExtensionType2["CanvasPipesAdaptor"] = "canvas-pipes-adaptor"; ExtensionType2["CanvasPipes"] = "canvas-pipes"; ExtensionType2["Asset"] = "asset"; ExtensionType2["LoadParser"] = "load-parser"; ExtensionType2["ResolveParser"] = "resolve-parser"; ExtensionType2["CacheParser"] = "cache-parser"; ExtensionType2["DetectionParser"] = "detection-parser"; ExtensionType2["MaskEffect"] = "mask-effect"; ExtensionType2["BlendMode"] = "blend-mode"; ExtensionType2["TextureSource"] = "texture-source"; ExtensionType2["Environment"] = "environment"; ExtensionType2["ShapeBuilder"] = "shape-builder"; ExtensionType2["Batcher"] = "batcher"; return ExtensionType2; })(ExtensionType || {}); extensions = { _addHandlers: {}, _removeHandlers: {}, _queue: {}, remove(...extensions2) { extensions2.map(normalizeExtension).forEach((ext) => { ext.type.forEach((type) => this._removeHandlers[type]?.(ext)); }); return this; }, add(...extensions2) { extensions2.map(normalizeExtension).forEach((ext) => { ext.type.forEach((type) => { const handlers = this._addHandlers; const queue = this._queue; if (!handlers[type]) { queue[type] = queue[type] || []; queue[type]?.push(ext); } else { handlers[type]?.(ext); } }); }); return this; }, handle(type, onAdd, onRemove) { const addHandlers = this._addHandlers; const removeHandlers = this._removeHandlers; if (addHandlers[type] || removeHandlers[type]) { throw new Error(`Extension type ${type} already has a handler`); } addHandlers[type] = onAdd; removeHandlers[type] = onRemove; const queue = this._queue; if (queue[type]) { queue[type]?.forEach((ext) => onAdd(ext)); delete queue[type]; } return this; }, handleByMap(type, map) { return this.handle(type, (extension) => { if (extension.name) { map[extension.name] = extension.ref; } }, (extension) => { if (extension.name) { delete map[extension.name]; } }); }, handleByNamedList(type, map, defaultPriority = -1) { return this.handle(type, (extension) => { const index = map.findIndex((item) => item.name === extension.name); if (index >= 0) return; map.push({ name: extension.name, value: extension.ref }); map.sort((a, b) => normalizeExtensionPriority(b.value, defaultPriority) - normalizeExtensionPriority(a.value, defaultPriority)); }, (extension) => { const index = map.findIndex((item) => item.name === extension.name); if (index !== -1) { map.splice(index, 1); } }); }, handleByList(type, list, defaultPriority = -1) { return this.handle(type, (extension) => { if (list.includes(extension.ref)) { return; } list.push(extension.ref); list.sort((a, b) => normalizeExtensionPriority(b, defaultPriority) - normalizeExtensionPriority(a, defaultPriority)); }, (extension) => { const index = list.indexOf(extension.ref); if (index !== -1) { list.splice(index, 1); } }); }, mixin(Target, ...sources) { for (const source of sources) { Object.defineProperties(Target.prototype, Object.getOwnPropertyDescriptors(source)); } } }; }); // node_modules/eventemitter3/index.js var require_eventemitter3 = __commonJS((exports, module) => { var has = Object.prototype.hasOwnProperty; var prefix = "~"; function Events() {} if (Object.create) { Events.prototype = Object.create(null); if (!new Events().__proto__) prefix = false; } function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; } function addListener(emitter, event, fn, context, once) { if (typeof fn !== "function") { throw new TypeError("The listener must be a function"); } var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); else emitter._events[evt] = [emitter._events[evt], listener]; return emitter; } function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events; else delete emitter._events[evt]; } function EventEmitter2() { this._events = new Events; this._eventsCount = 0; } EventEmitter2.prototype.eventNames = function eventNames() { var names = [], events, name; if (this._eventsCount === 0) return names; for (name in events = this._events) { if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events)); } return names; }; EventEmitter2.prototype.listeners = function listeners(event) { var evt = prefix ? prefix + event : event, handlers = this._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i = 0, l = handlers.length, ee = new Array(l);i < l; i++) { ee[i] = handlers[i].fn; } return ee; }; EventEmitter2.prototype.listenerCount = function listenerCount(event) { var evt = prefix ? prefix + event : event, listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt], len = arguments.length, args, i; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i = 1, args = new Array(len - 1);i < len; i++) { args[i - 1] = arguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length, j; for (i = 0;i < length; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context); break; case 2: listeners[i].fn.call(listeners[i].context, a1); break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; default: if (!args) for (j = 1, args = new Array(len - 1);j < len; j++) { args[j - 1] = arguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; EventEmitter2.prototype.on = function on(event, fn, context) { return addListener(this, event, fn, context, false); }; EventEmitter2.prototype.once = function once(event, fn, context) { return addListener(this, event, fn, context, true); }; EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) { clearEvent(this, evt); } } else { for (var i = 0, events = [], length = listeners.length;i < length; i++) { if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) { events.push(listeners[i]); } } if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; else clearEvent(this, evt); } return this; }; EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events; this._eventsCount = 0; } return this; }; EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; EventEmitter2.prefixed = prefix; EventEmitter2.EventEmitter = EventEmitter2; if (typeof module !== "undefined") { module.exports = EventEmitter2; } }); // node_modules/eventemitter3/index.mjs var import__, eventemitter3_default; var init_eventemitter3 = __esm(() => { import__ = __toESM(require_eventemitter3(), 1); eventemitter3_default = import__.default; }); // node_modules/@pixi/colord/index.mjs var r, t = function(r2) { return typeof r2 == "string" ? r2.length > 0 : typeof r2 == "number"; }, n = function(r2, t2, n2) { return t2 === undefined && (t2 = 0), n2 === undefined && (n2 = Math.pow(10, t2)), Math.round(n2 * r2) / n2 + 0; }, e = function(r2, t2, n2) { return t2 === undefined && (t2 = 0), n2 === undefined && (n2 = 1), r2 > n2 ? n2 : r2 > t2 ? r2 : t2; }, u = function(r2) { return (r2 = isFinite(r2) ? r2 % 360 : 0) > 0 ? r2 : r2 + 360; }, a = function(r2) { return { r: e(r2.r, 0, 255), g: e(r2.g, 0, 255), b: e(r2.b, 0, 255), a: e(r2.a) }; }, o = function(r2) { return { r: n(r2.r), g: n(r2.g), b: n(r2.b), a: n(r2.a, 3) }; }, i, s = function(r2) { var t2 = r2.toString(16); return t2.length < 2 ? "0" + t2 : t2; }, h = function(r2) { var { r: t2, g: n2, b: e2, a: u2 } = r2, a2 = Math.max(t2, n2, e2), o2 = a2 - Math.min(t2, n2, e2), i2 = o2 ? a2 === t2 ? (n2 - e2) / o2 : a2 === n2 ? 2 + (e2 - t2) / o2 : 4 + (t2 - n2) / o2 : 0; return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o2 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; }, b = function(r2) { var { h: t2, s: n2, v: e2, a: u2 } = r2; t2 = t2 / 360 * 6, n2 /= 100, e2 /= 100; var a2 = Math.floor(t2), o2 = e2 * (1 - n2), i2 = e2 * (1 - (t2 - a2) * n2), s2 = e2 * (1 - (1 - t2 + a2) * n2), h2 = a2 % 6; return { r: 255 * [e2, i2, o2, o2, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o2, o2][h2], b: 255 * [o2, o2, s2, e2, e2, i2][h2], a: u2 }; }, g = function(r2) { return { h: u(r2.h), s: e(r2.s, 0, 100), l: e(r2.l, 0, 100), a: e(r2.a) }; }, d = function(r2) { return { h: n(r2.h), s: n(r2.s), l: n(r2.l), a: n(r2.a, 3) }; }, f = function(r2) { return b((n2 = (t2 = r2).s, { h: t2.h, s: (n2 *= ((e2 = t2.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t2.a })); var t2, n2, e2; }, c = function(r2) { return { h: (t2 = h(r2)).h, s: (u2 = (200 - (n2 = t2.s)) * (e2 = t2.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t2.a }; var t2, n2, e2, u2; }, l, p, v, m, y, N = function(r2, t2) { for (var n2 = 0;n2 < t2.length; n2++) { var e2 = t2[n2][0](r2); if (e2) return [e2, t2[n2][1]]; } return [null, undefined]; }, x = function(r2) { return typeof r2 == "string" ? N(r2.trim(), y.string) : typeof r2 == "object" && r2 !== null ? N(r2, y.object) : [null, undefined]; }, M = function(r2, t2) { var n2 = c(r2); return { h: n2.h, s: e(n2.s + 100 * t2, 0, 100), l: n2.l, a: n2.a }; }, H = function(r2) { return (299 * r2.r + 587 * r2.g + 114 * r2.b) / 1000 / 255; }, $ = function(r2, t2) { var n2 = c(r2); return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t2, 0, 100), a: n2.a }; }, j, w = function(r2) { return r2 instanceof j ? r2 : new j(r2); }, S, k = function(r2) { r2.forEach(function(r3) { S.indexOf(r3) < 0 && (r3(j, y), S.push(r3)); }); }; var init_colord = __esm(() => { r = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; i = /^#([0-9a-f]{3,8})$/i; l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; y = { string: [[function(r2) { var t2 = i.exec(r2); return t2 ? (r2 = t2[1]).length <= 4 ? { r: parseInt(r2[0] + r2[0], 16), g: parseInt(r2[1] + r2[1], 16), b: parseInt(r2[2] + r2[2], 16), a: r2.length === 4 ? n(parseInt(r2[3] + r2[3], 16) / 255, 2) : 1 } : r2.length === 6 || r2.length === 8 ? { r: parseInt(r2.substr(0, 2), 16), g: parseInt(r2.substr(2, 2), 16), b: parseInt(r2.substr(4, 2), 16), a: r2.length === 8 ? n(parseInt(r2.substr(6, 2), 16) / 255, 2) : 1 } : null : null; }, "hex"], [function(r2) { var t2 = v.exec(r2) || m.exec(r2); return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: t2[7] === undefined ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null; }, "rgb"], [function(t2) { var n2 = l.exec(t2) || p.exec(t2); if (!n2) return null; var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], u2 === undefined && (u2 = "deg"), Number(e2) * (r[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: n2[5] === undefined ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); return f(a2); }, "hsl"]], object: [[function(r2) { var { r: n2, g: e2, b: u2, a: o2 } = r2, i2 = o2 === undefined ? 1 : o2; return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; }, "rgb"], [function(r2) { var { h: n2, s: e2, l: u2, a: a2 } = r2, o2 = a2 === undefined ? 1 : a2; if (!t(n2) || !t(e2) || !t(u2)) return null; var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o2) }); return f(i2); }, "hsl"], [function(r2) { var { h: n2, s: a2, v: o2, a: i2 } = r2, s2 = i2 === undefined ? 1 : i2; if (!t(n2) || !t(a2) || !t(o2)) return null; var h2 = function(r3) { return { h: u(r3.h), s: e(r3.s, 0, 100), v: e(r3.v, 0, 100), a: e(r3.a) }; }({ h: Number(n2), s: Number(a2), v: Number(o2), a: Number(s2) }); return b(h2); }, "hsv"]] }; j = function() { function r2(r3) { this.parsed = x(r3)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; } return r2.prototype.isValid = function() { return this.parsed !== null; }, r2.prototype.brightness = function() { return n(H(this.rgba), 2); }, r2.prototype.isDark = function() { return H(this.rgba) < 0.5; }, r2.prototype.isLight = function() { return H(this.rgba) >= 0.5; }, r2.prototype.toHex = function() { return r3 = o(this.rgba), t2 = r3.r, e2 = r3.g, u2 = r3.b, i2 = (a2 = r3.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t2) + s(e2) + s(u2) + i2; var r3, t2, e2, u2, a2, i2; }, r2.prototype.toRgb = function() { return o(this.rgba); }, r2.prototype.toRgbString = function() { return r3 = o(this.rgba), t2 = r3.r, n2 = r3.g, e2 = r3.b, (u2 = r3.a) < 1 ? "rgba(" + t2 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t2 + ", " + n2 + ", " + e2 + ")"; var r3, t2, n2, e2, u2; }, r2.prototype.toHsl = function() { return d(c(this.rgba)); }, r2.prototype.toHslString = function() { return r3 = d(c(this.rgba)), t2 = r3.h, n2 = r3.s, e2 = r3.l, (u2 = r3.a) < 1 ? "hsla(" + t2 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t2 + ", " + n2 + "%, " + e2 + "%)"; var r3, t2, n2, e2, u2; }, r2.prototype.toHsv = function() { return r3 = h(this.rgba), { h: n(r3.h), s: n(r3.s), v: n(r3.v), a: n(r3.a, 3) }; var r3; }, r2.prototype.invert = function() { return w({ r: 255 - (r3 = this.rgba).r, g: 255 - r3.g, b: 255 - r3.b, a: r3.a }); var r3; }, r2.prototype.saturate = function(r3) { return r3 === undefined && (r3 = 0.1), w(M(this.rgba, r3)); }, r2.prototype.desaturate = function(r3) { return r3 === undefined && (r3 = 0.1), w(M(this.rgba, -r3)); }, r2.prototype.grayscale = function() { return w(M(this.rgba, -1)); }, r2.prototype.lighten = function(r3) { return r3 === undefined && (r3 = 0.1), w($(this.rgba, r3)); }, r2.prototype.darken = function(r3) { return r3 === undefined && (r3 = 0.1), w($(this.rgba, -r3)); }, r2.prototype.rotate = function(r3) { return r3 === undefined && (r3 = 15), this.hue(this.hue() + r3); }, r2.prototype.alpha = function(r3) { return typeof r3 == "number" ? w({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r3 }) : n(this.rgba.a, 3); var t2; }, r2.prototype.hue = function(r3) { var t2 = c(this.rgba); return typeof r3 == "number" ? w({ h: r3, s: t2.s, l: t2.l, a: t2.a }) : n(t2.h); }, r2.prototype.isEqual = function(r3) { return this.toHex() === w(r3).toHex(); }, r2; }(); S = []; }); // node_modules/@pixi/colord/plugins/names.mjs function names_default(e2, f2) { var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r2 = {}; for (var d2 in a2) r2[a2[d2]] = d2; var l2 = {}; e2.prototype.toName = function(f3) { if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; var d3, i2, n2 = r2[this.toHex()]; if (n2) return n2; if (f3 == null ? undefined : f3.closest) { var o2 = this.toRgb(), t2 = 1 / 0, b2 = "black"; if (!l2.length) for (var c2 in a2) l2[c2] = new e2(a2[c2]).toRgb(); for (var g2 in a2) { var u2 = (d3 = o2, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2)); u2 < t2 && (t2 = u2, b2 = g2); } return b2; } }; f2.string.push([function(f3) { var r3 = f3.toLowerCase(), d3 = r3 === "transparent" ? "#0000" : a2[r3]; return d3 ? new e2(d3).toRgb() : null; }, "name"]); } // node_modules/pixi.js/lib/color/Color.mjs var _Color = class _Color2 { constructor(value = 16777215) { this._value = null; this._components = new Float32Array(4); this._components.fill(1); this._int = 16777215; this.value = value; } get red() { return this._components[0]; } get green() { return this._components[1]; } get blue() { return this._components[2]; } get alpha() { return this._components[3]; } setValue(value) { this.value = value; return this; } set value(value) { if (value instanceof _Color2) { this._value = this._cloneSource(value._value); this._int = value._int; this._components.set(value._components); } else if (value === null) { throw new Error("Cannot set Color#value to null"); } else if (this._value === null || !this._isSourceEqual(this._value, value)) { this._value = this._cloneSource(value); this._normalize(this._value); } } get value() { return this._value; } _cloneSource(value) { if (typeof value === "string" || typeof value === "number" || value instanceof Number || value === null) { return value; } else if (Array.isArray(value) || ArrayBuffer.isView(value)) { return value.slice(0); } else if (typeof value === "object" && value !== null) { return { ...value }; } return value; } _isSourceEqual(value1, value2) { const type1 = typeof value1; const type2 = typeof value2; if (type1 !== type2) { return false; } else if (type1 === "number" || type1 === "string" || value1 instanceof Number) { return value1 === value2; } else if (Array.isArray(value1) && Array.isArray(value2) || ArrayBuffer.isView(value1) && ArrayBuffer.isView(value2)) { if (value1.length !== value2.length) { return false; } return value1.every((v2, i2) => v2 === value2[i2]); } else if (value1 !== null && value2 !== null) { const keys1 = Object.keys(value1); const keys2 = Object.keys(value2); if (keys1.length !== keys2.length) { return false; } return keys1.every((key) => value1[key] === value2[key]); } return value1 === value2; } toRgba() { const [r2, g2, b2, a2] = this._components; return { r: r2, g: g2, b: b2, a: a2 }; } toRgb() { const [r2, g2, b2] = this._components; return { r: r2, g: g2, b: b2 }; } toRgbaString() { const [r2, g2, b2] = this.toUint8RgbArray(); return `rgba(${r2},${g2},${b2},${this.alpha})`; } toUint8RgbArray(out) { const [r2, g2, b2] = this._components; if (!this._arrayRgb) { this._arrayRgb = []; } out || (out = this._arrayRgb); out[0] = Math.round(r2 * 255); out[1] = Math.round(g2 * 255); out[2] = Math.round(b2 * 255); return out; } toArray(out) { if (!this._arrayRgba) { this._arrayRgba = []; } out || (out = this._arrayRgba); const [r2, g2, b2, a2] = this._components; out[0] = r2; out[1] = g2; out[2] = b2; out[3] = a2; return out; } toRgbArray(out) { if (!this._arrayRgb) { this._arrayRgb = []; } out || (out = this._arrayRgb); const [r2, g2, b2] = this._components; out[0] = r2; out[1] = g2; out[2] = b2; return out; } toNumber() { return this._int; } toBgrNumber() { const [r2, g2, b2] = this.toUint8RgbArray(); return (b2 << 16) + (g2 << 8) + r2; } toLittleEndianNumber() { const value = this._int; return (value >> 16) + (value & 65280) + ((value & 255) << 16); } multiply(value) { const [r2, g2, b2, a2] = _Color2._temp.setValue(value)._components; this._components[0] *= r2; this._components[1] *= g2; this._components[2] *= b2; this._components[3] *= a2; this._refreshInt(); this._value = null; return this; } premultiply(alpha, applyToRGB = true) { if (applyToRGB) { this._components[0] *= alpha; this._components[1] *= alpha; this._components[2] *= alpha; } this._components[3] = alpha; this._refreshInt(); this._value = null; return this; } toPremultiplied(alpha, applyToRGB = true) { if (alpha === 1) { return (255 << 24) + this._int; } if (alpha === 0) { return applyToRGB ? 0 : this._int; } let r2 = this._int >> 16 & 255; let g2 = this._int >> 8 & 255; let b2 = this._int & 255; if (applyToRGB) { r2 = r2 * alpha + 0.5 | 0; g2 = g2 * alpha + 0.5 | 0; b2 = b2 * alpha + 0.5 | 0; } return (alpha * 255 << 24) + (r2 << 16) + (g2 << 8) + b2; } toHex() { const hexString = this._int.toString(16); return `#${"000000".substring(0, 6 - hexString.length) + hexString}`; } toHexa() { const alphaValue = Math.round(this._components[3] * 255); const alphaString = alphaValue.toString(16); return this.toHex() + "00".substring(0, 2 - alphaString.length) + alphaString; } setAlpha(alpha) { this._components[3] = this._clamp(alpha); return this; } _normalize(value) { let r2; let g2; let b2; let a2; if ((typeof value === "number" || value instanceof Number) && value >= 0 && value <= 16777215) { const int = value; r2 = (int >> 16 & 255) / 255; g2 = (int >> 8 & 255) / 255; b2 = (int & 255) / 255; a2 = 1; } else if ((Array.isArray(value) || value instanceof Float32Array) && value.length >= 3 && value.length <= 4) { value = this._clamp(value); [r2, g2, b2, a2 = 1] = value; } else if ((value instanceof Uint8Array || value instanceof Uint8ClampedArray) && value.length >= 3 && value.length <= 4) { value = this._clamp(value, 0, 255); [r2, g2, b2, a2 = 255] = value; r2 /= 255; g2 /= 255; b2 /= 255; a2 /= 255; } else if (typeof value === "string" || typeof value === "object") { if (typeof value === "string") { const match = _Color2.HEX_PATTERN.exec(value); if (match) { value = `#${match[2]}`; } } const color = w(value); if (color.isValid()) { ({ r: r2, g: g2, b: b2, a: a2 } = color.rgba); r2 /= 255; g2 /= 255; b2 /= 255; } } if (r2 !== undefined) { this._components[0] = r2; this._components[1] = g2; this._components[2] = b2; this._components[3] = a2; this._refreshInt(); } else { throw new Error(`Unable to convert color ${value}`); } } _refreshInt() { this._clamp(this._components); const [r2, g2, b2] = this._components; this._int = (r2 * 255 << 16) + (g2 * 255 << 8) + (b2 * 255 | 0); } _clamp(value, min = 0, max = 1) { if (typeof value === "number") { return Math.min(Math.max(value, min), max); } value.forEach((v2, i2) => { value[i2] = Math.min(Math.max(v2, min), max); }); return value; } static isColorLike(value) { return typeof value === "number" || typeof value === "string" || value instanceof Number || value instanceof _Color2 || Array.isArray(value) || value instanceof Uint8Array || value instanceof Uint8ClampedArray || value instanceof Float32Array || value.r !== undefined && value.g !== undefined && value.b !== undefined || value.r !== undefined && value.g !== undefined && value.b !== undefined && value.a !== undefined || value.h !== undefined && value.s !== undefined && value.l !== undefined || value.h !== undefined && value.s !== undefined && value.l !== undefined && value.a !== undefined || value.h !== undefined && value.s !== undefined && value.v !== undefined || value.h !== undefined && value.s !== undefined && value.v !== undefined && value.a !== undefined; } }, Color; var init_Color = __esm(() => { init_colord(); k([names_default]); _Color.shared = new _Color; _Color._temp = new _Color; _Color.HEX_PATTERN = /^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i; Color = _Color; }); // node_modules/pixi.js/lib/culling/cullingMixin.mjs var cullingMixin; var init_cullingMixin = __esm(() => { cullingMixin = { cullArea: null, cullable: false, cullableChildren: true }; }); // node_modules/pixi.js/lib/maths/misc/const.mjs var PI_2, RAD_TO_DEG, DEG_TO_RAD; var init_const = __esm(() => { PI_2 = Math.PI * 2; RAD_TO_DEG = 180 / Math.PI; DEG_TO_RAD = Math.PI / 180; }); // node_modules/pixi.js/lib/maths/point/Point.mjs class Point { constructor(x2 = 0, y2 = 0) { this.x = 0; this.y = 0; this.x = x2; this.y = y2; } clone() { return new Point(this.x, this.y); } copyFrom(p2) { this.set(p2.x, p2.y); return this; } copyTo(p2) { p2.set(this.x, this.y); return p2; } equals(p2) { return p2.x === this.x && p2.y === this.y; } set(x2 = 0, y2 = x2) { this.x = x2; this.y = y2; return this; } toString() { return `[pixi.js/math:Point x=${this.x} y=${this.y}]`; } static get shared() { tempPoint.x = 0; tempPoint.y = 0; return tempPoint; } } var tempPoint; var init_Point = __esm(() => { tempPoint = new Point; }); // node_modules/pixi.js/lib/maths/matrix/Matrix.mjs class Matrix { constructor(a2 = 1, b2 = 0, c2 = 0, d2 = 1, tx = 0, ty = 0) { this.array = null; this.a = a2; this.b = b2; this.c = c2; this.d = d2; this.tx = tx; this.ty = ty; } fromArray(array) { this.a = array[0]; this.b = array[1]; this.c = array[3]; this.d = array[4]; this.tx = array[2]; this.ty = array[5]; } set(a2, b2, c2, d2, tx, ty) { this.a = a2; this.b = b2; this.c = c2; this.d = d2; this.tx = tx; this.ty = ty; return this; } toArray(transpose, out) { if (!this.array) { this.array = new Float32Array(9); } const array = out || this.array; if (transpose) { array[0] = this.a; array[1] = this.b; array[2] = 0; array[3] = this.c; array[4] = this.d; array[5] = 0; array[6] = this.tx; array[7] = this.ty; array[8] = 1; } else { array[0] = this.a; array[1] = this.c; array[2] = this.tx; array[3] = this.b; array[4] = this.d; array[5] = this.ty; array[6] = 0; array[7] = 0; array[8] = 1; } return array; } apply(pos, newPos) { newPos = newPos || new Point; const x2 = pos.x; const y2 = pos.y; newPos.x = this.a * x2 + this.c * y2 + this.tx; newPos.y = this.b * x2 + this.d * y2 + this.ty; return newPos; } applyInverse(pos, newPos) { newPos = newPos || new Point; const a2 = this.a; const b2 = this.b; const c2 = this.c; const d2 = this.d; const tx = this.tx; const ty = this.ty; const id = 1 / (a2 * d2 + c2 * -b2); const x2 = pos.x; const y2 = pos.y; newPos.x = d2 * id * x2 + -c2 * id * y2 + (ty * c2 - tx * d2) * id; newPos.y = a2 * id * y2 + -b2 * id * x2 + (-ty * a2 + tx * b2) * id; return newPos; } translate(x2, y2) { this.tx += x2; this.ty += y2; return this; } scale(x2, y2) { this.a *= x2; this.d *= y2; this.c *= x2; this.b *= y2; this.tx *= x2; this.ty *= y2; return this; } rotate(angle) { const cos = Math.cos(angle); const sin = Math.sin(angle); const a1 = this.a; const c1 = this.c; const tx1 = this.tx; this.a = a1 * cos - this.b * sin; this.b = a1 * sin + this.b * cos; this.c = c1 * cos - this.d * sin; this.d = c1 * sin + this.d * cos; this.tx = tx1 * cos - this.ty * sin; this.ty = tx1 * sin + this.ty * cos; return this; } append(matrix) { const a1 = this.a; const b1 = this.b; const c1 = this.c; const d1 = this.d; this.a = matrix.a * a1 + matrix.b * c1; this.b = matrix.a * b1 + matrix.b * d1; this.c = matrix.c * a1 + matrix.d * c1; this.d = matrix.c * b1 + matrix.d * d1; this.tx = matrix.tx * a1 + matrix.ty * c1 + this.tx; this.ty = matrix.tx * b1 + matrix.ty * d1 + this.ty; return this; } appendFrom(a2, b2) { const a1 = a2.a; const b1 = a2.b; const c1 = a2.c; const d1 = a2.d; const tx = a2.tx; const ty = a2.ty; const a22 = b2.a; const b22 = b2.b; const c2 = b2.c; const d2 = b2.d; this.a = a1 * a22 + b1 * c2; this.b = a1 * b22 + b1 * d2; this.c = c1 * a22 + d1 * c2; this.d = c1 * b22 + d1 * d2; this.tx = tx * a22 + ty * c2 + b2.tx; this.ty = tx * b22 + ty * d2 + b2.ty; return this; } setTransform(x2, y2, pivotX, pivotY, scaleX, scaleY, rotation, skewX, skewY) { this.a = Math.cos(rotation + skewY) * scaleX; this.b = Math.sin(rotation + skewY) * scaleX; this.c = -Math.sin(rotation - skewX) * scaleY; this.d = Math.cos(rotation - skewX) * scaleY; this.tx = x2 - (pivotX * this.a + pivotY * this.c); this.ty = y2 - (pivotX * this.b + pivotY * this.d); return this; } prepend(matrix) { const tx1 = this.tx; if (matrix.a !== 1 || matrix.b !== 0 || matrix.c !== 0 || matrix.d !== 1) { const a1 = this.a; const c1 = this.c; this.a = a1 * matrix.a + this.b * matrix.c; this.b = a1 * matrix.b + this.b * matrix.d; this.c = c1 * matrix.a + this.d * matrix.c; this.d = c1 * matrix.b + this.d * matrix.d; } this.tx = tx1 * matrix.a + this.ty * matrix.c + matrix.tx; this.ty = tx1 * matrix.b + this.ty * matrix.d + matrix.ty; return this; } decompose(transform) { const a2 = this.a; const b2 = this.b; const c2 = this.c; const d2 = this.d; const pivot = transform.pivot; const skewX = -Math.atan2(-c2, d2); const skewY = Math.atan2(b2, a2); const delta = Math.abs(skewX + skewY); if (delta < 0.00001 || Math.abs(PI_2 - delta) < 0.00001) { transform.rotation = skewY; transform.skew.x = transform.skew.y = 0; } else { transform.rotation = 0; transform.skew.x = skewX; transform.skew.y = skewY; } transform.scale.x = Math.sqrt(a2 * a2 + b2 * b2); transform.scale.y = Math.sqrt(c2 * c2 + d2 * d2); transform.position.x = this.tx + (pivot.x * a2 + pivot.y * c2); transform.position.y = this.ty + (pivot.x * b2 + pivot.y * d2); return transform; } invert() { const a1 = this.a; const b1 = this.b; const c1 = this.c; const d1 = this.d; const tx1 = this.tx; const n2 = a1 * d1 - b1 * c1; this.a = d1 / n2; this.b = -b1 / n2; this.c = -c1 / n2; this.d = a1 / n2; this.tx = (c1 * this.ty - d1 * tx1) / n2; this.ty = -(a1 * this.ty - b1 * tx1) / n2; return this; } isIdentity() { return this.a === 1 && this.b === 0 && this.c === 0 && this.d === 1 && this.tx === 0 && this.ty === 0; } identity() { this.a = 1; this.b = 0; this.c = 0; this.d = 1; this.tx = 0; this.ty = 0; return this; } clone() { const matrix = new Matrix; matrix.a = this.a; matrix.b = this.b; matrix.c = this.c; matrix.d = this.d; matrix.tx = this.tx; matrix.ty = this.ty; return matrix; } copyTo(matrix) { matrix.a = this.a; matrix.b = this.b; matrix.c = this.c; matrix.d = this.d; matrix.tx = this.tx; matrix.ty = this.ty; return matrix; } copyFrom(matrix) { this.a = matrix.a; this.b = matrix.b; this.c = matrix.c; this.d = matrix.d; this.tx = matrix.tx; this.ty = matrix.ty; return this; } equals(matrix) { return matrix.a === this.a && matrix.b === this.b && matrix.c === this.c && matrix.d === this.d && matrix.tx === this.tx && matrix.ty === this.ty; } toString() { return `[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`; } static get IDENTITY() { return identityMatrix.identity(); } static get shared() { return tempMatrix.identity(); } } var tempMatrix, identityMatrix; var init_Matrix = __esm(() => { init_const(); init_Point(); tempMatrix = new Matrix; identityMatrix = new Matrix; }); // node_modules/pixi.js/lib/maths/point/ObservablePoint.mjs class ObservablePoint { constructor(observer, x2, y2) { this._x = x2 || 0; this._y = y2 || 0; this._observer = observer; } clone(observer) { return new ObservablePoint(observer ?? this._observer, this._x, this._y); } set(x2 = 0, y2 = x2) { if (this._x !== x2 || this._y !== y2) { this._x = x2; this._y = y2; this._observer._onUpdate(this); } return this; } copyFrom(p2) { if (this._x !== p2.x || this._y !== p2.y) { this._x = p2.x; this._y = p2.y; this._observer._onUpdate(this); } return this; } copyTo(p2) { p2.set(this._x, this._y); return p2; } equals(p2) { return p2.x === this._x && p2.y === this._y; } toString() { return `[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`; } get x() { return this._x; } set x(value) { if (this._x !== value) { this._x = value; this._observer._onUpdate(this); } } get y() { return this._y; } set y(value) { if (this._y !== value) { this._y = value; this._observer._onUpdate(this); } } } var init_ObservablePoint = () => {}; // node_modules/pixi.js/lib/utils/data/uid.mjs function uid(name = "default") { if (uidCache[name] === undefined) { uidCache[name] = -1; } return ++uidCache[name]; } var uidCache; var init_uid = __esm(() => { uidCache = { default: -1 }; }); // node_modules/pixi.js/lib/utils/logging/deprecation.mjs var warnings, v8_0_0 = "8.0.0", v8_3_4 = "8.3.4", deprecationState, deprecation = (version, message, ignoreDepth = 3) => { if (deprecationState.quiet || warnings.has(message)) return; let stack = new Error().stack; const deprecationMessage = `${message} Deprecated since v${version}`; const useGroup = typeof console.groupCollapsed === "function" && !deprecationState.noColor; if (typeof stack === "undefined") { console.warn("PixiJS Deprecation Warning: ", deprecationMessage); } else { stack = stack.split(` `).splice(ignoreDepth).join(` `); if (useGroup) { console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s", "color:#614108;background:#fffbe6", "font-weight:normal;color:#614108;background:#fffbe6", deprecationMessage); console.warn(stack); console.groupEnd(); } else { console.warn("PixiJS Deprecation Warning: ", deprecationMessage); console.warn(stack); } } warnings.add(message); }; var init_deprecation = __esm(() => { warnings = /* @__PURE__ */ new Set; deprecationState = { quiet: false, noColor: false }; Object.defineProperties(deprecation, { quiet: { get: () => deprecationState.quiet, set: (value) => { deprecationState.quiet = value; }, enumerable: true, configurable: false }, noColor: { get: () => deprecationState.noColor, set: (value) => { deprecationState.noColor = value; }, enumerable: true, configurable: false } }); }); // node_modules/pixi.js/lib/utils/logging/warn.mjs function warn(...args) { if (warnCount === maxWarnings) return; warnCount++; if (warnCount === maxWarnings) { console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."); } else { console.warn("PixiJS Warning: ", ...args); } } var warnCount = 0, maxWarnings = 500; var init_warn = () => {}; // node_modules/pixi.js/lib/utils/pool/GlobalResourceRegistry.mjs var GlobalResourceRegistry; var init_GlobalResourceRegistry = __esm(() => { GlobalResourceRegistry = { _registeredResources: /* @__PURE__ */ new Set, register(pool) { this._registeredResources.add(pool); }, unregister(pool) { this._registeredResources.delete(pool); }, release() { this._registeredResources.forEach((pool) => pool.clear()); }, get registeredCount() { return this._registeredResources.size; }, isRegistered(pool) { return this._registeredResources.has(pool); }, reset() { this._registeredResources.clear(); } }; }); // node_modules/pixi.js/lib/utils/pool/Pool.mjs class Pool { constructor(ClassType, initialSize) { this._pool = []; this._count = 0; this._index = 0; this._classType = ClassType; if (initialSize) { this.prepopulate(initialSize); } } prepopulate(total) { for (let i2 = 0;i2 < total; i2++) { this._pool[this._index++] = new this._classType; } this._count += total; } get(data) { let item; if (this._index > 0) { item = this._pool[--this._index]; } else { item = new this._classType; } item.init?.(data); return item; } return(item) { item.reset?.(); this._pool[this._index++] = item; } get totalSize() { return this._count; } get totalFree() { return this._index; } get totalUsed() { return this._count - this._index; } clear() { if (this._pool.length > 0 && this._pool[0].destroy) { for (let i2 = 0;i2 < this._index; i2++) { this._pool[i2].destroy(); } } this._pool.length = 0; this._count = 0; this._index = 0; } } var init_Pool = () => {}; // node_modules/pixi.js/lib/utils/pool/PoolGroup.mjs class PoolGroupClass { constructor() { this._poolsByClass = /* @__PURE__ */ new Map; } prepopulate(Class, total) { const classPool = this.getPool(Class); classPool.prepopulate(total); } get(Class, data) { const pool = this.getPool(Class); return pool.get(data); } return(item) { const pool = this.getPool(item.constructor); pool.return(item); } getPool(ClassType) { if (!this._poolsByClass.has(ClassType)) { this._poolsByClass.set(ClassType, new Pool(ClassType)); } return this._poolsByClass.get(ClassType); } stats() { const stats = {}; this._poolsByClass.forEach((pool) => { const name = stats[pool._classType.name] ? pool._classType.name + pool._classType.ID : pool._classType.name; stats[name] = { free: pool.totalFree, used: pool.totalUsed, size: pool.totalSize }; }); return stats; } clear() { this._poolsByClass.forEach((pool) => pool.clear()); this._poolsByClass.clear(); } } var BigPool; var init_PoolGroup = __esm(() => { init_GlobalResourceRegistry(); init_Pool(); BigPool = new PoolGroupClass; GlobalResourceRegistry.register(BigPool); }); // node_modules/pixi.js/lib/scene/container/container-mixins/cacheAsTextureMixin.mjs var cacheAsTextureMixin; var init_cacheAsTextureMixin = __esm(() => { init_deprecation(); cacheAsTextureMixin = { get isCachedAsTexture() { return !!this.renderGroup?.isCachedAsTexture