excalibur 0.32.0-alpha.1590 → 0.32.0-alpha.1592

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! excalibur - 0.32.0-alpha.1590+1be15c8 - 2025-12-3
1
+ /*! excalibur - 0.32.0-alpha.1592+3ba41a7 - 2025-12-6
2
2
  https://github.com/excaliburjs/Excalibur
3
3
  Copyright (c) 2025 Excalibur.js <https://github.com/excaliburjs/Excalibur/graphs/contributors>
4
4
  Licensed BSD-2-Clause
@@ -35,25 +35,25 @@ function hn() {
35
35
  clearTimeout(r);
36
36
  });
37
37
  }
38
- const hs = class Lt {
38
+ const hs = class Ut {
39
39
  /**
40
40
  * Force excalibur to load the Canvas 2D graphics context fallback
41
41
  * @warning not all features of excalibur are supported in the Canvas 2D fallback
42
42
  */
43
43
  static useCanvasGraphicsContext() {
44
- Lt.enable("use-canvas-context");
44
+ Ut.enable("use-canvas-context");
45
45
  }
46
46
  /**
47
47
  * Force excalibur to use the less optimized image renderer
48
48
  */
49
49
  static useLegacyImageRenderer() {
50
- Lt.enable("use-legacy-image-renderer");
50
+ Ut.enable("use-legacy-image-renderer");
51
51
  }
52
52
  /**
53
53
  * Freeze all flag modifications making them readonly
54
54
  */
55
55
  static freeze() {
56
- Lt._FROZEN = !0;
56
+ Ut._FROZEN = !0;
57
57
  }
58
58
  /**
59
59
  * Resets internal flag state, not meant to be called by users. Only used for testing.
@@ -62,7 +62,7 @@ const hs = class Lt {
62
62
  * @internal
63
63
  */
64
64
  static _reset() {
65
- Lt._FROZEN = !1, Lt._FLAGS = {};
65
+ Ut._FROZEN = !1, Ut._FLAGS = {};
66
66
  }
67
67
  /**
68
68
  * Enable a specific feature flag by name. **Note: can only be set before {@apilink Engine} constructor time**
@@ -71,7 +71,7 @@ const hs = class Lt {
71
71
  static enable(t) {
72
72
  if (this._FROZEN)
73
73
  throw Error("Feature flags can only be enabled before Engine constructor time");
74
- Lt._FLAGS[t] = !0;
74
+ Ut._FLAGS[t] = !0;
75
75
  }
76
76
  /**
77
77
  * Disable a specific feature flag by name. **Note: can only be set before {@apilink Engine} constructor time**
@@ -80,20 +80,20 @@ const hs = class Lt {
80
80
  static disable(t) {
81
81
  if (this._FROZEN)
82
82
  throw Error("Feature flags can only be disabled before Engine constructor time");
83
- Lt._FLAGS[t] = !1;
83
+ Ut._FLAGS[t] = !1;
84
84
  }
85
85
  /**
86
86
  * Check if a flag is enabled. If the flag is disabled or does not exist `false` is returned
87
87
  * @param flagName
88
88
  */
89
89
  static isEnabled(t) {
90
- return !!Lt._FLAGS[t];
90
+ return !!Ut._FLAGS[t];
91
91
  }
92
92
  /**
93
93
  * Show a list of currently known flags
94
94
  */
95
95
  static show() {
96
- return Object.keys(Lt._FLAGS);
96
+ return Object.keys(Ut._FLAGS);
97
97
  }
98
98
  };
99
99
  hs._FROZEN = !1;
@@ -200,7 +200,7 @@ class Z {
200
200
  }
201
201
  }
202
202
  var Xe = /* @__PURE__ */ ((r) => (r.Canvas = "Canvas", r.Document = "Document", r))(Xe || {}), J = /* @__PURE__ */ ((r) => (r.ShortestPath = "shortest-path", r.LongestPath = "longest-path", r.Clockwise = "clockwise", r.CounterClockwise = "counter-clockwise", r))(J || {});
203
- const zi = 4294967295, eo = Date.now();
203
+ const Ui = 4294967295, eo = Date.now();
204
204
  let io = 0;
205
205
  class ge {
206
206
  /**
@@ -221,10 +221,10 @@ class ge {
221
221
  const t = [0, this._a];
222
222
  let e = 0, i = 0;
223
223
  for (; i < this._n - this._m; i++)
224
- e = this._mt[i] & this._upperMask | this._mt[i + 1] & this._lowerMask, this._mt[i] = this._mt[i + this._m] ^ e >>> 1 ^ t[e & 1] & zi;
224
+ e = this._mt[i] & this._upperMask | this._mt[i + 1] & this._lowerMask, this._mt[i] = this._mt[i + this._m] ^ e >>> 1 ^ t[e & 1] & Ui;
225
225
  for (; i < this._n - 1; i++)
226
- e = this._mt[i] & this._upperMask | this._mt[i + 1] & this._lowerMask, this._mt[i] = this._mt[i + (this._m - this._n)] ^ e >>> 1 ^ t[e & 1] & zi;
227
- e = this._mt[this._n - 1] & this._upperMask | this._mt[0] & this._lowerMask, this._mt[this._n - 1] = this._mt[this._m - 1] ^ e >>> 1 ^ t[e & 1] & zi, this._index = 0;
226
+ e = this._mt[i] & this._upperMask | this._mt[i + 1] & this._lowerMask, this._mt[i] = this._mt[i + (this._m - this._n)] ^ e >>> 1 ^ t[e & 1] & Ui;
227
+ e = this._mt[this._n - 1] & this._upperMask | this._mt[0] & this._lowerMask, this._mt[this._n - 1] = this._mt[this._m - 1] ^ e >>> 1 ^ t[e & 1] & Ui, this._index = 0;
228
228
  }
229
229
  /**
230
230
  * Return next 32 bit integer number in sequence
@@ -400,15 +400,15 @@ function se(r) {
400
400
  function no(r) {
401
401
  return 180 / Math.PI * r;
402
402
  }
403
- function Yh(r) {
403
+ function $h(r) {
404
404
  return r / 180 * Math.PI;
405
405
  }
406
- const $h = (r, t) => Array.from(new Array(t - r + 1), (e, i) => i + r);
407
- function qt(r, t, e = new ge()) {
406
+ const Yh = (r, t) => Array.from(new Array(t - r + 1), (e, i) => i + r);
407
+ function Xt(r, t, e = new ge()) {
408
408
  return e ? e.floating(r, t) : r + Math.random() * (t - r);
409
409
  }
410
410
  function Zh(r, t, e = new ge()) {
411
- return e ? e.integer(r, t) : Math.round(qt(r, t));
411
+ return e ? e.integer(r, t) : Math.round(Xt(r, t));
412
412
  }
413
413
  const ln = class V {
414
414
  /**
@@ -740,7 +740,7 @@ let x = ln;
740
740
  function w(r, t) {
741
741
  return new x(r, t);
742
742
  }
743
- class zs extends x {
743
+ class Us extends x {
744
744
  constructor(t) {
745
745
  super(0, 0), this._getX = t.getX, this._getY = t.getY, this._setX = t.setX, this._setY = t.setY;
746
746
  }
@@ -842,8 +842,8 @@ class Tt {
842
842
  const i = e || new x(0, 0), s = t, n = s.x * this.data[0] + s.y * this.data[4] + this.data[12], o = s.x * this.data[1] + s.y * this.data[5] + this.data[13];
843
843
  return i.x = n, i.y = o, i;
844
844
  } else {
845
- const i = e || new Tt(), s = t, n = this.data[0], o = this.data[1], a = this.data[2], h = this.data[3], l = this.data[4], c = this.data[5], d = this.data[6], u = this.data[7], _ = this.data[8], p = this.data[9], g = this.data[10], v = this.data[11], m = this.data[12], f = this.data[13], b = this.data[14], C = this.data[15], S = s.data[0], E = s.data[1], y = s.data[2], k = s.data[3], L = s.data[4], O = s.data[5], Q = s.data[6], st = s.data[7], X = s.data[8], U = s.data[9], ot = s.data[10], ct = s.data[11], A = s.data[12], oe = s.data[13], ae = s.data[14], he = s.data[15];
846
- i.data[0] = n * S + l * E + _ * y + m * k, i.data[1] = o * S + c * E + p * y + f * k, i.data[2] = a * S + d * E + g * y + b * k, i.data[3] = h * S + u * E + v * y + C * k, i.data[4] = n * L + l * O + _ * Q + m * st, i.data[5] = o * L + c * O + p * Q + f * st, i.data[6] = a * L + d * O + g * Q + b * st, i.data[7] = h * L + u * O + v * Q + C * st, i.data[8] = n * X + l * U + _ * ot + m * ct, i.data[9] = o * X + c * U + p * ot + f * ct, i.data[10] = a * X + d * U + g * ot + b * ct, i.data[11] = h * X + u * U + v * ot + C * ct, i.data[12] = n * A + l * oe + _ * ae + m * he, i.data[13] = o * A + c * oe + p * ae + f * he, i.data[14] = a * A + d * oe + g * ae + b * he, i.data[15] = h * A + u * oe + v * ae + C * he;
845
+ const i = e || new Tt(), s = t, n = this.data[0], o = this.data[1], a = this.data[2], h = this.data[3], l = this.data[4], c = this.data[5], d = this.data[6], u = this.data[7], _ = this.data[8], p = this.data[9], g = this.data[10], v = this.data[11], m = this.data[12], f = this.data[13], b = this.data[14], C = this.data[15], S = s.data[0], E = s.data[1], y = s.data[2], k = s.data[3], L = s.data[4], O = s.data[5], Q = s.data[6], st = s.data[7], X = s.data[8], z = s.data[9], ot = s.data[10], ct = s.data[11], A = s.data[12], oe = s.data[13], ae = s.data[14], he = s.data[15];
846
+ i.data[0] = n * S + l * E + _ * y + m * k, i.data[1] = o * S + c * E + p * y + f * k, i.data[2] = a * S + d * E + g * y + b * k, i.data[3] = h * S + u * E + v * y + C * k, i.data[4] = n * L + l * O + _ * Q + m * st, i.data[5] = o * L + c * O + p * Q + f * st, i.data[6] = a * L + d * O + g * Q + b * st, i.data[7] = h * L + u * O + v * Q + C * st, i.data[8] = n * X + l * z + _ * ot + m * ct, i.data[9] = o * X + c * z + p * ot + f * ct, i.data[10] = a * X + d * z + g * ot + b * ct, i.data[11] = h * X + u * z + v * ot + C * ct, i.data[12] = n * A + l * oe + _ * ae + m * he, i.data[13] = o * A + c * oe + p * ae + f * he, i.data[14] = a * A + d * oe + g * ae + b * he, i.data[15] = h * A + u * oe + v * ae + C * he;
847
847
  const Le = this.getScale();
848
848
  return i._scaleSignX = q(Le.x) * q(i._scaleSignX), i._scaleSignY = q(Le.y) * q(i._scaleSignY), i;
849
849
  }
@@ -1161,7 +1161,7 @@ class re {
1161
1161
  constructor() {
1162
1162
  this._parent = null, this._children = [], this._pos = new ie(w(0, 0), () => {
1163
1163
  this.flagDirty();
1164
- }), this._globalPos = new zs({
1164
+ }), this._globalPos = new Us({
1165
1165
  getX: () => this.matrix.data[4],
1166
1166
  getY: () => this.matrix.data[5],
1167
1167
  setX: (t) => {
@@ -1182,7 +1182,7 @@ class re {
1182
1182
  }
1183
1183
  }), this._rotation = 0, this._scale = new ie(w(1, 1), () => {
1184
1184
  this.flagDirty();
1185
- }), this._globalScale = new zs({
1185
+ }), this._globalScale = new Us({
1186
1186
  getX: () => this.parent ? this.matrix.getScaleX() : this.scale.x,
1187
1187
  getY: () => this.parent ? this.matrix.getScaleY() : this.scale.y,
1188
1188
  setX: (t) => {
@@ -1328,7 +1328,7 @@ class re {
1328
1328
  }
1329
1329
  }
1330
1330
  var ht = /* @__PURE__ */ ((r) => (r.World = "world", r.Screen = "screen", r))(ht || {});
1331
- class Ye {
1331
+ class $e {
1332
1332
  constructor(t, e, i) {
1333
1333
  this.worldPos = t, this.pagePos = e, this.screenPos = i;
1334
1334
  }
@@ -1336,7 +1336,7 @@ class Ye {
1336
1336
  let s, n, o, a;
1337
1337
  arguments.length === 3 ? (s = t, n = e, o = new x(s, n), a = i) : (o = t, s = o.x, n = o.y, a = e);
1338
1338
  const h = a.screen.pageToScreenCoordinates(o), l = a.screen.screenToWorldCoordinates(h);
1339
- return new Ye(l, o, h);
1339
+ return new $e(l, o, h);
1340
1340
  }
1341
1341
  }
1342
1342
  class K {
@@ -1736,9 +1736,9 @@ class dn {
1736
1736
  return [];
1737
1737
  let a;
1738
1738
  i ? a = "directed" in i ? i.directed : !1 : a = !1;
1739
- const h = new Us(t, e, i);
1739
+ const h = new zs(t, e, i);
1740
1740
  if (this._edges.add(h), t.registerNewEdge(h), e.registerNewEdge(h), (s = this.adjacencyList.get(t.id)) == null || s.add(e.id), !a) {
1741
- const l = new Us(e, t, i);
1741
+ const l = new zs(e, t, i);
1742
1742
  return (n = this.adjacencyList.get(e.id)) == null || n.add(t.id), this._edges.add(l), e.registerNewEdge(l), t.registerNewEdge(l), h.linkWithPartner(l), l.linkWithPartner(h), [h, l];
1743
1743
  }
1744
1744
  return [h];
@@ -2004,7 +2004,7 @@ class dn {
2004
2004
  return Math.sqrt((s.x - i.x) ** 2 + (s.y - i.y) ** 2);
2005
2005
  }
2006
2006
  }
2007
- class Us {
2007
+ class zs {
2008
2008
  // Reference to the opposite direction edge
2009
2009
  constructor(t, e, i) {
2010
2010
  this._id = ls.generateUUID(), this._weight = 0, this._partnerEdge = null, this._source = t, this._target = e, i && i.weight ? this._weight = i.weight : i && i.useEuclidean ? this._weight = t.pos.distance(e.pos) : this._weight = 0;
@@ -2591,17 +2591,17 @@ class mt {
2591
2591
  }
2592
2592
  }
2593
2593
  var Ze = /* @__PURE__ */ ((r) => (r[r.Debug = 0] = "Debug", r[r.Info = 1] = "Info", r[r.Warn = 2] = "Warn", r[r.Error = 3] = "Error", r[r.Fatal = 4] = "Fatal", r))(Ze || {});
2594
- const gn = class Wt {
2594
+ const gn = class Vt {
2595
2595
  constructor() {
2596
- if (this._appenders = [], this.defaultLevel = 1, this._logOnceSet = /* @__PURE__ */ new Set(), Wt._INSTANCE)
2596
+ if (this._appenders = [], this.defaultLevel = 1, this._logOnceSet = /* @__PURE__ */ new Set(), Vt._INSTANCE)
2597
2597
  throw new Error("Logger is a singleton");
2598
- return Wt._INSTANCE = this, Wt._INSTANCE.addAppender(new pn()), Wt._INSTANCE;
2598
+ return Vt._INSTANCE = this, Vt._INSTANCE.addAppender(new pn()), Vt._INSTANCE;
2599
2599
  }
2600
2600
  /**
2601
2601
  * Gets the current static instance of Logger
2602
2602
  */
2603
2603
  static getInstance() {
2604
- return Wt._INSTANCE == null && (Wt._INSTANCE = new Wt()), Wt._INSTANCE;
2604
+ return Vt._INSTANCE == null && (Vt._INSTANCE = new Vt()), Vt._INSTANCE;
2605
2605
  }
2606
2606
  /**
2607
2607
  * Adds a new {@apilink Appender} to the list of appenders to write to
@@ -2752,7 +2752,7 @@ function uo(r) {
2752
2752
  function _o(r) {
2753
2753
  return !!(r != null && r.clone);
2754
2754
  }
2755
- class Bt {
2755
+ class kt {
2756
2756
  constructor() {
2757
2757
  this.owner = void 0;
2758
2758
  }
@@ -2822,7 +2822,7 @@ class xt {
2822
2822
  this.observers.length = 0, this.subscriptions.length = 0;
2823
2823
  }
2824
2824
  }
2825
- class P extends Bt {
2825
+ class P extends kt {
2826
2826
  constructor() {
2827
2827
  super(...arguments), this._logger = I.getInstance(), this._parentComponent = null, this._transform = new re(), this._addChildTransform = (t) => {
2828
2828
  const e = t.get(P);
@@ -2919,7 +2919,7 @@ class P extends Bt {
2919
2919
  return t._transform = this._transform.clone(), t;
2920
2920
  }
2921
2921
  }
2922
- class H extends Bt {
2922
+ class H extends kt {
2923
2923
  constructor() {
2924
2924
  super(...arguments), this.vel = x.Zero, this.maxVel = x.One.scaleEqual(1 / 0), this.acc = x.Zero, this.scaleFactor = x.Zero, this.angularVelocity = 0, this.torque = 0, this.inertia = 1, this.integration = {
2925
2925
  onScreenOnly: !1
@@ -2969,7 +2969,7 @@ ue._MAX_GROUPS = 32;
2969
2969
  ue._CURRENT_GROUP = 1;
2970
2970
  ue._CURRENT_BIT = ue._STARTING_BIT;
2971
2971
  ue._GROUPS = /* @__PURE__ */ new Map();
2972
- let Ui = ue;
2972
+ let zi = ue;
2973
2973
  const Xi = class {
2974
2974
  /**
2975
2975
  * STOP!!** It is preferred that {@apilink CollisionGroupManager.create} is used to create collision groups
@@ -3015,7 +3015,7 @@ const Xi = class {
3015
3015
  * @returns CollisionGroup
3016
3016
  */
3017
3017
  invert() {
3018
- const t = Ui.create("~(" + this.name + ")", ~this.mask | 0);
3018
+ const t = zi.create("~(" + this.name + ")", ~this.mask | 0);
3019
3019
  return t._category = ~this.category, t;
3020
3020
  }
3021
3021
  /**
@@ -3024,7 +3024,7 @@ const Xi = class {
3024
3024
  */
3025
3025
  static combine(t) {
3026
3026
  const e = t.map((n) => n.name).join("+"), s = ~t.reduce((n, o) => o.category | n, 0);
3027
- return Ui.create(e, s);
3027
+ return zi.create(e, s);
3028
3028
  }
3029
3029
  /**
3030
3030
  * Creates a collision group that collides with the listed groups
@@ -3032,7 +3032,7 @@ const Xi = class {
3032
3032
  */
3033
3033
  static collidesWith(t) {
3034
3034
  const e = `collidesWith(${t.map((s) => s.name).join("+")})`, i = t.reduce((s, n) => n.category | s, 0);
3035
- return Ui.create(e, i);
3035
+ return zi.create(e, i);
3036
3036
  }
3037
3037
  toString() {
3038
3038
  return `
@@ -3203,12 +3203,12 @@ class Re extends B {
3203
3203
  super(), this.self = t, this.other = e, this.side = i, this.intersection = s, this.contact = n, this.target = t;
3204
3204
  }
3205
3205
  }
3206
- class Yi {
3206
+ class $i {
3207
3207
  constructor(t, e, i, s) {
3208
3208
  this.self = t, this.other = e, this.side = i, this.contact = s;
3209
3209
  }
3210
3210
  }
3211
- class $i {
3211
+ class Yi {
3212
3212
  constructor(t, e, i, s) {
3213
3213
  this.self = t, this.other = e, this.side = i, this.lastContact = s;
3214
3214
  }
@@ -3267,12 +3267,12 @@ class Ln extends B {
3267
3267
  super(), this.context = t, this.self = e, this.target = e;
3268
3268
  }
3269
3269
  }
3270
- class zn extends B {
3270
+ class Un extends B {
3271
3271
  constructor(t) {
3272
3272
  super(), this.self = t, this.target = t;
3273
3273
  }
3274
3274
  }
3275
- class Un extends B {
3275
+ class zn extends B {
3276
3276
  constructor(t) {
3277
3277
  super(), this.self = t, this.target = t;
3278
3278
  }
@@ -3317,14 +3317,14 @@ const El = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3317
3317
  CollisionPostSolveEvent: ji,
3318
3318
  CollisionPreSolveEvent: Zi,
3319
3319
  CollisionStartEvent: gi,
3320
- ContactEndEvent: $i,
3321
- ContactStartEvent: Yi,
3320
+ ContactEndEvent: Yi,
3321
+ ContactStartEvent: $i,
3322
3322
  DeactivateEvent: Ln,
3323
3323
  EnterTriggerEvent: Hn,
3324
- EnterViewPortEvent: Un,
3324
+ EnterViewPortEvent: zn,
3325
3325
  EventTypes: mn,
3326
3326
  ExitTriggerEvent: On,
3327
- ExitViewPortEvent: zn,
3327
+ ExitViewPortEvent: Un,
3328
3328
  GameEvent: B,
3329
3329
  GameStartEvent: bn,
3330
3330
  GameStopEvent: yn,
@@ -3360,7 +3360,7 @@ function qn(r) {
3360
3360
  r[i] < t && (t = r[i], e = i);
3361
3361
  return e;
3362
3362
  }
3363
- function ze(r) {
3363
+ function Ue(r) {
3364
3364
  if (r && r.getBoundingClientRect) {
3365
3365
  const t = r.getBoundingClientRect();
3366
3366
  return w(t.x + window.scrollX, t.y + window.scrollY);
@@ -3380,7 +3380,7 @@ function Xn(r, t) {
3380
3380
  return !0;
3381
3381
  return !1;
3382
3382
  }
3383
- function Yn(r) {
3383
+ function $n(r) {
3384
3384
  throw new Error(r);
3385
3385
  }
3386
3386
  function mi(r, t) {
@@ -3390,7 +3390,7 @@ function mi(r, t) {
3390
3390
  i.resolve();
3391
3391
  }, r), i.promise;
3392
3392
  }
3393
- function $n(r, t) {
3393
+ function Yn(r, t) {
3394
3394
  const e = {};
3395
3395
  for (const i in r)
3396
3396
  t.includes(i) || (e[i] = r[i]);
@@ -3638,7 +3638,7 @@ const Dl = {
3638
3638
  _getClassHierarchyRoot(t) {
3639
3639
  var e, i;
3640
3640
  let s = t, n = (e = Object.getPrototypeOf(s.prototype)) == null ? void 0 : e.constructor;
3641
- for (; n && n !== Object && n !== Bt; )
3641
+ for (; n && n !== Object && n !== kt; )
3642
3642
  s = n, n = (i = Object.getPrototypeOf(s.prototype)) == null ? void 0 : i.constructor;
3643
3643
  return s;
3644
3644
  }
@@ -5337,11 +5337,11 @@ class _t extends Pi {
5337
5337
  */
5338
5338
  collide(t) {
5339
5339
  if (t instanceof _t)
5340
- return Ut.CollideCircleCircle(this, t);
5340
+ return Ht.CollideCircleCircle(this, t);
5341
5341
  if (t instanceof dt)
5342
- return Ut.CollideCirclePolygon(this, t);
5342
+ return Ht.CollideCirclePolygon(this, t);
5343
5343
  if (t instanceof At)
5344
- return Ut.CollideCircleEdge(this, t);
5344
+ return Ht.CollideCircleEdge(this, t);
5345
5345
  throw new Error(`Circle could not collide with unknown CollisionShape ${typeof t}`);
5346
5346
  }
5347
5347
  /**
@@ -5484,23 +5484,23 @@ class wo {
5484
5484
  this.axis = w(0, 0), this.localAxis = w(0, 0), this.side = new K(w(0, 0), w(0, 0)), this.localSide = new K(w(0, 0), w(0, 0)), this.point = w(0, 0), this.localPoint = w(0, 0);
5485
5485
  }
5486
5486
  }
5487
- const xe = class Vt {
5487
+ const xe = class Gt {
5488
5488
  static findPolygonPolygonSeparation(t, e) {
5489
5489
  if (e.transform.matrix.determinant() === 0)
5490
- return Vt.findPolygonPolygonSeparationDegenerate(t, e);
5490
+ return Gt.findPolygonPolygonSeparationDegenerate(t, e);
5491
5491
  let i = -Number.MAX_VALUE, s = -1, n;
5492
- const o = e.transform.inverse.multiply(t.transform.matrix, Vt._SCRATCH_MATRIX), a = o.getRotation(), h = t.normals, l = t.points, c = e.points;
5492
+ const o = e.transform.inverse.multiply(t.transform.matrix, Gt._SCRATCH_MATRIX), a = o.getRotation(), h = t.normals, l = t.points, c = e.points;
5493
5493
  for (let _ = 0; _ < l.length; _++) {
5494
- const p = h[_].rotate(a, Vt._ZERO, Vt._SCRATCH_NORMAL), g = o.multiply(l[_], Vt._SCRATCH_POINT);
5494
+ const p = h[_].rotate(a, Gt._ZERO, Gt._SCRATCH_NORMAL), g = o.multiply(l[_], Gt._SCRATCH_POINT);
5495
5495
  let v = Number.MAX_VALUE, m;
5496
5496
  for (let f = 0; f < c.length; f++) {
5497
- const b = p.dot(c[f].sub(g, Vt._SCRATCH_SUB_POINT));
5497
+ const b = p.dot(c[f].sub(g, Gt._SCRATCH_SUB_POINT));
5498
5498
  b < v && (v = b, m = c[f]);
5499
5499
  }
5500
5500
  v > i && (i = v, s = _, n = m);
5501
5501
  }
5502
- const d = (s + 1) % l.length, u = Vt.SeparationPool.get();
5503
- return u.collider = t, u.separation = i, i > 0 || (h[s].clone(u.localAxis), h[s].rotate(t.transform.rotation, Vt._ZERO, u.axis), t.transform.matrix.multiply(l[s], u.side.begin), t.transform.matrix.multiply(l[d], u.side.end), e.transform.matrix.multiply(n, u.point), u.sideId = s, n.clone(u.localPoint), l[s].clone(u.localSide.begin), l[d].clone(u.localSide.end)), u;
5502
+ const d = (s + 1) % l.length, u = Gt.SeparationPool.get();
5503
+ return u.collider = t, u.separation = i, i > 0 || (h[s].clone(u.localAxis), h[s].rotate(t.transform.rotation, Gt._ZERO, u.axis), t.transform.matrix.multiply(l[s], u.side.begin), t.transform.matrix.multiply(l[d], u.side.end), e.transform.matrix.multiply(n, u.point), u.sideId = s, n.clone(u.localPoint), l[s].clone(u.localSide.begin), l[d].clone(u.localSide.end)), u;
5504
5504
  }
5505
5505
  static findCirclePolygonSeparation(t, e) {
5506
5506
  const i = e.axes, n = e.center.sub(t.worldPos), o = e.getFurthestPoint(n.negate());
@@ -5546,7 +5546,7 @@ xe._SCRATCH_NORMAL = w(0, 0);
5546
5546
  xe._SCRATCH_MATRIX = j.identity();
5547
5547
  let We = xe;
5548
5548
  We.SeparationPool.disableWarnings = !0;
5549
- const bo = x.Zero, yo = x.Zero, Co = j.identity(), Ut = {
5549
+ const bo = x.Zero, yo = x.Zero, Co = j.identity(), Ht = {
5550
5550
  CollideCircleCircle(r, t) {
5551
5551
  const e = r.worldPos, i = t.worldPos, s = r.radius + t.radius, n = e.distance(i);
5552
5552
  if (n > s)
@@ -5810,11 +5810,11 @@ class At extends Pi {
5810
5810
  */
5811
5811
  collide(t) {
5812
5812
  if (t instanceof _t)
5813
- return Ut.CollideCircleEdge(t, this);
5813
+ return Ht.CollideCircleEdge(t, this);
5814
5814
  if (t instanceof dt)
5815
- return Ut.CollidePolygonEdge(t, this);
5815
+ return Ht.CollidePolygonEdge(t, this);
5816
5816
  if (t instanceof At)
5817
- return Ut.CollideEdgeEdge();
5817
+ return Ht.CollideEdgeEdge();
5818
5818
  throw new Error(`Edge could not collide with unknown CollisionShape ${typeof t}`);
5819
5819
  }
5820
5820
  /**
@@ -6162,11 +6162,11 @@ class dt extends Pi {
6162
6162
  */
6163
6163
  collide(t) {
6164
6164
  if (t instanceof _t)
6165
- return Ut.CollideCirclePolygon(t, this);
6165
+ return Ht.CollideCirclePolygon(t, this);
6166
6166
  if (t instanceof dt)
6167
- return Ut.CollidePolygonPolygon(this, t);
6167
+ return Ht.CollidePolygonPolygon(this, t);
6168
6168
  if (t instanceof At)
6169
- return Ut.CollidePolygonEdge(this, t);
6169
+ return Ht.CollidePolygonEdge(this, t);
6170
6170
  throw new Error(`Polygon could not collide with unknown CollisionShape ${typeof t}`);
6171
6171
  }
6172
6172
  /**
@@ -6753,13 +6753,13 @@ const Bl = {
6753
6753
  };
6754
6754
  ar._LOGGER = I.getInstance();
6755
6755
  let _s = ar;
6756
- class $e extends nt {
6756
+ class Ye extends nt {
6757
6757
  constructor(t) {
6758
6758
  var e;
6759
6759
  super(t), this._logger = I.getInstance(), this.useAnchor = !0, this.members = [], this.members = t.members, this.useAnchor = (e = t.useAnchor) != null ? e : this.useAnchor, this._updateDimensions();
6760
6760
  }
6761
6761
  clone() {
6762
- return new $e({
6762
+ return new Ye({
6763
6763
  members: [...this.members],
6764
6764
  ...this.cloneGraphicOptions()
6765
6765
  });
@@ -6780,7 +6780,7 @@ class $e extends nt {
6780
6780
  return t;
6781
6781
  }
6782
6782
  _isAnimationOrGroup(t) {
6783
- return t instanceof _s || t instanceof $e;
6783
+ return t instanceof _s || t instanceof Ye;
6784
6784
  }
6785
6785
  tick(t, e) {
6786
6786
  for (const i of this.members) {
@@ -6808,7 +6808,7 @@ class $e extends nt {
6808
6808
  class Ke extends nt {
6809
6809
  constructor(t) {
6810
6810
  var e, i, s, n, o, a, h, l, c, d;
6811
- super($n({ ...t }, ["width", "height"])), this.lineCap = "butt", this.quality = 1, this._dirty = !0, this._smoothing = !1, this._color = Pt(T.Black, () => this.flagDirty()), this._lineWidth = 1, this._lineDash = [], this._padding = 0, t && (this.quality = (e = t.quality) != null ? e : this.quality, this.color = (i = t.color) != null ? i : T.Black, this.strokeColor = t == null ? void 0 : t.strokeColor, this.smoothing = (s = t.smoothing) != null ? s : this.smoothing, this.lineWidth = (n = t.lineWidth) != null ? n : this.lineWidth, this.lineDash = (o = t.lineDash) != null ? o : this.lineDash, this.lineCap = (a = t.lineCap) != null ? a : this.lineCap, this.padding = (h = t.padding) != null ? h : this.padding, this.filtering = (l = t.filtering) != null ? l : this.filtering), this._bitmap = document.createElement("canvas");
6811
+ super(Yn({ ...t }, ["width", "height"])), this.lineCap = "butt", this.quality = 1, this._dirty = !0, this._smoothing = !1, this._color = Pt(T.Black, () => this.flagDirty()), this._lineWidth = 1, this._lineDash = [], this._padding = 0, t && (this.quality = (e = t.quality) != null ? e : this.quality, this.color = (i = t.color) != null ? i : T.Black, this.strokeColor = t == null ? void 0 : t.strokeColor, this.smoothing = (s = t.smoothing) != null ? s : this.smoothing, this.lineWidth = (n = t.lineWidth) != null ? n : this.lineWidth, this.lineDash = (o = t.lineDash) != null ? o : this.lineDash, this.lineCap = (a = t.lineCap) != null ? a : this.lineCap, this.padding = (h = t.padding) != null ? h : this.padding, this.filtering = (l = t.filtering) != null ? l : this.filtering), this._bitmap = document.createElement("canvas");
6812
6812
  const u = (c = t == null ? void 0 : t.width) != null ? c : this._bitmap.width, _ = (d = t == null ? void 0 : t.height) != null ? d : this._bitmap.height;
6813
6813
  this.width = u, this.height = _;
6814
6814
  const p = this._bitmap.getContext("2d");
@@ -7135,7 +7135,7 @@ Check your server configuration, for example Vite serves static files from the /
7135
7135
  });
7136
7136
  }
7137
7137
  }
7138
- class Ht extends nt {
7138
+ class Bt extends nt {
7139
7139
  constructor(t) {
7140
7140
  var e, i;
7141
7141
  super(t), this._logger = I.getInstance(), this._dirty = !0, this.image = t.image;
@@ -7145,7 +7145,7 @@ class Ht extends nt {
7145
7145
  });
7146
7146
  }
7147
7147
  static from(t, e) {
7148
- return new Ht({
7148
+ return new Bt({
7149
7149
  image: t,
7150
7150
  ...e
7151
7151
  });
@@ -7188,7 +7188,7 @@ Read https://excaliburjs.com/docs/imagesource for more information.`
7188
7188
  );
7189
7189
  }
7190
7190
  clone() {
7191
- return new Ht({
7191
+ return new Bt({
7192
7192
  image: this.image,
7193
7193
  sourceView: { ...this.sourceView },
7194
7194
  destSize: { ...this.destSize },
@@ -7197,7 +7197,7 @@ Read https://excaliburjs.com/docs/imagesource for more information.`
7197
7197
  }
7198
7198
  }
7199
7199
  var gt = /* @__PURE__ */ ((r) => (r.Clamp = "Clamp", r.Repeat = "Repeat", r.Mirror = "Mirror", r))(gt || {});
7200
- function Ot(r) {
7200
+ function Nt(r) {
7201
7201
  switch (r) {
7202
7202
  case "Clamp":
7203
7203
  return "Clamp";
@@ -7330,12 +7330,12 @@ ii.filtering = wt.Blended;
7330
7330
  ii.wrapping = { x: gt.Clamp, y: gt.Clamp };
7331
7331
  ii._MAX_TEXTURE_SIZE = 4096;
7332
7332
  let Ve = ii;
7333
- const z = {
7333
+ const U = {
7334
7334
  Filtering: "filtering",
7335
7335
  WrappingX: "wrapping-x",
7336
7336
  WrappingY: "wrapping-y"
7337
7337
  };
7338
- class $t {
7338
+ class Ot {
7339
7339
  constructor(t, e, i) {
7340
7340
  this._logger = I.getInstance(), this.data = new Image(), this._readyFuture = new yt(), this.ready = this._readyFuture.promise, this.path = t;
7341
7341
  let s = !1, n;
@@ -7373,8 +7373,8 @@ class $t {
7373
7373
  * @param image
7374
7374
  */
7375
7375
  static fromHtmlImageElement(t, e) {
7376
- const i = new $t("");
7377
- if (i._src = "image-element", i.data = t, i.data.setAttribute("data-original-src", "image-element"), e != null && e.filtering ? i.data.setAttribute(z.Filtering, e == null ? void 0 : e.filtering) : i.data.setAttribute(z.Filtering, wt.Blended), e != null && e.wrapping) {
7376
+ const i = new Ot("");
7377
+ if (i._src = "image-element", i.data = t, i.data.setAttribute("data-original-src", "image-element"), e != null && e.filtering ? i.data.setAttribute(U.Filtering, e == null ? void 0 : e.filtering) : i.data.setAttribute(U.Filtering, wt.Blended), e != null && e.wrapping) {
7378
7378
  let s;
7379
7379
  typeof e.wrapping == "string" ? s = {
7380
7380
  x: e.wrapping,
@@ -7382,14 +7382,14 @@ class $t {
7382
7382
  } : s = {
7383
7383
  x: e.wrapping.x,
7384
7384
  y: e.wrapping.y
7385
- }, i.data.setAttribute(z.WrappingX, s.x), i.data.setAttribute(z.WrappingY, s.y);
7385
+ }, i.data.setAttribute(U.WrappingX, s.x), i.data.setAttribute(U.WrappingY, s.y);
7386
7386
  } else
7387
- i.data.setAttribute(z.WrappingX, gt.Clamp), i.data.setAttribute(z.WrappingY, gt.Clamp);
7387
+ i.data.setAttribute(U.WrappingX, gt.Clamp), i.data.setAttribute(U.WrappingY, gt.Clamp);
7388
7388
  return Ve.checkImageSizeSupportedAndLog(t), i._readyFuture.resolve(t), i;
7389
7389
  }
7390
7390
  static fromHtmlCanvasElement(t, e) {
7391
- const i = new $t("");
7392
- if (i._src = "canvas-element-blob", i.data.setAttribute("data-original-src", "canvas-element-blob"), e != null && e.filtering ? i.data.setAttribute(z.Filtering, e == null ? void 0 : e.filtering) : i.data.setAttribute(z.Filtering, wt.Blended), e != null && e.wrapping) {
7391
+ const i = new Ot("");
7392
+ if (i._src = "canvas-element-blob", i.data.setAttribute("data-original-src", "canvas-element-blob"), e != null && e.filtering ? i.data.setAttribute(U.Filtering, e == null ? void 0 : e.filtering) : i.data.setAttribute(U.Filtering, wt.Blended), e != null && e.wrapping) {
7393
7393
  let s;
7394
7394
  typeof e.wrapping == "string" ? s = {
7395
7395
  x: e.wrapping,
@@ -7397,9 +7397,9 @@ class $t {
7397
7397
  } : s = {
7398
7398
  x: e.wrapping.x,
7399
7399
  y: e.wrapping.y
7400
- }, i.data.setAttribute(z.WrappingX, s.x), i.data.setAttribute(z.WrappingY, s.y);
7400
+ }, i.data.setAttribute(U.WrappingX, s.x), i.data.setAttribute(U.WrappingY, s.y);
7401
7401
  } else
7402
- i.data.setAttribute(z.WrappingX, gt.Clamp), i.data.setAttribute(z.WrappingY, gt.Clamp);
7402
+ i.data.setAttribute(U.WrappingX, gt.Clamp), i.data.setAttribute(U.WrappingY, gt.Clamp);
7403
7403
  return Ve.checkImageSizeSupportedAndLog(t), t.toBlob((s) => {
7404
7404
  const n = URL.createObjectURL(s);
7405
7405
  i.image.onload = () => {
@@ -7409,7 +7409,7 @@ class $t {
7409
7409
  }
7410
7410
  static fromSvgString(t, e) {
7411
7411
  const i = new Blob([t], { type: "image/svg+xml" }), s = URL.createObjectURL(i);
7412
- return new $t(s, e);
7412
+ return new Ot(s, e);
7413
7413
  }
7414
7414
  /**
7415
7415
  * Should excalibur add a cache busting querystring? By default false.
@@ -7441,13 +7441,13 @@ class $t {
7441
7441
  } catch (n) {
7442
7442
  throw `Error loading ImageSource from path '${this.path}' with error [${n.message}]`;
7443
7443
  }
7444
- return this.data.setAttribute(z.Filtering, this.filtering), this.data.setAttribute(z.WrappingX, (e = (t = this.wrapping) == null ? void 0 : t.x) != null ? e : gt.Clamp), this.data.setAttribute(z.WrappingY, (s = (i = this.wrapping) == null ? void 0 : i.y) != null ? s : gt.Clamp), this._readyFuture.resolve(this.data), this.data;
7444
+ return this.data.setAttribute(U.Filtering, this.filtering), this.data.setAttribute(U.WrappingX, (e = (t = this.wrapping) == null ? void 0 : t.x) != null ? e : gt.Clamp), this.data.setAttribute(U.WrappingY, (s = (i = this.wrapping) == null ? void 0 : i.y) != null ? s : gt.Clamp), this._readyFuture.resolve(this.data), this.data;
7445
7445
  }
7446
7446
  /**
7447
7447
  * Build a sprite from this ImageSource
7448
7448
  */
7449
7449
  toSprite(t) {
7450
- return Ht.from(this, t);
7450
+ return Bt.from(this, t);
7451
7451
  }
7452
7452
  /**
7453
7453
  * Unload images from memory
@@ -7521,7 +7521,7 @@ class fs extends nt {
7521
7521
  return this._cachedText = t, this._cachedLines = s, this._cachedRenderWidth = e, s;
7522
7522
  }
7523
7523
  }
7524
- class Ii extends Ht {
7524
+ class Ii extends Bt {
7525
7525
  constructor(t) {
7526
7526
  super({
7527
7527
  image: t.image,
@@ -7558,7 +7558,7 @@ class Ii extends Ht {
7558
7558
  this.sourceView.width,
7559
7559
  this.sourceView.height
7560
7560
  );
7561
- const a = $t.fromHtmlCanvasElement(n, {
7561
+ const a = Ot.fromHtmlCanvasElement(n, {
7562
7562
  wrapping: s != null ? s : gt.Repeat,
7563
7563
  filtering: i
7564
7564
  });
@@ -7630,12 +7630,89 @@ class Te {
7630
7630
  return Ii.fromSprite(n, i);
7631
7631
  throw Error(`Invalid sprite coordinates (${t}, ${e})`);
7632
7632
  }
7633
+ /**
7634
+ * Returns a sprite that has a new backing image the exact size of the sprite that tha is a copy of the original sprite slice.
7635
+ *
7636
+ * Useful if you need to apply effects, manipulate, or mutate the image and you don't want to disturb the original sprite sheet.
7637
+ *
7638
+ */
7639
+ async getSpriteAsStandalone(t, e) {
7640
+ if (t >= this.columns || t < 0)
7641
+ throw Error(`No sprite exists in the SpriteSheet at (${t}, ${e}), x: ${t} should be between 0 and ${this.columns - 1} columns`);
7642
+ if (e >= this.rows || e < 0)
7643
+ throw Error(`No sprite exists in the SpriteSheet at (${t}, ${e}), y: ${e} should be between 0 and ${this.rows - 1} rows`);
7644
+ const i = t + e * this.columns, s = this.sprites[i], n = document.createElement("canvas"), o = n.getContext("2d");
7645
+ if (n.width = s.width, n.height = s.height, !s)
7646
+ throw Error(`Invalid sprite coordinates (${t}, ${e})`);
7647
+ if (!o)
7648
+ throw Error("Unable to create canvas context");
7649
+ o.drawImage(
7650
+ s.image.image,
7651
+ s.sourceView.x,
7652
+ s.sourceView.y,
7653
+ s.sourceView.width,
7654
+ s.sourceView.height,
7655
+ 0,
7656
+ 0,
7657
+ s.sourceView.width,
7658
+ s.sourceView.height
7659
+ );
7660
+ const a = new Ot(n.toDataURL());
7661
+ return await a.load(), new Bt({
7662
+ image: a,
7663
+ sourceView: {
7664
+ x: 0,
7665
+ y: 0,
7666
+ width: s.width,
7667
+ height: s.height
7668
+ },
7669
+ destSize: {
7670
+ width: s.width,
7671
+ height: s.height
7672
+ }
7673
+ });
7674
+ }
7675
+ /**
7676
+ * Returns a new image exact size and copy of the original sprite slice.
7677
+ *
7678
+ * Useful if you need to apply effects, manipulate, or mutate the image and you don't want to disturb the original sprite sheet.
7679
+ */
7680
+ async getSpriteAsImage(t, e) {
7681
+ if (t >= this.columns || t < 0)
7682
+ throw Error(`No sprite exists in the SpriteSheet at (${t}, ${e}), x: ${t} should be between 0 and ${this.columns - 1} columns`);
7683
+ if (e >= this.rows || e < 0)
7684
+ throw Error(`No sprite exists in the SpriteSheet at (${t}, ${e}), y: ${e} should be between 0 and ${this.rows - 1} rows`);
7685
+ const i = t + e * this.columns, s = this.sprites[i], n = document.createElement("canvas"), o = n.getContext("2d");
7686
+ if (n.width = s.width, n.height = s.height, !s)
7687
+ throw Error(`Invalid sprite coordinates (${t}, ${e})`);
7688
+ if (!o)
7689
+ throw Error("Unable to create canvas context");
7690
+ o.drawImage(
7691
+ s.image.image,
7692
+ s.sourceView.x,
7693
+ s.sourceView.y,
7694
+ s.sourceView.width,
7695
+ s.sourceView.height,
7696
+ 0,
7697
+ 0,
7698
+ s.sourceView.width,
7699
+ s.sourceView.height
7700
+ );
7701
+ const a = new Image(s.width, s.height);
7702
+ return a.src = n.toDataURL(), await new Promise((h, l) => {
7703
+ a.onload = () => {
7704
+ h(a);
7705
+ }, a.onerror = (c) => {
7706
+ l(c);
7707
+ };
7708
+ });
7709
+ }
7633
7710
  /**
7634
7711
  * Create a sprite sheet from a sparse set of {@apilink SourceView} rectangles
7635
7712
  * @param options
7636
7713
  */
7637
7714
  static fromImageSourceWithSourceViews(t) {
7638
- const e = t.sourceViews.map((i) => new Ht({
7715
+ const e = t.sourceViews.map((i) => new Bt({
7639
7716
  image: t.image,
7640
7717
  sourceView: i
7641
7718
  }));
@@ -7685,7 +7762,7 @@ class Te {
7685
7762
  const _ = { x: 0, y: 0, ...u }, p = { x: 0, y: 0, ...d };
7686
7763
  for (let g = 0; g < o; g++)
7687
7764
  for (let v = 0; v < n; v++)
7688
- i[g + v * o] = new Ht({
7765
+ i[g + v * o] = new Bt({
7689
7766
  image: s,
7690
7767
  sourceView: {
7691
7768
  x: g * a + p.x * g + _.x,
@@ -7816,7 +7893,7 @@ class fr {
7816
7893
  return St.config.settings.text.border;
7817
7894
  }
7818
7895
  load() {
7819
- return this._imageSource = new $t(this.fontSheet), this._imageSource.load().then(() => {
7896
+ return this._imageSource = new Ot(this.fontSheet), this._imageSource.load().then(() => {
7820
7897
  this._spriteSheet = Te.fromImageSource({
7821
7898
  image: this._imageSource,
7822
7899
  grid: {
@@ -8019,12 +8096,12 @@ class gr extends nt {
8019
8096
  });
8020
8097
  }
8021
8098
  }
8022
- class gs extends Bt {
8099
+ class gs extends kt {
8023
8100
  constructor(t, e = !0) {
8024
8101
  super(), this.draw = t, this.useTransform = e;
8025
8102
  }
8026
8103
  }
8027
- class ps extends Bt {
8104
+ class ps extends kt {
8028
8105
  constructor(t) {
8029
8106
  super(), this.parallaxFactor = w(1, 1), this.parallaxFactor = t != null ? t : this.parallaxFactor;
8030
8107
  }
@@ -8080,7 +8157,7 @@ ke._TEXT_USAGE = /* @__PURE__ */ new Map();
8080
8157
  ke._TEXT_CACHE = /* @__PURE__ */ new Map();
8081
8158
  ke._MEASURE_CACHE = /* @__PURE__ */ new Map();
8082
8159
  let is = ke;
8083
- function zo(r, t, e, i) {
8160
+ function Uo(r, t, e, i) {
8084
8161
  if (r.parent !== t.parent) {
8085
8162
  const c = r.clone(), d = r.globalPos.clone(), u = r.globalScale.clone(), _ = r.globalRotation;
8086
8163
  c.parent = t.parent, c.globalPos = d, c.globalScale = u, c.globalRotation = _, r = c;
@@ -8146,7 +8223,7 @@ class pr extends Ft {
8146
8223
  if ((n || o) && (a.flipHorizontal = n ? !v : v, a.flipVertical = o ? !m : m), a == null || a.draw(this._graphicsContext, p, g), (n || o) && (a.flipHorizontal = v, a.flipVertical = m), (s = this._engine) != null && s.isDebug && this._engine.debug.graphics.showBounds) {
8147
8224
  this._graphicsContext.save();
8148
8225
  const f = w(p, g);
8149
- if (a instanceof $e)
8226
+ if (a instanceof Ye)
8150
8227
  for (const b of a.members) {
8151
8228
  let C, S = x.Zero;
8152
8229
  b instanceof nt ? C = b : (C = b.graphic, S = b.offset), a.useAnchor ? C == null || C.localBounds.translate(f.add(S)).debug(this._graphicsContext, { color: this._engine.debug.graphics.boundsColor, dashed: !0 }) : C == null || C.localBounds.translate(S).debug(this._graphicsContext, { color: this._engine.debug.graphics.boundsColor, dashed: !0 });
@@ -8170,7 +8247,7 @@ class pr extends Ft {
8170
8247
  let a = n.get();
8171
8248
  if (o && this._engine.fixedUpdateTimestep && o.__oldTransformCaptured && o.enableFixedUpdateInterpolate) {
8172
8249
  const h = this._engine.currentFrameLagMs / this._engine.fixedUpdateTimestep;
8173
- a = zo(o.oldTransform, n.get(), h, this._targetInterpolationTransform);
8250
+ a = Uo(o.oldTransform, n.get(), h, this._targetInterpolationTransform);
8174
8251
  }
8175
8252
  this._graphicsContext.z = n.globalZ, this._graphicsContext.translate(a.pos.x, a.pos.y), this._graphicsContext.scale(a.scale.x, a.scale.y), this._graphicsContext.rotate(a.rotation);
8176
8253
  }
@@ -8205,7 +8282,7 @@ class mr extends Ft {
8205
8282
  o = this._camera.pos.scale(h);
8206
8283
  }
8207
8284
  const a = this._isOffscreen(t, e, o);
8208
- a && !n.hasTag("ex.offscreen") && (n.events.emit("exitviewport", new zn(n)), n.addTag("ex.offscreen")), !a && n.hasTag("ex.offscreen") && (n.events.emit("enterviewport", new Un(n)), n.removeTag("ex.offscreen"));
8285
+ a && !n.hasTag("ex.offscreen") && (n.events.emit("exitviewport", new Un(n)), n.addTag("ex.offscreen")), !a && n.hasTag("ex.offscreen") && (n.events.emit("enterviewport", new zn(n)), n.removeTag("ex.offscreen"));
8209
8286
  }
8210
8287
  }
8211
8288
  _isOffscreen(t, e, i) {
@@ -8316,7 +8393,7 @@ class xs extends Ke {
8316
8393
  (e = this._options) != null && e.draw && ((i = this._options) == null || i.draw(t)), this._options.cache || this.flagDirty();
8317
8394
  }
8318
8395
  }
8319
- var Uo = /* @__PURE__ */ ((r) => (r.Stretch = "stretch", r.Tile = "tile", r.TileFit = "tile-fit", r))(Uo || {});
8396
+ var zo = /* @__PURE__ */ ((r) => (r.Stretch = "stretch", r.Tile = "tile", r.TileFit = "tile-fit", r))(zo || {});
8320
8397
  class vr extends nt {
8321
8398
  constructor(t) {
8322
8399
  super(t), this._logger = I.getInstance(), this._config = t, this._imgSource = t.source, this._canvasA = document.createElement("canvas"), this._canvasB = document.createElement("canvas"), this._canvasC = document.createElement("canvas"), this._canvasD = document.createElement("canvas"), this._canvasE = document.createElement("canvas"), this._canvasF = document.createElement("canvas"), this._canvasG = document.createElement("canvas"), this._canvasH = document.createElement("canvas"), this._canvasI = document.createElement("canvas"), this._initialize(), this._imgSource.ready.then(() => {
@@ -8663,7 +8740,7 @@ class wr extends _s {
8663
8740
  const e = [];
8664
8741
  for (let i = 0; i < this.frames.length; i++) {
8665
8742
  const s = this.frames[i].graphic;
8666
- if (s && s instanceof Ht) {
8743
+ if (s && s instanceof Bt) {
8667
8744
  const n = new Ii({
8668
8745
  image: s.image,
8669
8746
  width: t.width,
@@ -8690,7 +8767,7 @@ class wr extends _s {
8690
8767
  _updateSourceView() {
8691
8768
  for (let t = 0; t < this.frames.length; t++) {
8692
8769
  const e = this.frames[t].graphic;
8693
- e && e instanceof Ht && (e.sourceView = { ...e.sourceView, ...this._sourceView });
8770
+ e && e instanceof Bt && (e.sourceView = { ...e.sourceView, ...this._sourceView });
8694
8771
  }
8695
8772
  }
8696
8773
  get sourceView() {
@@ -8702,7 +8779,7 @@ class wr extends _s {
8702
8779
  _updateWidthHeight() {
8703
8780
  for (let t = 0; t < this.frames.length; t++) {
8704
8781
  const e = this.frames[t].graphic;
8705
- e && e instanceof Ht && (e.sourceView.height = this._tiledHeight || e.height, e.destSize.height = this._tiledHeight || e.height, e.sourceView.width = this._tiledWidth || e.width, e.destSize.width = this._tiledWidth || e.width);
8782
+ e && e instanceof Bt && (e.sourceView.height = this._tiledHeight || e.height, e.destSize.height = this._tiledHeight || e.height, e.sourceView.width = this._tiledWidth || e.width, e.destSize.width = this._tiledWidth || e.width);
8706
8783
  }
8707
8784
  }
8708
8785
  get width() {
@@ -8738,8 +8815,8 @@ const Ho = {
8738
8815
  Fi.DrawCallCount = 0;
8739
8816
  Fi.DrawnImagesCount = 0;
8740
8817
  Fi.RendererSwaps = 0;
8741
- let $ = Fi;
8742
- const Y = 1e-4;
8818
+ let Y = Fi;
8819
+ const $ = 1e-4;
8743
8820
  class No {
8744
8821
  constructor(t) {
8745
8822
  this._ex = t, this._debugText = new fr();
@@ -8753,26 +8830,26 @@ class No {
8753
8830
  */
8754
8831
  drawRect(t, e, i, s) {
8755
8832
  this._ex.__ctx.save(), this._ex.__ctx.strokeStyle = "red", this._ex.__ctx.strokeRect(
8756
- this._ex.snapToPixel ? ~~(t + Y) : t,
8757
- this._ex.snapToPixel ? ~~(e + Y) : e,
8758
- this._ex.snapToPixel ? ~~(i + Y) : i,
8759
- this._ex.snapToPixel ? ~~(s + Y) : s
8833
+ this._ex.snapToPixel ? ~~(t + $) : t,
8834
+ this._ex.snapToPixel ? ~~(e + $) : e,
8835
+ this._ex.snapToPixel ? ~~(i + $) : i,
8836
+ this._ex.snapToPixel ? ~~(s + $) : s
8760
8837
  ), this._ex.__ctx.restore();
8761
8838
  }
8762
8839
  drawLine(t, e, i = { color: T.Black }) {
8763
8840
  var s, n;
8764
8841
  this._ex.__ctx.save(), this._ex.__ctx.beginPath(), this._ex.__ctx.strokeStyle = (n = (s = i.color) == null ? void 0 : s.toString()) != null ? n : "", this._ex.__ctx.moveTo(
8765
- this._ex.snapToPixel ? ~~(t.x + Y) : t.x,
8766
- this._ex.snapToPixel ? ~~(t.y + Y) : t.y
8842
+ this._ex.snapToPixel ? ~~(t.x + $) : t.x,
8843
+ this._ex.snapToPixel ? ~~(t.y + $) : t.y
8767
8844
  ), this._ex.__ctx.lineTo(
8768
- this._ex.snapToPixel ? ~~(e.x + Y) : e.x,
8769
- this._ex.snapToPixel ? ~~(e.y + Y) : e.y
8845
+ this._ex.snapToPixel ? ~~(e.x + $) : e.x,
8846
+ this._ex.snapToPixel ? ~~(e.y + $) : e.y
8770
8847
  ), this._ex.__ctx.lineWidth = 2, this._ex.__ctx.stroke(), this._ex.__ctx.closePath(), this._ex.__ctx.restore();
8771
8848
  }
8772
8849
  drawPoint(t, e = { color: T.Black, size: 5 }) {
8773
8850
  this._ex.__ctx.save(), this._ex.__ctx.beginPath(), this._ex.__ctx.fillStyle = e.color.toString(), this._ex.__ctx.arc(
8774
- this._ex.snapToPixel ? ~~(t.x + Y) : t.x,
8775
- this._ex.snapToPixel ? ~~(t.y + Y) : t.y,
8851
+ this._ex.snapToPixel ? ~~(t.x + $) : t.x,
8852
+ this._ex.snapToPixel ? ~~(t.y + $) : t.y,
8776
8853
  e.size,
8777
8854
  0,
8778
8855
  Math.PI * 2
@@ -8780,8 +8857,8 @@ class No {
8780
8857
  }
8781
8858
  drawCircle(t, e, i, s, n) {
8782
8859
  this._ex.__ctx.save(), this._ex.__ctx.beginPath(), s && (this._ex.__ctx.strokeStyle = s.toString()), n && (this._ex.__ctx.lineWidth = n), this._ex.__ctx.fillStyle = i.toString(), this._ex.__ctx.arc(
8783
- this._ex.snapToPixel ? ~~(t.x + Y) : t.x,
8784
- this._ex.snapToPixel ? ~~(t.y + Y) : t.y,
8860
+ this._ex.snapToPixel ? ~~(t.x + $) : t.x,
8861
+ this._ex.snapToPixel ? ~~(t.y + $) : t.y,
8785
8862
  e,
8786
8863
  0,
8787
8864
  Math.PI * 2
@@ -8839,26 +8916,26 @@ class ss {
8839
8916
  return;
8840
8917
  this.__ctx.globalAlpha = this.opacity;
8841
8918
  const c = [t, e, i, s, n, o, a, h, l].filter((d) => d !== void 0).map((d) => typeof d == "number" && this.snapToPixel ? ~~d : d);
8842
- this.__ctx.drawImage.apply(this.__ctx, c), $.DrawCallCount++, $.DrawnImagesCount = 1;
8919
+ this.__ctx.drawImage.apply(this.__ctx, c), Y.DrawCallCount++, Y.DrawnImagesCount = 1;
8843
8920
  }
8844
8921
  drawLine(t, e, i, s = 1) {
8845
8922
  this.__ctx.save(), this.__ctx.beginPath(), this.__ctx.strokeStyle = i.toString(), this.__ctx.moveTo(
8846
- this.snapToPixel ? ~~(t.x + Y) : t.x,
8847
- this.snapToPixel ? ~~(t.y + Y) : t.y
8848
- ), this.__ctx.lineTo(this.snapToPixel ? ~~(e.x + Y) : e.x, this.snapToPixel ? ~~(e.y + Y) : e.y), this.__ctx.lineWidth = s, this.__ctx.stroke(), this.__ctx.closePath(), this.__ctx.restore();
8923
+ this.snapToPixel ? ~~(t.x + $) : t.x,
8924
+ this.snapToPixel ? ~~(t.y + $) : t.y
8925
+ ), this.__ctx.lineTo(this.snapToPixel ? ~~(e.x + $) : e.x, this.snapToPixel ? ~~(e.y + $) : e.y), this.__ctx.lineWidth = s, this.__ctx.stroke(), this.__ctx.closePath(), this.__ctx.restore();
8849
8926
  }
8850
8927
  drawRectangle(t, e, i, s) {
8851
8928
  this.__ctx.save(), this.__ctx.fillStyle = s.toString(), this.__ctx.fillRect(
8852
- this.snapToPixel ? ~~(t.x + Y) : t.x,
8853
- this.snapToPixel ? ~~(t.y + Y) : t.y,
8854
- this.snapToPixel ? ~~(e + Y) : e,
8855
- this.snapToPixel ? ~~(i + Y) : i
8929
+ this.snapToPixel ? ~~(t.x + $) : t.x,
8930
+ this.snapToPixel ? ~~(t.y + $) : t.y,
8931
+ this.snapToPixel ? ~~(e + $) : e,
8932
+ this.snapToPixel ? ~~(i + $) : i
8856
8933
  ), this.__ctx.restore();
8857
8934
  }
8858
8935
  drawCircle(t, e, i, s, n) {
8859
8936
  this.__ctx.save(), this.__ctx.beginPath(), s && (this.__ctx.strokeStyle = s.toString()), n && (this.__ctx.lineWidth = n), this.__ctx.fillStyle = i.toString(), this.__ctx.arc(
8860
- this.snapToPixel ? ~~(t.x + Y) : t.x,
8861
- this.snapToPixel ? ~~(t.y + Y) : t.y,
8937
+ this.snapToPixel ? ~~(t.x + $) : t.x,
8938
+ this.snapToPixel ? ~~(t.y + $) : t.y,
8862
8939
  e,
8863
8940
  0,
8864
8941
  Math.PI * 2
@@ -8882,7 +8959,7 @@ class ss {
8882
8959
  * @param y
8883
8960
  */
8884
8961
  translate(t, e) {
8885
- this.__ctx.translate(this.snapToPixel ? ~~(t + Y) : t, this.snapToPixel ? ~~(e + Y) : e);
8962
+ this.__ctx.translate(this.snapToPixel ? ~~(t + $) : t, this.snapToPixel ? ~~(e + $) : e);
8886
8963
  }
8887
8964
  /**
8888
8965
  * Rotate the context about the current origin
@@ -8927,7 +9004,7 @@ class ss {
8927
9004
  return null;
8928
9005
  }
8929
9006
  clear() {
8930
- this.__ctx.clearRect(0, 0, this.width, this.height), this.__ctx.fillStyle = this.backgroundColor.toString(), this.__ctx.fillRect(0, 0, this.width, this.height), $.clear();
9007
+ this.__ctx.clearRect(0, 0, this.width, this.height), this.__ctx.fillStyle = this.backgroundColor.toString(), this.__ctx.fillRect(0, 0, this.width, this.height), Y.clear();
8931
9008
  }
8932
9009
  /**
8933
9010
  * Flushes the batched draw calls to the screen
@@ -9179,7 +9256,7 @@ function Vo(r, t) {
9179
9256
  throw new Error(`Unknown uniform type: ${t}`);
9180
9257
  }
9181
9258
  }
9182
- const Sr = class Ue {
9259
+ const Sr = class ze {
9183
9260
  /**
9184
9261
  * Create a shader program in excalibur
9185
9262
  * @param options specify shader vertex and fragment source
@@ -9215,14 +9292,14 @@ const Sr = class Ue {
9215
9292
  * Binds the shader program
9216
9293
  */
9217
9294
  use() {
9218
- this._gl.useProgram(this.program), Ue._ACTIVE_SHADER_INSTANCE = this, this._dirtyUniforms && (this._setUniforms(), this._dirtyUniforms = !1), this._setImages();
9295
+ this._gl.useProgram(this.program), ze._ACTIVE_SHADER_INSTANCE = this, this._dirtyUniforms && (this._setUniforms(), this._dirtyUniforms = !1), this._setImages();
9219
9296
  }
9220
9297
  unuse() {
9221
9298
  const t = this._gl;
9222
- Ue._ACTIVE_SHADER_INSTANCE = null, t.useProgram(null);
9299
+ ze._ACTIVE_SHADER_INSTANCE = null, t.useProgram(null);
9223
9300
  }
9224
9301
  isCurrentlyBound() {
9225
- return Ue._ACTIVE_SHADER_INSTANCE === this;
9302
+ return ze._ACTIVE_SHADER_INSTANCE === this;
9226
9303
  }
9227
9304
  _setUniforms() {
9228
9305
  const t = this._gl, e = Object.entries(this.uniforms);
@@ -9256,7 +9333,7 @@ const Sr = class Ue {
9256
9333
  }
9257
9334
  }
9258
9335
  _loadImageSource(t) {
9259
- const e = t.image, i = e.getAttribute(z.Filtering), s = i ? ti(i) : void 0, n = Ot(e.getAttribute(z.WrappingX)), o = Ot(e.getAttribute(z.WrappingY)), a = e.getAttribute("forceUpload") === "true", h = this._textureLoader.load(
9336
+ const e = t.image, i = e.getAttribute(U.Filtering), s = i ? ti(i) : void 0, n = Nt(e.getAttribute(U.WrappingX)), o = Nt(e.getAttribute(U.WrappingY)), a = e.getAttribute("forceUpload") === "true", h = this._textureLoader.load(
9260
9337
  e,
9261
9338
  {
9262
9339
  filtering: s,
@@ -9294,7 +9371,7 @@ const Sr = class Ue {
9294
9371
  const n = this.getUniformDefinitions();
9295
9372
  for (const o of n)
9296
9373
  this._uniforms[o.name] = o;
9297
- return this._compiled = !0, this._onPostCompile && this._onPostCompile(this), t.useProgram(this.program), Ue._ACTIVE_SHADER_INSTANCE = this, this._dirtyUniforms && (this._setUniforms(), this._dirtyUniforms = !1), this._setImages(!0), this.unuse(), this.program;
9374
+ return this._compiled = !0, this._onPostCompile && this._onPostCompile(this), t.useProgram(this.program), ze._ACTIVE_SHADER_INSTANCE = this, this._dirtyUniforms && (this._setUniforms(), this._dirtyUniforms = !1), this._setImages(!0), this.unuse(), this.program;
9298
9375
  }
9299
9376
  /**
9300
9377
  * Get's the uniform definitons
@@ -9623,7 +9700,7 @@ Source:
9623
9700
  }
9624
9701
  };
9625
9702
  Sr._ACTIVE_SHADER_INSTANCE = null;
9626
- let kt = Sr;
9703
+ let Lt = Sr;
9627
9704
  const Go = `#version 300 es
9628
9705
  precision mediump float;
9629
9706
 
@@ -9783,7 +9860,7 @@ class Xo {
9783
9860
  this.type = "ex.particle", this.priority = 0;
9784
9861
  }
9785
9862
  initialize(t, e) {
9786
- this._gl = t, this._context = e, this._shader = new kt({
9863
+ this._gl = t, this._context = e, this._shader = new Lt({
9787
9864
  graphicsContext: e,
9788
9865
  vertexSource: Go,
9789
9866
  fragmentSource: qo,
@@ -9797,7 +9874,7 @@ class Xo {
9797
9874
  }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", this._context.ortho);
9798
9875
  }
9799
9876
  _getTexture(t) {
9800
- const e = t.getAttribute(z.Filtering), i = e ? ti(e) : void 0, s = Ot(t.getAttribute(z.WrappingX)), n = Ot(t.getAttribute(z.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
9877
+ const e = t.getAttribute(U.Filtering), i = e ? ti(e) : void 0, s = Nt(t.getAttribute(U.WrappingX)), n = Nt(t.getAttribute(U.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
9801
9878
  t,
9802
9879
  {
9803
9880
  filtering: i,
@@ -9829,7 +9906,7 @@ class Xo {
9829
9906
  dispose() {
9830
9907
  }
9831
9908
  }
9832
- class Nt {
9909
+ class Wt {
9833
9910
  constructor(t) {
9834
9911
  this.type = "dynamic";
9835
9912
  const { gl: e, size: i, type: s, data: n } = t;
@@ -9952,13 +10029,13 @@ class Kt {
9952
10029
  this._vertexBuffer.bind(), t && this._vertexBuffer.upload(e), i.bindVertexArray(this._vao);
9953
10030
  }
9954
10031
  }
9955
- class Yo {
10032
+ class $o {
9956
10033
  constructor(t, e) {
9957
10034
  e.includes("v_texcoord") && I.getInstance().warn(
9958
10035
  `ScreenShader: "v_texcoord" is deprecated in postprocessing fragment shaders will be removed in v1.0, use "v_uv" instead. Source [${e}]`
9959
10036
  );
9960
10037
  const i = t.__gl;
9961
- this._shader = new kt({
10038
+ this._shader = new Lt({
9962
10039
  graphicsContext: t,
9963
10040
  vertexSource: `#version 300 es
9964
10041
  in vec2 a_position;
@@ -9973,7 +10050,7 @@ class Yo {
9973
10050
  v_uv = a_uv;
9974
10051
  }`,
9975
10052
  fragmentSource: e
9976
- }), this._shader.compile(), this._buffer = new Nt({
10053
+ }), this._shader.compile(), this._buffer = new Wt({
9977
10054
  gl: i,
9978
10055
  type: "static",
9979
10056
  // clip space quad + uv since we don't need a camera
@@ -10021,7 +10098,7 @@ class Yo {
10021
10098
  }
10022
10099
  }
10023
10100
  var Ge = /* @__PURE__ */ ((r) => (r.Protanope = "Protanope", r.Deuteranope = "Deuteranope", r.Tritanope = "Tritanope", r))(Ge || {});
10024
- const $o = `#version 300 es
10101
+ const Yo = `#version 300 es
10025
10102
  precision mediump float;
10026
10103
  // our texture
10027
10104
  uniform sampler2D u_image;
@@ -10091,7 +10168,7 @@ class Zo {
10091
10168
  this._colorBlindnessMode = t, this._simulate = !1, this._simulate = e;
10092
10169
  }
10093
10170
  initialize(t) {
10094
- this._shader = new Yo(t, $o), this.simulate = this._simulate, this.colorBlindnessMode = this._colorBlindnessMode;
10171
+ this._shader = new $o(t, Yo), this.simulate = this._simulate, this.colorBlindnessMode = this._colorBlindnessMode;
10095
10172
  }
10096
10173
  getShader() {
10097
10174
  return this._shader.getShader();
@@ -10274,11 +10351,11 @@ class Jo {
10274
10351
  this.type = "ex.debug-line", this.priority = 0, this._maxLines = 10922, this._vertexIndex = 0, this._lineCount = 0, this._startScratch = w(0, 0), this._endScratch = w(0, 0), this._lengthSoFar = 0, this._currentlyDashed = !1;
10275
10352
  }
10276
10353
  initialize(t, e) {
10277
- this._gl = t, this._context = e, this._shader = new kt({
10354
+ this._gl = t, this._context = e, this._shader = new Lt({
10278
10355
  graphicsContext: e,
10279
10356
  vertexSource: ko,
10280
10357
  fragmentSource: Lo
10281
- }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._vertexBuffer = new Nt({
10358
+ }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._vertexBuffer = new Wt({
10282
10359
  gl: t,
10283
10360
  size: 42 * this._maxLines,
10284
10361
  // 7 floats per vert, 6 verts per line
@@ -10312,7 +10389,7 @@ class Jo {
10312
10389
  if (this._lineCount === 0)
10313
10390
  return;
10314
10391
  const t = this._gl;
10315
- this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._shader.setUniformBoolean("u_dashed", this._currentlyDashed), t.drawArrays(t.TRIANGLES, 0, this._lineCount * 6), $.DrawnImagesCount += this._lineCount, $.DrawCallCount++, this._vertexIndex = 0, this._lineCount = 0, this._lengthSoFar = 0;
10392
+ this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._shader.setUniformBoolean("u_dashed", this._currentlyDashed), t.drawArrays(t.TRIANGLES, 0, this._lineCount * 6), Y.DrawnImagesCount += this._lineCount, Y.DrawCallCount++, this._vertexIndex = 0, this._lineCount = 0, this._lengthSoFar = 0;
10316
10393
  }
10317
10394
  }
10318
10395
  const Ko = `#version 300 es
@@ -10351,11 +10428,11 @@ class ea {
10351
10428
  this.type = "ex.debug-point", this.priority = 0, this._maxPoints = 10922, this._pointCount = 0, this._vertexIndex = 0;
10352
10429
  }
10353
10430
  initialize(t, e) {
10354
- this._gl = t, this._context = e, this._shader = new kt({
10431
+ this._gl = t, this._context = e, this._shader = new Lt({
10355
10432
  graphicsContext: e,
10356
10433
  vertexSource: Ko,
10357
10434
  fragmentSource: ta
10358
- }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._buffer = new Nt({
10435
+ }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._buffer = new Wt({
10359
10436
  gl: t,
10360
10437
  size: 7 * this._maxPoints,
10361
10438
  type: "dynamic"
@@ -10390,7 +10467,7 @@ class ea {
10390
10467
  if (this._pointCount === 0)
10391
10468
  return;
10392
10469
  const t = this._gl;
10393
- this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), t.drawArrays(t.POINTS, 0, this._pointCount), $.DrawnImagesCount += this._pointCount, $.DrawCallCount++, this._pointCount = 0, this._vertexIndex = 0;
10470
+ this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), t.drawArrays(t.POINTS, 0, this._pointCount), Y.DrawnImagesCount += this._pointCount, Y.DrawCallCount++, this._pointCount = 0, this._vertexIndex = 0;
10394
10471
  }
10395
10472
  }
10396
10473
  const ia = `#version 300 es
@@ -10496,11 +10573,11 @@ class na {
10496
10573
  this.type = "ex.debug-circle", this.priority = 0, this._maxCircles = 10922, this._circleCount = 0, this._vertexIndex = 0;
10497
10574
  }
10498
10575
  initialize(t, e) {
10499
- this._gl = t, this._context = e, this._shader = new kt({
10576
+ this._gl = t, this._context = e, this._shader = new Lt({
10500
10577
  graphicsContext: e,
10501
10578
  fragmentSource: ia,
10502
10579
  vertexSource: sa
10503
- }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", e.ortho), this._buffer = new Nt({
10580
+ }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", e.ortho), this._buffer = new Wt({
10504
10581
  gl: t,
10505
10582
  size: 60 * this._maxCircles,
10506
10583
  type: "dynamic"
@@ -10539,7 +10616,7 @@ class na {
10539
10616
  if (this._circleCount === 0)
10540
10617
  return;
10541
10618
  const t = this._gl;
10542
- this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._quads.bind(), t.drawElements(t.TRIANGLES, this._circleCount * 6, this._quads.bufferGlType, 0), $.DrawnImagesCount += this._circleCount, $.DrawCallCount++, this._circleCount = 0, this._vertexIndex = 0;
10619
+ this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._quads.bind(), t.drawElements(t.TRIANGLES, this._circleCount * 6, this._quads.bufferGlType, 0), Y.DrawnImagesCount += this._circleCount, Y.DrawCallCount++, this._circleCount = 0, this._vertexIndex = 0;
10543
10620
  }
10544
10621
  }
10545
10622
  const ra = `#version 300 es
@@ -10570,11 +10647,11 @@ void main() {
10570
10647
  class aa {
10571
10648
  constructor(t) {
10572
10649
  const e = t.__gl;
10573
- this._gl = e, this._shader = new kt({
10650
+ this._gl = e, this._shader = new Lt({
10574
10651
  graphicsContext: t,
10575
10652
  vertexSource: ra,
10576
10653
  fragmentSource: oa
10577
- }), this._shader.compile(), this._buffer = new Nt({
10654
+ }), this._shader.compile(), this._buffer = new Wt({
10578
10655
  gl: e,
10579
10656
  type: "static",
10580
10657
  // clip space quad + uv since we don't need a camera
@@ -10719,14 +10796,14 @@ class ca {
10719
10796
  const i = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS), s = vs(t, i);
10720
10797
  this._maxTextures = Math.min(i, s);
10721
10798
  const n = this._transformFragmentSource(ha, this._maxTextures);
10722
- this._shader = new kt({
10799
+ this._shader = new Lt({
10723
10800
  graphicsContext: e,
10724
10801
  fragmentSource: n,
10725
10802
  vertexSource: la
10726
10803
  }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", e.ortho), this._shader.setUniformIntArray(
10727
10804
  "u_textures",
10728
10805
  [...Array(this._maxTextures)].map((o, a) => a)
10729
- ), this._buffer = new Nt({
10806
+ ), this._buffer = new Wt({
10730
10807
  gl: t,
10731
10808
  size: 48 * this._maxImages,
10732
10809
  // 12 components * 4 verts
@@ -10762,7 +10839,7 @@ class ca {
10762
10839
  _addImageAsTexture(t) {
10763
10840
  if (this._images.has(t))
10764
10841
  return;
10765
- const e = t.getAttribute(z.Filtering), i = e ? ti(e) : void 0, s = Ot(t.getAttribute(z.WrappingX)), n = Ot(t.getAttribute(z.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
10842
+ const e = t.getAttribute(U.Filtering), i = e ? ti(e) : void 0, s = Nt(t.getAttribute(U.WrappingX)), n = Nt(t.getAttribute(U.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
10766
10843
  t,
10767
10844
  {
10768
10845
  filtering: i,
@@ -10803,8 +10880,8 @@ class ca {
10803
10880
  this._view[0] = 0, this._view[1] = 0, this._view[2] = (c = s != null ? s : p) != null ? c : 0, this._view[3] = (d = n != null ? n : g) != null ? d : 0, this._dest[0] = e != null ? e : 1, this._dest[1] = i != null ? i : 1, o !== void 0 && a !== void 0 && h !== void 0 && l !== void 0 && (this._view[0] = e != null ? e : 1, this._view[1] = i != null ? i : 1, this._view[2] = (u = s != null ? s : p) != null ? u : 0, this._view[3] = (_ = n != null ? n : g) != null ? _ : 0, this._dest[0] = o, this._dest[1] = a, v = h, m = l), e = this._view[0], i = this._view[1];
10804
10881
  const f = this._view[2], b = this._view[3], C = this._context.getTransform(), S = this._context.opacity, E = this._context.snapToPixel;
10805
10882
  this._quad[0] = this._dest[0], this._quad[1] = this._dest[1], this._quad[2] = this._dest[0] + v, this._quad[3] = this._dest[1], this._quad[4] = this._dest[0], this._quad[5] = this._dest[1] + m, this._quad[6] = this._dest[0] + v, this._quad[7] = this._dest[1] + m, C.multiplyQuadInPlace(this._quad), E && (this._quad[0] = ~~(this._quad[0] + q(this._quad[0]) * M), this._quad[1] = ~~(this._quad[1] + q(this._quad[1]) * M), this._quad[2] = ~~(this._quad[2] + q(this._quad[2]) * M), this._quad[3] = ~~(this._quad[3] + q(this._quad[3]) * M), this._quad[4] = ~~(this._quad[4] + q(this._quad[4]) * M), this._quad[5] = ~~(this._quad[5] + q(this._quad[5]) * M), this._quad[6] = ~~(this._quad[6] + q(this._quad[6]) * M), this._quad[7] = ~~(this._quad[7] + q(this._quad[7]) * M));
10806
- const y = this._context.tint || this._defaultTint, k = this._getTextureIdForImage(t), L = p || v, O = g || m, Q = (e + this.uvPadding) / L, st = (i + this.uvPadding) / O, X = (e + f - this.uvPadding) / L, U = (i + b - this.uvPadding) / O, ot = p, ct = g, A = this._layout.vertexBuffer.bufferData;
10807
- A[this._vertexIndex++] = this._quad[0], A[this._vertexIndex++] = this._quad[1], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = Q, A[this._vertexIndex++] = st, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a, A[this._vertexIndex++] = this._quad[4], A[this._vertexIndex++] = this._quad[5], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = Q, A[this._vertexIndex++] = U, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a, A[this._vertexIndex++] = this._quad[2], A[this._vertexIndex++] = this._quad[3], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = X, A[this._vertexIndex++] = st, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a, A[this._vertexIndex++] = this._quad[6], A[this._vertexIndex++] = this._quad[7], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = X, A[this._vertexIndex++] = U, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a;
10883
+ const y = this._context.tint || this._defaultTint, k = this._getTextureIdForImage(t), L = p || v, O = g || m, Q = (e + this.uvPadding) / L, st = (i + this.uvPadding) / O, X = (e + f - this.uvPadding) / L, z = (i + b - this.uvPadding) / O, ot = p, ct = g, A = this._layout.vertexBuffer.bufferData;
10884
+ A[this._vertexIndex++] = this._quad[0], A[this._vertexIndex++] = this._quad[1], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = Q, A[this._vertexIndex++] = st, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a, A[this._vertexIndex++] = this._quad[4], A[this._vertexIndex++] = this._quad[5], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = Q, A[this._vertexIndex++] = z, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a, A[this._vertexIndex++] = this._quad[2], A[this._vertexIndex++] = this._quad[3], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = X, A[this._vertexIndex++] = st, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a, A[this._vertexIndex++] = this._quad[6], A[this._vertexIndex++] = this._quad[7], A[this._vertexIndex++] = S, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = X, A[this._vertexIndex++] = z, A[this._vertexIndex++] = k, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a;
10808
10885
  }
10809
10886
  hasPendingDraws() {
10810
10887
  return this._imageCount !== 0;
@@ -10813,7 +10890,7 @@ class ca {
10813
10890
  if (this._imageCount === 0)
10814
10891
  return;
10815
10892
  const t = this._gl;
10816
- this._shader.use(), this._layout.use(!0, 48 * this._imageCount), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._shader.setUniformBoolean("u_pixelart", this.pixelArtSampler), this._bindTextures(t), this._quads.bind(), t.drawElements(t.TRIANGLES, this._imageCount * 6, this._quads.bufferGlType, 0), $.DrawnImagesCount += this._imageCount, $.DrawCallCount++, this._imageCount = 0, this._vertexIndex = 0, this._textures.length = 0, this._textureIndex = 0, this._textureToIndex.clear(), this._images.clear(), this._imageToWidth.clear(), this._imageToHeight.clear();
10893
+ this._shader.use(), this._layout.use(!0, 48 * this._imageCount), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._shader.setUniformBoolean("u_pixelart", this.pixelArtSampler), this._bindTextures(t), this._quads.bind(), t.drawElements(t.TRIANGLES, this._imageCount * 6, this._quads.bufferGlType, 0), Y.DrawnImagesCount += this._imageCount, Y.DrawCallCount++, this._imageCount = 0, this._vertexIndex = 0, this._textures.length = 0, this._textureIndex = 0, this._textureToIndex.clear(), this._images.clear(), this._imageToWidth.clear(), this._imageToHeight.clear();
10817
10894
  }
10818
10895
  }
10819
10896
  const da = `#version 300 es
@@ -10949,11 +11026,11 @@ class _a {
10949
11026
  this.type = "ex.rectangle", this.priority = 0, this._maxRectangles = 10922, this._rectangleCount = 0, this._vertexIndex = 0, this._transparent = T.Transparent, this._scratch1 = w(0, 0), this._scratch2 = w(0, 0), this._scratch3 = w(0, 0), this._scratch4 = w(0, 0);
10950
11027
  }
10951
11028
  initialize(t, e) {
10952
- this._gl = t, this._context = e, this._shader = new kt({
11029
+ this._gl = t, this._context = e, this._shader = new Lt({
10953
11030
  graphicsContext: e,
10954
11031
  fragmentSource: da,
10955
11032
  vertexSource: ua
10956
- }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", e.ortho), this._buffer = new Nt({
11033
+ }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", e.ortho), this._buffer = new Wt({
10957
11034
  gl: t,
10958
11035
  size: 64 * this._maxRectangles,
10959
11036
  type: "dynamic"
@@ -11002,7 +11079,7 @@ class _a {
11002
11079
  if (this._rectangleCount === 0)
11003
11080
  return;
11004
11081
  const t = this._gl;
11005
- this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._quads.bind(), t.drawElements(t.TRIANGLES, this._rectangleCount * 6, this._quads.bufferGlType, 0), $.DrawnImagesCount += this._rectangleCount, $.DrawCallCount++, this._rectangleCount = 0, this._vertexIndex = 0;
11082
+ this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._quads.bind(), t.drawElements(t.TRIANGLES, this._rectangleCount * 6, this._quads.bufferGlType, 0), Y.DrawnImagesCount += this._rectangleCount, Y.DrawCallCount++, this._rectangleCount = 0, this._vertexIndex = 0;
11006
11083
  }
11007
11084
  }
11008
11085
  const fa = `#version 300 es
@@ -11100,11 +11177,11 @@ class pa {
11100
11177
  this.type = "ex.circle", this.priority = 0, this._maxCircles = 10922, this._circleCount = 0, this._vertexIndex = 0;
11101
11178
  }
11102
11179
  initialize(t, e) {
11103
- this._gl = t, this._context = e, this._shader = new kt({
11180
+ this._gl = t, this._context = e, this._shader = new Lt({
11104
11181
  graphicsContext: e,
11105
11182
  fragmentSource: fa,
11106
11183
  vertexSource: ga
11107
- }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", e.ortho), this._buffer = new Nt({
11184
+ }), this._shader.compile(), this._shader.use(), this._shader.setUniformMatrix("u_matrix", e.ortho), this._buffer = new Wt({
11108
11185
  gl: t,
11109
11186
  size: 56 * this._maxCircles,
11110
11187
  type: "dynamic"
@@ -11142,7 +11219,7 @@ class pa {
11142
11219
  if (this._circleCount === 0)
11143
11220
  return;
11144
11221
  const t = this._gl;
11145
- this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._quads.bind(), t.drawElements(t.TRIANGLES, this._circleCount * 6, this._quads.bufferGlType, 0), $.DrawnImagesCount += this._circleCount, $.DrawCallCount++, this._circleCount = 0, this._vertexIndex = 0;
11222
+ this._shader.use(), this._layout.use(!0), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._quads.bind(), t.drawElements(t.TRIANGLES, this._circleCount * 6, this._quads.bufferGlType, 0), Y.DrawnImagesCount += this._circleCount, Y.DrawCallCount++, this._circleCount = 0, this._vertexIndex = 0;
11146
11223
  }
11147
11224
  }
11148
11225
  class ma {
@@ -11160,7 +11237,7 @@ class Ns {
11160
11237
  this.type = "ex.material", this.priority = 0, this._textures = [];
11161
11238
  }
11162
11239
  initialize(t, e) {
11163
- this._gl = t, this._context = e, this._buffer = new Nt({
11240
+ this._gl = t, this._context = e, this._buffer = new Wt({
11164
11241
  gl: t,
11165
11242
  size: 24,
11166
11243
  // 6 components * 4 verts
@@ -11187,13 +11264,13 @@ class Ns {
11187
11264
  const m = this._context.getTransform(), f = this._context.opacity, b = v.getShader(), C = this._layout.vertexBuffer.bufferData;
11188
11265
  let S = 0, E = (t == null ? void 0 : t.width) || s || 0, y = (t == null ? void 0 : t.height) || n || 0, k = [0, 0, (c = s != null ? s : t == null ? void 0 : t.width) != null ? c : 0, (d = n != null ? n : t == null ? void 0 : t.height) != null ? d : 0], L = [e != null ? e : 1, i != null ? i : 1];
11189
11266
  o !== void 0 && a !== void 0 && h !== void 0 && l !== void 0 && (k = [e != null ? e : 1, i != null ? i : 1, (u = s != null ? s : t == null ? void 0 : t.width) != null ? u : 0, (_ = n != null ? n : t == null ? void 0 : t.height) != null ? _ : 0], L = [o, a], E = h, y = l), e = k[0], i = k[1];
11190
- const O = k[2], Q = k[3], st = w(L[0], L[1]), X = w(L[0] + E, L[1]), U = w(L[0], L[1] + y), ot = w(L[0] + E, L[1] + y), ct = t.width || E, A = t.height || y, oe = e / ct, ae = i / A, he = (e + O - 0.01) / ct, Le = (i + Q - 0.01) / A, Li = m.getPosition(), Ms = Li.add(ot), Fs = Li.x / this._context.width, Ds = Li.y / this._context.height, Bs = Ms.x / this._context.width, ks = Ms.y / this._context.height;
11191
- C[S++] = st.x, C[S++] = st.y, C[S++] = oe, C[S++] = ae, C[S++] = Fs, C[S++] = Ds, C[S++] = U.x, C[S++] = U.y, C[S++] = oe, C[S++] = Le, C[S++] = Fs, C[S++] = ks, C[S++] = X.x, C[S++] = X.y, C[S++] = he, C[S++] = ae, C[S++] = Bs, C[S++] = Ds, C[S++] = ot.x, C[S++] = ot.y, C[S++] = he, C[S++] = Le, C[S++] = Bs, C[S++] = ks;
11267
+ const O = k[2], Q = k[3], st = w(L[0], L[1]), X = w(L[0] + E, L[1]), z = w(L[0], L[1] + y), ot = w(L[0] + E, L[1] + y), ct = t.width || E, A = t.height || y, oe = e / ct, ae = i / A, he = (e + O - 0.01) / ct, Le = (i + Q - 0.01) / A, Li = m.getPosition(), Ms = Li.add(ot), Fs = Li.x / this._context.width, Ds = Li.y / this._context.height, Bs = Ms.x / this._context.width, ks = Ms.y / this._context.height;
11268
+ C[S++] = st.x, C[S++] = st.y, C[S++] = oe, C[S++] = ae, C[S++] = Fs, C[S++] = Ds, C[S++] = z.x, C[S++] = z.y, C[S++] = oe, C[S++] = Le, C[S++] = Fs, C[S++] = ks, C[S++] = X.x, C[S++] = X.y, C[S++] = he, C[S++] = ae, C[S++] = Bs, C[S++] = Ds, C[S++] = ot.x, C[S++] = ot.y, C[S++] = he, C[S++] = Le, C[S++] = Bs, C[S++] = ks;
11192
11269
  let Ls = this._addImageAsTexture(t);
11193
- v.use(), this._layout.shader = b, this._layout.use(!0), b.trySetUniformFloat("u_time_ms", performance.now()), b.trySetUniformFloat("u_opacity", f), b.trySetUniformFloatVector("u_resolution", w(this._context.width, this._context.height)), b.trySetUniformFloatVector("u_graphic_resolution", w(ct, A)), b.trySetUniformFloatVector("u_size", w(O, Q)), b.trySetUniformMatrix("u_matrix", this._context.ortho), b.trySetUniformMatrix("u_transform", m.to4x4()), v.isOverridingGraphic && (p = v.images.u_graphic) != null && p.image && (Ls = this._addImageAsTexture(v.images.u_graphic.image)), g.activeTexture(g.TEXTURE0 + 0), g.bindTexture(g.TEXTURE_2D, Ls), b.trySetUniformInt("u_graphic", 0), v.isUsingScreenTexture && (g.activeTexture(g.TEXTURE0 + 1), g.bindTexture(g.TEXTURE_2D, this._context.materialScreenTexture), b.trySetUniformInt("u_screen_texture", 1)), this._quads.bind(), g.drawElements(g.TRIANGLES, 6, this._quads.bufferGlType, 0), $.DrawnImagesCount++, $.DrawCallCount++;
11270
+ v.use(), this._layout.shader = b, this._layout.use(!0), b.trySetUniformFloat("u_time_ms", performance.now()), b.trySetUniformFloat("u_opacity", f), b.trySetUniformFloatVector("u_resolution", w(this._context.width, this._context.height)), b.trySetUniformFloatVector("u_graphic_resolution", w(ct, A)), b.trySetUniformFloatVector("u_size", w(O, Q)), b.trySetUniformMatrix("u_matrix", this._context.ortho), b.trySetUniformMatrix("u_transform", m.to4x4()), v.isOverridingGraphic && (p = v.images.u_graphic) != null && p.image && (Ls = this._addImageAsTexture(v.images.u_graphic.image)), g.activeTexture(g.TEXTURE0 + 0), g.bindTexture(g.TEXTURE_2D, Ls), b.trySetUniformInt("u_graphic", 0), v.isUsingScreenTexture && (g.activeTexture(g.TEXTURE0 + 1), g.bindTexture(g.TEXTURE_2D, this._context.materialScreenTexture), b.trySetUniformInt("u_screen_texture", 1)), this._quads.bind(), g.drawElements(g.TRIANGLES, 6, this._quads.bufferGlType, 0), Y.DrawnImagesCount++, Y.DrawCallCount++;
11194
11271
  }
11195
11272
  _addImageAsTexture(t) {
11196
- const e = t.getAttribute(z.Filtering), i = e ? ti(e) : void 0, s = Ot(t.getAttribute(z.WrappingX)), n = Ot(t.getAttribute(z.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
11273
+ const e = t.getAttribute(U.Filtering), i = e ? ti(e) : void 0, s = Nt(t.getAttribute(U.WrappingX)), n = Nt(t.getAttribute(U.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
11197
11274
  t,
11198
11275
  {
11199
11276
  filtering: i,
@@ -11341,7 +11418,7 @@ class wa {
11341
11418
  const i = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS), s = vs(t, i);
11342
11419
  this._maxTextures = Math.min(i, s);
11343
11420
  const n = this._transformFragmentSource(xa, this._maxTextures);
11344
- this._shader = new kt({
11421
+ this._shader = new Lt({
11345
11422
  graphicsContext: e,
11346
11423
  fragmentSource: n,
11347
11424
  vertexSource: va
@@ -11376,7 +11453,7 @@ class wa {
11376
11453
  1
11377
11454
  ]), this._meshBuffer = t.createBuffer(), t.bindBuffer(t.ARRAY_BUFFER, this._meshBuffer), t.bufferData(t.ARRAY_BUFFER, this._quadMesh, t.STATIC_DRAW), t.vertexAttribPointer(0, 2, t.FLOAT, !1, 16, 0), t.enableVertexAttribArray(0), t.vertexAttribPointer(1, 2, t.FLOAT, !1, 16, 8), t.enableVertexAttribArray(1), t.bindBuffer(t.ARRAY_BUFFER, null);
11378
11455
  const o = this._components;
11379
- this._transformData = new Nt({
11456
+ this._transformData = new Wt({
11380
11457
  gl: t,
11381
11458
  size: o * this._maxImages,
11382
11459
  // components * images
@@ -11406,7 +11483,7 @@ class wa {
11406
11483
  _addImageAsTexture(t) {
11407
11484
  if (this._images.has(t))
11408
11485
  return;
11409
- const e = t.getAttribute(z.Filtering), i = e ? ti(e) : void 0, s = Ot(t.getAttribute(z.WrappingX)), n = Ot(t.getAttribute(z.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
11486
+ const e = t.getAttribute(U.Filtering), i = e ? ti(e) : void 0, s = Nt(t.getAttribute(U.WrappingX)), n = Nt(t.getAttribute(U.WrappingY)), o = t.getAttribute("forceUpload") === "true", a = this._context.textureLoader.load(
11410
11487
  t,
11411
11488
  {
11412
11489
  filtering: i,
@@ -11448,8 +11525,8 @@ class wa {
11448
11525
  this._view[0] = 0, this._view[1] = 0, this._view[2] = (c = s != null ? s : p) != null ? c : 0, this._view[3] = (d = n != null ? n : g) != null ? d : 0, this._dest[0] = e != null ? e : 1, this._dest[1] = i != null ? i : 1, o !== void 0 && a !== void 0 && h !== void 0 && l !== void 0 && (this._view[0] = e != null ? e : 1, this._view[1] = i != null ? i : 1, this._view[2] = (u = s != null ? s : p) != null ? u : 0, this._view[3] = (_ = n != null ? n : g) != null ? _ : 0, this._dest[0] = o, this._dest[1] = a, v = h, m = l), e = this._view[0], i = this._view[1];
11449
11526
  const f = this._view[2], b = this._view[3], C = this._context.getTransform(), S = this._context.opacity;
11450
11527
  this._context.snapToPixel && (this._dest[0] = ~~(this._dest[0] + M), this._dest[1] = ~~(this._dest[1] + M));
11451
- const y = this._context.tint || this._defaultTint, k = this._getTextureIdForImage(t), L = p || v, O = g || m, Q = (e + this.uvPadding) / L, st = (i + this.uvPadding) / O, X = (e + f - this.uvPadding) / L, U = (i + b - this.uvPadding) / O, ot = p, ct = g, A = this._transformData.bufferData;
11452
- A[this._vertexIndex++] = this._dest[0], A[this._vertexIndex++] = this._dest[1], A[this._vertexIndex++] = C.data[0], A[this._vertexIndex++] = C.data[1], A[this._vertexIndex++] = C.data[2], A[this._vertexIndex++] = C.data[3], A[this._vertexIndex++] = C.data[4], A[this._vertexIndex++] = C.data[5], A[this._vertexIndex++] = S, A[this._vertexIndex++] = v, A[this._vertexIndex++] = m, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = k, A[this._vertexIndex++] = Q, A[this._vertexIndex++] = st, A[this._vertexIndex++] = X, A[this._vertexIndex++] = U, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a;
11528
+ const y = this._context.tint || this._defaultTint, k = this._getTextureIdForImage(t), L = p || v, O = g || m, Q = (e + this.uvPadding) / L, st = (i + this.uvPadding) / O, X = (e + f - this.uvPadding) / L, z = (i + b - this.uvPadding) / O, ot = p, ct = g, A = this._transformData.bufferData;
11529
+ A[this._vertexIndex++] = this._dest[0], A[this._vertexIndex++] = this._dest[1], A[this._vertexIndex++] = C.data[0], A[this._vertexIndex++] = C.data[1], A[this._vertexIndex++] = C.data[2], A[this._vertexIndex++] = C.data[3], A[this._vertexIndex++] = C.data[4], A[this._vertexIndex++] = C.data[5], A[this._vertexIndex++] = S, A[this._vertexIndex++] = v, A[this._vertexIndex++] = m, A[this._vertexIndex++] = ot, A[this._vertexIndex++] = ct, A[this._vertexIndex++] = k, A[this._vertexIndex++] = Q, A[this._vertexIndex++] = st, A[this._vertexIndex++] = X, A[this._vertexIndex++] = z, A[this._vertexIndex++] = y.r / 255, A[this._vertexIndex++] = y.g / 255, A[this._vertexIndex++] = y.b / 255, A[this._vertexIndex++] = y.a;
11453
11530
  }
11454
11531
  hasPendingDraws() {
11455
11532
  return this._imageCount !== 0;
@@ -11458,7 +11535,7 @@ class wa {
11458
11535
  if (this._imageCount === 0)
11459
11536
  return;
11460
11537
  const t = this._gl;
11461
- this._shader.use(), this._bindData(t), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._shader.setUniformBoolean("u_pixelart", this.pixelArtSampler), this._bindTextures(t), t.drawArraysInstanced(t.TRIANGLES, 0, 6, this._imageCount), $.DrawnImagesCount += this._imageCount, $.DrawCallCount++, t.bindVertexArray(null), this._imageCount = 0, this._vertexIndex = 0, this._textures.length = 0, this._textureIndex = 0, this._textureToIndex.clear(), this._images.clear(), this._imageToWidth.clear(), this._imageToHeight.clear();
11538
+ this._shader.use(), this._bindData(t), this._shader.setUniformMatrix("u_matrix", this._context.ortho), this._shader.setUniformBoolean("u_pixelart", this.pixelArtSampler), this._bindTextures(t), t.drawArraysInstanced(t.TRIANGLES, 0, 6, this._imageCount), Y.DrawnImagesCount += this._imageCount, Y.DrawCallCount++, t.bindVertexArray(null), this._imageCount = 0, this._vertexIndex = 0, this._textures.length = 0, this._textureIndex = 0, this._textureToIndex.clear(), this._images.clear(), this._imageToWidth.clear(), this._imageToHeight.clear();
11462
11539
  }
11463
11540
  }
11464
11541
  const M = 1e-4;
@@ -11780,7 +11857,7 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
11780
11857
  return new Qo({ ...t, graphicsContext: this });
11781
11858
  }
11782
11859
  createShader(t) {
11783
- const { name: e, vertexSource: i, fragmentSource: s, uniforms: n, images: o, startingTextureSlot: a } = t, h = new kt({
11860
+ const { name: e, vertexSource: i, fragmentSource: s, uniforms: n, images: o, startingTextureSlot: a } = t, h = new Lt({
11784
11861
  name: e,
11785
11862
  graphicsContext: this,
11786
11863
  vertexSource: i,
@@ -11825,7 +11902,7 @@ If you want to do custom drawing, use Actor.graphics, or any onPreDraw or onPost
11825
11902
  if (this._drawCalls.length && this._drawCallIndex) {
11826
11903
  let o = this._drawCalls[0].renderer, a = this.get(o);
11827
11904
  for (let h = 0; h < this._drawCallIndex; h++)
11828
- this._transform.current = this._drawCalls[h].transform, this._state.current = this._drawCalls[h].state, this._drawCalls[h].renderer !== o && (a.flush(), o = this._drawCalls[h].renderer, a = this.get(o), $.RendererSwaps++), a instanceof Ns && ((t = this.material) != null && t.isUsingScreenTexture) && (e.copyToTexture(this.materialScreenTexture), e.use()), a.draw(...this._drawCalls[h].args);
11905
+ this._transform.current = this._drawCalls[h].transform, this._state.current = this._drawCalls[h].state, this._drawCalls[h].renderer !== o && (a.flush(), o = this._drawCalls[h].renderer, a = this.get(o), Y.RendererSwaps++), a instanceof Ns && ((t = this.material) != null && t.isUsingScreenTexture) && (e.copyToTexture(this.materialScreenTexture), e.use()), a.draw(...this._drawCalls[h].args);
11829
11906
  a.hasPendingDraws() && a.flush();
11830
11907
  }
11831
11908
  this._transform.current = s, this._state.current = n, this._drawCallPool.done(), this._drawCallIndex = 0, this._imageToHeight.clear(), this._imageToWidth.clear();
@@ -12086,7 +12163,7 @@ class Di extends nt {
12086
12163
  function Ir(r) {
12087
12164
  return !!r.tick;
12088
12165
  }
12089
- class tt extends Bt {
12166
+ class tt extends kt {
12090
12167
  constructor(t) {
12091
12168
  super(), this._logger = I.getInstance(), this._current = "default", this._graphics = {}, this._options = {}, this.material = null, this.isVisible = !0, this.forceOnScreen = !1, this.opacity = 1, this._offset = new ie(x.Zero, () => this.recalculateBounds()), this._anchor = new ie(x.Half, () => this.recalculateBounds()), this.flipHorizontal = !1, this.flipVertical = !1, this.copyGraphics = !1, t = {
12092
12169
  visible: this.isVisible,
@@ -12242,7 +12319,7 @@ class tt extends Bt {
12242
12319
  let s = this.anchor, n = this.offset;
12243
12320
  i != null && i.anchor && (s = i.anchor), i != null && i.offset && (n = i.offset);
12244
12321
  const o = e.localBounds, a = -o.width * s.x + n.x, h = -o.height * s.y + n.y;
12245
- e instanceof $e && !e.useAnchor ? t = e == null ? void 0 : e.localBounds.combine(t) : t = e == null ? void 0 : e.localBounds.translate(w(a, h)).combine(t), this._localBounds = t;
12322
+ e instanceof Ye && !e.useAnchor ? t = e == null ? void 0 : e.localBounds.combine(t) : t = e == null ? void 0 : e.localBounds.translate(w(a, h)).combine(t), this._localBounds = t;
12246
12323
  }
12247
12324
  /**
12248
12325
  * Get local bounds of graphics component
@@ -12275,7 +12352,7 @@ class tt extends Bt {
12275
12352
  return t._graphics = { ...this._graphics }, t._options = { ...this._options }, t.offset = this.offset.clone(), this.color && (t.color = this.color.clone()), t.opacity = this.opacity, t.anchor = this.anchor.clone(), t.copyGraphics = this.copyGraphics, t.onPreDraw = this.onPreDraw, t.onPostDraw = this.onPostDraw, t.isVisible = this.isVisible, t;
12276
12353
  }
12277
12354
  }
12278
- class fe extends Bt {
12355
+ class fe extends kt {
12279
12356
  constructor(t) {
12280
12357
  var e, i;
12281
12358
  super(), this.useColliderShape = !0, this.useGraphicsBounds = !0, this.useColliderShape = (e = t == null ? void 0 : t.useColliderShape) != null ? e : this.useColliderShape, this.useGraphicsBounds = (i = t == null ? void 0 : t.useGraphicsBounds) != null ? i : this.useGraphicsBounds, this.localBounds = t == null ? void 0 : t.localBounds;
@@ -12527,7 +12604,7 @@ class Vs {
12527
12604
  this._started = !1, this._stopped = !1;
12528
12605
  }
12529
12606
  }
12530
- function Ul(r) {
12607
+ function zl(r) {
12531
12608
  return typeof r.angle == "number" && typeof r.duration == "number";
12532
12609
  }
12533
12610
  class Ra {
@@ -12704,10 +12781,10 @@ class La {
12704
12781
  this._started = !1, this._stopped = !1;
12705
12782
  }
12706
12783
  }
12707
- function za(r) {
12784
+ function Ua(r) {
12708
12785
  return typeof r.scaleOffset == "object" && typeof r.duration == "number";
12709
12786
  }
12710
- class Ua {
12787
+ class za {
12711
12788
  constructor(t, e) {
12712
12789
  if (this.entity = t, this.id = W(), this._started = !1, this._stopped = !1, this._endScale = w(1, 1), this._scaleOffset = w(0, 0), this._startScale = w(1, 1), this._scaleOffset = e.scaleOffset, this._tx = t.get(P), this._motion = t.get(H), !this._tx)
12713
12790
  throw new Error(`Entity ${t.name} has no TransformComponent, can only ScaleBy on Entities with TransformComponents.`);
@@ -12967,7 +13044,7 @@ class Xa {
12967
13044
  this._started = !1, this._stopped = !1;
12968
13045
  }
12969
13046
  }
12970
- class Ya {
13047
+ class $a {
12971
13048
  constructor(t, e) {
12972
13049
  this.id = W(), this._started = !1, this._stopped = !1, this._mode = "dynamic";
12973
13050
  var i;
@@ -12993,7 +13070,7 @@ class Ya {
12993
13070
  this._stopped = !0, this._currentMs = 0;
12994
13071
  }
12995
13072
  }
12996
- class $a {
13073
+ class Ya {
12997
13074
  constructor(t, e) {
12998
13075
  this.id = W(), this._started = !1, this._stopped = !1, this._mode = "dynamic";
12999
13076
  var i;
@@ -13044,7 +13121,7 @@ class Bi {
13044
13121
  * @param options
13045
13122
  */
13046
13123
  curveBy(t) {
13047
- return this._queue.add(new $a(this._entity, t)), this;
13124
+ return this._queue.add(new Ya(this._entity, t)), this;
13048
13125
  }
13049
13126
  /**
13050
13127
  * Animates an actor with a specified bezier curve to an absolute world space coordinate, the start point is assumed
@@ -13052,7 +13129,7 @@ class Bi {
13052
13129
  * @param options
13053
13130
  */
13054
13131
  curveTo(t) {
13055
- return this._queue.add(new Ya(this._entity, t)), this;
13132
+ return this._queue.add(new $a(this._entity, t)), this;
13056
13133
  }
13057
13134
  easeTo(...t) {
13058
13135
  var e, i;
@@ -13083,8 +13160,8 @@ class Bi {
13083
13160
  return Ba(t) ? (this._queue.add(new ka(this._entity, t)), this) : (t instanceof x && e instanceof x && (n = t.x, o = t.y, a = e.x, h = e.y), typeof t == "number" && typeof e == "number" && (n = t, o = e, a = i, h = s), this._queue.add(new La(this._entity, n, o, a, h)), this);
13084
13161
  }
13085
13162
  scaleBy(t, e, i) {
13086
- if (za(t))
13087
- return this._queue.add(new Ua(this._entity, t)), this;
13163
+ if (Ua(t))
13164
+ return this._queue.add(new za(this._entity, t)), this;
13088
13165
  let s = 1, n = 1;
13089
13166
  return t instanceof x && (s = t.x, n = t.y, i = e), typeof t == "number" && typeof e == "number" && (s = t, n = e), this._queue.add(new Ha(this._entity, s, n, i)), this;
13090
13167
  }
@@ -13213,7 +13290,7 @@ class Bi {
13213
13290
  });
13214
13291
  }
13215
13292
  }
13216
- class qe extends Bt {
13293
+ class qe extends kt {
13217
13294
  constructor() {
13218
13295
  super(...arguments), this.dependencies = [P, H], this._ctx = null;
13219
13296
  }
@@ -13984,7 +14061,7 @@ Rr.defaults = {
13984
14061
  anchor: x.Half
13985
14062
  };
13986
14063
  let Dt = Rr;
13987
- class it extends Bt {
14064
+ class it extends kt {
13988
14065
  constructor(t) {
13989
14066
  super(), this.events = new Z(), this.$colliderAdded = new xt(), this.$colliderRemoved = new xt(), this._collidersToRemove = [], this.set(t);
13990
14067
  }
@@ -14136,7 +14213,7 @@ class it extends Bt {
14136
14213
  }
14137
14214
  }
14138
14215
  var le = /* @__PURE__ */ ((r) => (r.Rotation = "rotation", r.X = "x", r.Y = "y", r))(le || {});
14139
- const bs = class di extends Bt {
14216
+ const bs = class di extends kt {
14140
14217
  constructor(t) {
14141
14218
  var e, i, s;
14142
14219
  super(), this.dependencies = [P, H], this.id = Pe("body", di._ID++), this.events = new Z(), this.oldTransform = new re(), this.__oldTransformCaptured = !1, this.enableFixedUpdateInterpolate = !0, this.collisionType = R.PreventCollision, this.group = Ee.All, this._sleeping = !1, this.bounciness = 0.2, this.friction = 0.99, this.useGravity = !0, this.limitDegreeOfFreedom = [], this._oldGlobalPos = x.Zero, this.oldVel = new x(0, 0), this.oldAcc = x.Zero, this._impulseScratch = w(0, 0), this._distanceFromCenterScratch = w(0, 0), t ? (this.collisionType = (e = t.type) != null ? e : this.collisionType, this.group = (i = t.group) != null ? i : this.group, this.useGravity = (s = t.useGravity) != null ? s : this.useGravity, this._bodyConfig = {
@@ -14471,12 +14548,12 @@ class Mr {
14471
14548
  this.bounds = this.object.bounds, this.leftX = Math.floor(this.bounds.left / this.gridSize), this.rightX = Math.floor(this.bounds.right / this.gridSize), this.bottomY = Math.floor(this.bounds.bottom / this.gridSize), this.topY = Math.floor(this.bounds.top / this.gridSize), this.hasZeroBounds = this.object.bounds.hasZeroDimensions();
14472
14549
  }
14473
14550
  }
14474
- class Xt {
14551
+ class $t {
14475
14552
  constructor() {
14476
14553
  this.proxies = [];
14477
14554
  }
14478
14555
  configure(t, e) {
14479
- this.x = t, this.y = e, this.key = Xt.calculateHashKey(t, e);
14556
+ this.x = t, this.y = e, this.key = $t.calculateHashKey(t, e);
14480
14557
  }
14481
14558
  static calculateHashKey(t, e) {
14482
14559
  return `${t}+${e}`;
@@ -14485,7 +14562,7 @@ class Xt {
14485
14562
  class Fr {
14486
14563
  constructor(t) {
14487
14564
  this.bounds = new F(), this._hashGridCellPool = new ei(
14488
- () => new Xt(),
14565
+ () => new $t(),
14489
14566
  (e) => (e.configure(0, 0), e.proxies.length = 0, e),
14490
14567
  1e3
14491
14568
  ), this.gridSize = t.size, this.sparseHashGrid = /* @__PURE__ */ new Map(), this.objectToProxy = /* @__PURE__ */ new Map(), t.proxyFactory ? this._buildProxy = (e) => t.proxyFactory(e, this.gridSize) : this._buildProxy = (e) => new Mr(e, this.gridSize);
@@ -14496,13 +14573,13 @@ class Fr {
14496
14573
  const i = t, s = Math.floor(i.left / this.gridSize), n = Math.floor(i.right / this.gridSize), o = Math.floor(i.bottom / this.gridSize), a = Math.floor(i.top / this.gridSize);
14497
14574
  for (let h = s; h <= n; h++)
14498
14575
  for (let l = a; l <= o; l++) {
14499
- const c = Xt.calculateHashKey(h, l), d = this.sparseHashGrid.get(c);
14576
+ const c = $t.calculateHashKey(h, l), d = this.sparseHashGrid.get(c);
14500
14577
  if (d)
14501
14578
  for (let u = 0; u < d.proxies.length; u++)
14502
14579
  d.proxies[u].updateBounds(), d.proxies[u].bounds.intersect(i) && e.add(d.proxies[u].object);
14503
14580
  }
14504
14581
  } else {
14505
- const i = t, s = Xt.calculateHashKey(Math.floor(i.x / this.gridSize), Math.floor(i.y / this.gridSize)), n = this.sparseHashGrid.get(s);
14582
+ const i = t, s = $t.calculateHashKey(Math.floor(i.x / this.gridSize), Math.floor(i.y / this.gridSize)), n = this.sparseHashGrid.get(s);
14506
14583
  if (n)
14507
14584
  for (let o = 0; o < n.proxies.length; o++)
14508
14585
  n.proxies[o].updateBounds(), n.proxies[o].bounds.contains(i) && e.add(n.proxies[o].object);
@@ -14510,16 +14587,16 @@ class Fr {
14510
14587
  return Array.from(e);
14511
14588
  }
14512
14589
  get(t, e) {
14513
- const i = Xt.calculateHashKey(t, e);
14590
+ const i = $t.calculateHashKey(t, e);
14514
14591
  return this.sparseHashGrid.get(i);
14515
14592
  }
14516
14593
  _insert(t, e, i) {
14517
- const s = Xt.calculateHashKey(t, e);
14594
+ const s = $t.calculateHashKey(t, e);
14518
14595
  let n = this.sparseHashGrid.get(s);
14519
14596
  n || (n = this._hashGridCellPool.rent(), n.configure(t, e), this.sparseHashGrid.set(n.key, n)), n.proxies.push(i), i.cells.push(n), this.bounds.combine(i.bounds, this.bounds);
14520
14597
  }
14521
14598
  _remove(t, e, i) {
14522
- const s = Xt.calculateHashKey(t, e), n = this.sparseHashGrid.get(s);
14599
+ const s = $t.calculateHashKey(t, e), n = this.sparseHashGrid.get(s);
14523
14600
  if (n) {
14524
14601
  const o = n.proxies.indexOf(i);
14525
14602
  o > -1 && n.proxies.splice(o, 1);
@@ -14601,32 +14678,32 @@ class Xs {
14601
14678
  const y = /* @__PURE__ */ new Set();
14602
14679
  let k = !1, L = 9999;
14603
14680
  for (; !k && L > 0 && (L--, !!this.hashGrid.bounds.contains(w(b * this.gridSize, C * this.gridSize))); ) {
14604
- const O = Xt.calculateHashKey(b, C), Q = this.hashGrid.sparseHashGrid.get(O);
14681
+ const O = $t.calculateHashKey(b, C), Q = this.hashGrid.sparseHashGrid.get(O);
14605
14682
  if (Q) {
14606
14683
  const st = [];
14607
14684
  for (let X = 0; X < Q.proxies.length; X++) {
14608
- const U = Q.proxies[X];
14609
- if (!y.has(U.collider.id.value)) {
14610
- if (y.add(U.collider.id.value), U.body) {
14611
- if (e != null && e.ignoreCollisionGroupAll && U.body.group === Ee.All)
14685
+ const z = Q.proxies[X];
14686
+ if (!y.has(z.collider.id.value)) {
14687
+ if (y.add(z.collider.id.value), z.body) {
14688
+ if (e != null && e.ignoreCollisionGroupAll && z.body.group === Ee.All)
14612
14689
  continue;
14613
- const ct = (l & U.body.group.category) !== 0;
14614
- if (U.body.group && !ct)
14690
+ const ct = (l & z.body.group.category) !== 0;
14691
+ if (z.body.group && !ct)
14615
14692
  continue;
14616
14693
  }
14617
- const ot = U.collider.rayCast(t, a);
14694
+ const ot = z.collider.rayCast(t, a);
14618
14695
  ot && st.push(ot);
14619
14696
  }
14620
14697
  }
14621
- st.sort((X, U) => X.distance - U.distance);
14698
+ st.sort((X, z) => X.distance - z.distance);
14622
14699
  for (let X = 0; X < st.length; X++) {
14623
- const U = st[X];
14700
+ const z = st[X];
14624
14701
  if (e != null && e.filter) {
14625
- if (e.filter(U) && (o.push(U), !c)) {
14702
+ if (e.filter(z) && (o.push(z), !c)) {
14626
14703
  k = !0;
14627
14704
  break;
14628
14705
  }
14629
- } else if (o.push(U), !c) {
14706
+ } else if (o.push(z), !c) {
14630
14707
  k = !0;
14631
14708
  break;
14632
14709
  }
@@ -14833,7 +14910,7 @@ class He {
14833
14910
  this.bounds.debug(t, { color: T.Yellow }), this._isDivided && (this.topLeft.bounds.debug(t, { color: T.Yellow }), this.topRight.bounds.debug(t, { color: T.Yellow }), this.bottomLeft.bounds.debug(t, { color: T.Yellow }), this.bottomRight.bounds.debug(t, { color: T.Yellow }));
14834
14911
  }
14835
14912
  }
14836
- class Ys {
14913
+ class $s {
14837
14914
  constructor(t) {
14838
14915
  this.config = t, this.directionMap = /* @__PURE__ */ new Map(), this.distanceMap = /* @__PURE__ */ new Map(), this._compositeContactsIds = /* @__PURE__ */ new Set();
14839
14916
  }
@@ -14968,7 +15045,7 @@ class ja {
14968
15045
  return x.Zero;
14969
15046
  }
14970
15047
  }
14971
- class $s {
15048
+ class Ys {
14972
15049
  constructor(t) {
14973
15050
  this.config = t, this.directionMap = /* @__PURE__ */ new Map(), this.distanceMap = /* @__PURE__ */ new Map(), this.lastFrameContacts = /* @__PURE__ */ new Map(), this.idToContactConstraint = /* @__PURE__ */ new Map();
14974
15051
  }
@@ -15030,8 +15107,8 @@ class $s {
15030
15107
  for (let m = 0; m < l.points.length; m++) {
15031
15108
  const f = l.points[m], b = l.normal, C = l.tangent, S = f.sub(p.center), E = f.sub(v.center), y = S.cross(b), k = E.cross(b), L = _.inverseMass + g.inverseMass + _.inverseInertia * y * y + g.inverseInertia * k * k, O = S.cross(C), Q = E.cross(C), st = _.inverseMass + g.inverseMass + _.inverseInertia * O * O + g.inverseInertia * Q * Q;
15032
15109
  d[u] && ((n = (s = d[u]) == null ? void 0 : s.point) == null ? void 0 : n.squareDistance(f)) < 4 ? (d[u].point = f, d[u].local = l.localPoints[u]) : d[u] = new ja(f, l.localPoints[u], l), d[u].aToContact = S, d[u].bToContact = E, d[u].normalMass = 1 / L, d[u].tangentMass = 1 / st;
15033
- const X = _.bounciness > g.bounciness ? _.bounciness : g.bounciness, U = l.normal.dot(d[u].getRelativeVelocity());
15034
- d[u].originalVelocityAndRestitution = 0, U < -0.1 && (d[u].originalVelocityAndRestitution = -X * U), u++;
15110
+ const X = _.bounciness > g.bounciness ? _.bounciness : g.bounciness, z = l.normal.dot(d[u].getRelativeVelocity());
15111
+ d[u].originalVelocityAndRestitution = 0, z < -0.1 && (d[u].originalVelocityAndRestitution = -X * z), u++;
15035
15112
  }
15036
15113
  this.idToContactConstraint.set(l.id, d);
15037
15114
  }
@@ -15108,7 +15185,7 @@ class $s {
15108
15185
  continue;
15109
15186
  const h = (e = this.idToContactConstraint.get(n.id)) != null ? e : [];
15110
15187
  for (const l of h) {
15111
- const c = n.normal, d = Ut.FindContactSeparation(n, l.local), u = this.config.steeringFactor, _ = -5, p = this.config.slop, g = D(u * (d + p), _, 0), v = c.scale(-g * l.normalMass);
15188
+ const c = n.normal, d = Ht.FindContactSeparation(n, l.local), u = this.config.steeringFactor, _ = -5, p = this.config.slop, g = D(u * (d + p), _, 0), v = c.scale(-g * l.normalMass);
15112
15189
  if (o.collisionType === R.Active) {
15113
15190
  const m = v.negate().scale(o.inverseMass);
15114
15191
  o.limitDegreeOfFreedom.includes(le.X) && (m.x = 0), o.limitDegreeOfFreedom.includes(le.Y) && (m.y = 0), o.globalPos = o.globalPos.add(m), o.limitDegreeOfFreedom.includes(le.Rotation) || (o.rotation -= l.aToContact.cross(v) * o.inverseInertia);
@@ -15193,7 +15270,7 @@ class ys extends Ft {
15193
15270
  ys.priority = Jt.Higher;
15194
15271
  class Cs extends Ft {
15195
15272
  constructor(t, e) {
15196
- super(), this._physics = e, this.systemType = Mt.Update, this._configDirty = !1, this._lastFrameContacts = /* @__PURE__ */ new Map(), this._currentFrameContacts = /* @__PURE__ */ new Map(), this._arcadeSolver = new Ys(e.config.arcade), this._realisticSolver = new $s(e.config.realistic), this._physics.$configUpdate.subscribe(() => this._configDirty = !0), this._trackCollider = (i) => this._processor.track(i), this._untrackCollider = (i) => this._processor.untrack(i), this.query = t.query([P, it]), this.query.entityAdded$.subscribe((i) => {
15273
+ super(), this._physics = e, this.systemType = Mt.Update, this._configDirty = !1, this._lastFrameContacts = /* @__PURE__ */ new Map(), this._currentFrameContacts = /* @__PURE__ */ new Map(), this._arcadeSolver = new $s(e.config.arcade), this._realisticSolver = new Ys(e.config.realistic), this._physics.$configUpdate.subscribe(() => this._configDirty = !0), this._trackCollider = (i) => this._processor.track(i), this._untrackCollider = (i) => this._processor.untrack(i), this.query = t.query([P, it]), this.query.entityAdded$.subscribe((i) => {
15197
15274
  const s = i.get(it);
15198
15275
  s.$colliderAdded.subscribe(this._trackCollider), s.$colliderRemoved.subscribe(this._untrackCollider);
15199
15276
  const n = s.get();
@@ -15252,7 +15329,7 @@ class Cs extends Ft {
15252
15329
  We.SeparationPool.done();
15253
15330
  }
15254
15331
  getSolver() {
15255
- return this._configDirty && (this._configDirty = !1, this._arcadeSolver = new Ys(this._physics.config.arcade), this._realisticSolver = new $s(this._physics.config.realistic)), this._physics.config.solver === ds.Realistic ? this._realisticSolver : this._arcadeSolver;
15332
+ return this._configDirty && (this._configDirty = !1, this._arcadeSolver = new $s(this._physics.config.arcade), this._realisticSolver = new Ys(this._physics.config.realistic)), this._physics.config.solver === ds.Realistic ? this._realisticSolver : this._arcadeSolver;
15256
15333
  }
15257
15334
  debug(t) {
15258
15335
  this._processor.debug(t, 0);
@@ -15261,12 +15338,12 @@ class Cs extends Ft {
15261
15338
  for (const [t, e] of this._currentFrameContacts)
15262
15339
  if (!this._lastFrameContacts.has(t)) {
15263
15340
  const i = e.colliderA, s = e.colliderB, n = G.fromDirection(e.mtv), o = G.getOpposite(n);
15264
- i.events.emit("collisionstart", new gi(i, s, n, e)), i.events.emit("contactstart", new Yi(i, s, n, e)), s.events.emit("collisionstart", new gi(s, i, o, e)), s.events.emit("contactstart", new Yi(s, i, o, e));
15341
+ i.events.emit("collisionstart", new gi(i, s, n, e)), i.events.emit("contactstart", new $i(i, s, n, e)), s.events.emit("collisionstart", new gi(s, i, o, e)), s.events.emit("contactstart", new $i(s, i, o, e));
15265
15342
  }
15266
15343
  for (const [t, e] of this._lastFrameContacts)
15267
15344
  if (!this._currentFrameContacts.has(t)) {
15268
15345
  const i = e.colliderA, s = e.colliderB, n = G.fromDirection(e.mtv), o = G.getOpposite(n);
15269
- i.events.emit("collisionend", new pi(i, s, n, e)), i.events.emit("contactend", new $i(i, s, n, e)), s.events.emit("collisionend", new pi(s, i, o, e)), s.events.emit("contactend", new $i(s, i, o, e));
15346
+ i.events.emit("collisionend", new pi(i, s, n, e)), i.events.emit("contactend", new Yi(i, s, n, e)), s.events.emit("collisionend", new pi(s, i, o, e)), s.events.emit("contactend", new Yi(s, i, o, e));
15270
15347
  }
15271
15348
  }
15272
15349
  }
@@ -15575,7 +15652,7 @@ class js {
15575
15652
  */
15576
15653
  pageToScreenCoordinates(t) {
15577
15654
  let e = t.x, i = t.y;
15578
- this._isFullscreen || (e -= ze(this._canvas).x, i -= ze(this._canvas).y);
15655
+ this._isFullscreen || (e -= Ue(this._canvas).x, i -= Ue(this._canvas).y);
15579
15656
  const s = this._viewportToPixels(this.viewport);
15580
15657
  if (this._isFullscreen)
15581
15658
  if (window.innerWidth / this.aspectRatio < window.innerHeight) {
@@ -15606,7 +15683,7 @@ class js {
15606
15683
  const n = window.innerHeight * this.aspectRatio, o = (window.innerWidth - n) / 2;
15607
15684
  e = e / s.width * n + o, i = i / s.height * window.innerHeight;
15608
15685
  }
15609
- return this._isFullscreen || (e += ze(this._canvas).x, i += ze(this._canvas).y), new x(e, i);
15686
+ return this._isFullscreen || (e += Ue(this._canvas).x, i += Ue(this._canvas).y), new x(e, i);
15610
15687
  }
15611
15688
  /**
15612
15689
  * Takes a coordinate in Excalibur screen space, and translates it to Excalibur world space.
@@ -16543,7 +16620,7 @@ class bi {
16543
16620
  this.events.off(t, e);
16544
16621
  }
16545
16622
  }
16546
- const nh = "data:image/png;base64,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", rh = 'button#excalibur-play{display:none}button#excalibur-play{box-sizing:border-box;display:flex;gap:.25rem;justify-content:center;position:relative;z-index:999;border-radius:6px;border:none;padding:1rem;margin:0;text-decoration:none;background:#00b233;color:#fff;font-family:sans-serif;font-size:2rem;white-space:nowrap;line-height:1;cursor:pointer;text-align:center;transition:background .25s ease-in-out,transform .15s ease;-webkit-appearance:none;-moz-appearance:none;-webkit-animation:excalibur-button-fadein .2s;-moz-animation:excalibur-button-fadein .2s;-ms-animation:excalibur-button-fadein .2s;-o-animation:excalibur-button-fadein .2s;animation:excalibur-button-fadein .2s}span#excalibur-play-icon{content:"";display:inline-block;position:relative;width:2rem;height:2rem}span#excalibur-play-icon:after{box-sizing:border-box;position:absolute;content:"";border:.5rem solid;border-color:transparent transparent transparent white;left:calc(50% - .1rem);top:calc(30% - .1rem);width:0;height:0}span#excalibur-play-icon:before{box-sizing:border-box;left:50%;top:50%;transform:translate(-50%,-50%);position:absolute;content:"";border:3px solid;border-radius:1rem;width:2rem;height:2rem}button#excalibur-play:focus{outline:1px solid #fff;outline-offset:-4px}button#excalibur-play:active{transform:scale(.99)}@keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-moz-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-ms-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-o-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}', zr = class Ur extends bi {
16623
+ const nh = "data:image/png;base64,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", rh = 'button#excalibur-play{display:none}button#excalibur-play{box-sizing:border-box;display:flex;gap:.25rem;justify-content:center;position:relative;z-index:999;border-radius:6px;border:none;padding:1rem;margin:0;text-decoration:none;background:#00b233;color:#fff;font-family:sans-serif;font-size:2rem;white-space:nowrap;line-height:1;cursor:pointer;text-align:center;transition:background .25s ease-in-out,transform .15s ease;-webkit-appearance:none;-moz-appearance:none;-webkit-animation:excalibur-button-fadein .2s;-moz-animation:excalibur-button-fadein .2s;-ms-animation:excalibur-button-fadein .2s;-o-animation:excalibur-button-fadein .2s;animation:excalibur-button-fadein .2s}span#excalibur-play-icon{content:"";display:inline-block;position:relative;width:2rem;height:2rem}span#excalibur-play-icon:after{box-sizing:border-box;position:absolute;content:"";border:.5rem solid;border-color:transparent transparent transparent white;left:calc(50% - .1rem);top:calc(30% - .1rem);width:0;height:0}span#excalibur-play-icon:before{box-sizing:border-box;left:50%;top:50%;transform:translate(-50%,-50%);position:absolute;content:"";border:3px solid;border-radius:1rem;width:2rem;height:2rem}button#excalibur-play:focus{outline:1px solid #fff;outline-offset:-4px}button#excalibur-play:active{transform:scale(.99)}@keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-moz-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-webkit-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-ms-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}@-o-keyframes excalibur-button-fadein{0%{opacity:0}to{opacity:1}}', Ur = class zr extends bi {
16547
16624
  constructor(t) {
16548
16625
  const e = Array.isArray(t) ? {
16549
16626
  loadables: t
@@ -16557,7 +16634,7 @@ const nh = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdQAAAB2CAYAAABxhGI9AA
16557
16634
  n.id = "excalibur-play-text", n.textContent = this.playButtonText, i.appendChild(n);
16558
16635
  }
16559
16636
  return i;
16560
- }, this._originalOptions = { ...Ur._DEFAULT_LOADER_OPTIONS, ...e };
16637
+ }, this._originalOptions = { ...zr._DEFAULT_LOADER_OPTIONS, ...e };
16561
16638
  }
16562
16639
  get _image() {
16563
16640
  return this._imageElement || (this._imageElement = new Image(), this._imageElement.onload = () => this._imageLoaded.resolve(), this._imageElement.src = this.logo), this._imageElement;
@@ -16673,12 +16750,12 @@ const nh = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAdQAAAB2CAYAAABxhGI9AA
16673
16750
  ), this.engine.screen.antialiasing = h;
16674
16751
  }
16675
16752
  };
16676
- zr._DEFAULT_LOADER_OPTIONS = {
16753
+ Ur._DEFAULT_LOADER_OPTIONS = {
16677
16754
  loadables: [],
16678
16755
  fullscreenAfterLoad: !1,
16679
16756
  fullscreenContainer: void 0
16680
16757
  };
16681
- let os = zr;
16758
+ let os = Ur;
16682
16759
  const Js = {
16683
16760
  webgl: "WebGL",
16684
16761
  webaudio: "WebAudio",
@@ -16789,7 +16866,7 @@ function ah(r) {
16789
16866
  class Hr extends Dt {
16790
16867
  constructor(t) {
16791
16868
  var e, i;
16792
- super({ ...t }), this.get(P).coordPlane = ht.Screen, this.anchor = (e = t == null ? void 0 : t.anchor) != null ? e : w(0, 0), this.body.collisionType = (i = t == null ? void 0 : t.collisionType) != null ? i : R.PreventCollision, this.pointer.useGraphicsBounds = !0, this.pointer.useColliderShape = !1, !(t != null && t.collider) && (t == null ? void 0 : t.width) > 0 && (t == null ? void 0 : t.height) > 0 && this.collider.useBoxCollider(this.width, this.height, this.anchor);
16869
+ super({ ...t }), this.get(P).coordPlane = ht.Screen, this.anchor = (e = t == null ? void 0 : t.anchor) != null ? e : w(0, 0), this.body.collisionType = (i = t == null ? void 0 : t.collisionType) != null ? i : R.PreventCollision, this.pointer.useGraphicsBounds = !0, this.pointer.useColliderShape = !1, !(t != null && t.collider) && (t == null ? void 0 : t.width) > 0 && (t == null ? void 0 : t.height) > 0 && this.collider.useBoxCollider(t.width, t.height, this.anchor);
16793
16870
  }
16794
16871
  _initialize(t) {
16795
16872
  this._engine = t, super._initialize(t);
@@ -17532,7 +17609,7 @@ class ch {
17532
17609
  e ? this.events.off(t, e) : this.events.off(t);
17533
17610
  }
17534
17611
  }
17535
- class yi extends Bt {
17612
+ class yi extends kt {
17536
17613
  /**
17537
17614
  * Specify the isometric map to use to position this entity's z-index
17538
17615
  * @param mapOrOptions
@@ -17926,7 +18003,7 @@ class xh {
17926
18003
  };
17927
18004
  }
17928
18005
  }
17929
- const Yl = {
18006
+ const $l = {
17930
18007
  Initialize: "initialize",
17931
18008
  PreUpdate: "preupdate",
17932
18009
  PostUpdate: "postupdate"
@@ -18242,7 +18319,7 @@ class vh {
18242
18319
  return !this._isShaking || this._elapsedShakeTime >= this._shakeDuration;
18243
18320
  }
18244
18321
  }
18245
- const $l = {
18322
+ const Yl = {
18246
18323
  ExitTrigger: "exit",
18247
18324
  EnterTrigger: "enter"
18248
18325
  };
@@ -18701,12 +18778,12 @@ function Xr() {
18701
18778
  }
18702
18779
  return !1;
18703
18780
  }
18704
- function Yr() {
18781
+ function $r() {
18705
18782
  return window !== window.top;
18706
18783
  }
18707
- function $r() {
18784
+ function Yr() {
18708
18785
  let r;
18709
- return Xr() ? (r = window, I.getInstance().warnOnce("Excalibur might be in a cross-origin iframe, in order to receive keyboard events it must be in focus")) : Yr() ? (r = window, I.getInstance().warnOnce("Excalibur might be in a iframe, in order to receive keyboard events it must be in focus")) : r = window.top, r;
18786
+ return Xr() ? (r = window, I.getInstance().warnOnce("Excalibur might be in a cross-origin iframe, in order to receive keyboard events it must be in focus")) : $r() ? (r = window, I.getInstance().warnOnce("Excalibur might be in a iframe, in order to receive keyboard events it must be in focus")) : r = window.top, r;
18710
18787
  }
18711
18788
  var Ch = /* @__PURE__ */ ((r) => (r.Backquote = "Backquote", r.Backslash = "Backslash", r.BracketLeft = "BracketLeft", r.BracketRight = "BracketRight", r.Comma = "Comma", r.Key0 = "Digit0", r.Key1 = "Digit1", r.Key2 = "Digit2", r.Key3 = "Digit3", r.Key4 = "Digit4", r.Key5 = "Digit5", r.Key6 = "Digit6", r.Key7 = "Digit7", r.Key8 = "Digit8", r.Key9 = "Digit9", r.Digit0 = "Digit0", r.Digit1 = "Digit1", r.Digit2 = "Digit2", r.Digit3 = "Digit3", r.Digit4 = "Digit4", r.Digit5 = "Digit5", r.Digit6 = "Digit6", r.Digit7 = "Digit7", r.Digit8 = "Digit8", r.Digit9 = "Digit9", r.Equal = "Equal", r.IntlBackslash = "IntlBackslash", r.IntlRo = "IntlRo", r.IntlYen = "IntlYen", r.A = "KeyA", r.B = "KeyB", r.C = "KeyC", r.D = "KeyD", r.E = "KeyE", r.F = "KeyF", r.G = "KeyG", r.H = "KeyH", r.I = "KeyI", r.J = "KeyJ", r.K = "KeyK", r.L = "KeyL", r.M = "KeyM", r.N = "KeyN", r.O = "KeyO", r.P = "KeyP", r.Q = "KeyQ", r.R = "KeyR", r.S = "KeyS", r.T = "KeyT", r.U = "KeyU", r.V = "KeyV", r.W = "KeyW", r.X = "KeyX", r.Y = "KeyY", r.Z = "KeyZ", r.KeyA = "KeyA", r.KeyB = "KeyB", r.KeyC = "KeyC", r.KeyD = "KeyD", r.KeyE = "KeyE", r.KeyF = "KeyF", r.KeyG = "KeyG", r.KeyH = "KeyH", r.KeyI = "KeyI", r.KeyJ = "KeyJ", r.KeyK = "KeyK", r.KeyL = "KeyL", r.KeyM = "KeyM", r.KeyN = "KeyN", r.KeyO = "KeyO", r.KeyP = "KeyP", r.KeyQ = "KeyQ", r.KeyR = "KeyR", r.KeyS = "KeyS", r.KeyT = "KeyT", r.KeyU = "KeyU", r.KeyV = "KeyV", r.KeyW = "KeyW", r.KeyX = "KeyX", r.KeyY = "KeyY", r.KeyZ = "KeyZ", r.Minus = "Minus", r.Period = "Period", r.Quote = "Quote", r.Semicolon = "Semicolon", r.Slash = "Slash", r.AltLeft = "AltLeft", r.AltRight = "AltRight", r.Alt = "Alt", r.AltGraph = "AltGraph", r.Backspace = "Backspace", r.CapsLock = "CapsLock", r.ContextMenu = "ContextMenu", r.ControlLeft = "ControlLeft", r.ControlRight = "ControlRight", r.Enter = "Enter", r.MetaLeft = "MetaLeft", r.MetaRight = "MetaRight", r.ShiftLeft = "ShiftLeft", r.ShiftRight = "ShiftRight", r.Space = "Space", r.Tab = "Tab", r.Convert = "Convert", r.KanaMode = "KanaMode", r.NonConvert = "NonConvert", r.Delete = "Delete", r.End = "End", r.Help = "Help", r.Home = "Home", r.Insert = "Insert", r.PageDown = "PageDown", r.PageUp = "PageUp", r.Up = "ArrowUp", r.Down = "ArrowDown", r.Left = "ArrowLeft", r.Right = "ArrowRight", r.ArrowUp = "ArrowUp", r.ArrowDown = "ArrowDown", r.ArrowLeft = "ArrowLeft", r.ArrowRight = "ArrowRight", r.NumLock = "NumLock", r.Numpad0 = "Numpad0", r.Numpad1 = "Numpad1", r.Numpad2 = "Numpad2", r.Numpad3 = "Numpad3", r.Numpad4 = "Numpad4", r.Numpad5 = "Numpad5", r.Numpad6 = "Numpad6", r.Numpad7 = "Numpad7", r.Numpad8 = "Numpad8", r.Numpad9 = "Numpad9", r.Num0 = "Numpad0", r.Num1 = "Numpad1", r.Num2 = "Numpad2", r.Num3 = "Numpad3", r.Num4 = "Numpad4", r.Num5 = "Numpad5", r.Num6 = "Numpad6", r.Num7 = "Numpad7", r.Num8 = "Numpad8", r.Num9 = "Numpad9", r.NumAdd = "NumpadAdd", r.NumpadAdd = "NumpadAdd", r.NumDecimal = "NumpadDecimal", r.NumpadDecimal = "NumpadDecimal", r.NumDivide = "NumpadDivide", r.NumpadDivide = "NumpadDivide", r.NumEnter = "NumpadEnter", r.NumpadEnter = "NumpadEnter", r.NumMultiply = "NumpadMultiply", r.NumpadMultiply = "NumpadMultiply", r.NumSubtract = "NumpadSubtract", r.NumpadSubtract = "NumpadSubtract", r.Esc = "Escape", r.Escape = "Escape", r.F1 = "F1", r.F2 = "F2", r.F3 = "F3", r.F4 = "F4", r.F5 = "F5", r.F6 = "F6", r.F7 = "F7", r.F8 = "F8", r.F9 = "F9", r.F10 = "F10", r.F11 = "F11", r.F12 = "F12", r.F13 = "F13", r.F14 = "F14", r.F15 = "F15", r.F16 = "F16", r.F17 = "F17", r.F18 = "F18", r.F19 = "F19", r.F20 = "F20", r.PrintScreen = "PrintScreen", r.ScrollLock = "ScrollLock", r.Pause = "Pause", r.Unidentified = "Unidentified", r))(Ch || {});
18712
18789
  class ri extends B {
@@ -18770,7 +18847,7 @@ class Th {
18770
18847
  init(t) {
18771
18848
  let { global: e } = t;
18772
18849
  const { grabWindowFocus: i } = t;
18773
- e ? typeof e == "function" && (e = e()) : e = $r(), i && e.focus(), e.addEventListener("blur", () => {
18850
+ e ? typeof e == "function" && (e = e()) : e = Yr(), i && e.focus(), e.addEventListener("blur", () => {
18774
18851
  this._keys.length = 0;
18775
18852
  }), e.addEventListener("keyup", this._handleKeyUp), e.addEventListener("keydown", this._handleKeyDown);
18776
18853
  }
@@ -18883,7 +18960,7 @@ class tn {
18883
18960
  * @param engine
18884
18961
  */
18885
18962
  _updateWorldPosition(t) {
18886
- const e = Ye.fromPagePosition(this.lastPagePos, t);
18963
+ const e = $e.fromPagePosition(this.lastPagePos, t);
18887
18964
  this.lastScreenPos = e.screenPos, this.lastWorldPos = e.worldPos;
18888
18965
  }
18889
18966
  }
@@ -19033,7 +19110,7 @@ class Es {
19033
19110
  const i = {
19034
19111
  passive: !(this.engine.pageScrollPreventionMode === Oe.All || this.engine.pageScrollPreventionMode === Oe.Canvas)
19035
19112
  };
19036
- if ("onwheel" in document.createElement("div") ? this.target.addEventListener("wheel", this._boundWheel, i) : document.onmousewheel !== void 0 ? this.target.addEventListener("mousewheel", this._boundWheel, i) : this.target.addEventListener("MozMousePixelScroll", this._boundWheel, i), ((e = t == null ? void 0 : t.grabWindowFocus) != null ? e : !0) && (Xr() || Yr())) {
19113
+ if ("onwheel" in document.createElement("div") ? this.target.addEventListener("wheel", this._boundWheel, i) : document.onmousewheel !== void 0 ? this.target.addEventListener("mousewheel", this._boundWheel, i) : this.target.addEventListener("MozMousePixelScroll", this._boundWheel, i), ((e = t == null ? void 0 : t.grabWindowFocus) != null ? e : !0) && (Xr() || $r())) {
19037
19114
  const n = () => {
19038
19115
  window.focus();
19039
19116
  };
@@ -19064,12 +19141,12 @@ class Es {
19064
19141
  if (Ah(t)) {
19065
19142
  i = ce.Unknown, s = de.Touch;
19066
19143
  for (let n = 0; n < t.changedTouches.length; n++) {
19067
- const o = t.changedTouches[n], a = Ye.fromPagePosition(o.pageX, o.pageY, this.engine), h = n + 1, l = this._normalizePointerId(h);
19144
+ const o = t.changedTouches[n], a = $e.fromPagePosition(o.pageX, o.pageY, this.engine), h = n + 1, l = this._normalizePointerId(h);
19068
19145
  this.currentFramePointerCoords.set(l, a), e.set(l, a);
19069
19146
  }
19070
19147
  } else {
19071
19148
  i = this._nativeButtonToPointerButton(t.button), s = de.Mouse;
19072
- const n = Ye.fromPagePosition(t.pageX, t.pageY, this.engine);
19149
+ const n = $e.fromPagePosition(t.pageX, t.pageY, this.engine);
19073
19150
  let o = 1;
19074
19151
  Ph(t) && (o = t.pointerId, s = this._stringToPointerType(t.pointerType));
19075
19152
  const a = this._normalizePointerId(o);
@@ -19145,7 +19222,7 @@ class Es {
19145
19222
  case ye.Unknown:
19146
19223
  return ce.Unknown;
19147
19224
  default:
19148
- return Yn(t);
19225
+ return $n(t);
19149
19226
  }
19150
19227
  }
19151
19228
  _stringToPointerType(t) {
@@ -19200,7 +19277,7 @@ const jl = {
19200
19277
  TransitionStart: "transitionstart",
19201
19278
  TransitionEnd: "transitionend"
19202
19279
  };
19203
- function Gt(r) {
19280
+ function qt(r) {
19204
19281
  var t, e;
19205
19282
  return !!(r != null && r.prototype) && !!((e = (t = r == null ? void 0 : r.prototype) == null ? void 0 : t.constructor) != null && e.name);
19206
19283
  }
@@ -20221,13 +20298,13 @@ class Lh {
20221
20298
  _getInTransition(t) {
20222
20299
  var e;
20223
20300
  const i = this.scenes[t];
20224
- if (!(i instanceof Et || Gt(i)))
20301
+ if (!(i instanceof Et || qt(i)))
20225
20302
  return (e = i == null ? void 0 : i.transitions) == null ? void 0 : e.in;
20226
20303
  }
20227
20304
  _getOutTransition(t) {
20228
20305
  var e;
20229
20306
  const i = this.scenes[t];
20230
- if (!(i instanceof Et || Gt(i)))
20307
+ if (!(i instanceof Et || qt(i)))
20231
20308
  return (e = i == null ? void 0 : i.transitions) == null ? void 0 : e.out;
20232
20309
  }
20233
20310
  getDeferredScene() {
@@ -20240,7 +20317,7 @@ class Lh {
20240
20317
  */
20241
20318
  getSceneDefinition(t) {
20242
20319
  const e = this.scenes[t];
20243
- if (e instanceof Et || Gt(e))
20320
+ if (e instanceof Et || qt(e))
20244
20321
  return e;
20245
20322
  if (e)
20246
20323
  return e.scene;
@@ -20254,10 +20331,10 @@ class Lh {
20254
20331
  if (i instanceof Et) {
20255
20332
  if (t === i)
20256
20333
  return e;
20257
- } else if (!Gt(i) && t === i.scene)
20334
+ } else if (!qt(i) && t === i.scene)
20258
20335
  return e;
20259
20336
  for (const [e, i] of Object.entries(this.scenes))
20260
- if (Gt(i)) {
20337
+ if (qt(i)) {
20261
20338
  if (t.constructor === i)
20262
20339
  return e;
20263
20340
  } else if (!(i instanceof Et) && t.constructor === i.scene)
@@ -20284,20 +20361,20 @@ class Lh {
20284
20361
  * @param sceneOrRoute
20285
20362
  */
20286
20363
  add(t, e) {
20287
- if (!(e instanceof Et) && !Gt(e)) {
20364
+ if (!(e instanceof Et) && !qt(e)) {
20288
20365
  const { loader: i, transitions: s } = e, { in: n, out: o } = s != null ? s : {};
20289
20366
  this._sceneToTransition.set(t, { in: n, out: o }), Qs(i) ? this._sceneToLoader.set(t, new i()) : i && this._sceneToLoader.set(t, i);
20290
20367
  }
20291
20368
  return this.scenes[t] && this._logger.warn("Scene", t, "already exists overwriting"), this.scenes[t] = e, this.assertAdded(t);
20292
20369
  }
20293
20370
  remove(t) {
20294
- if (t instanceof Et || Gt(t)) {
20371
+ if (t instanceof Et || qt(t)) {
20295
20372
  const e = t;
20296
20373
  for (const i in this.scenes)
20297
20374
  if (this.scenes.hasOwnProperty(i)) {
20298
20375
  const s = this.scenes[i];
20299
20376
  let n;
20300
- if (s instanceof Et || Gt(s) ? n = s : n = s.scene, n === e) {
20377
+ if (s instanceof Et || qt(s) ? n = s : n = s.scene, n === e) {
20301
20378
  if (i === this.currentSceneName)
20302
20379
  throw new Error(`Cannot remove a currently active scene: ${i}`);
20303
20380
  this._sceneToInstance.delete(i), this._sceneToTransition.delete(i), this._sceneToLoader.delete(i), delete this.scenes[i];
@@ -20445,7 +20522,7 @@ const sn = {
20445
20522
  // fontCollectInterval: 60_000,
20446
20523
  // textMeasurementCollectInterval: 60_000,
20447
20524
  };
20448
- class zh {
20525
+ class Uh {
20449
20526
  constructor(t) {
20450
20527
  this.options = t, this._running = !1, this._collectionMap = /* @__PURE__ */ new Map(), this._collectors = /* @__PURE__ */ new Map(), this.collectStaleResources = (e) => {
20451
20528
  if (this._running) {
@@ -20614,7 +20691,7 @@ O|===|* >________________>
20614
20691
  ), this.garbageCollectorConfig = null) : this.garbageCollectorConfig = {
20615
20692
  ...sn,
20616
20693
  ...t.garbageCollection
20617
- }, this._garbageCollector = new zh({ getTimestamp: Date.now }), this.canvasElementId = t.canvasElementId, t.canvasElementId) {
20694
+ }, this._garbageCollector = new Uh({ getTimestamp: Date.now }), this.canvasElementId = t.canvasElementId, t.canvasElementId) {
20618
20695
  if (this._logger.debug("Using Canvas element specified: " + t.canvasElementId), document.getElementById(t.canvasElementId) === null)
20619
20696
  throw new Error("Cannot find existing element in the DOM, please ensure element is created prior to engine creation.");
20620
20697
  this.canvas = document.getElementById(t.canvasElementId), this._hasCreatedCanvas = !1;
@@ -20625,7 +20702,7 @@ O|===|* >________________>
20625
20702
  let u = (e = t.displayMode) != null ? e : ui.Fixed;
20626
20703
  t.width && t.height || t.viewport ? (t.displayMode === void 0 && (u = ui.Fixed), this._logger.debug("Engine viewport is size " + t.width + " x " + t.height)) : t.displayMode || (this._logger.debug("Engine viewport is fit"), u = ui.FitScreen);
20627
20704
  const _ = t.global && typeof t.global == "function" ? t.global() : t.global;
20628
- this.global = _ != null ? _ : $r(), this.grabWindowFocus = t.grabWindowFocus, this.pointerScope = t.pointerScope, this._originalDisplayMode = u;
20705
+ this.global = _ != null ? _ : Yr(), this.grabWindowFocus = t.grabWindowFocus, this.pointerScope = t.pointerScope, this._originalDisplayMode = u;
20629
20706
  let p, g, v, m, f, b;
20630
20707
  typeof t.antialiasing == "object" ? { pixelArtSampler: p, nativeContextAntialiasing: v, multiSampleAntialiasing: b, filtering: f, canvasImageRendering: m } = {
20631
20708
  ...t.pixelArt ? Oo : Ho,
@@ -20953,7 +21030,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`
20953
21030
  e instanceof Et ? e.add(t) : this.currentScene.add(t);
20954
21031
  }
20955
21032
  remove(t) {
20956
- t instanceof Rt && this.currentScene.remove(t), (t instanceof Et || Gt(t)) && this.removeScene(t), typeof t == "string" && this.removeScene(t);
21033
+ t instanceof Rt && this.currentScene.remove(t), (t instanceof Et || qt(t)) && this.removeScene(t), typeof t == "string" && this.removeScene(t);
20957
21034
  }
20958
21035
  /**
20959
21036
  * Changes the current scene with optionally supplied:
@@ -21150,7 +21227,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`
21150
21227
  const e = t * this.timescale;
21151
21228
  this.currentFrameElapsedMs = e;
21152
21229
  const i = this.stats.prevFrame.id + 1;
21153
- this.stats.currFrame.reset(), this.stats.currFrame.id = i, this.stats.currFrame.elapsedMs = e, this.stats.currFrame.fps = this.clock.fpsSampler.fps, $.clear();
21230
+ this.stats.currFrame.reset(), this.stats.currFrame.id = i, this.stats.currFrame.elapsedMs = e, this.stats.currFrame.fps = this.clock.fpsSampler.fps, Y.clear();
21154
21231
  const s = this.clock.now(), n = this.fixedUpdateTimestep;
21155
21232
  if (this.fixedUpdateTimestep)
21156
21233
  for (this._lagMs += e; this._lagMs >= n; )
@@ -21160,7 +21237,7 @@ Read more about this issue at https://excaliburjs.com/docs/performance`
21160
21237
  const o = this.clock.now();
21161
21238
  this.currentFrameLagMs = this._lagMs, this._draw(e);
21162
21239
  const a = this.clock.now();
21163
- this.stats.currFrame.duration.update = o - s, this.stats.currFrame.duration.draw = a - o, this.stats.currFrame.graphics.drawnImages = $.DrawnImagesCount, this.stats.currFrame.graphics.drawCalls = $.DrawCallCount, this.stats.currFrame.graphics.rendererSwaps = $.RendererSwaps, this.emit("postframe", new En(this, this.stats.currFrame)), this.stats.prevFrame.reset(this.stats.currFrame), this._monitorPerformanceThresholdAndTriggerFallback();
21240
+ this.stats.currFrame.duration.update = o - s, this.stats.currFrame.duration.draw = a - o, this.stats.currFrame.graphics.drawnImages = Y.DrawnImagesCount, this.stats.currFrame.graphics.drawCalls = Y.DrawCallCount, this.stats.currFrame.graphics.rendererSwaps = Y.RendererSwaps, this.emit("postframe", new En(this, this.stats.currFrame)), this.stats.prevFrame.reset(this.stats.currFrame), this._monitorPerformanceThresholdAndTriggerFallback();
21164
21241
  });
21165
21242
  }
21166
21243
  /**
@@ -21364,11 +21441,11 @@ class Kl extends Dt {
21364
21441
  // Creates a new particle given the constraints of the emitter
21365
21442
  _createParticle() {
21366
21443
  let t = 0, e = 0;
21367
- const i = qt(this.particle.minAngle || 0, this.particle.maxAngle || Math.PI * 2, this.random), s = qt(this.particle.minSpeed || 0, this.particle.maxSpeed || 0, this.random), n = this.particle.startSize || qt(this.particle.minSize || 5, this.particle.maxSize || 5, this.random), o = s * Math.cos(i), a = s * Math.sin(i);
21444
+ const i = Xt(this.particle.minAngle || 0, this.particle.maxAngle || Math.PI * 2, this.random), s = Xt(this.particle.minSpeed || 0, this.particle.maxSpeed || 0, this.random), n = this.particle.startSize || Xt(this.particle.minSize || 5, this.particle.maxSize || 5, this.random), o = s * Math.cos(i), a = s * Math.sin(i);
21368
21445
  if (this.emitterType === Ae.Rectangle)
21369
- t = qt(0, this.width, this.random), e = qt(0, this.height, this.random);
21446
+ t = Xt(0, this.width, this.random), e = Xt(0, this.height, this.random);
21370
21447
  else if (this.emitterType === Ae.Circle) {
21371
- const l = qt(0, this.radius, this.random);
21448
+ const l = Xt(0, this.radius, this.random);
21372
21449
  t = l * Math.cos(i), e = l * Math.sin(i);
21373
21450
  }
21374
21451
  const h = this._particlePool.rent();
@@ -21388,7 +21465,7 @@ class Kl extends Dt {
21388
21465
  size: n,
21389
21466
  graphic: this.particle.graphic,
21390
21467
  fade: this.particle.fade
21391
- }), h.registerEmitter(this), this.particle.randomRotation && (h.transform.rotation = qt(0, Math.PI * 2, this.random)), this.particle.focus && (h.focus = this.particle.focus.add(w(this.pos.x, this.pos.y)), h.focusAccel = this.particle.focusAccel), h;
21468
+ }), h.registerEmitter(this), this.particle.randomRotation && (h.transform.rotation = Xt(0, Math.PI * 2, this.random)), this.particle.focus && (h.focus = this.particle.focus.add(w(this.pos.x, this.pos.y)), h.focusAccel = this.particle.focusAccel), h;
21392
21469
  }
21393
21470
  update(t, e) {
21394
21471
  var i;
@@ -21450,7 +21527,7 @@ class as {
21450
21527
  l,
21451
21528
  c,
21452
21529
  // velocity
21453
- this.particle.randomRotation ? qt(0, rt, this._random) : this.particle.rotation || 0,
21530
+ this.particle.randomRotation ? Xt(0, rt, this._random) : this.particle.rotation || 0,
21454
21531
  // rotation
21455
21532
  this.particle.angularVelocity || 0,
21456
21533
  // angular velocity
@@ -21633,7 +21710,7 @@ function uc(r) {
21633
21710
  function _c(r) {
21634
21711
  return !!r.onPostDraw;
21635
21712
  }
21636
- class Uh {
21713
+ class zh {
21637
21714
  constructor(t, e) {
21638
21715
  this.soundManager = e;
21639
21716
  }
@@ -21680,7 +21757,7 @@ class fc {
21680
21757
  constructor(t) {
21681
21758
  this._channelToConfig = /* @__PURE__ */ new Map(), this._nameToConfig = /* @__PURE__ */ new Map(), this._mix = /* @__PURE__ */ new Map(), this._muted = /* @__PURE__ */ new Set(), this._all = /* @__PURE__ */ new Set(), this._defaultVolume = 1;
21682
21759
  var e;
21683
- if (this._defaultVolume = (e = t.volume) != null ? e : 1, this.channel = new Uh(t, this), t.sounds)
21760
+ if (this._defaultVolume = (e = t.volume) != null ? e : 1, this.channel = new zh(t, this), t.sounds)
21684
21761
  for (const [i, s] of Object.entries(t.sounds))
21685
21762
  this.track(i, s);
21686
21763
  }
@@ -21855,7 +21932,7 @@ class gc {
21855
21932
  async load() {
21856
21933
  const t = await this._resource.load();
21857
21934
  this._stream = new Hh(t), this._gif = new Nh(this._stream);
21858
- const e = this._gif.images.map((i) => new $t(i.src, !1));
21935
+ const e = this._gif.images.map((i) => new Ot(i.src, !1));
21859
21936
  return await Promise.all(e.map((i) => i.load())), this.data = this._images = e, this._sprites = this._images.map((i) => i.toSprite()), this.data;
21860
21937
  }
21861
21938
  isLoaded() {
@@ -22342,7 +22419,7 @@ class xc extends Rs {
22342
22419
  this.image = await t.engine.screenshot(!0), await this.image.decode();
22343
22420
  }
22344
22421
  onInitialize(t) {
22345
- this.engine = t, this.transform.pos = t.screen.unsafeArea.topLeft, this.screenCover = $t.fromHtmlImageElement(this.image).toSprite(), this.graphics.add(this.screenCover), this.transform.scale = w(1 / t.screen.pixelRatio, 1 / t.screen.pixelRatio), this.graphics.opacity = this.progress;
22422
+ this.engine = t, this.transform.pos = t.screen.unsafeArea.topLeft, this.screenCover = Ot.fromHtmlImageElement(this.image).toSprite(), this.graphics.add(this.screenCover), this.transform.scale = w(1 / t.screen.pixelRatio, 1 / t.screen.pixelRatio), this.graphics.opacity = this.progress;
22346
22423
  }
22347
22424
  onStart(t) {
22348
22425
  this.graphics.opacity = this.progress;
@@ -22363,7 +22440,7 @@ class vc extends Rs {
22363
22440
  super({ direction: "in", ...t }), this._easing = It.Linear, this._start = x.Zero, this._end = x.Zero, this.name = `Slide#${this.id}`, this.slideDirection = t.slideDirection, this.transform.coordPlane = ht.Screen, this.graphics.forceOnScreen = !0, this._easing = (e = t.easingFunction) != null ? e : this._easing;
22364
22441
  }
22365
22442
  async onPreviousSceneDeactivate(t) {
22366
- this._image = await t.engine.screenshot(!0), await this._image.decode(), this._screenCover = $t.fromHtmlImageElement(this._image).toSprite();
22443
+ this._image = await t.engine.screenshot(!0), await this._image.decode(), this._screenCover = Ot.fromHtmlImageElement(this._image).toSprite();
22367
22444
  }
22368
22445
  onInitialize(t) {
22369
22446
  this._engine = t;
@@ -22409,13 +22486,13 @@ const wc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22409
22486
  addItemToArray: fo,
22410
22487
  contains: Xn,
22411
22488
  delay: mi,
22412
- fail: Yn,
22489
+ fail: $n,
22413
22490
  getMinIndex: qn,
22414
- getPosition: ze,
22491
+ getPosition: Ue,
22415
22492
  isLegacyEasing: Fe,
22416
22493
  isObject: li,
22417
22494
  mergeDeep: xi,
22418
- omit: $n,
22495
+ omit: Yn,
22419
22496
  removeItemFromArray: Be
22420
22497
  }, Symbol.toStringTag, { value: "Module" })), Gh = 5, De = {}, bc = () => {
22421
22498
  for (const r in De)
@@ -22490,7 +22567,7 @@ class Cc {
22490
22567
  }
22491
22568
  }
22492
22569
  }
22493
- const an = "0.32.0-alpha.1590+1be15c8";
22570
+ const an = "0.32.0-alpha.1592+3ba41a7";
22494
22571
  hn();
22495
22572
  export {
22496
22573
  Wn as ActionCompleteEvent,
@@ -22510,7 +22587,7 @@ export {
22510
22587
  So as AnimationDirection,
22511
22588
  Bl as AnimationEvents,
22512
22589
  Ao as AnimationStrategy,
22513
- Ys as ArcadeSolver,
22590
+ $s as ArcadeSolver,
22514
22591
  wi as AudioContextFactory,
22515
22592
  bh as Axes,
22516
22593
  _h as Axis,
@@ -22523,9 +22600,9 @@ export {
22523
22600
  Rh as BrowserEvents,
22524
22601
  qr as Buttons,
22525
22602
  vh as Camera,
22526
- Yl as CameraEvents,
22603
+ $l as CameraEvents,
22527
22604
  xs as Canvas,
22528
- Uh as ChannelCollection,
22605
+ zh as ChannelCollection,
22529
22606
  ms as Circle,
22530
22607
  _t as CircleCollider,
22531
22608
  jr as Clock,
@@ -22535,8 +22612,8 @@ export {
22535
22612
  we as CollisionContact,
22536
22613
  pi as CollisionEndEvent,
22537
22614
  Ee as CollisionGroup,
22538
- Ui as CollisionGroupManager,
22539
- Ut as CollisionJumpTable,
22615
+ zi as CollisionGroupManager,
22616
+ Ht as CollisionJumpTable,
22540
22617
  ji as CollisionPostSolveEvent,
22541
22618
  Zi as CollisionPreSolveEvent,
22542
22619
  gi as CollisionStartEvent,
@@ -22546,17 +22623,17 @@ export {
22546
22623
  Eh as ColorBlindFlags,
22547
22624
  Ge as ColorBlindnessMode,
22548
22625
  Zo as ColorBlindnessPostProcessor,
22549
- Bt as Component,
22626
+ kt as Component,
22550
22627
  lt as CompositeCollider,
22551
22628
  pn as ConsoleAppender,
22552
22629
  ja as ContactConstraintPoint,
22553
- $i as ContactEndEvent,
22630
+ Yi as ContactEndEvent,
22554
22631
  _e as ContactSolveBias,
22555
- Yi as ContactStartEvent,
22632
+ $i as ContactStartEvent,
22556
22633
  ht as CoordPlane,
22557
22634
  xc as CrossFade,
22558
- $a as CurveBy,
22559
- Ya as CurveTo,
22635
+ Ya as CurveBy,
22636
+ $a as CurveTo,
22560
22637
  Ln as DeactivateEvent,
22561
22638
  St as Debug,
22562
22639
  Ih as DebugConfig,
@@ -22581,14 +22658,14 @@ export {
22581
22658
  Na as EaseBy,
22582
22659
  Oa as EaseTo,
22583
22660
  It as EasingFunctions,
22584
- Us as Edge,
22661
+ zs as Edge,
22585
22662
  At as EdgeCollider,
22586
22663
  ph as ElasticToActorStrategy,
22587
22664
  Ae as EmitterType,
22588
22665
  Vi as Engine,
22589
22666
  Ql as EngineEvents,
22590
22667
  Hn as EnterTriggerEvent,
22591
- Un as EnterViewPortEvent,
22668
+ zn as EnterViewPortEvent,
22592
22669
  Rt as Entity,
22593
22670
  Dl as EntityEvents,
22594
22671
  go as EntityManager,
@@ -22599,7 +22676,7 @@ export {
22599
22676
  ss as ExcaliburGraphicsContext2DCanvas,
22600
22677
  jt as ExcaliburGraphicsContextWebGL,
22601
22678
  On as ExitTriggerEvent,
22602
- zn as ExitViewPortEvent,
22679
+ Un as ExitViewPortEvent,
22603
22680
  Va as Fade,
22604
22681
  mc as FadeInOut,
22605
22682
  Ne as Flags,
@@ -22622,25 +22699,25 @@ export {
22622
22699
  In as GamepadConnectEvent,
22623
22700
  Rn as GamepadDisconnectEvent,
22624
22701
  Ps as Gamepads,
22625
- zh as GarbageCollector,
22702
+ Uh as GarbageCollector,
22626
22703
  gc as Gif,
22627
22704
  Nh as GifParser,
22628
- Ye as GlobalCoordinates,
22705
+ $e as GlobalCoordinates,
22629
22706
  tc as GpuParticleEmitter,
22630
22707
  as as GpuParticleRenderer,
22631
22708
  dn as Graph,
22632
22709
  nt as Graphic,
22633
22710
  tt as GraphicsComponent,
22634
- $e as GraphicsGroup,
22711
+ Ye as GraphicsGroup,
22635
22712
  pr as GraphicsSystem,
22636
22713
  Za as HashColliderProxy,
22637
- Xt as HashGridCell,
22714
+ $t as HashGridCell,
22638
22715
  Mr as HashGridProxy,
22639
22716
  Bn as HiddenEvent,
22640
22717
  ir as HorizontalFirst,
22641
22718
  wt as ImageFiltering,
22642
- $t as ImageSource,
22643
- z as ImageSourceAttributeConstants,
22719
+ Ot as ImageSource,
22720
+ U as ImageSourceAttributeConstants,
22644
22721
  gt as ImageWrapping,
22645
22722
  Je as InitializeEvent,
22646
22723
  Zr as InputHost,
@@ -22678,7 +22755,7 @@ export {
22678
22755
  be as NativeSoundEvent,
22679
22756
  eh as NativeSoundProcessedEvent,
22680
22757
  vr as NineSlice,
22681
- Uo as NineSliceStretch,
22758
+ zo as NineSliceStretch,
22682
22759
  qi as Node,
22683
22760
  sr as None,
22684
22761
  xt as Observable,
@@ -22728,7 +22805,7 @@ export {
22728
22805
  ge as Random,
22729
22806
  Ke as Raster,
22730
22807
  Ce as Ray,
22731
- $s as RealisticSolver,
22808
+ Ys as RealisticSolver,
22732
22809
  Mi as Rectangle,
22733
22810
  Gn as RemoveEvent,
22734
22811
  Ml as RemovedComponent,
@@ -22744,7 +22821,7 @@ export {
22744
22821
  Ra as RotateToWithOptions,
22745
22822
  J as RotationType,
22746
22823
  Ha as ScaleBy,
22747
- Ua as ScaleByWithOptions,
22824
+ za as ScaleByWithOptions,
22748
22825
  La as ScaleTo,
22749
22826
  ka as ScaleToWithOptions,
22750
22827
  Et as Scene,
@@ -22753,12 +22830,12 @@ export {
22753
22830
  co as ScreenAppender,
22754
22831
  Hr as ScreenElement,
22755
22832
  Wl as ScreenEvents,
22756
- Yo as ScreenShader,
22833
+ $o as ScreenShader,
22757
22834
  Oe as ScrollPreventionMode,
22758
22835
  Cc as Semaphore,
22759
22836
  We as SeparatingAxis,
22760
22837
  wo as SeparationInfo,
22761
- kt as Shader,
22838
+ Lt as Shader,
22762
22839
  ft as Shape,
22763
22840
  G as Side,
22764
22841
  vc as Slide,
@@ -22769,7 +22846,7 @@ export {
22769
22846
  Fr as SparseHashGrid,
22770
22847
  Xs as SparseHashGridCollisionProcessor,
22771
22848
  vi as SpatialPartitionStrategy,
22772
- Ht as Sprite,
22849
+ Bt as Sprite,
22773
22850
  fs as SpriteFont,
22774
22851
  Te as SpriteSheet,
22775
22852
  Qr as StandardClock,
@@ -22797,13 +22874,13 @@ export {
22797
22874
  Rs as Transition,
22798
22875
  Os as TreeNode,
22799
22876
  wh as Trigger,
22800
- $l as TriggerEvents,
22877
+ Yl as TriggerEvents,
22801
22878
  rt as TwoPI,
22802
22879
  Wo as UniformBuffer,
22803
22880
  wc as Util,
22804
22881
  x as Vector,
22805
- zs as VectorView,
22806
- Nt as VertexBuffer,
22882
+ Us as VectorView,
22883
+ Wt as VertexBuffer,
22807
22884
  Kt as VertexLayout,
22808
22885
  er as VerticalFirst,
22809
22886
  Dn as VisibleEvent,
@@ -22875,10 +22952,10 @@ export {
22875
22952
  Ea as isMoveToOptions,
22876
22953
  Fl as isRemovedComponent,
22877
22954
  Hl as isRotateByOptions,
22878
- Ul as isRotateToOptions,
22879
- za as isScaleByOptions,
22955
+ zl as isRotateToOptions,
22956
+ Ua as isScaleByOptions,
22880
22957
  Ba as isScaleToOptions,
22881
- Gt as isSceneConstructor,
22958
+ qt as isSceneConstructor,
22882
22959
  ah as isScreenElement,
22883
22960
  mo as isSystemConstructor,
22884
22961
  at as lerp,
@@ -22889,11 +22966,11 @@ export {
22889
22966
  W as nextActionId,
22890
22967
  yc as obsolete,
22891
22968
  ti as parseImageFiltering,
22892
- Ot as parseImageWrapping,
22969
+ Nt as parseImageWrapping,
22893
22970
  M as pixelSnapEpsilon,
22894
- qt as randomInRange,
22971
+ Xt as randomInRange,
22895
22972
  Zh as randomIntInRange,
22896
- $h as range,
22973
+ Yh as range,
22897
22974
  Qt as remap,
22898
22975
  jh as remapVector,
22899
22976
  bc as resetObsoleteCounter,
@@ -22901,7 +22978,7 @@ export {
22901
22978
  Jh as smootherstep,
22902
22979
  Qh as smoothstep,
22903
22980
  no as toDegrees,
22904
- Yh as toRadians,
22981
+ $h as toRadians,
22905
22982
  w as vec,
22906
22983
  Ll as webgl
22907
22984
  };