exodeui 2.6.29 → 2.6.31

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.
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  var MC = Object.defineProperty;
2
2
  var JC = (D, A, I) => A in D ? MC(D, A, { enumerable: !0, configurable: !0, writable: !0, value: I }) : D[A] = I;
3
- var V = (D, A, I) => JC(D, typeof A != "symbol" ? A + "" : A, I);
3
+ var z = (D, A, I) => JC(D, typeof A != "symbol" ? A + "" : A, I);
4
4
  import { jsx as UC } from "react/jsx-runtime";
5
- import { forwardRef as RC, useRef as wI, useImperativeHandle as tC, useEffect as eA, useState as cC, useCallback as qA } from "react";
5
+ import { forwardRef as RC, useRef as wI, useImperativeHandle as tC, useEffect as eA, useState as cC, useCallback as nA } from "react";
6
6
  var YC = /* @__PURE__ */ ((D) => (D.Equal = "Equal", D.NotEqual = "NotEqual", D.GreaterThan = "GreaterThan", D.LessThan = "LessThan", D.GreaterEqual = "GreaterEqual", D.LessEqual = "LessEqual", D.IsTrue = "IsTrue", D.IsFalse = "IsFalse", D))(YC || {}), VA = /* @__PURE__ */ ((D) => (D.AND = "AND", D.OR = "OR", D.NOT = "NOT", D.XOR = "XOR", D))(VA || {});
7
7
  let E;
8
8
  const v = new Array(128).fill(void 0);
@@ -31,7 +31,7 @@ let zA = null;
31
31
  function OI(D, A) {
32
32
  return D >>>= 0, Wg.decode((zA !== null && zA.byteLength !== 0 || (zA = new Uint8Array(E.memory.buffer)), zA).subarray(D, D + A));
33
33
  }
34
- function q(D) {
34
+ function n(D) {
35
35
  return D == null;
36
36
  }
37
37
  let ZA = null;
@@ -76,18 +76,18 @@ function dA(D, A) {
76
76
  const I = A(4 * D.length, 4) >>> 0;
77
77
  return jg().set(D, I / 4), UA = D.length, I;
78
78
  }
79
- const yI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }), fA = Object.freeze({ Revolute: 0, 0: "Revolute", Fixed: 1, 1: "Fixed", Prismatic: 2, 2: "Prismatic", Rope: 3, 3: "Rope", Spring: 4, 4: "Spring", Generic: 5, 5: "Generic" }), FA = Object.freeze({ Ball: 0, 0: "Ball", Cuboid: 1, 1: "Cuboid", Capsule: 2, 2: "Capsule", Segment: 3, 3: "Segment", Polyline: 4, 4: "Polyline", Triangle: 5, 5: "Triangle", TriMesh: 6, 6: "TriMesh", HeightField: 7, 7: "HeightField", Compound: 8, 8: "Compound", ConvexPolygon: 9, 9: "ConvexPolygon", RoundCuboid: 10, 10: "RoundCuboid", RoundTriangle: 11, 11: "RoundTriangle", RoundConvexPolygon: 12, 12: "RoundConvexPolygon", HalfSpace: 13, 13: "HalfSpace", Voxels: 14, 14: "Voxels" }), qI = typeof FinalizationRegistry > "u" ? { register: () => {
79
+ const yI = Object.freeze({ LinX: 0, 0: "LinX", LinY: 1, 1: "LinY", AngX: 2, 2: "AngX" }), fA = Object.freeze({ Revolute: 0, 0: "Revolute", Fixed: 1, 1: "Fixed", Prismatic: 2, 2: "Prismatic", Rope: 3, 3: "Rope", Spring: 4, 4: "Spring", Generic: 5, 5: "Generic" }), FA = Object.freeze({ Ball: 0, 0: "Ball", Cuboid: 1, 1: "Cuboid", Capsule: 2, 2: "Capsule", Segment: 3, 3: "Segment", Polyline: 4, 4: "Polyline", Triangle: 5, 5: "Triangle", TriMesh: 6, 6: "TriMesh", HeightField: 7, 7: "HeightField", Compound: 8, 8: "Compound", ConvexPolygon: 9, 9: "ConvexPolygon", RoundCuboid: 10, 10: "RoundCuboid", RoundTriangle: 11, 11: "RoundTriangle", RoundConvexPolygon: 12, 12: "RoundConvexPolygon", HalfSpace: 13, 13: "HalfSpace", Voxels: 14, 14: "Voxels" }), nI = typeof FinalizationRegistry > "u" ? { register: () => {
80
80
  }, unregister: () => {
81
81
  } } : new FinalizationRegistry((D) => E.__wbg_rawbroadphase_free(D >>> 0, 1));
82
82
  class bA {
83
83
  static __wrap(A) {
84
84
  A >>>= 0;
85
85
  const I = Object.create(bA.prototype);
86
- return I.__wbg_ptr = A, qI.register(I, I.__wbg_ptr, I), I;
86
+ return I.__wbg_ptr = A, nI.register(I, I.__wbg_ptr, I), I;
87
87
  }
88
88
  __destroy_into_raw() {
89
89
  const A = this.__wbg_ptr;
90
- return this.__wbg_ptr = 0, qI.unregister(this), A;
90
+ return this.__wbg_ptr = 0, nI.unregister(this), A;
91
91
  }
92
92
  free() {
93
93
  const A = this.__destroy_into_raw();
@@ -95,87 +95,87 @@ class bA {
95
95
  }
96
96
  constructor() {
97
97
  const A = E.rawbroadphase_new();
98
- return this.__wbg_ptr = A >>> 0, qI.register(this, this.__wbg_ptr, this), this;
98
+ return this.__wbg_ptr = A >>> 0, nI.register(this, this.__wbg_ptr, this), this;
99
99
  }
100
- castRay(A, I, C, g, Q, B, i, o, w, G, h, s) {
100
+ castRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
101
101
  try {
102
- K(A, GA), K(I, EA), K(C, wA), K(g, y), K(Q, y);
103
- const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, q(w) ? 4294967297 : w >>> 0, !q(G), q(G) ? 0 : G, !q(h), q(h) ? 0 : h, DA(s));
102
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
103
+ const a = E.rawbroadphase_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
104
104
  return a === 0 ? void 0 : gg.__wrap(a);
105
105
  } finally {
106
106
  v[CA++] = void 0;
107
107
  }
108
108
  }
109
- castRayAndGetNormal(A, I, C, g, Q, B, i, o, w, G, h, s) {
109
+ castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G, w) {
110
110
  try {
111
- K(A, GA), K(I, EA), K(C, wA), K(g, y), K(Q, y);
112
- const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, q(w) ? 4294967297 : w >>> 0, !q(G), q(G) ? 0 : G, !q(h), q(h) ? 0 : h, DA(s));
111
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M);
112
+ const a = E.rawbroadphase_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
113
113
  return a === 0 ? void 0 : JI.__wrap(a);
114
114
  } finally {
115
115
  v[CA++] = void 0;
116
116
  }
117
117
  }
118
- intersectionsWithRay(A, I, C, g, Q, B, i, o, w, G, h, s, a) {
118
+ intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w, a) {
119
119
  try {
120
- K(A, GA), K(I, EA), K(C, wA), K(g, y), K(Q, y), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, DA(o), w, q(G) ? 4294967297 : G >>> 0, !q(h), q(h) ? 0 : h, !q(s), q(s) ? 0 : s, DA(a));
120
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_intersectionsWithRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i, DA(o), h, n(s) ? 4294967297 : s >>> 0, !n(G), n(G) ? 0 : G, !n(w), n(w) ? 0 : w, DA(a));
121
121
  } finally {
122
122
  v[CA++] = void 0, v[CA++] = void 0;
123
123
  }
124
124
  }
125
- intersectionWithShape(A, I, C, g, Q, B, i, o, w, G, h) {
125
+ intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
126
126
  try {
127
127
  const N = E.__wbindgen_add_to_stack_pointer(-16);
128
- K(A, GA), K(I, EA), K(C, wA), K(g, y), K(Q, u), K(B, H), E.rawbroadphase_intersectionWithShape(N, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, q(o) ? 4294967297 : o >>> 0, !q(w), q(w) ? 0 : w, !q(G), q(G) ? 0 : G, DA(h));
129
- var s = SA().getInt32(N + 0, !0), a = SA().getFloat64(N + 8, !0);
130
- return s === 0 ? void 0 : a;
128
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, H), E.rawbroadphase_intersectionWithShape(N, this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, n(o) ? 4294967297 : o >>> 0, !n(h), n(h) ? 0 : h, !n(s), n(s) ? 0 : s, DA(G));
129
+ var w = SA().getInt32(N + 0, !0), a = SA().getFloat64(N + 8, !0);
130
+ return w === 0 ? void 0 : a;
131
131
  } finally {
132
132
  E.__wbindgen_add_to_stack_pointer(16), v[CA++] = void 0;
133
133
  }
134
134
  }
135
- projectPoint(A, I, C, g, Q, B, i, o, w, G) {
135
+ projectPoint(A, I, C, g, Q, B, i, o, h, s) {
136
136
  try {
137
- K(A, GA), K(I, EA), K(C, wA), K(g, y);
138
- const h = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, q(i) ? 4294967297 : i >>> 0, !q(o), q(o) ? 0 : o, !q(w), q(w) ? 0 : w, DA(G));
139
- return h === 0 ? void 0 : GI.__wrap(h);
137
+ K(A, GA), K(I, EA), K(C, wA), K(g, M);
138
+ const G = E.rawbroadphase_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, n(i) ? 4294967297 : i >>> 0, !n(o), n(o) ? 0 : o, !n(h), n(h) ? 0 : h, DA(s));
139
+ return G === 0 ? void 0 : GI.__wrap(G);
140
140
  } finally {
141
141
  v[CA++] = void 0;
142
142
  }
143
143
  }
144
- projectPointAndGetFeature(A, I, C, g, Q, B, i, o, w) {
144
+ projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
145
145
  try {
146
- K(A, GA), K(I, EA), K(C, wA), K(g, y);
147
- const G = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, q(B) ? 4294967297 : B >>> 0, !q(i), q(i) ? 0 : i, !q(o), q(o) ? 0 : o, DA(w));
148
- return G === 0 ? void 0 : GI.__wrap(G);
146
+ K(A, GA), K(I, EA), K(C, wA), K(g, M);
147
+ const s = E.rawbroadphase_projectPointAndGetFeature(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, n(B) ? 4294967297 : B >>> 0, !n(i), n(i) ? 0 : i, !n(o), n(o) ? 0 : o, DA(h));
148
+ return s === 0 ? void 0 : GI.__wrap(s);
149
149
  } finally {
150
150
  v[CA++] = void 0;
151
151
  }
152
152
  }
153
- intersectionsWithPoint(A, I, C, g, Q, B, i, o, w, G) {
153
+ intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
154
154
  try {
155
- K(A, GA), K(I, EA), K(C, wA), K(g, y), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, DA(Q), B, q(i) ? 4294967297 : i >>> 0, !q(o), q(o) ? 0 : o, !q(w), q(w) ? 0 : w, DA(G));
155
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), E.rawbroadphase_intersectionsWithPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, DA(Q), B, n(i) ? 4294967297 : i >>> 0, !n(o), n(o) ? 0 : o, !n(h), n(h) ? 0 : h, DA(s));
156
156
  } finally {
157
157
  v[CA++] = void 0, v[CA++] = void 0;
158
158
  }
159
159
  }
160
- castShape(A, I, C, g, Q, B, i, o, w, G, h, s, a, N, S) {
160
+ castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
161
161
  try {
162
- K(A, GA), K(I, EA), K(C, wA), K(g, y), K(Q, u), K(B, y), K(i, H);
163
- const F = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, w, G, h, q(s) ? 4294967297 : s >>> 0, !q(a), q(a) ? 0 : a, !q(N), q(N) ? 0 : N, DA(S));
164
- return F === 0 ? void 0 : FI.__wrap(F);
162
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, M), K(i, H);
163
+ const k = E.rawbroadphase_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s, G, n(w) ? 4294967297 : w >>> 0, !n(a), n(a) ? 0 : a, !n(N), n(N) ? 0 : N, DA(S));
164
+ return k === 0 ? void 0 : FI.__wrap(k);
165
165
  } finally {
166
166
  v[CA++] = void 0;
167
167
  }
168
168
  }
169
- intersectionsWithShape(A, I, C, g, Q, B, i, o, w, G, h, s) {
169
+ intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
170
170
  try {
171
- K(A, GA), K(I, EA), K(C, wA), K(g, y), K(Q, u), K(B, H), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, DA(i), o, q(w) ? 4294967297 : w >>> 0, !q(G), q(G) ? 0 : G, !q(h), q(h) ? 0 : h, DA(s));
171
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, u), K(B, H), E.rawbroadphase_intersectionsWithShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, DA(i), o, n(h) ? 4294967297 : h >>> 0, !n(s), n(s) ? 0 : s, !n(G), n(G) ? 0 : G, DA(w));
172
172
  } finally {
173
173
  v[CA++] = void 0, v[CA++] = void 0;
174
174
  }
175
175
  }
176
176
  collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
177
177
  try {
178
- K(A, GA), K(I, EA), K(C, wA), K(g, y), K(Q, y), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, DA(B));
178
+ K(A, GA), K(I, EA), K(C, wA), K(g, M), K(Q, M), E.rawbroadphase_collidersWithAabbIntersectingAabb(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, DA(B));
179
179
  } finally {
180
180
  v[CA++] = void 0;
181
181
  }
@@ -219,30 +219,30 @@ class xg {
219
219
  }
220
220
  translationDeltaApplied() {
221
221
  const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
222
- return y.__wrap(A);
222
+ return M.__wrap(A);
223
223
  }
224
224
  translationDeltaRemaining() {
225
225
  const A = E.rawcharactercollision_translationDeltaRemaining(this.__wbg_ptr);
226
- return y.__wrap(A);
226
+ return M.__wrap(A);
227
227
  }
228
228
  toi() {
229
229
  return E.rawcharactercollision_toi(this.__wbg_ptr);
230
230
  }
231
231
  worldWitness1() {
232
232
  const A = E.rawcharactercollision_worldWitness1(this.__wbg_ptr);
233
- return y.__wrap(A);
233
+ return M.__wrap(A);
234
234
  }
235
235
  worldWitness2() {
236
236
  const A = E.rawcharactercollision_worldWitness2(this.__wbg_ptr);
237
- return y.__wrap(A);
237
+ return M.__wrap(A);
238
238
  }
239
239
  worldNormal1() {
240
240
  const A = E.rawcharactercollision_worldNormal1(this.__wbg_ptr);
241
- return y.__wrap(A);
241
+ return M.__wrap(A);
242
242
  }
243
243
  worldNormal2() {
244
244
  const A = E.rawcharactercollision_worldNormal2(this.__wbg_ptr);
245
- return y.__wrap(A);
245
+ return M.__wrap(A);
246
246
  }
247
247
  }
248
248
  const lI = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -264,7 +264,7 @@ class wA {
264
264
  }
265
265
  coTranslation(A) {
266
266
  const I = E.rawcolliderset_coTranslation(this.__wbg_ptr, A);
267
- return y.__wrap(I);
267
+ return M.__wrap(I);
268
268
  }
269
269
  coRotation(A) {
270
270
  const I = E.rawcolliderset_coRotation(this.__wbg_ptr, A);
@@ -272,7 +272,7 @@ class wA {
272
272
  }
273
273
  coTranslationWrtParent(A) {
274
274
  const I = E.rawcolliderset_coTranslationWrtParent(this.__wbg_ptr, A);
275
- return I === 0 ? void 0 : y.__wrap(I);
275
+ return I === 0 ? void 0 : M.__wrap(I);
276
276
  }
277
277
  coRotationWrtParent(A) {
278
278
  const I = E.rawcolliderset_coRotationWrtParent(this.__wbg_ptr, A);
@@ -298,14 +298,14 @@ class wA {
298
298
  }
299
299
  coHalfspaceNormal(A) {
300
300
  const I = E.rawcolliderset_coHalfspaceNormal(this.__wbg_ptr, A);
301
- return I === 0 ? void 0 : y.__wrap(I);
301
+ return I === 0 ? void 0 : M.__wrap(I);
302
302
  }
303
303
  coHalfExtents(A) {
304
304
  const I = E.rawcolliderset_coHalfExtents(this.__wbg_ptr, A);
305
- return I === 0 ? void 0 : y.__wrap(I);
305
+ return I === 0 ? void 0 : M.__wrap(I);
306
306
  }
307
307
  coSetHalfExtents(A, I) {
308
- K(I, y), E.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
308
+ K(I, M), E.rawcolliderset_coSetHalfExtents(this.__wbg_ptr, A, I.__wbg_ptr);
309
309
  }
310
310
  coRadius(A) {
311
311
  const I = E.rawcolliderset_coRadius(this.__wbg_ptr, A);
@@ -341,7 +341,7 @@ class wA {
341
341
  }
342
342
  coVoxelSize(A) {
343
343
  const I = E.rawcolliderset_coVoxelSize(this.__wbg_ptr, A);
344
- return I === 0 ? void 0 : y.__wrap(I);
344
+ return I === 0 ? void 0 : M.__wrap(I);
345
345
  }
346
346
  coSetVoxel(A, I, C, g) {
347
347
  E.rawcolliderset_coSetVoxel(this.__wbg_ptr, A, I, C, g);
@@ -393,7 +393,7 @@ class wA {
393
393
  }
394
394
  coHeightfieldScale(A) {
395
395
  const I = E.rawcolliderset_coHeightfieldScale(this.__wbg_ptr, A);
396
- return I === 0 ? void 0 : y.__wrap(I);
396
+ return I === 0 ? void 0 : M.__wrap(I);
397
397
  }
398
398
  coParent(A) {
399
399
  try {
@@ -451,23 +451,23 @@ class wA {
451
451
  return E.rawcolliderset_coContactForceEventThreshold(this.__wbg_ptr, A);
452
452
  }
453
453
  coContainsPoint(A, I) {
454
- return K(I, y), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
454
+ return K(I, M), E.rawcolliderset_coContainsPoint(this.__wbg_ptr, A, I.__wbg_ptr) !== 0;
455
455
  }
456
- coCastShape(A, I, C, g, Q, B, i, o, w) {
457
- K(I, y), K(C, H), K(g, y), K(Q, u), K(B, y);
458
- const G = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, o, w);
459
- return G === 0 ? void 0 : RI.__wrap(G);
456
+ coCastShape(A, I, C, g, Q, B, i, o, h) {
457
+ K(I, M), K(C, H), K(g, M), K(Q, u), K(B, M);
458
+ const s = E.rawcolliderset_coCastShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i, o, h);
459
+ return s === 0 ? void 0 : RI.__wrap(s);
460
460
  }
461
461
  coCastCollider(A, I, C, g, Q, B, i) {
462
- K(I, y), K(g, y);
462
+ K(I, M), K(g, M);
463
463
  const o = E.rawcolliderset_coCastCollider(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q, B, i);
464
464
  return o === 0 ? void 0 : FI.__wrap(o);
465
465
  }
466
466
  coIntersectsShape(A, I, C, g) {
467
- return K(I, H), K(C, y), K(g, u), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
467
+ return K(I, H), K(C, M), K(g, u), E.rawcolliderset_coIntersectsShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr) !== 0;
468
468
  }
469
469
  coContactShape(A, I, C, g, Q) {
470
- K(I, H), K(C, y), K(g, u);
470
+ K(I, H), K(C, M), K(g, u);
471
471
  const B = E.rawcolliderset_coContactShape(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q);
472
472
  return B === 0 ? void 0 : gI.__wrap(B);
473
473
  }
@@ -476,18 +476,18 @@ class wA {
476
476
  return g === 0 ? void 0 : gI.__wrap(g);
477
477
  }
478
478
  coProjectPoint(A, I, C) {
479
- K(I, y);
479
+ K(I, M);
480
480
  const g = E.rawcolliderset_coProjectPoint(this.__wbg_ptr, A, I.__wbg_ptr, C);
481
481
  return MI.__wrap(g);
482
482
  }
483
483
  coIntersectsRay(A, I, C, g) {
484
- return K(I, y), K(C, y), E.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g) !== 0;
484
+ return K(I, M), K(C, M), E.rawcolliderset_coIntersectsRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g) !== 0;
485
485
  }
486
486
  coCastRay(A, I, C, g, Q) {
487
- return K(I, y), K(C, y), E.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
487
+ return K(I, M), K(C, M), E.rawcolliderset_coCastRay(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
488
488
  }
489
489
  coCastRayAndGetNormal(A, I, C, g, Q) {
490
- K(I, y), K(C, y);
490
+ K(I, M), K(C, M);
491
491
  const B = E.rawcolliderset_coCastRayAndGetNormal(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q);
492
492
  return B === 0 ? void 0 : UI.__wrap(B);
493
493
  }
@@ -540,7 +540,7 @@ class wA {
540
540
  E.rawcolliderset_coSetMass(this.__wbg_ptr, A, I);
541
541
  }
542
542
  coSetMassProperties(A, I, C, g) {
543
- K(C, y), E.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g);
543
+ K(C, M), E.rawcolliderset_coSetMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g);
544
544
  }
545
545
  constructor() {
546
546
  const A = E.rawcolliderset_new();
@@ -552,10 +552,10 @@ class wA {
552
552
  contains(A) {
553
553
  return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
554
554
  }
555
- createCollider(A, I, C, g, Q, B, i, o, w, G, h, s, a, N, S, F, M, R, Y, t, J, U, c, e) {
555
+ createCollider(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R, e, Y) {
556
556
  try {
557
557
  const b = E.__wbindgen_add_to_stack_pointer(-16);
558
- K(I, H), K(C, y), K(g, u), K(i, y), K(e, EA), E.rawcolliderset_createCollider(b, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, i.__wbg_ptr, o, w, G, h, s, a, N, S, F, M, R, Y, t, J, U, c, e.__wbg_ptr);
558
+ K(I, H), K(C, M), K(g, u), K(i, M), K(Y, EA), E.rawcolliderset_createCollider(b, this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B, i.__wbg_ptr, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R, e, Y.__wbg_ptr);
559
559
  var r = SA().getInt32(b + 0, !0), L = SA().getFloat64(b + 8, !0);
560
560
  return r === 0 ? void 0 : L;
561
561
  } finally {
@@ -563,7 +563,7 @@ class wA {
563
563
  }
564
564
  }
565
565
  remove(A, I, C, g) {
566
- K(I, nA), K(C, EA), E.rawcolliderset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
566
+ K(I, qA), K(C, EA), E.rawcolliderset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
567
567
  }
568
568
  isHandleValid(A) {
569
569
  return E.rawcolliderset_contains(this.__wbg_ptr, A) !== 0;
@@ -601,19 +601,19 @@ class FI {
601
601
  }
602
602
  witness1() {
603
603
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
604
- return y.__wrap(A);
604
+ return M.__wrap(A);
605
605
  }
606
606
  witness2() {
607
607
  const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
608
- return y.__wrap(A);
608
+ return M.__wrap(A);
609
609
  }
610
610
  normal1() {
611
611
  const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
612
- return y.__wrap(A);
612
+ return M.__wrap(A);
613
613
  }
614
614
  normal2() {
615
615
  const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
616
- return y.__wrap(A);
616
+ return M.__wrap(A);
617
617
  }
618
618
  }
619
619
  const Mg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -641,14 +641,14 @@ class _I {
641
641
  }
642
642
  total_force() {
643
643
  const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
644
- return y.__wrap(A);
644
+ return M.__wrap(A);
645
645
  }
646
646
  total_force_magnitude() {
647
647
  return E.rawcontactforceevent_total_force_magnitude(this.__wbg_ptr);
648
648
  }
649
649
  max_force_direction() {
650
650
  const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
651
- return y.__wrap(A);
651
+ return M.__wrap(A);
652
652
  }
653
653
  max_force_magnitude() {
654
654
  return E.rawcontactforceevent_max_force_magnitude(this.__wbg_ptr);
@@ -673,15 +673,15 @@ class $I {
673
673
  }
674
674
  normal() {
675
675
  const A = E.rawcontactmanifold_normal(this.__wbg_ptr);
676
- return y.__wrap(A);
676
+ return M.__wrap(A);
677
677
  }
678
678
  local_n1() {
679
679
  const A = E.rawcontactmanifold_local_n1(this.__wbg_ptr);
680
- return y.__wrap(A);
680
+ return M.__wrap(A);
681
681
  }
682
682
  local_n2() {
683
683
  const A = E.rawcontactmanifold_local_n2(this.__wbg_ptr);
684
- return y.__wrap(A);
684
+ return M.__wrap(A);
685
685
  }
686
686
  subshape1() {
687
687
  return E.rawcontactmanifold_subshape1(this.__wbg_ptr) >>> 0;
@@ -694,11 +694,11 @@ class $I {
694
694
  }
695
695
  contact_local_p1(A) {
696
696
  const I = E.rawcontactmanifold_contact_local_p1(this.__wbg_ptr, A);
697
- return I === 0 ? void 0 : y.__wrap(I);
697
+ return I === 0 ? void 0 : M.__wrap(I);
698
698
  }
699
699
  contact_local_p2(A) {
700
700
  const I = E.rawcontactmanifold_contact_local_p2(this.__wbg_ptr, A);
701
- return I === 0 ? void 0 : y.__wrap(I);
701
+ return I === 0 ? void 0 : M.__wrap(I);
702
702
  }
703
703
  contact_dist(A) {
704
704
  return E.rawcontactmanifold_contact_dist(this.__wbg_ptr, A);
@@ -720,7 +720,7 @@ class $I {
720
720
  }
721
721
  solver_contact_point(A) {
722
722
  const I = E.rawcontactmanifold_solver_contact_point(this.__wbg_ptr, A);
723
- return I === 0 ? void 0 : y.__wrap(I);
723
+ return I === 0 ? void 0 : M.__wrap(I);
724
724
  }
725
725
  solver_contact_dist(A) {
726
726
  return E.rawcontactmanifold_solver_contact_dist(this.__wbg_ptr, A);
@@ -733,7 +733,7 @@ class $I {
733
733
  }
734
734
  solver_contact_tangent_velocity(A) {
735
735
  const I = E.rawcontactmanifold_solver_contact_tangent_velocity(this.__wbg_ptr, A);
736
- return y.__wrap(I);
736
+ return M.__wrap(I);
737
737
  }
738
738
  }
739
739
  const Ug = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -816,7 +816,7 @@ class Ig {
816
816
  }
817
817
  takeGravity() {
818
818
  const A = E.rawdeserializedworld_takeGravity(this.__wbg_ptr);
819
- return A === 0 ? void 0 : y.__wrap(A);
819
+ return A === 0 ? void 0 : M.__wrap(A);
820
820
  }
821
821
  takeIntegrationParameters() {
822
822
  const A = E.rawdeserializedworld_takeIntegrationParameters(this.__wbg_ptr);
@@ -824,7 +824,7 @@ class Ig {
824
824
  }
825
825
  takeIslandManager() {
826
826
  const A = E.rawdeserializedworld_takeIslandManager(this.__wbg_ptr);
827
- return A === 0 ? void 0 : nA.__wrap(A);
827
+ return A === 0 ? void 0 : qA.__wrap(A);
828
828
  }
829
829
  takeBroadPhase() {
830
830
  const A = E.rawdeserializedworld_takeBroadPhase(this.__wbg_ptr);
@@ -903,43 +903,43 @@ class MA {
903
903
  E.__wbg_rawgenericjoint_free(A, 0);
904
904
  }
905
905
  static spring(A, I, C, g, Q) {
906
- K(g, y), K(Q, y);
906
+ K(g, M), K(Q, M);
907
907
  const B = E.rawgenericjoint_spring(A, I, C, g.__wbg_ptr, Q.__wbg_ptr);
908
908
  return MA.__wrap(B);
909
909
  }
910
910
  static rope(A, I, C) {
911
- K(I, y), K(C, y);
911
+ K(I, M), K(C, M);
912
912
  const g = E.rawgenericjoint_rope(A, I.__wbg_ptr, C.__wbg_ptr);
913
913
  return MA.__wrap(g);
914
914
  }
915
915
  static prismatic(A, I, C, g, Q, B) {
916
- K(A, y), K(I, y), K(C, y);
916
+ K(A, M), K(I, M), K(C, M);
917
917
  const i = E.rawgenericjoint_prismatic(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g, Q, B);
918
918
  return i === 0 ? void 0 : MA.__wrap(i);
919
919
  }
920
920
  static fixed(A, I, C, g) {
921
- K(A, y), K(I, u), K(C, y), K(g, u);
921
+ K(A, M), K(I, u), K(C, M), K(g, u);
922
922
  const Q = E.rawgenericjoint_fixed(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr);
923
923
  return MA.__wrap(Q);
924
924
  }
925
925
  static revolute(A, I) {
926
- K(A, y), K(I, y);
926
+ K(A, M), K(I, M);
927
927
  const C = E.rawgenericjoint_revolute(A.__wbg_ptr, I.__wbg_ptr);
928
928
  return C === 0 ? void 0 : MA.__wrap(C);
929
929
  }
930
930
  }
931
- const nI = typeof FinalizationRegistry > "u" ? { register: () => {
931
+ const qI = typeof FinalizationRegistry > "u" ? { register: () => {
932
932
  }, unregister: () => {
933
933
  } } : new FinalizationRegistry((D) => E.__wbg_rawimpulsejointset_free(D >>> 0, 1));
934
934
  class lA {
935
935
  static __wrap(A) {
936
936
  A >>>= 0;
937
937
  const I = Object.create(lA.prototype);
938
- return I.__wbg_ptr = A, nI.register(I, I.__wbg_ptr, I), I;
938
+ return I.__wbg_ptr = A, qI.register(I, I.__wbg_ptr, I), I;
939
939
  }
940
940
  __destroy_into_raw() {
941
941
  const A = this.__wbg_ptr;
942
- return this.__wbg_ptr = 0, nI.unregister(this), A;
942
+ return this.__wbg_ptr = 0, qI.unregister(this), A;
943
943
  }
944
944
  free() {
945
945
  const A = this.__destroy_into_raw();
@@ -964,17 +964,17 @@ class lA {
964
964
  }
965
965
  jointAnchor1(A) {
966
966
  const I = E.rawimpulsejointset_jointAnchor1(this.__wbg_ptr, A);
967
- return y.__wrap(I);
967
+ return M.__wrap(I);
968
968
  }
969
969
  jointAnchor2(A) {
970
970
  const I = E.rawimpulsejointset_jointAnchor2(this.__wbg_ptr, A);
971
- return y.__wrap(I);
971
+ return M.__wrap(I);
972
972
  }
973
973
  jointSetAnchor1(A, I) {
974
- K(I, y), E.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
974
+ K(I, M), E.rawimpulsejointset_jointSetAnchor1(this.__wbg_ptr, A, I.__wbg_ptr);
975
975
  }
976
976
  jointSetAnchor2(A, I) {
977
- K(I, y), E.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
977
+ K(I, M), E.rawimpulsejointset_jointSetAnchor2(this.__wbg_ptr, A, I.__wbg_ptr);
978
978
  }
979
979
  jointContactsEnabled(A) {
980
980
  return E.rawimpulsejointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
@@ -1008,7 +1008,7 @@ class lA {
1008
1008
  }
1009
1009
  constructor() {
1010
1010
  const A = E.rawimpulsejointset_new();
1011
- return this.__wbg_ptr = A >>> 0, nI.register(this, this.__wbg_ptr, this), this;
1011
+ return this.__wbg_ptr = A >>> 0, qI.register(this, this.__wbg_ptr, this), this;
1012
1012
  }
1013
1013
  createJoint(A, I, C, g) {
1014
1014
  return K(A, MA), E.rawimpulsejointset_createJoint(this.__wbg_ptr, A.__wbg_ptr, I, C, g);
@@ -1116,10 +1116,10 @@ class jA {
1116
1116
  const pI = typeof FinalizationRegistry > "u" ? { register: () => {
1117
1117
  }, unregister: () => {
1118
1118
  } } : new FinalizationRegistry((D) => E.__wbg_rawislandmanager_free(D >>> 0, 1));
1119
- class nA {
1119
+ class qA {
1120
1120
  static __wrap(A) {
1121
1121
  A >>>= 0;
1122
- const I = Object.create(nA.prototype);
1122
+ const I = Object.create(qA.prototype);
1123
1123
  return I.__wbg_ptr = A, pI.register(I, I.__wbg_ptr, I), I;
1124
1124
  }
1125
1125
  __destroy_into_raw() {
@@ -1160,10 +1160,10 @@ class LC {
1160
1160
  }
1161
1161
  up() {
1162
1162
  const A = E.rawcollidershapecasthit_normal2(this.__wbg_ptr);
1163
- return y.__wrap(A);
1163
+ return M.__wrap(A);
1164
1164
  }
1165
1165
  setUp(A) {
1166
- K(A, y), E.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
1166
+ K(A, M), E.rawkinematiccharactercontroller_setUp(this.__wbg_ptr, A.__wbg_ptr);
1167
1167
  }
1168
1168
  normalNudgeFactor() {
1169
1169
  return E.rawkinematiccharactercontroller_normalNudgeFactor(this.__wbg_ptr);
@@ -1229,16 +1229,16 @@ class LC {
1229
1229
  snapToGroundEnabled() {
1230
1230
  return E.rawkinematiccharactercontroller_snapToGroundEnabled(this.__wbg_ptr) !== 0;
1231
1231
  }
1232
- computeColliderMovement(A, I, C, g, Q, B, i, o, w, G, h, s) {
1232
+ computeColliderMovement(A, I, C, g, Q, B, i, o, h, s, G, w) {
1233
1233
  try {
1234
- K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i, y), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i.__wbg_ptr, o, q(w) ? 4294967297 : Math.fround(w), G, q(h) ? 4294967297 : h >>> 0, DA(s));
1234
+ K(I, bA), K(C, GA), K(g, EA), K(Q, wA), K(i, M), E.rawkinematiccharactercontroller_computeColliderMovement(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B, i.__wbg_ptr, o, n(h) ? 4294967297 : Math.fround(h), s, n(G) ? 4294967297 : G >>> 0, DA(w));
1235
1235
  } finally {
1236
1236
  v[CA++] = void 0;
1237
1237
  }
1238
1238
  }
1239
1239
  computedMovement() {
1240
1240
  const A = E.rawkinematiccharactercontroller_computedMovement(this.__wbg_ptr);
1241
- return y.__wrap(A);
1241
+ return M.__wrap(A);
1242
1242
  }
1243
1243
  computedGrounded() {
1244
1244
  return E.rawkinematiccharactercontroller_computedGrounded(this.__wbg_ptr) !== 0;
@@ -1280,11 +1280,11 @@ class HA {
1280
1280
  }
1281
1281
  jointAnchor1(A) {
1282
1282
  const I = E.rawmultibodyjointset_jointAnchor1(this.__wbg_ptr, A);
1283
- return y.__wrap(I);
1283
+ return M.__wrap(I);
1284
1284
  }
1285
1285
  jointAnchor2(A) {
1286
1286
  const I = E.rawmultibodyjointset_jointAnchor2(this.__wbg_ptr, A);
1287
- return y.__wrap(I);
1287
+ return M.__wrap(I);
1288
1288
  }
1289
1289
  jointContactsEnabled(A) {
1290
1290
  return E.rawmultibodyjointset_jointContactsEnabled(this.__wbg_ptr, A) !== 0;
@@ -1367,7 +1367,7 @@ class GA {
1367
1367
  const rg = typeof FinalizationRegistry > "u" ? { register: () => {
1368
1368
  }, unregister: () => {
1369
1369
  } } : new FinalizationRegistry((D) => E.__wbg_rawphysicspipeline_free(D >>> 0, 1));
1370
- class qC {
1370
+ class nC {
1371
1371
  __destroy_into_raw() {
1372
1372
  const A = this.__wbg_ptr;
1373
1373
  return this.__wbg_ptr = 0, rg.unregister(this), A;
@@ -1434,11 +1434,11 @@ class qC {
1434
1434
  timing_user_changes() {
1435
1435
  return E.rawphysicspipeline_timing_user_changes(this.__wbg_ptr);
1436
1436
  }
1437
- step(A, I, C, g, Q, B, i, o, w, G) {
1438
- K(A, y), K(I, jA), K(C, nA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(w, HA), K(G, WI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, G.__wbg_ptr);
1437
+ step(A, I, C, g, Q, B, i, o, h, s) {
1438
+ K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), E.rawphysicspipeline_step(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr);
1439
1439
  }
1440
- stepWithEvents(A, I, C, g, Q, B, i, o, w, G, h, s, a, N) {
1441
- K(A, y), K(I, jA), K(C, nA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(w, HA), K(G, WI), K(h, Xg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr, G.__wbg_ptr, h.__wbg_ptr, $(s), $(a), $(N));
1440
+ stepWithEvents(A, I, C, g, Q, B, i, o, h, s, G, w, a, N) {
1441
+ K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), K(s, WI), K(G, Xg), E.rawphysicspipeline_stepWithEvents(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr, s.__wbg_ptr, G.__wbg_ptr, $(w), $(a), $(N));
1442
1442
  }
1443
1443
  }
1444
1444
  const Lg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -1473,32 +1473,32 @@ class lC {
1473
1473
  E.rawpidcontroller_reset_integrals(this.__wbg_ptr);
1474
1474
  }
1475
1475
  apply_linear_correction(A, I, C, g, Q) {
1476
- K(I, EA), K(g, y), K(Q, y), E.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
1476
+ K(I, EA), K(g, M), K(Q, M), E.rawpidcontroller_apply_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
1477
1477
  }
1478
1478
  apply_angular_correction(A, I, C, g, Q) {
1479
1479
  K(I, EA), E.rawpidcontroller_apply_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
1480
1480
  }
1481
1481
  linear_correction(A, I, C, g, Q) {
1482
- K(I, EA), K(g, y), K(Q, y);
1482
+ K(I, EA), K(g, M), K(Q, M);
1483
1483
  const B = E.rawpidcontroller_linear_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g.__wbg_ptr, Q.__wbg_ptr);
1484
- return y.__wrap(B);
1484
+ return M.__wrap(B);
1485
1485
  }
1486
1486
  angular_correction(A, I, C, g, Q) {
1487
1487
  return K(I, EA), E.rawpidcontroller_angular_correction(this.__wbg_ptr, A, I.__wbg_ptr, C, g, Q);
1488
1488
  }
1489
1489
  }
1490
- const qg = typeof FinalizationRegistry > "u" ? { register: () => {
1490
+ const ng = typeof FinalizationRegistry > "u" ? { register: () => {
1491
1491
  }, unregister: () => {
1492
1492
  } } : new FinalizationRegistry((D) => E.__wbg_rawpointcolliderprojection_free(D >>> 0, 1));
1493
1493
  class GI {
1494
1494
  static __wrap(A) {
1495
1495
  A >>>= 0;
1496
1496
  const I = Object.create(GI.prototype);
1497
- return I.__wbg_ptr = A, qg.register(I, I.__wbg_ptr, I), I;
1497
+ return I.__wbg_ptr = A, ng.register(I, I.__wbg_ptr, I), I;
1498
1498
  }
1499
1499
  __destroy_into_raw() {
1500
1500
  const A = this.__wbg_ptr;
1501
- return this.__wbg_ptr = 0, qg.unregister(this), A;
1501
+ return this.__wbg_ptr = 0, ng.unregister(this), A;
1502
1502
  }
1503
1503
  free() {
1504
1504
  const A = this.__destroy_into_raw();
@@ -1509,7 +1509,7 @@ class GI {
1509
1509
  }
1510
1510
  point() {
1511
1511
  const A = E.rawpointcolliderprojection_point(this.__wbg_ptr);
1512
- return y.__wrap(A);
1512
+ return M.__wrap(A);
1513
1513
  }
1514
1514
  isInside() {
1515
1515
  return E.rawpointcolliderprojection_isInside(this.__wbg_ptr) !== 0;
@@ -1541,24 +1541,24 @@ class MI {
1541
1541
  }
1542
1542
  point() {
1543
1543
  const A = E.rawpointprojection_point(this.__wbg_ptr);
1544
- return y.__wrap(A);
1544
+ return M.__wrap(A);
1545
1545
  }
1546
1546
  isInside() {
1547
1547
  return E.rawpointprojection_isInside(this.__wbg_ptr) !== 0;
1548
1548
  }
1549
1549
  }
1550
- const ng = typeof FinalizationRegistry > "u" ? { register: () => {
1550
+ const qg = typeof FinalizationRegistry > "u" ? { register: () => {
1551
1551
  }, unregister: () => {
1552
1552
  } } : new FinalizationRegistry((D) => E.__wbg_rawraycolliderhit_free(D >>> 0, 1));
1553
1553
  class gg {
1554
1554
  static __wrap(A) {
1555
1555
  A >>>= 0;
1556
1556
  const I = Object.create(gg.prototype);
1557
- return I.__wbg_ptr = A, ng.register(I, I.__wbg_ptr, I), I;
1557
+ return I.__wbg_ptr = A, qg.register(I, I.__wbg_ptr, I), I;
1558
1558
  }
1559
1559
  __destroy_into_raw() {
1560
1560
  const A = this.__wbg_ptr;
1561
- return this.__wbg_ptr = 0, ng.unregister(this), A;
1561
+ return this.__wbg_ptr = 0, qg.unregister(this), A;
1562
1562
  }
1563
1563
  free() {
1564
1564
  const A = this.__destroy_into_raw();
@@ -1593,7 +1593,7 @@ class JI {
1593
1593
  }
1594
1594
  normal() {
1595
1595
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
1596
- return y.__wrap(A);
1596
+ return M.__wrap(A);
1597
1597
  }
1598
1598
  time_of_impact() {
1599
1599
  return E.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
@@ -1625,7 +1625,7 @@ class UI {
1625
1625
  }
1626
1626
  normal() {
1627
1627
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
1628
- return y.__wrap(A);
1628
+ return M.__wrap(A);
1629
1629
  }
1630
1630
  time_of_impact() {
1631
1631
  return E.rawcollidershapecasthit_time_of_impact(this.__wbg_ptr);
@@ -1657,7 +1657,7 @@ class EA {
1657
1657
  }
1658
1658
  rbTranslation(A) {
1659
1659
  const I = E.rawrigidbodyset_rbTranslation(this.__wbg_ptr, A);
1660
- return y.__wrap(I);
1660
+ return M.__wrap(I);
1661
1661
  }
1662
1662
  rbRotation(A) {
1663
1663
  const I = E.rawrigidbodyset_rbRotation(this.__wbg_ptr, A);
@@ -1674,7 +1674,7 @@ class EA {
1674
1674
  }
1675
1675
  rbNextTranslation(A) {
1676
1676
  const I = E.rawrigidbodyset_rbNextTranslation(this.__wbg_ptr, A);
1677
- return y.__wrap(I);
1677
+ return M.__wrap(I);
1678
1678
  }
1679
1679
  rbNextRotation(A) {
1680
1680
  const I = E.rawrigidbodyset_rbNextRotation(this.__wbg_ptr, A);
@@ -1687,7 +1687,7 @@ class EA {
1687
1687
  E.rawrigidbodyset_rbSetRotation(this.__wbg_ptr, A, I, C);
1688
1688
  }
1689
1689
  rbSetLinvel(A, I, C) {
1690
- K(I, y), E.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, C);
1690
+ K(I, M), E.rawrigidbodyset_rbSetLinvel(this.__wbg_ptr, A, I.__wbg_ptr, C);
1691
1691
  }
1692
1692
  rbSetAngvel(A, I, C) {
1693
1693
  E.rawrigidbodyset_rbSetAngvel(this.__wbg_ptr, A, I, C);
@@ -1705,19 +1705,19 @@ class EA {
1705
1705
  E.rawrigidbodyset_rbSetAdditionalMass(this.__wbg_ptr, A, I, C);
1706
1706
  }
1707
1707
  rbSetAdditionalMassProperties(A, I, C, g, Q) {
1708
- K(C, y), E.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g, Q);
1708
+ K(C, M), E.rawrigidbodyset_rbSetAdditionalMassProperties(this.__wbg_ptr, A, I, C.__wbg_ptr, g, Q);
1709
1709
  }
1710
1710
  rbLinvel(A) {
1711
1711
  const I = E.rawrigidbodyset_rbLinvel(this.__wbg_ptr, A);
1712
- return y.__wrap(I);
1712
+ return M.__wrap(I);
1713
1713
  }
1714
1714
  rbAngvel(A) {
1715
1715
  return E.rawrigidbodyset_rbAngvel(this.__wbg_ptr, A);
1716
1716
  }
1717
1717
  rbVelocityAtPoint(A, I) {
1718
- K(I, y);
1718
+ K(I, M);
1719
1719
  const C = E.rawrigidbodyset_rbVelocityAtPoint(this.__wbg_ptr, A, I.__wbg_ptr);
1720
- return y.__wrap(C);
1720
+ return M.__wrap(C);
1721
1721
  }
1722
1722
  rbLockTranslations(A, I, C) {
1723
1723
  E.rawrigidbodyset_rbLockTranslations(this.__wbg_ptr, A, I, C);
@@ -1748,15 +1748,15 @@ class EA {
1748
1748
  }
1749
1749
  rbEffectiveInvMass(A) {
1750
1750
  const I = E.rawrigidbodyset_rbEffectiveInvMass(this.__wbg_ptr, A);
1751
- return y.__wrap(I);
1751
+ return M.__wrap(I);
1752
1752
  }
1753
1753
  rbLocalCom(A) {
1754
1754
  const I = E.rawrigidbodyset_rbLocalCom(this.__wbg_ptr, A);
1755
- return y.__wrap(I);
1755
+ return M.__wrap(I);
1756
1756
  }
1757
1757
  rbWorldCom(A) {
1758
1758
  const I = E.rawrigidbodyset_rbWorldCom(this.__wbg_ptr, A);
1759
- return y.__wrap(I);
1759
+ return M.__wrap(I);
1760
1760
  }
1761
1761
  rbInvPrincipalInertia(A) {
1762
1762
  return E.rawrigidbodyset_rbInvPrincipalInertia(this.__wbg_ptr, A);
@@ -1831,10 +1831,10 @@ class EA {
1831
1831
  E.rawrigidbodyset_rbResetTorques(this.__wbg_ptr, A, I);
1832
1832
  }
1833
1833
  rbAddForce(A, I, C) {
1834
- K(I, y), E.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, C);
1834
+ K(I, M), E.rawrigidbodyset_rbAddForce(this.__wbg_ptr, A, I.__wbg_ptr, C);
1835
1835
  }
1836
1836
  rbApplyImpulse(A, I, C) {
1837
- K(I, y), E.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, C);
1837
+ K(I, M), E.rawrigidbodyset_rbApplyImpulse(this.__wbg_ptr, A, I.__wbg_ptr, C);
1838
1838
  }
1839
1839
  rbAddTorque(A, I, C) {
1840
1840
  E.rawrigidbodyset_rbAddTorque(this.__wbg_ptr, A, I, C);
@@ -1843,10 +1843,10 @@ class EA {
1843
1843
  E.rawrigidbodyset_rbApplyTorqueImpulse(this.__wbg_ptr, A, I, C);
1844
1844
  }
1845
1845
  rbAddForceAtPoint(A, I, C, g) {
1846
- K(I, y), K(C, y), E.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1846
+ K(I, M), K(C, M), E.rawrigidbodyset_rbAddForceAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1847
1847
  }
1848
1848
  rbApplyImpulseAtPoint(A, I, C, g) {
1849
- K(I, y), K(C, y), E.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1849
+ K(I, M), K(C, M), E.rawrigidbodyset_rbApplyImpulseAtPoint(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g);
1850
1850
  }
1851
1851
  rbAdditionalSolverIterations(A) {
1852
1852
  return E.rawrigidbodyset_rbAdditionalSolverIterations(this.__wbg_ptr, A) >>> 0;
@@ -1862,7 +1862,7 @@ class EA {
1862
1862
  }
1863
1863
  rbUserForce(A) {
1864
1864
  const I = E.rawrigidbodyset_rbUserForce(this.__wbg_ptr, A);
1865
- return y.__wrap(I);
1865
+ return M.__wrap(I);
1866
1866
  }
1867
1867
  rbUserTorque(A) {
1868
1868
  return E.rawrigidbodyset_rbUserTorque(this.__wbg_ptr, A);
@@ -1871,11 +1871,11 @@ class EA {
1871
1871
  const A = E.rawrigidbodyset_new();
1872
1872
  return this.__wbg_ptr = A >>> 0, bI.register(this, this.__wbg_ptr, this), this;
1873
1873
  }
1874
- createRigidBody(A, I, C, g, Q, B, i, o, w, G, h, s, a, N, S, F, M, R, Y, t, J, U) {
1875
- return K(I, y), K(C, u), K(i, y), K(o, y), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, i.__wbg_ptr, o.__wbg_ptr, w, G, h, s, a, N, S, F, M, R, Y, t, J, U);
1874
+ createRigidBody(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S, k, y, U, c, t, J, R) {
1875
+ return K(I, M), K(C, u), K(i, M), K(o, M), E.rawrigidbodyset_createRigidBody(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g, Q, B, i.__wbg_ptr, o.__wbg_ptr, h, s, G, w, a, N, S, k, y, U, c, t, J, R);
1876
1876
  }
1877
1877
  remove(A, I, C, g, Q) {
1878
- K(I, nA), K(C, wA), K(g, lA), K(Q, HA), E.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr);
1878
+ K(I, qA), K(C, wA), K(g, lA), K(Q, HA), E.rawrigidbodyset_remove(this.__wbg_ptr, A, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr);
1879
1879
  }
1880
1880
  len() {
1881
1881
  return E.rawrigidbodyset_len(this.__wbg_ptr) >>> 0;
@@ -1932,7 +1932,7 @@ class u {
1932
1932
  const fg = typeof FinalizationRegistry > "u" ? { register: () => {
1933
1933
  }, unregister: () => {
1934
1934
  } } : new FinalizationRegistry((D) => E.__wbg_rawserializationpipeline_free(D >>> 0, 1));
1935
- class nC {
1935
+ class qC {
1936
1936
  __destroy_into_raw() {
1937
1937
  const A = this.__wbg_ptr;
1938
1938
  return this.__wbg_ptr = 0, fg.unregister(this), A;
@@ -1945,8 +1945,8 @@ class nC {
1945
1945
  const A = E.rawccdsolver_new();
1946
1946
  return this.__wbg_ptr = A >>> 0, fg.register(this, this.__wbg_ptr, this), this;
1947
1947
  }
1948
- serializeAll(A, I, C, g, Q, B, i, o, w) {
1949
- return K(A, y), K(I, jA), K(C, nA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(w, HA), sI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, w.__wbg_ptr));
1948
+ serializeAll(A, I, C, g, Q, B, i, o, h) {
1949
+ return K(A, M), K(I, jA), K(C, qA), K(g, bA), K(Q, GA), K(B, EA), K(i, wA), K(o, lA), K(h, HA), sI(E.rawserializationpipeline_serializeAll(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o.__wbg_ptr, h.__wbg_ptr));
1950
1950
  }
1951
1951
  deserializeAll(A) {
1952
1952
  const I = E.rawserializationpipeline_deserializeAll(this.__wbg_ptr, $(A));
@@ -1983,7 +1983,7 @@ class H {
1983
1983
  return H.__wrap(I);
1984
1984
  }
1985
1985
  static halfspace(A) {
1986
- K(A, y);
1986
+ K(A, M);
1987
1987
  const I = E.rawshape_halfspace(A.__wbg_ptr);
1988
1988
  return H.__wrap(I);
1989
1989
  }
@@ -1992,12 +1992,12 @@ class H {
1992
1992
  return H.__wrap(C);
1993
1993
  }
1994
1994
  static voxels(A, I) {
1995
- K(A, y);
1995
+ K(A, M);
1996
1996
  const C = LI(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxels(A.__wbg_ptr, C, g);
1997
1997
  return H.__wrap(Q);
1998
1998
  }
1999
1999
  static voxelsFromPoints(A, I) {
2000
- K(A, y);
2000
+ K(A, M);
2001
2001
  const C = dA(I, E.__wbindgen_export_2), g = UA, Q = E.rawshape_voxelsFromPoints(A.__wbg_ptr, C, g);
2002
2002
  return H.__wrap(Q);
2003
2003
  }
@@ -2011,22 +2011,22 @@ class H {
2011
2011
  }
2012
2012
  static heightfield(A, I) {
2013
2013
  const C = dA(A, E.__wbindgen_export_2), g = UA;
2014
- K(I, y);
2014
+ K(I, M);
2015
2015
  const Q = E.rawshape_heightfield(C, g, I.__wbg_ptr);
2016
2016
  return H.__wrap(Q);
2017
2017
  }
2018
2018
  static segment(A, I) {
2019
- K(A, y), K(I, y);
2019
+ K(A, M), K(I, M);
2020
2020
  const C = E.rawshape_segment(A.__wbg_ptr, I.__wbg_ptr);
2021
2021
  return H.__wrap(C);
2022
2022
  }
2023
2023
  static triangle(A, I, C) {
2024
- K(A, y), K(I, y), K(C, y);
2024
+ K(A, M), K(I, M), K(C, M);
2025
2025
  const g = E.rawshape_triangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr);
2026
2026
  return H.__wrap(g);
2027
2027
  }
2028
2028
  static roundTriangle(A, I, C, g) {
2029
- K(A, y), K(I, y), K(C, y);
2029
+ K(A, M), K(I, M), K(C, M);
2030
2030
  const Q = E.rawshape_roundTriangle(A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
2031
2031
  return H.__wrap(Q);
2032
2032
  }
@@ -2046,35 +2046,35 @@ class H {
2046
2046
  const C = dA(A, E.__wbindgen_export_2), g = UA, Q = E.rawshape_roundConvexPolyline(C, g, I);
2047
2047
  return Q === 0 ? void 0 : H.__wrap(Q);
2048
2048
  }
2049
- castShape(A, I, C, g, Q, B, i, o, w, G) {
2050
- K(A, y), K(I, u), K(C, y), K(g, H), K(Q, y), K(B, u), K(i, y);
2051
- const h = E.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, w, G);
2052
- return h === 0 ? void 0 : RI.__wrap(h);
2049
+ castShape(A, I, C, g, Q, B, i, o, h, s) {
2050
+ K(A, M), K(I, u), K(C, M), K(g, H), K(Q, M), K(B, u), K(i, M);
2051
+ const G = E.rawshape_castShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B.__wbg_ptr, i.__wbg_ptr, o, h, s);
2052
+ return G === 0 ? void 0 : RI.__wrap(G);
2053
2053
  }
2054
2054
  intersectsShape(A, I, C, g, Q) {
2055
- return K(A, y), K(I, u), K(C, H), K(g, y), K(Q, u), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
2055
+ return K(A, M), K(I, u), K(C, H), K(g, M), K(Q, u), E.rawshape_intersectsShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr) !== 0;
2056
2056
  }
2057
2057
  contactShape(A, I, C, g, Q, B) {
2058
- K(A, y), K(I, u), K(C, H), K(g, y), K(Q, u);
2058
+ K(A, M), K(I, u), K(C, H), K(g, M), K(Q, u);
2059
2059
  const i = E.rawshape_contactShape(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q.__wbg_ptr, B);
2060
2060
  return i === 0 ? void 0 : gI.__wrap(i);
2061
2061
  }
2062
2062
  containsPoint(A, I, C) {
2063
- return K(A, y), K(I, u), K(C, y), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
2063
+ return K(A, M), K(I, u), K(C, M), E.rawshape_containsPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr) !== 0;
2064
2064
  }
2065
2065
  projectPoint(A, I, C, g) {
2066
- K(A, y), K(I, u), K(C, y);
2066
+ K(A, M), K(I, u), K(C, M);
2067
2067
  const Q = E.rawshape_projectPoint(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g);
2068
2068
  return MI.__wrap(Q);
2069
2069
  }
2070
2070
  intersectsRay(A, I, C, g, Q) {
2071
- return K(A, y), K(I, u), K(C, y), K(g, y), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
2071
+ return K(A, M), K(I, u), K(C, M), K(g, M), E.rawshape_intersectsRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q) !== 0;
2072
2072
  }
2073
2073
  castRay(A, I, C, g, Q, B) {
2074
- return K(A, y), K(I, u), K(C, y), K(g, y), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2074
+ return K(A, M), K(I, u), K(C, M), K(g, M), E.rawshape_castRay(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2075
2075
  }
2076
2076
  castRayAndGetNormal(A, I, C, g, Q, B) {
2077
- K(A, y), K(I, u), K(C, y), K(g, y);
2077
+ K(A, M), K(I, u), K(C, M), K(g, M);
2078
2078
  const i = E.rawshape_castRayAndGetNormal(this.__wbg_ptr, A.__wbg_ptr, I.__wbg_ptr, C.__wbg_ptr, g.__wbg_ptr, Q, B);
2079
2079
  return i === 0 ? void 0 : UI.__wrap(i);
2080
2080
  }
@@ -2101,19 +2101,19 @@ class RI {
2101
2101
  }
2102
2102
  witness1() {
2103
2103
  const A = E.rawshapecasthit_witness1(this.__wbg_ptr);
2104
- return y.__wrap(A);
2104
+ return M.__wrap(A);
2105
2105
  }
2106
2106
  witness2() {
2107
2107
  const A = E.rawcollidershapecasthit_witness1(this.__wbg_ptr);
2108
- return y.__wrap(A);
2108
+ return M.__wrap(A);
2109
2109
  }
2110
2110
  normal1() {
2111
2111
  const A = E.rawcollidershapecasthit_witness2(this.__wbg_ptr);
2112
- return y.__wrap(A);
2112
+ return M.__wrap(A);
2113
2113
  }
2114
2114
  normal2() {
2115
2115
  const A = E.rawcollidershapecasthit_normal1(this.__wbg_ptr);
2116
- return y.__wrap(A);
2116
+ return M.__wrap(A);
2117
2117
  }
2118
2118
  }
2119
2119
  const Zg = typeof FinalizationRegistry > "u" ? { register: () => {
@@ -2138,28 +2138,28 @@ class gI {
2138
2138
  }
2139
2139
  point1() {
2140
2140
  const A = E.rawpointprojection_point(this.__wbg_ptr);
2141
- return y.__wrap(A);
2141
+ return M.__wrap(A);
2142
2142
  }
2143
2143
  point2() {
2144
2144
  const A = E.rawpointcolliderprojection_point(this.__wbg_ptr);
2145
- return y.__wrap(A);
2145
+ return M.__wrap(A);
2146
2146
  }
2147
2147
  normal1() {
2148
2148
  const A = E.rawcontactforceevent_total_force(this.__wbg_ptr);
2149
- return y.__wrap(A);
2149
+ return M.__wrap(A);
2150
2150
  }
2151
2151
  normal2() {
2152
2152
  const A = E.rawcharactercollision_translationDeltaApplied(this.__wbg_ptr);
2153
- return y.__wrap(A);
2153
+ return M.__wrap(A);
2154
2154
  }
2155
2155
  }
2156
2156
  const TI = typeof FinalizationRegistry > "u" ? { register: () => {
2157
2157
  }, unregister: () => {
2158
2158
  } } : new FinalizationRegistry((D) => E.__wbg_rawvector_free(D >>> 0, 1));
2159
- class y {
2159
+ class M {
2160
2160
  static __wrap(A) {
2161
2161
  A >>>= 0;
2162
- const I = Object.create(y.prototype);
2162
+ const I = Object.create(M.prototype);
2163
2163
  return I.__wbg_ptr = A, TI.register(I, I.__wbg_ptr, I), I;
2164
2164
  }
2165
2165
  __destroy_into_raw() {
@@ -2172,7 +2172,7 @@ class y {
2172
2172
  }
2173
2173
  static zero() {
2174
2174
  const A = E.rawvector_zero();
2175
- return y.__wrap(A);
2175
+ return M.__wrap(A);
2176
2176
  }
2177
2177
  constructor(A, I) {
2178
2178
  const C = E.rawvector_new(A, I);
@@ -2192,11 +2192,11 @@ class y {
2192
2192
  }
2193
2193
  xy() {
2194
2194
  const A = E.rawvector_xy(this.__wbg_ptr);
2195
- return y.__wrap(A);
2195
+ return M.__wrap(A);
2196
2196
  }
2197
2197
  yx() {
2198
2198
  const A = E.rawvector_yx(this.__wbg_ptr);
2199
- return y.__wrap(A);
2199
+ return M.__wrap(A);
2200
2200
  }
2201
2201
  }
2202
2202
  async function vg(D) {
@@ -2221,8 +2221,8 @@ async function vg(D) {
2221
2221
  return $(j(Q).call(j(B), j(i), j(o)));
2222
2222
  }, arguments);
2223
2223
  }, g.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() {
2224
- return hI(function(Q, B, i, o, w) {
2225
- return $(j(Q).call(j(B), j(i), j(o), j(w)));
2224
+ return hI(function(Q, B, i, o, h) {
2225
+ return $(j(Q).call(j(B), j(i), j(o), j(h)));
2226
2226
  }, arguments);
2227
2227
  }, g.wbg.__wbg_length_3b4f022188ae8db6 = function(Q) {
2228
2228
  return j(Q).length;
@@ -2252,16 +2252,16 @@ async function vg(D) {
2252
2252
  j(Q).set(j(B), i >>> 0);
2253
2253
  }, g.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
2254
2254
  const Q = typeof global > "u" ? null : global;
2255
- return q(Q) ? 0 : $(Q);
2255
+ return n(Q) ? 0 : $(Q);
2256
2256
  }, g.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
2257
2257
  const Q = typeof globalThis > "u" ? null : globalThis;
2258
- return q(Q) ? 0 : $(Q);
2258
+ return n(Q) ? 0 : $(Q);
2259
2259
  }, g.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
2260
2260
  const Q = typeof self > "u" ? null : self;
2261
- return q(Q) ? 0 : $(Q);
2261
+ return n(Q) ? 0 : $(Q);
2262
2262
  }, g.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
2263
2263
  const Q = typeof window > "u" ? null : window;
2264
- return q(Q) ? 0 : $(Q);
2264
+ return n(Q) ? 0 : $(Q);
2265
2265
  }, g.wbg.__wbindgen_boolean_get = function(Q) {
2266
2266
  const B = j(Q);
2267
2267
  return typeof B == "boolean" ? B ? 1 : 0 : 2;
@@ -2273,7 +2273,7 @@ async function vg(D) {
2273
2273
  return $(E.memory);
2274
2274
  }, g.wbg.__wbindgen_number_get = function(Q, B) {
2275
2275
  const i = j(B), o = typeof i == "number" ? i : void 0;
2276
- SA().setFloat64(Q + 8, q(o) ? 0 : o, !0), SA().setInt32(Q + 0, !q(o), !0);
2276
+ SA().setFloat64(Q + 8, n(o) ? 0 : o, !0), SA().setInt32(Q + 0, !n(o), !0);
2277
2277
  }, g.wbg.__wbindgen_number_new = function(Q) {
2278
2278
  return $(Q);
2279
2279
  }, g.wbg.__wbindgen_object_clone_ref = function(Q) {
@@ -2310,20 +2310,20 @@ class ug {
2310
2310
  this.x = A, this.y = I;
2311
2311
  }
2312
2312
  }
2313
- class k {
2313
+ class F {
2314
2314
  static new(A, I) {
2315
2315
  return new ug(A, I);
2316
2316
  }
2317
2317
  static zeros() {
2318
- return k.new(0, 0);
2318
+ return F.new(0, 0);
2319
2319
  }
2320
2320
  static fromRaw(A) {
2321
2321
  if (!A) return null;
2322
- let I = k.new(A.x, A.y);
2322
+ let I = F.new(A.x, A.y);
2323
2323
  return A.free(), I;
2324
2324
  }
2325
2325
  static intoRaw(A) {
2326
- return new y(A.x, A.y);
2326
+ return new M(A.x, A.y);
2327
2327
  }
2328
2328
  static copy(A, I) {
2329
2329
  A.x = I.x, A.y = I.y;
@@ -2391,7 +2391,7 @@ class PI {
2391
2391
  }
2392
2392
  translation() {
2393
2393
  let A = this.rawSet.rbTranslation(this.handle);
2394
- return k.fromRaw(A);
2394
+ return F.fromRaw(A);
2395
2395
  }
2396
2396
  rotation() {
2397
2397
  let A = this.rawSet.rbRotation(this.handle);
@@ -2399,7 +2399,7 @@ class PI {
2399
2399
  }
2400
2400
  nextTranslation() {
2401
2401
  let A = this.rawSet.rbNextTranslation(this.handle);
2402
- return k.fromRaw(A);
2402
+ return F.fromRaw(A);
2403
2403
  }
2404
2404
  nextRotation() {
2405
2405
  let A = this.rawSet.rbNextRotation(this.handle);
@@ -2409,7 +2409,7 @@ class PI {
2409
2409
  this.rawSet.rbSetTranslation(this.handle, A.x, A.y, I);
2410
2410
  }
2411
2411
  setLinvel(A, I) {
2412
- let C = k.intoRaw(A);
2412
+ let C = F.intoRaw(A);
2413
2413
  this.rawSet.rbSetLinvel(this.handle, C, I), C.free();
2414
2414
  }
2415
2415
  gravityScale() {
@@ -2431,11 +2431,11 @@ class PI {
2431
2431
  this.rawSet.rbSetNextKinematicRotation(this.handle, A);
2432
2432
  }
2433
2433
  linvel() {
2434
- return k.fromRaw(this.rawSet.rbLinvel(this.handle));
2434
+ return F.fromRaw(this.rawSet.rbLinvel(this.handle));
2435
2435
  }
2436
2436
  velocityAtPoint(A) {
2437
- const I = k.intoRaw(A);
2438
- let C = k.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2437
+ const I = F.intoRaw(A);
2438
+ let C = F.fromRaw(this.rawSet.rbVelocityAtPoint(this.handle, I));
2439
2439
  return I.free(), C;
2440
2440
  }
2441
2441
  angvel() {
@@ -2445,16 +2445,16 @@ class PI {
2445
2445
  return this.rawSet.rbMass(this.handle);
2446
2446
  }
2447
2447
  effectiveInvMass() {
2448
- return k.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
2448
+ return F.fromRaw(this.rawSet.rbEffectiveInvMass(this.handle));
2449
2449
  }
2450
2450
  invMass() {
2451
2451
  return this.rawSet.rbInvMass(this.handle);
2452
2452
  }
2453
2453
  localCom() {
2454
- return k.fromRaw(this.rawSet.rbLocalCom(this.handle));
2454
+ return F.fromRaw(this.rawSet.rbLocalCom(this.handle));
2455
2455
  }
2456
2456
  worldCom() {
2457
- return k.fromRaw(this.rawSet.rbWorldCom(this.handle));
2457
+ return F.fromRaw(this.rawSet.rbWorldCom(this.handle));
2458
2458
  }
2459
2459
  invPrincipalInertia() {
2460
2460
  return this.rawSet.rbInvPrincipalInertia(this.handle);
@@ -2526,7 +2526,7 @@ class PI {
2526
2526
  this.rawSet.rbSetAdditionalMass(this.handle, A, I);
2527
2527
  }
2528
2528
  setAdditionalMassProperties(A, I, C, g) {
2529
- let Q = k.intoRaw(I);
2529
+ let Q = F.intoRaw(I);
2530
2530
  this.rawSet.rbSetAdditionalMassProperties(this.handle, A, Q, C, g), Q.free();
2531
2531
  }
2532
2532
  setAngularDamping(A) {
@@ -2539,11 +2539,11 @@ class PI {
2539
2539
  this.rawSet.rbResetTorques(this.handle, A);
2540
2540
  }
2541
2541
  addForce(A, I) {
2542
- const C = k.intoRaw(A);
2542
+ const C = F.intoRaw(A);
2543
2543
  this.rawSet.rbAddForce(this.handle, C, I), C.free();
2544
2544
  }
2545
2545
  applyImpulse(A, I) {
2546
- const C = k.intoRaw(A);
2546
+ const C = F.intoRaw(A);
2547
2547
  this.rawSet.rbApplyImpulse(this.handle, C, I), C.free();
2548
2548
  }
2549
2549
  addTorque(A, I) {
@@ -2553,15 +2553,15 @@ class PI {
2553
2553
  this.rawSet.rbApplyTorqueImpulse(this.handle, A, I);
2554
2554
  }
2555
2555
  addForceAtPoint(A, I, C) {
2556
- const g = k.intoRaw(A), Q = k.intoRaw(I);
2556
+ const g = F.intoRaw(A), Q = F.intoRaw(I);
2557
2557
  this.rawSet.rbAddForceAtPoint(this.handle, g, Q, C), g.free(), Q.free();
2558
2558
  }
2559
2559
  applyImpulseAtPoint(A, I, C) {
2560
- const g = k.intoRaw(A), Q = k.intoRaw(I);
2560
+ const g = F.intoRaw(A), Q = F.intoRaw(I);
2561
2561
  this.rawSet.rbApplyImpulseAtPoint(this.handle, g, Q, C), g.free(), Q.free();
2562
2562
  }
2563
2563
  userForce() {
2564
- return k.fromRaw(this.rawSet.rbUserForce(this.handle));
2564
+ return F.fromRaw(this.rawSet.rbUserForce(this.handle));
2565
2565
  }
2566
2566
  userTorque() {
2567
2567
  return this.rawSet.rbUserTorque(this.handle);
@@ -2569,7 +2569,7 @@ class PI {
2569
2569
  }
2570
2570
  class rA {
2571
2571
  constructor(A) {
2572
- this.enabled = !0, this.status = A, this.translation = k.zeros(), this.rotation = AA.identity(), this.gravityScale = 1, this.linvel = k.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = k.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
2572
+ this.enabled = !0, this.status = A, this.translation = F.zeros(), this.rotation = AA.identity(), this.gravityScale = 1, this.linvel = F.zeros(), this.mass = 0, this.massOnly = !1, this.centerOfMass = F.zeros(), this.translationsEnabledX = !0, this.translationsEnabledY = !0, this.angvel = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0, this.linearDamping = 0, this.angularDamping = 0, this.canSleep = !0, this.sleeping = !1, this.ccdEnabled = !1, this.softCcdPrediction = 0, this.dominanceGroup = 0, this.additionalSolverIterations = 0;
2573
2573
  }
2574
2574
  static dynamic() {
2575
2575
  return new rA(YA.Dynamic);
@@ -2625,7 +2625,7 @@ class rA {
2625
2625
  return this.angvel = A, this;
2626
2626
  }
2627
2627
  setAdditionalMassProperties(A, I, C) {
2628
- return this.mass = A, k.copy(this.centerOfMass, I), this.principalAngularInertia = C, this.massOnly = !1, this;
2628
+ return this.mass = A, F.copy(this.centerOfMass, I), this.principalAngularInertia = C, this.massOnly = !1, this;
2629
2629
  }
2630
2630
  enabledTranslations(A, I) {
2631
2631
  return this.translationsEnabledX = A, this.translationsEnabledY = I, this;
@@ -2707,7 +2707,7 @@ class Pg {
2707
2707
  this.map.forEach((I) => I.finalizeDeserialization(A));
2708
2708
  }
2709
2709
  createRigidBody(A, I) {
2710
- let C = k.intoRaw(I.translation), g = AA.intoRaw(I.rotation), Q = k.intoRaw(I.linvel), B = k.intoRaw(I.centerOfMass), i = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
2710
+ let C = F.intoRaw(I.translation), g = AA.intoRaw(I.rotation), Q = F.intoRaw(I.linvel), B = F.intoRaw(I.centerOfMass), i = this.raw.createRigidBody(I.enabled, C, g, I.gravityScale, I.mass, I.massOnly, B, Q, I.angvel, I.principalAngularInertia, I.translationsEnabledX, I.translationsEnabledY, I.rotationsEnabled, I.linearDamping, I.angularDamping, I.status, I.canSleep, I.sleeping, I.softCcdPrediction, I.ccdEnabled, I.dominanceGroup, I.additionalSolverIterations);
2711
2711
  C.free(), g.free(), Q.free(), B.free();
2712
2712
  const o = new PI(this.raw, A, i);
2713
2713
  return o.userData = I.userData, this.map.set(i, o), o;
@@ -2842,17 +2842,17 @@ class pA {
2842
2842
  return this.rawSet.jointType(this.handle);
2843
2843
  }
2844
2844
  anchor1() {
2845
- return k.fromRaw(this.rawSet.jointAnchor1(this.handle));
2845
+ return F.fromRaw(this.rawSet.jointAnchor1(this.handle));
2846
2846
  }
2847
2847
  anchor2() {
2848
- return k.fromRaw(this.rawSet.jointAnchor2(this.handle));
2848
+ return F.fromRaw(this.rawSet.jointAnchor2(this.handle));
2849
2849
  }
2850
2850
  setAnchor1(A) {
2851
- const I = k.intoRaw(A);
2851
+ const I = F.intoRaw(A);
2852
2852
  this.rawSet.jointSetAnchor1(this.handle, I), I.free();
2853
2853
  }
2854
2854
  setAnchor2(A) {
2855
- const I = k.intoRaw(A);
2855
+ const I = F.intoRaw(A);
2856
2856
  this.rawSet.jointSetAnchor2(this.handle, I), I.free();
2857
2857
  }
2858
2858
  setContactsEnabled(A) {
@@ -2928,11 +2928,11 @@ class OA {
2928
2928
  return g.anchor1 = A, g.anchor2 = I, g.axis = C, g.jointType = RA.Prismatic, g;
2929
2929
  }
2930
2930
  intoRaw() {
2931
- let A, I, C = k.intoRaw(this.anchor1), g = k.intoRaw(this.anchor2), Q = !1, B = 0, i = 0;
2931
+ let A, I, C = F.intoRaw(this.anchor1), g = F.intoRaw(this.anchor2), Q = !1, B = 0, i = 0;
2932
2932
  switch (this.jointType) {
2933
2933
  case RA.Fixed:
2934
- let o = AA.intoRaw(this.frame1), w = AA.intoRaw(this.frame2);
2935
- I = MA.fixed(C, o, g, w), o.free(), w.free();
2934
+ let o = AA.intoRaw(this.frame1), h = AA.intoRaw(this.frame2);
2935
+ I = MA.fixed(C, o, g, h), o.free(), h.free();
2936
2936
  break;
2937
2937
  case RA.Spring:
2938
2938
  I = MA.spring(this.length, this.stiffness, this.damping, C, g);
@@ -2941,7 +2941,7 @@ class OA {
2941
2941
  I = MA.rope(this.length, C, g);
2942
2942
  break;
2943
2943
  case RA.Prismatic:
2944
- A = k.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], i = this.limits[1]), I = MA.prismatic(C, g, A, Q, B, i), A.free();
2944
+ A = F.intoRaw(this.axis), this.limitsEnabled && (Q = !0, B = this.limits[0], i = this.limits[1]), I = MA.prismatic(C, g, A, Q, B, i), A.free();
2945
2945
  break;
2946
2946
  case RA.Revolute:
2947
2947
  I = MA.revolute(C, g);
@@ -3085,7 +3085,7 @@ class iC {
3085
3085
  }
3086
3086
  class DC {
3087
3087
  constructor(A) {
3088
- this.raw = A || new nA();
3088
+ this.raw = A || new qA();
3089
3089
  }
3090
3090
  free() {
3091
3091
  this.raw && this.raw.free(), this.raw = void 0;
@@ -3111,7 +3111,7 @@ class EI {
3111
3111
  }
3112
3112
  static fromRaw(A) {
3113
3113
  if (!A) return null;
3114
- const I = new EI(A.time_of_impact(), k.fromRaw(A.normal()), A.featureType(), A.featureId());
3114
+ const I = new EI(A.time_of_impact(), F.fromRaw(A.normal()), A.featureType(), A.featureId());
3115
3115
  return A.free(), I;
3116
3116
  }
3117
3117
  }
@@ -3121,7 +3121,7 @@ class QI {
3121
3121
  }
3122
3122
  static fromRaw(A, I) {
3123
3123
  if (!I) return null;
3124
- const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(), k.fromRaw(I.normal()), I.featureType(), I.featureId());
3124
+ const C = new QI(A.get(I.colliderHandle()), I.time_of_impact(), F.fromRaw(I.normal()), I.featureType(), I.featureId());
3125
3125
  return I.free(), C;
3126
3126
  }
3127
3127
  }
@@ -3141,7 +3141,7 @@ class iI {
3141
3141
  }
3142
3142
  static fromRaw(A) {
3143
3143
  if (!A) return null;
3144
- const I = new iI(k.fromRaw(A.point()), A.isInside());
3144
+ const I = new iI(F.fromRaw(A.point()), A.isInside());
3145
3145
  return A.free(), I;
3146
3146
  }
3147
3147
  }
@@ -3151,7 +3151,7 @@ class BI {
3151
3151
  }
3152
3152
  static fromRaw(A, I) {
3153
3153
  if (!I) return null;
3154
- const C = new BI(A.get(I.colliderHandle()), k.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3154
+ const C = new BI(A.get(I.colliderHandle()), F.fromRaw(I.point()), I.isInside(), I.featureType(), I.featureId());
3155
3155
  return I.free(), C;
3156
3156
  }
3157
3157
  }
@@ -3161,7 +3161,7 @@ class PA {
3161
3161
  }
3162
3162
  static fromRaw(A, I) {
3163
3163
  if (!I) return null;
3164
- const C = new PA(I.time_of_impact(), k.fromRaw(I.witness1()), k.fromRaw(I.witness2()), k.fromRaw(I.normal1()), k.fromRaw(I.normal2()));
3164
+ const C = new PA(I.time_of_impact(), F.fromRaw(I.witness1()), F.fromRaw(I.witness2()), F.fromRaw(I.normal1()), F.fromRaw(I.normal2()));
3165
3165
  return I.free(), C;
3166
3166
  }
3167
3167
  }
@@ -3171,7 +3171,7 @@ class DI extends PA {
3171
3171
  }
3172
3172
  static fromRaw(A, I) {
3173
3173
  if (!I) return null;
3174
- const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(), k.fromRaw(I.witness1()), k.fromRaw(I.witness2()), k.fromRaw(I.normal1()), k.fromRaw(I.normal2()));
3174
+ const C = new DI(A.get(I.colliderHandle()), I.time_of_impact(), F.fromRaw(I.witness1()), F.fromRaw(I.witness2()), F.fromRaw(I.normal1()), F.fromRaw(I.normal2()));
3175
3175
  return I.free(), C;
3176
3176
  }
3177
3177
  }
@@ -3182,44 +3182,44 @@ class oC {
3182
3182
  free() {
3183
3183
  this.raw && this.raw.free(), this.raw = void 0;
3184
3184
  }
3185
- castRay(A, I, C, g, Q, B, i, o, w, G, h) {
3186
- let s = k.intoRaw(g.origin), a = k.intoRaw(g.dir), N = cI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, s, a, Q, B, i, o, w, G, h));
3187
- return s.free(), a.free(), N;
3185
+ castRay(A, I, C, g, Q, B, i, o, h, s, G) {
3186
+ let w = F.intoRaw(g.origin), a = F.intoRaw(g.dir), N = cI.fromRaw(C, this.raw.castRay(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
3187
+ return w.free(), a.free(), N;
3188
3188
  }
3189
- castRayAndGetNormal(A, I, C, g, Q, B, i, o, w, G, h) {
3190
- let s = k.intoRaw(g.origin), a = k.intoRaw(g.dir), N = QI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, s, a, Q, B, i, o, w, G, h));
3191
- return s.free(), a.free(), N;
3189
+ castRayAndGetNormal(A, I, C, g, Q, B, i, o, h, s, G) {
3190
+ let w = F.intoRaw(g.origin), a = F.intoRaw(g.dir), N = QI.fromRaw(C, this.raw.castRayAndGetNormal(A.raw, I.raw, C.raw, w, a, Q, B, i, o, h, s, G));
3191
+ return w.free(), a.free(), N;
3192
3192
  }
3193
- intersectionsWithRay(A, I, C, g, Q, B, i, o, w, G, h, s) {
3194
- let a = k.intoRaw(g.origin), N = k.intoRaw(g.dir);
3195
- this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, N, Q, B, (S) => i(QI.fromRaw(C, S)), o, w, G, h, s), a.free(), N.free();
3193
+ intersectionsWithRay(A, I, C, g, Q, B, i, o, h, s, G, w) {
3194
+ let a = F.intoRaw(g.origin), N = F.intoRaw(g.dir);
3195
+ this.raw.intersectionsWithRay(A.raw, I.raw, C.raw, a, N, Q, B, (S) => i(QI.fromRaw(C, S)), o, h, s, G, w), a.free(), N.free();
3196
3196
  }
3197
- intersectionWithShape(A, I, C, g, Q, B, i, o, w, G, h) {
3198
- let s = k.intoRaw(g), a = AA.intoRaw(Q), N = B.intoRaw(), S = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, s, a, N, i, o, w, G, h);
3199
- return s.free(), a.free(), N.free(), S;
3197
+ intersectionWithShape(A, I, C, g, Q, B, i, o, h, s, G) {
3198
+ let w = F.intoRaw(g), a = AA.intoRaw(Q), N = B.intoRaw(), S = this.raw.intersectionWithShape(A.raw, I.raw, C.raw, w, a, N, i, o, h, s, G);
3199
+ return w.free(), a.free(), N.free(), S;
3200
3200
  }
3201
- projectPoint(A, I, C, g, Q, B, i, o, w, G) {
3202
- let h = k.intoRaw(g), s = BI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, h, Q, B, i, o, w, G));
3203
- return h.free(), s;
3201
+ projectPoint(A, I, C, g, Q, B, i, o, h, s) {
3202
+ let G = F.intoRaw(g), w = BI.fromRaw(C, this.raw.projectPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s));
3203
+ return G.free(), w;
3204
3204
  }
3205
- projectPointAndGetFeature(A, I, C, g, Q, B, i, o, w) {
3206
- let G = k.intoRaw(g), h = BI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, G, Q, B, i, o, w));
3207
- return G.free(), h;
3205
+ projectPointAndGetFeature(A, I, C, g, Q, B, i, o, h) {
3206
+ let s = F.intoRaw(g), G = BI.fromRaw(C, this.raw.projectPointAndGetFeature(A.raw, I.raw, C.raw, s, Q, B, i, o, h));
3207
+ return s.free(), G;
3208
3208
  }
3209
- intersectionsWithPoint(A, I, C, g, Q, B, i, o, w, G) {
3210
- let h = k.intoRaw(g);
3211
- this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, h, Q, B, i, o, w, G), h.free();
3209
+ intersectionsWithPoint(A, I, C, g, Q, B, i, o, h, s) {
3210
+ let G = F.intoRaw(g);
3211
+ this.raw.intersectionsWithPoint(A.raw, I.raw, C.raw, G, Q, B, i, o, h, s), G.free();
3212
3212
  }
3213
- castShape(A, I, C, g, Q, B, i, o, w, G, h, s, a, N, S) {
3214
- let F = k.intoRaw(g), M = AA.intoRaw(Q), R = k.intoRaw(B), Y = i.intoRaw(), t = DI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, F, M, R, Y, o, w, G, h, s, a, N, S));
3215
- return F.free(), M.free(), R.free(), Y.free(), t;
3213
+ castShape(A, I, C, g, Q, B, i, o, h, s, G, w, a, N, S) {
3214
+ let k = F.intoRaw(g), y = AA.intoRaw(Q), U = F.intoRaw(B), c = i.intoRaw(), t = DI.fromRaw(C, this.raw.castShape(A.raw, I.raw, C.raw, k, y, U, c, o, h, s, G, w, a, N, S));
3215
+ return k.free(), y.free(), U.free(), c.free(), t;
3216
3216
  }
3217
- intersectionsWithShape(A, I, C, g, Q, B, i, o, w, G, h, s) {
3218
- let a = k.intoRaw(g), N = AA.intoRaw(Q), S = B.intoRaw();
3219
- this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, N, S, i, o, w, G, h, s), a.free(), N.free(), S.free();
3217
+ intersectionsWithShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
3218
+ let a = F.intoRaw(g), N = AA.intoRaw(Q), S = B.intoRaw();
3219
+ this.raw.intersectionsWithShape(A.raw, I.raw, C.raw, a, N, S, i, o, h, s, G, w), a.free(), N.free(), S.free();
3220
3220
  }
3221
3221
  collidersWithAabbIntersectingAabb(A, I, C, g, Q, B) {
3222
- let i = k.intoRaw(g), o = k.intoRaw(Q);
3222
+ let i = F.intoRaw(g), o = F.intoRaw(Q);
3223
3223
  this.raw.collidersWithAabbIntersectingAabb(A.raw, I.raw, C.raw, i, o, B), i.free(), o.free();
3224
3224
  }
3225
3225
  }
@@ -3257,13 +3257,13 @@ class hC {
3257
3257
  this.raw && this.raw.free(), this.raw = void 0;
3258
3258
  }
3259
3259
  normal() {
3260
- return k.fromRaw(this.raw.normal());
3260
+ return F.fromRaw(this.raw.normal());
3261
3261
  }
3262
3262
  localNormal1() {
3263
- return k.fromRaw(this.raw.local_n1());
3263
+ return F.fromRaw(this.raw.local_n1());
3264
3264
  }
3265
3265
  localNormal2() {
3266
- return k.fromRaw(this.raw.local_n2());
3266
+ return F.fromRaw(this.raw.local_n2());
3267
3267
  }
3268
3268
  subshape1() {
3269
3269
  return this.raw.subshape1();
@@ -3275,10 +3275,10 @@ class hC {
3275
3275
  return this.raw.num_contacts();
3276
3276
  }
3277
3277
  localContactPoint1(A) {
3278
- return k.fromRaw(this.raw.contact_local_p1(A));
3278
+ return F.fromRaw(this.raw.contact_local_p1(A));
3279
3279
  }
3280
3280
  localContactPoint2(A) {
3281
- return k.fromRaw(this.raw.contact_local_p2(A));
3281
+ return F.fromRaw(this.raw.contact_local_p2(A));
3282
3282
  }
3283
3283
  contactDist(A) {
3284
3284
  return this.raw.contact_dist(A);
@@ -3299,7 +3299,7 @@ class hC {
3299
3299
  return this.raw.num_solver_contacts();
3300
3300
  }
3301
3301
  solverContactPoint(A) {
3302
- return k.fromRaw(this.raw.solver_contact_point(A));
3302
+ return F.fromRaw(this.raw.solver_contact_point(A));
3303
3303
  }
3304
3304
  solverContactDist(A) {
3305
3305
  return this.raw.solver_contact_dist(A);
@@ -3311,7 +3311,7 @@ class hC {
3311
3311
  return this.raw.solver_contact_restitution(A);
3312
3312
  }
3313
3313
  solverContactTangentVelocity(A) {
3314
- return k.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3314
+ return F.fromRaw(this.raw.solver_contact_tangent_velocity(A));
3315
3315
  }
3316
3316
  }
3317
3317
  class uA {
@@ -3320,14 +3320,14 @@ class uA {
3320
3320
  }
3321
3321
  static fromRaw(A) {
3322
3322
  if (!A) return null;
3323
- const I = new uA(A.distance(), k.fromRaw(A.point1()), k.fromRaw(A.point2()), k.fromRaw(A.normal1()), k.fromRaw(A.normal2()));
3323
+ const I = new uA(A.distance(), F.fromRaw(A.point1()), F.fromRaw(A.point2()), F.fromRaw(A.normal1()), F.fromRaw(A.normal2()));
3324
3324
  return A.free(), I;
3325
3325
  }
3326
3326
  }
3327
3327
  class yA {
3328
3328
  static fromRaw(A, I) {
3329
3329
  const C = A.coShapeType(I);
3330
- let g, Q, B, i, o, w, G;
3330
+ let g, Q, B, i, o, h, s;
3331
3331
  switch (C) {
3332
3332
  case FA.Ball:
3333
3333
  return new Bg(A.coRadius(I));
@@ -3336,20 +3336,20 @@ class yA {
3336
3336
  case FA.RoundCuboid:
3337
3337
  return g = A.coHalfExtents(I), Q = A.coRoundRadius(I), new Dg(g.x, g.y, Q);
3338
3338
  case FA.Capsule:
3339
- return o = A.coHalfHeight(I), w = A.coRadius(I), new og(o, w);
3339
+ return o = A.coHalfHeight(I), h = A.coRadius(I), new og(o, h);
3340
3340
  case FA.Segment:
3341
- return B = A.coVertices(I), new wg(k.new(B[0], B[1]), k.new(B[2], B[3]));
3341
+ return B = A.coVertices(I), new wg(F.new(B[0], B[1]), F.new(B[2], B[3]));
3342
3342
  case FA.Polyline:
3343
3343
  return B = A.coVertices(I), i = A.coIndices(I), new Gg(B, i);
3344
3344
  case FA.Triangle:
3345
- return B = A.coVertices(I), new hg(k.new(B[0], B[1]), k.new(B[2], B[3]), k.new(B[4], B[5]));
3345
+ return B = A.coVertices(I), new hg(F.new(B[0], B[1]), F.new(B[2], B[3]), F.new(B[4], B[5]));
3346
3346
  case FA.RoundTriangle:
3347
- return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(k.new(B[0], B[1]), k.new(B[2], B[3]), k.new(B[4], B[5]), Q);
3347
+ return B = A.coVertices(I), Q = A.coRoundRadius(I), new sg(F.new(B[0], B[1]), F.new(B[2], B[3]), F.new(B[4], B[5]), Q);
3348
3348
  case FA.HalfSpace:
3349
- return G = k.fromRaw(A.coHalfspaceNormal(I)), new Eg(G);
3349
+ return s = F.fromRaw(A.coHalfspaceNormal(I)), new Eg(s);
3350
3350
  case FA.Voxels:
3351
- const h = A.coVoxelData(I), s = A.coVoxelSize(I);
3352
- return new ag(h, s);
3351
+ const G = A.coVoxelData(I), w = A.coVoxelSize(I);
3352
+ return new ag(G, w);
3353
3353
  case FA.TriMesh:
3354
3354
  B = A.coVertices(I), i = A.coIndices(I);
3355
3355
  const a = A.coTriMeshFlags(I);
@@ -3365,37 +3365,37 @@ class yA {
3365
3365
  throw new Error("unknown shape type: " + C);
3366
3366
  }
3367
3367
  }
3368
- castShape(A, I, C, g, Q, B, i, o, w, G) {
3369
- let h = k.intoRaw(A), s = AA.intoRaw(I), a = k.intoRaw(C), N = k.intoRaw(Q), S = AA.intoRaw(B), F = k.intoRaw(i), M = this.intoRaw(), R = g.intoRaw(), Y = PA.fromRaw(null, M.castShape(h, s, a, R, N, S, F, o, w, G));
3370
- return h.free(), s.free(), a.free(), N.free(), S.free(), F.free(), M.free(), R.free(), Y;
3368
+ castShape(A, I, C, g, Q, B, i, o, h, s) {
3369
+ let G = F.intoRaw(A), w = AA.intoRaw(I), a = F.intoRaw(C), N = F.intoRaw(Q), S = AA.intoRaw(B), k = F.intoRaw(i), y = this.intoRaw(), U = g.intoRaw(), c = PA.fromRaw(null, y.castShape(G, w, a, U, N, S, k, o, h, s));
3370
+ return G.free(), w.free(), a.free(), N.free(), S.free(), k.free(), y.free(), U.free(), c;
3371
3371
  }
3372
3372
  intersectsShape(A, I, C, g, Q) {
3373
- let B = k.intoRaw(A), i = AA.intoRaw(I), o = k.intoRaw(g), w = AA.intoRaw(Q), G = this.intoRaw(), h = C.intoRaw(), s = G.intersectsShape(B, i, h, o, w);
3374
- return B.free(), i.free(), o.free(), w.free(), G.free(), h.free(), s;
3373
+ let B = F.intoRaw(A), i = AA.intoRaw(I), o = F.intoRaw(g), h = AA.intoRaw(Q), s = this.intoRaw(), G = C.intoRaw(), w = s.intersectsShape(B, i, G, o, h);
3374
+ return B.free(), i.free(), o.free(), h.free(), s.free(), G.free(), w;
3375
3375
  }
3376
3376
  contactShape(A, I, C, g, Q, B) {
3377
- let i = k.intoRaw(A), o = AA.intoRaw(I), w = k.intoRaw(g), G = AA.intoRaw(Q), h = this.intoRaw(), s = C.intoRaw(), a = uA.fromRaw(h.contactShape(i, o, s, w, G, B));
3378
- return i.free(), o.free(), w.free(), G.free(), h.free(), s.free(), a;
3377
+ let i = F.intoRaw(A), o = AA.intoRaw(I), h = F.intoRaw(g), s = AA.intoRaw(Q), G = this.intoRaw(), w = C.intoRaw(), a = uA.fromRaw(G.contactShape(i, o, w, h, s, B));
3378
+ return i.free(), o.free(), h.free(), s.free(), G.free(), w.free(), a;
3379
3379
  }
3380
3380
  containsPoint(A, I, C) {
3381
- let g = k.intoRaw(A), Q = AA.intoRaw(I), B = k.intoRaw(C), i = this.intoRaw(), o = i.containsPoint(g, Q, B);
3381
+ let g = F.intoRaw(A), Q = AA.intoRaw(I), B = F.intoRaw(C), i = this.intoRaw(), o = i.containsPoint(g, Q, B);
3382
3382
  return g.free(), Q.free(), B.free(), i.free(), o;
3383
3383
  }
3384
3384
  projectPoint(A, I, C, g) {
3385
- let Q = k.intoRaw(A), B = AA.intoRaw(I), i = k.intoRaw(C), o = this.intoRaw(), w = iI.fromRaw(o.projectPoint(Q, B, i, g));
3386
- return Q.free(), B.free(), i.free(), o.free(), w;
3385
+ let Q = F.intoRaw(A), B = AA.intoRaw(I), i = F.intoRaw(C), o = this.intoRaw(), h = iI.fromRaw(o.projectPoint(Q, B, i, g));
3386
+ return Q.free(), B.free(), i.free(), o.free(), h;
3387
3387
  }
3388
3388
  intersectsRay(A, I, C, g) {
3389
- let Q = k.intoRaw(I), B = AA.intoRaw(C), i = k.intoRaw(A.origin), o = k.intoRaw(A.dir), w = this.intoRaw(), G = w.intersectsRay(Q, B, i, o, g);
3390
- return Q.free(), B.free(), i.free(), o.free(), w.free(), G;
3389
+ let Q = F.intoRaw(I), B = AA.intoRaw(C), i = F.intoRaw(A.origin), o = F.intoRaw(A.dir), h = this.intoRaw(), s = h.intersectsRay(Q, B, i, o, g);
3390
+ return Q.free(), B.free(), i.free(), o.free(), h.free(), s;
3391
3391
  }
3392
3392
  castRay(A, I, C, g, Q) {
3393
- let B = k.intoRaw(I), i = AA.intoRaw(C), o = k.intoRaw(A.origin), w = k.intoRaw(A.dir), G = this.intoRaw(), h = G.castRay(B, i, o, w, g, Q);
3394
- return B.free(), i.free(), o.free(), w.free(), G.free(), h;
3393
+ let B = F.intoRaw(I), i = AA.intoRaw(C), o = F.intoRaw(A.origin), h = F.intoRaw(A.dir), s = this.intoRaw(), G = s.castRay(B, i, o, h, g, Q);
3394
+ return B.free(), i.free(), o.free(), h.free(), s.free(), G;
3395
3395
  }
3396
3396
  castRayAndGetNormal(A, I, C, g, Q) {
3397
- let B = k.intoRaw(I), i = AA.intoRaw(C), o = k.intoRaw(A.origin), w = k.intoRaw(A.dir), G = this.intoRaw(), h = EI.fromRaw(G.castRayAndGetNormal(B, i, o, w, g, Q));
3398
- return B.free(), i.free(), o.free(), w.free(), G.free(), h;
3397
+ let B = F.intoRaw(I), i = AA.intoRaw(C), o = F.intoRaw(A.origin), h = F.intoRaw(A.dir), s = this.intoRaw(), G = EI.fromRaw(s.castRayAndGetNormal(B, i, o, h, g, Q));
3398
+ return B.free(), i.free(), o.free(), h.free(), s.free(), G;
3399
3399
  }
3400
3400
  }
3401
3401
  (function(D) {
@@ -3416,13 +3416,13 @@ class Eg extends yA {
3416
3416
  super(), this.type = kA.HalfSpace, this.normal = A;
3417
3417
  }
3418
3418
  intoRaw() {
3419
- let A = k.intoRaw(this.normal), I = H.halfspace(A);
3419
+ let A = F.intoRaw(this.normal), I = H.halfspace(A);
3420
3420
  return A.free(), I;
3421
3421
  }
3422
3422
  }
3423
3423
  class ig extends yA {
3424
3424
  constructor(A, I) {
3425
- super(), this.type = kA.Cuboid, this.halfExtents = k.new(A, I);
3425
+ super(), this.type = kA.Cuboid, this.halfExtents = F.new(A, I);
3426
3426
  }
3427
3427
  intoRaw() {
3428
3428
  return H.cuboid(this.halfExtents.x, this.halfExtents.y);
@@ -3430,7 +3430,7 @@ class ig extends yA {
3430
3430
  }
3431
3431
  class Dg extends yA {
3432
3432
  constructor(A, I, C) {
3433
- super(), this.type = kA.RoundCuboid, this.halfExtents = k.new(A, I), this.borderRadius = C;
3433
+ super(), this.type = kA.RoundCuboid, this.halfExtents = F.new(A, I), this.borderRadius = C;
3434
3434
  }
3435
3435
  intoRaw() {
3436
3436
  return H.roundCuboid(this.halfExtents.x, this.halfExtents.y, this.borderRadius);
@@ -3449,7 +3449,7 @@ class wg extends yA {
3449
3449
  super(), this.type = kA.Segment, this.a = A, this.b = I;
3450
3450
  }
3451
3451
  intoRaw() {
3452
- let A = k.intoRaw(this.a), I = k.intoRaw(this.b), C = H.segment(A, I);
3452
+ let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = H.segment(A, I);
3453
3453
  return A.free(), I.free(), C;
3454
3454
  }
3455
3455
  }
@@ -3458,7 +3458,7 @@ class hg extends yA {
3458
3458
  super(), this.type = kA.Triangle, this.a = A, this.b = I, this.c = C;
3459
3459
  }
3460
3460
  intoRaw() {
3461
- let A = k.intoRaw(this.a), I = k.intoRaw(this.b), C = k.intoRaw(this.c), g = H.triangle(A, I, C);
3461
+ let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = F.intoRaw(this.c), g = H.triangle(A, I, C);
3462
3462
  return A.free(), I.free(), C.free(), g;
3463
3463
  }
3464
3464
  }
@@ -3467,7 +3467,7 @@ class sg extends yA {
3467
3467
  super(), this.type = kA.RoundTriangle, this.a = A, this.b = I, this.c = C, this.borderRadius = g;
3468
3468
  }
3469
3469
  intoRaw() {
3470
- let A = k.intoRaw(this.a), I = k.intoRaw(this.b), C = k.intoRaw(this.c), g = H.roundTriangle(A, I, C, this.borderRadius);
3470
+ let A = F.intoRaw(this.a), I = F.intoRaw(this.b), C = F.intoRaw(this.c), g = H.roundTriangle(A, I, C, this.borderRadius);
3471
3471
  return A.free(), I.free(), C.free(), g;
3472
3472
  }
3473
3473
  }
@@ -3484,7 +3484,7 @@ class ag extends yA {
3484
3484
  super(), this.type = kA.Voxels, this.data = A, this.voxelSize = I;
3485
3485
  }
3486
3486
  intoRaw() {
3487
- let A, I = k.intoRaw(this.voxelSize);
3487
+ let A, I = F.intoRaw(this.voxelSize);
3488
3488
  return A = this.data instanceof Int32Array ? H.voxels(I, this.data) : H.voxelsFromPoints(I, this.data), I.free(), A;
3489
3489
  }
3490
3490
  }
@@ -3517,33 +3517,33 @@ class Sg extends yA {
3517
3517
  super(), this.type = kA.HeightField, this.heights = A, this.scale = I;
3518
3518
  }
3519
3519
  intoRaw() {
3520
- let A = k.intoRaw(this.scale), I = H.heightfield(this.heights, A);
3520
+ let A = F.intoRaw(this.scale), I = H.heightfield(this.heights, A);
3521
3521
  return A.free(), I;
3522
3522
  }
3523
3523
  }
3524
3524
  class sC {
3525
3525
  constructor(A) {
3526
- this.raw = A || new qC();
3526
+ this.raw = A || new nC();
3527
3527
  }
3528
3528
  free() {
3529
3529
  this.raw && this.raw.free(), this.raw = void 0;
3530
3530
  }
3531
- step(A, I, C, g, Q, B, i, o, w, G, h, s) {
3532
- let a = k.intoRaw(A);
3533
- h ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, w.raw, G.raw, h.raw, s, s ? s.filterContactPair : null, s ? s.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, w.raw, G.raw), a.free();
3531
+ step(A, I, C, g, Q, B, i, o, h, s, G, w) {
3532
+ let a = F.intoRaw(A);
3533
+ G ? this.raw.stepWithEvents(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw, G.raw, w, w ? w.filterContactPair : null, w ? w.filterIntersectionPair : null) : this.raw.step(a, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw, s.raw), a.free();
3534
3534
  }
3535
3535
  }
3536
3536
  class VI {
3537
3537
  constructor(A) {
3538
- this.raw = A || new nC();
3538
+ this.raw = A || new qC();
3539
3539
  }
3540
3540
  free() {
3541
3541
  this.raw && this.raw.free(), this.raw = void 0;
3542
3542
  }
3543
- serializeAll(A, I, C, g, Q, B, i, o, w) {
3544
- let G = k.intoRaw(A);
3545
- const h = this.raw.serializeAll(G, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, w.raw);
3546
- return G.free(), h;
3543
+ serializeAll(A, I, C, g, Q, B, i, o, h) {
3544
+ let s = F.intoRaw(A);
3545
+ const G = this.raw.serializeAll(s, I.raw, C.raw, g.raw, Q.raw, B.raw, i.raw, o.raw, h.raw);
3546
+ return s.free(), G;
3547
3547
  }
3548
3548
  deserializeAll(A) {
3549
3549
  return YI.fromRaw(this.raw.deserializeAll(A));
@@ -3578,7 +3578,7 @@ class SC {
3578
3578
  return this.raw.up();
3579
3579
  }
3580
3580
  setUp(A) {
3581
- let I = k.intoRaw(A);
3581
+ let I = F.intoRaw(A);
3582
3582
  return this.raw.setUp(I);
3583
3583
  }
3584
3584
  applyImpulsesToDynamicBodies() {
@@ -3654,11 +3654,11 @@ class SC {
3654
3654
  return this.raw.snapToGroundEnabled();
3655
3655
  }
3656
3656
  computeColliderMovement(A, I, C, g, Q) {
3657
- let B = k.intoRaw(I);
3657
+ let B = F.intoRaw(I);
3658
3658
  this.raw.computeColliderMovement(this.params.dt, this.broadPhase.raw, this.narrowPhase.raw, this.bodies.raw, this.colliders.raw, A.handle, B, this._applyImpulsesToDynamicBodies, this._characterMass, C, g, this.colliders.castClosure(Q)), B.free();
3659
3659
  }
3660
3660
  computedMovement() {
3661
- return k.fromRaw(this.raw.computedMovement());
3661
+ return F.fromRaw(this.raw.computedMovement());
3662
3662
  }
3663
3663
  computedGrounded() {
3664
3664
  return this.raw.computedGrounded();
@@ -3669,7 +3669,7 @@ class SC {
3669
3669
  computedCollision(A, I) {
3670
3670
  if (this.raw.computedCollision(A, this.rawCharacterCollision)) {
3671
3671
  let C = this.rawCharacterCollision;
3672
- return (I = I ?? new KC()).translationDeltaApplied = k.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = k.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = k.fromRaw(C.worldWitness1()), I.witness2 = k.fromRaw(C.worldWitness2()), I.normal1 = k.fromRaw(C.worldNormal1()), I.normal2 = k.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
3672
+ return (I = I ?? new KC()).translationDeltaApplied = F.fromRaw(C.translationDeltaApplied()), I.translationDeltaRemaining = F.fromRaw(C.translationDeltaRemaining()), I.toi = C.toi(), I.witness1 = F.fromRaw(C.worldWitness1()), I.witness2 = F.fromRaw(C.worldWitness2()), I.normal1 = F.fromRaw(C.worldNormal1()), I.normal2 = F.fromRaw(C.worldNormal2()), I.collider = this.colliders.get(C.handle()), I;
3673
3673
  }
3674
3674
  return null;
3675
3675
  }
@@ -3700,29 +3700,29 @@ class NC {
3700
3700
  this.raw.reset_integrals();
3701
3701
  }
3702
3702
  applyLinearCorrection(A, I, C) {
3703
- let g = k.intoRaw(I), Q = k.intoRaw(C);
3703
+ let g = F.intoRaw(I), Q = F.intoRaw(C);
3704
3704
  this.raw.apply_linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q), g.free(), Q.free();
3705
3705
  }
3706
3706
  applyAngularCorrection(A, I, C) {
3707
3707
  this.raw.apply_angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
3708
3708
  }
3709
3709
  linearCorrection(A, I, C) {
3710
- let g = k.intoRaw(I), Q = k.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
3711
- return g.free(), Q.free(), k.fromRaw(B);
3710
+ let g = F.intoRaw(I), Q = F.intoRaw(C), B = this.raw.linear_correction(this.params.dt, this.bodies.raw, A.handle, g, Q);
3711
+ return g.free(), Q.free(), F.fromRaw(B);
3712
3712
  }
3713
3713
  angularCorrection(A, I, C) {
3714
3714
  return this.raw.angular_correction(this.params.dt, this.bodies.raw, A.handle, I, C);
3715
3715
  }
3716
3716
  }
3717
3717
  class YI {
3718
- constructor(A, I, C, g, Q, B, i, o, w, G, h, s, a) {
3719
- this.gravity = A, this.integrationParameters = new Vg(I), this.islands = new DC(C), this.broadPhase = new oC(g), this.narrowPhase = new wC(Q), this.bodies = new Pg(B), this.colliders = new yC(i), this.impulseJoints = new gC(o), this.multibodyJoints = new EC(w), this.ccdSolver = new iC(G), this.physicsPipeline = new sC(h), this.serializationPipeline = new VI(s), this.debugRenderPipeline = new aC(a), this.characterControllers = /* @__PURE__ */ new Set(), this.pidControllers = /* @__PURE__ */ new Set(), this.impulseJoints.finalizeDeserialization(this.bodies), this.bodies.finalizeDeserialization(this.colliders), this.colliders.finalizeDeserialization(this.bodies);
3718
+ constructor(A, I, C, g, Q, B, i, o, h, s, G, w, a) {
3719
+ this.gravity = A, this.integrationParameters = new Vg(I), this.islands = new DC(C), this.broadPhase = new oC(g), this.narrowPhase = new wC(Q), this.bodies = new Pg(B), this.colliders = new yC(i), this.impulseJoints = new gC(o), this.multibodyJoints = new EC(h), this.ccdSolver = new iC(s), this.physicsPipeline = new sC(G), this.serializationPipeline = new VI(w), this.debugRenderPipeline = new aC(a), this.characterControllers = /* @__PURE__ */ new Set(), this.pidControllers = /* @__PURE__ */ new Set(), this.impulseJoints.finalizeDeserialization(this.bodies), this.bodies.finalizeDeserialization(this.colliders), this.colliders.finalizeDeserialization(this.bodies);
3720
3720
  }
3721
3721
  free() {
3722
3722
  this.integrationParameters.free(), this.islands.free(), this.broadPhase.free(), this.narrowPhase.free(), this.bodies.free(), this.colliders.free(), this.impulseJoints.free(), this.multibodyJoints.free(), this.ccdSolver.free(), this.physicsPipeline.free(), this.serializationPipeline.free(), this.debugRenderPipeline.free(), this.characterControllers.forEach((A) => A.free()), this.pidControllers.forEach((A) => A.free()), this.integrationParameters = void 0, this.islands = void 0, this.broadPhase = void 0, this.narrowPhase = void 0, this.bodies = void 0, this.colliders = void 0, this.ccdSolver = void 0, this.impulseJoints = void 0, this.multibodyJoints = void 0, this.physicsPipeline = void 0, this.serializationPipeline = void 0, this.debugRenderPipeline = void 0, this.characterControllers = void 0, this.pidControllers = void 0;
3723
3723
  }
3724
3724
  static fromRaw(A) {
3725
- return A ? new YI(k.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
3725
+ return A ? new YI(F.fromRaw(A.takeGravity()), A.takeIntegrationParameters(), A.takeIslandManager(), A.takeBroadPhase(), A.takeNarrowPhase(), A.takeBodies(), A.takeColliders(), A.takeImpulseJoints(), A.takeMultibodyJoints()) : null;
3726
3726
  }
3727
3727
  takeSnapshot() {
3728
3728
  return this.serializationPipeline.serializeAll(this.gravity, this.integrationParameters, this.islands, this.broadPhase, this.narrowPhase, this.bodies, this.colliders, this.impulseJoints, this.multibodyJoints);
@@ -3835,12 +3835,12 @@ class YI {
3835
3835
  castRayAndGetNormal(A, I, C, g, Q, B, i, o) {
3836
3836
  return this.broadPhase.castRayAndGetNormal(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, i ? i.handle : null, this.colliders.castClosure(o));
3837
3837
  }
3838
- intersectionsWithRay(A, I, C, g, Q, B, i, o, w) {
3839
- this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(w));
3838
+ intersectionsWithRay(A, I, C, g, Q, B, i, o, h) {
3839
+ this.broadPhase.intersectionsWithRay(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(h));
3840
3840
  }
3841
3841
  intersectionWithShape(A, I, C, g, Q, B, i, o) {
3842
- let w = this.broadPhase.intersectionWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, i ? i.handle : null, this.colliders.castClosure(o));
3843
- return w != null ? this.colliders.get(w) : null;
3842
+ let h = this.broadPhase.intersectionWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B ? B.handle : null, i ? i.handle : null, this.colliders.castClosure(o));
3843
+ return h != null ? this.colliders.get(h) : null;
3844
3844
  }
3845
3845
  projectPoint(A, I, C, g, Q, B, i) {
3846
3846
  return this.broadPhase.projectPoint(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q ? Q.handle : null, B ? B.handle : null, this.colliders.castClosure(i));
@@ -3851,11 +3851,11 @@ class YI {
3851
3851
  intersectionsWithPoint(A, I, C, g, Q, B, i) {
3852
3852
  this.broadPhase.intersectionsWithPoint(this.narrowPhase, this.bodies, this.colliders, A, this.colliders.castClosure(I), C, g, Q ? Q.handle : null, B ? B.handle : null, this.colliders.castClosure(i));
3853
3853
  }
3854
- castShape(A, I, C, g, Q, B, i, o, w, G, h, s) {
3855
- return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i, o, w, G ? G.handle : null, h ? h.handle : null, this.colliders.castClosure(s));
3854
+ castShape(A, I, C, g, Q, B, i, o, h, s, G, w) {
3855
+ return this.broadPhase.castShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, g, Q, B, i, o, h, s ? s.handle : null, G ? G.handle : null, this.colliders.castClosure(w));
3856
3856
  }
3857
- intersectionsWithShape(A, I, C, g, Q, B, i, o, w) {
3858
- this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(w));
3857
+ intersectionsWithShape(A, I, C, g, Q, B, i, o, h) {
3858
+ this.broadPhase.intersectionsWithShape(this.narrowPhase, this.bodies, this.colliders, A, I, C, this.colliders.castClosure(g), Q, B, i ? i.handle : null, o ? o.handle : null, this.colliders.castClosure(h));
3859
3859
  }
3860
3860
  collidersWithAabbIntersectingAabb(A, I, C) {
3861
3861
  this.broadPhase.collidersWithAabbIntersectingAabb(this.narrowPhase, this.bodies, this.colliders, A, I, this.colliders.castClosure(C));
@@ -3941,13 +3941,13 @@ class kC {
3941
3941
  return this.raw.collider2();
3942
3942
  }
3943
3943
  totalForce() {
3944
- return k.fromRaw(this.raw.total_force());
3944
+ return F.fromRaw(this.raw.total_force());
3945
3945
  }
3946
3946
  totalForceMagnitude() {
3947
3947
  return this.raw.total_force_magnitude();
3948
3948
  }
3949
3949
  maxForceDirection() {
3950
- return k.fromRaw(this.raw.max_force_direction());
3950
+ return F.fromRaw(this.raw.max_force_direction());
3951
3951
  }
3952
3952
  maxForceMagnitude() {
3953
3953
  return this.raw.max_force_magnitude();
@@ -4002,10 +4002,10 @@ class zI {
4002
4002
  return this.colliderSet.raw.contains(this.handle);
4003
4003
  }
4004
4004
  translation() {
4005
- return k.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4005
+ return F.fromRaw(this.colliderSet.raw.coTranslation(this.handle));
4006
4006
  }
4007
4007
  translationWrtParent() {
4008
- return k.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4008
+ return F.fromRaw(this.colliderSet.raw.coTranslationWrtParent(this.handle));
4009
4009
  }
4010
4010
  rotation() {
4011
4011
  return AA.fromRaw(this.colliderSet.raw.coRotation(this.handle));
@@ -4090,7 +4090,7 @@ class zI {
4090
4090
  this.colliderSet.raw.coSetMass(this.handle, A);
4091
4091
  }
4092
4092
  setMassProperties(A, I, C) {
4093
- let g = k.intoRaw(I);
4093
+ let g = F.intoRaw(I);
4094
4094
  this.colliderSet.raw.coSetMassProperties(this.handle, A, g, C), g.free();
4095
4095
  }
4096
4096
  setTranslation(A) {
@@ -4109,10 +4109,10 @@ class zI {
4109
4109
  return this.colliderSet.raw.coShapeType(this.handle);
4110
4110
  }
4111
4111
  halfExtents() {
4112
- return k.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4112
+ return F.fromRaw(this.colliderSet.raw.coHalfExtents(this.handle));
4113
4113
  }
4114
4114
  setHalfExtents(A) {
4115
- const I = k.intoRaw(A);
4115
+ const I = F.intoRaw(A);
4116
4116
  this.colliderSet.raw.coSetHalfExtents(this.handle, I);
4117
4117
  }
4118
4118
  radius() {
@@ -4153,7 +4153,7 @@ class zI {
4153
4153
  }
4154
4154
  heightfieldScale() {
4155
4155
  let A = this.colliderSet.raw.coHeightfieldScale(this.handle);
4156
- return k.fromRaw(A);
4156
+ return F.fromRaw(A);
4157
4157
  }
4158
4158
  parent() {
4159
4159
  return this._parent;
@@ -4180,42 +4180,42 @@ class zI {
4180
4180
  return this.colliderSet.raw.coSolverGroups(this.handle);
4181
4181
  }
4182
4182
  containsPoint(A) {
4183
- let I = k.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
4183
+ let I = F.intoRaw(A), C = this.colliderSet.raw.coContainsPoint(this.handle, I);
4184
4184
  return I.free(), C;
4185
4185
  }
4186
4186
  projectPoint(A, I) {
4187
- let C = k.intoRaw(A), g = iI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
4187
+ let C = F.intoRaw(A), g = iI.fromRaw(this.colliderSet.raw.coProjectPoint(this.handle, C, I));
4188
4188
  return C.free(), g;
4189
4189
  }
4190
4190
  intersectsRay(A, I) {
4191
- let C = k.intoRaw(A.origin), g = k.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
4191
+ let C = F.intoRaw(A.origin), g = F.intoRaw(A.dir), Q = this.colliderSet.raw.coIntersectsRay(this.handle, C, g, I);
4192
4192
  return C.free(), g.free(), Q;
4193
4193
  }
4194
4194
  castShape(A, I, C, g, Q, B, i, o) {
4195
- let w = k.intoRaw(A), G = k.intoRaw(C), h = AA.intoRaw(g), s = k.intoRaw(Q), a = I.intoRaw(), N = PA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, w, a, G, h, s, B, i, o));
4196
- return w.free(), G.free(), h.free(), s.free(), a.free(), N;
4195
+ let h = F.intoRaw(A), s = F.intoRaw(C), G = AA.intoRaw(g), w = F.intoRaw(Q), a = I.intoRaw(), N = PA.fromRaw(this.colliderSet, this.colliderSet.raw.coCastShape(this.handle, h, a, s, G, w, B, i, o));
4196
+ return h.free(), s.free(), G.free(), w.free(), a.free(), N;
4197
4197
  }
4198
4198
  castCollider(A, I, C, g, Q, B) {
4199
- let i = k.intoRaw(A), o = k.intoRaw(C), w = DI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, i, I.handle, o, g, Q, B));
4200
- return i.free(), o.free(), w;
4199
+ let i = F.intoRaw(A), o = F.intoRaw(C), h = DI.fromRaw(this.colliderSet, this.colliderSet.raw.coCastCollider(this.handle, i, I.handle, o, g, Q, B));
4200
+ return i.free(), o.free(), h;
4201
4201
  }
4202
4202
  intersectsShape(A, I, C) {
4203
- let g = k.intoRaw(I), Q = AA.intoRaw(C), B = A.intoRaw(), i = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
4203
+ let g = F.intoRaw(I), Q = AA.intoRaw(C), B = A.intoRaw(), i = this.colliderSet.raw.coIntersectsShape(this.handle, B, g, Q);
4204
4204
  return g.free(), Q.free(), B.free(), i;
4205
4205
  }
4206
4206
  contactShape(A, I, C, g) {
4207
- let Q = k.intoRaw(I), B = AA.intoRaw(C), i = A.intoRaw(), o = uA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, i, Q, B, g));
4207
+ let Q = F.intoRaw(I), B = AA.intoRaw(C), i = A.intoRaw(), o = uA.fromRaw(this.colliderSet.raw.coContactShape(this.handle, i, Q, B, g));
4208
4208
  return Q.free(), B.free(), i.free(), o;
4209
4209
  }
4210
4210
  contactCollider(A, I) {
4211
4211
  return uA.fromRaw(this.colliderSet.raw.coContactCollider(this.handle, A.handle, I));
4212
4212
  }
4213
4213
  castRay(A, I, C) {
4214
- let g = k.intoRaw(A.origin), Q = k.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
4214
+ let g = F.intoRaw(A.origin), Q = F.intoRaw(A.dir), B = this.colliderSet.raw.coCastRay(this.handle, g, Q, I, C);
4215
4215
  return g.free(), Q.free(), B;
4216
4216
  }
4217
4217
  castRayAndGetNormal(A, I, C) {
4218
- let g = k.intoRaw(A.origin), Q = k.intoRaw(A.dir), B = EI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
4218
+ let g = F.intoRaw(A.origin), Q = F.intoRaw(A.dir), B = EI.fromRaw(this.colliderSet.raw.coCastRayAndGetNormal(this.handle, g, Q, I, C));
4219
4219
  return g.free(), Q.free(), B;
4220
4220
  }
4221
4221
  }
@@ -4224,7 +4224,7 @@ class zI {
4224
4224
  })(WA || (WA = {}));
4225
4225
  class KA {
4226
4226
  constructor(A) {
4227
- this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = AA.identity(), this.translation = k.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = CI.Average, this.restitutionCombineRule = CI.Average, this.activeCollisionTypes = SI.DEFAULT, this.activeEvents = aI.NONE, this.activeHooks = KI.NONE, this.mass = 0, this.centerOfMass = k.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
4227
+ this.enabled = !0, this.shape = A, this.massPropsMode = WA.Density, this.density = 1, this.friction = 0.5, this.restitution = 0, this.rotation = AA.identity(), this.translation = F.zeros(), this.isSensor = !1, this.collisionGroups = 4294967295, this.solverGroups = 4294967295, this.frictionCombineRule = CI.Average, this.restitutionCombineRule = CI.Average, this.activeCollisionTypes = SI.DEFAULT, this.activeEvents = aI.NONE, this.activeHooks = KI.NONE, this.mass = 0, this.centerOfMass = F.zeros(), this.contactForceEventThreshold = 0, this.contactSkin = 0, this.principalAngularInertia = 0, this.rotationsEnabled = !0;
4228
4228
  }
4229
4229
  static ball(A) {
4230
4230
  const I = new Bg(A);
@@ -4313,7 +4313,7 @@ class KA {
4313
4313
  return this.massPropsMode = WA.Mass, this.mass = A, this;
4314
4314
  }
4315
4315
  setMassProperties(A, I, C) {
4316
- return this.massPropsMode = WA.MassProps, this.mass = A, k.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
4316
+ return this.massPropsMode = WA.MassProps, this.mass = A, F.copy(this.centerOfMass, I), this.principalAngularInertia = C, this;
4317
4317
  }
4318
4318
  setRestitution(A) {
4319
4319
  return this.restitution = A, this;
@@ -4364,10 +4364,10 @@ class yC {
4364
4364
  createCollider(A, I, C) {
4365
4365
  let g = C != null && C != null;
4366
4366
  if (g && isNaN(C)) throw Error("Cannot create a collider with a parent rigid-body handle that is not a number.");
4367
- let Q = I.shape.intoRaw(), B = k.intoRaw(I.translation), i = AA.intoRaw(I.rotation), o = k.intoRaw(I.centerOfMass), w = this.raw.createCollider(I.enabled, Q, B, i, I.massPropsMode, I.mass, o, I.principalAngularInertia, I.density, I.friction, I.restitution, I.frictionCombineRule, I.restitutionCombineRule, I.isSensor, I.collisionGroups, I.solverGroups, I.activeCollisionTypes, I.activeHooks, I.activeEvents, I.contactForceEventThreshold, I.contactSkin, g, g ? C : 0, A.raw);
4367
+ let Q = I.shape.intoRaw(), B = F.intoRaw(I.translation), i = AA.intoRaw(I.rotation), o = F.intoRaw(I.centerOfMass), h = this.raw.createCollider(I.enabled, Q, B, i, I.massPropsMode, I.mass, o, I.principalAngularInertia, I.density, I.friction, I.restitution, I.frictionCombineRule, I.restitutionCombineRule, I.isSensor, I.collisionGroups, I.solverGroups, I.activeCollisionTypes, I.activeHooks, I.activeEvents, I.contactForceEventThreshold, I.contactSkin, g, g ? C : 0, A.raw);
4368
4368
  Q.free(), B.free(), i.free(), o.free();
4369
- let G = g ? A.get(C) : null, h = new zI(this, w, G, I.shape);
4370
- return this.map.set(w, h), h;
4369
+ let s = g ? A.get(C) : null, G = new zI(this, h, s, I.shape);
4370
+ return this.map.set(h, G), G;
4371
4371
  }
4372
4372
  remove(A, I, C, g) {
4373
4373
  this.raw.remove(A, I.raw, C.raw, g), this.unmap(A);
@@ -4393,24 +4393,24 @@ class yC {
4393
4393
  }
4394
4394
  function dC(D, A, I, C) {
4395
4395
  return new (I || (I = Promise))(function(g, Q) {
4396
- function B(w) {
4396
+ function B(h) {
4397
4397
  try {
4398
- o(C.next(w));
4399
- } catch (G) {
4400
- Q(G);
4398
+ o(C.next(h));
4399
+ } catch (s) {
4400
+ Q(s);
4401
4401
  }
4402
4402
  }
4403
- function i(w) {
4403
+ function i(h) {
4404
4404
  try {
4405
- o(C.throw(w));
4406
- } catch (G) {
4407
- Q(G);
4405
+ o(C.throw(h));
4406
+ } catch (s) {
4407
+ Q(s);
4408
4408
  }
4409
4409
  }
4410
- function o(w) {
4411
- var G;
4412
- w.done ? g(w.value) : (G = w.value, G instanceof I ? G : new I(function(h) {
4413
- h(G);
4410
+ function o(h) {
4411
+ var s;
4412
+ h.done ? g(h.value) : (s = h.value, s instanceof I ? s : new I(function(G) {
4413
+ G(s);
4414
4414
  })).then(B, i);
4415
4415
  }
4416
4416
  o((C = C.apply(D, [])).next());
@@ -4420,8 +4420,8 @@ for (var fC = { byteLength: function(D) {
4420
4420
  var A = Og(D), I = A[0], C = A[1];
4421
4421
  return 3 * (I + C) / 4 - C;
4422
4422
  }, toByteArray: function(D) {
4423
- var A, I, C = Og(D), g = C[0], Q = C[1], B = new bC(function(w, G, h) {
4424
- return 3 * (G + h) / 4 - h;
4423
+ var A, I, C = Og(D), g = C[0], Q = C[1], B = new bC(function(h, s, G) {
4424
+ return 3 * (s + G) / 4 - G;
4425
4425
  }(0, g, Q)), i = 0, o = Q > 0 ? g - 4 : g;
4426
4426
  for (I = 0; I < o; I += 4) A = tA[D.charCodeAt(I)] << 18 | tA[D.charCodeAt(I + 1)] << 12 | tA[D.charCodeAt(I + 2)] << 6 | tA[D.charCodeAt(I + 3)], B[i++] = A >> 16 & 255, B[i++] = A >> 8 & 255, B[i++] = 255 & A;
4427
4427
  return Q === 2 && (A = tA[D.charCodeAt(I)] << 2 | tA[D.charCodeAt(I + 1)] >> 4, B[i++] = 255 & A), Q === 1 && (A = tA[D.charCodeAt(I)] << 10 | tA[D.charCodeAt(I + 1)] << 4 | tA[D.charCodeAt(I + 2)] >> 2, B[i++] = A >> 8 & 255, B[i++] = 255 & A), B;
@@ -4462,7 +4462,7 @@ function jC(D) {
4462
4462
  A = D, E.reserve_memory(A);
4463
4463
  }
4464
4464
  tA[45] = 62, tA[95] = 63;
4465
- var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps: k, RotationOps: AA, get RigidBodyType() {
4465
+ var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector2: ug, VectorOps: F, RotationOps: AA, get RigidBodyType() {
4466
4466
  return YA;
4467
4467
  }, RigidBody: PI, RigidBodyDesc: rA, RigidBodySet: Pg, IntegrationParameters: Vg, get JointType() {
4468
4468
  return RA;
@@ -4495,10 +4495,10 @@ var JA = Object.freeze({ __proto__: null, version: WC, reserveMemory: jC, Vector
4495
4495
  }, PidController: NC });
4496
4496
  class mC {
4497
4497
  constructor() {
4498
- V(this, "world", null);
4499
- V(this, "bodies", /* @__PURE__ */ new Map());
4500
- V(this, "colliders", /* @__PURE__ */ new Map());
4501
- V(this, "initialized", !1);
4498
+ z(this, "world", null);
4499
+ z(this, "bodies", /* @__PURE__ */ new Map());
4500
+ z(this, "colliders", /* @__PURE__ */ new Map());
4501
+ z(this, "initialized", !1);
4502
4502
  }
4503
4503
  async init(A) {
4504
4504
  this.initialized || (await JA.init(), this.world = new JA.World(new JA.Vector2(A.x, A.y)), this.initialized = !0);
@@ -4598,42 +4598,42 @@ class mC {
4598
4598
  }
4599
4599
  class xC {
4600
4600
  constructor() {
4601
- V(this, "artboard", null);
4602
- V(this, "objectStates", /* @__PURE__ */ new Map());
4601
+ z(this, "artboard", null);
4602
+ z(this, "objectStates", /* @__PURE__ */ new Map());
4603
4603
  // Physics State
4604
- V(this, "physicsEngine", null);
4604
+ z(this, "physicsEngine", null);
4605
4605
  // State Machine State
4606
- V(this, "activeStateMachine", null);
4607
- V(this, "inputs", /* @__PURE__ */ new Map());
4606
+ z(this, "activeStateMachine", null);
4607
+ z(this, "inputs", /* @__PURE__ */ new Map());
4608
4608
  // id -> value
4609
- V(this, "inputNameMap", /* @__PURE__ */ new Map());
4609
+ z(this, "inputNameMap", /* @__PURE__ */ new Map());
4610
4610
  // name -> id[] mapping
4611
- V(this, "layerStates", /* @__PURE__ */ new Map());
4612
- V(this, "imageCache", /* @__PURE__ */ new Map());
4613
- V(this, "layout", { fit: "Contain", alignment: "Center" });
4614
- V(this, "onTrigger");
4615
- V(this, "onInputUpdate");
4616
- V(this, "onComponentChange");
4611
+ z(this, "layerStates", /* @__PURE__ */ new Map());
4612
+ z(this, "imageCache", /* @__PURE__ */ new Map());
4613
+ z(this, "layout", { fit: "Contain", alignment: "Center" });
4614
+ z(this, "onTrigger");
4615
+ z(this, "onInputUpdate");
4616
+ z(this, "onComponentChange");
4617
4617
  // Specific Component Listeners
4618
- V(this, "onToggle");
4619
- V(this, "onInputChange");
4620
- V(this, "onInputFocus");
4621
- V(this, "onInputBlur");
4618
+ z(this, "onToggle");
4619
+ z(this, "onInputChange");
4620
+ z(this, "onInputFocus");
4621
+ z(this, "onInputBlur");
4622
4622
  // Track triggers that were just fired in the current frame
4623
- V(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4623
+ z(this, "justFiredTriggers", /* @__PURE__ */ new Set());
4624
4624
  // Track currently hovered object for Enter/Leave events
4625
- V(this, "lastHoveredObjectId", null);
4626
- V(this, "_lastPointerPos", null);
4627
- V(this, "_prevPointerPos", null);
4625
+ z(this, "lastHoveredObjectId", null);
4626
+ z(this, "_lastPointerPos", null);
4627
+ z(this, "_prevPointerPos", null);
4628
4628
  // Interaction State
4629
- V(this, "focusedId", null);
4630
- V(this, "draggingSliderId", null);
4631
- V(this, "activeDropdownId", null);
4632
- V(this, "draggingListViewId", null);
4629
+ z(this, "focusedId", null);
4630
+ z(this, "draggingSliderId", null);
4631
+ z(this, "activeDropdownId", null);
4632
+ z(this, "draggingListViewId", null);
4633
4633
  // Physics/Animation State
4634
- V(this, "objectVelocities", /* @__PURE__ */ new Map());
4634
+ z(this, "objectVelocities", /* @__PURE__ */ new Map());
4635
4635
  // Trigger Management
4636
- V(this, "activeTriggers", /* @__PURE__ */ new Map());
4636
+ z(this, "activeTriggers", /* @__PURE__ */ new Map());
4637
4637
  }
4638
4638
  setTriggerCallback(A) {
4639
4639
  this.onTrigger = A;
@@ -4709,8 +4709,8 @@ class xC {
4709
4709
  ...I.transform,
4710
4710
  width: C,
4711
4711
  height: g,
4712
- cornerRadius: I.cornerRadius ?? I.corner_radius ?? I.geometry.cornerRadius ?? I.geometry.corner_radius,
4713
- opacity: I.opacity !== void 0 ? I.opacity : 1,
4712
+ corner_radius: I.corner_radius ?? I.cornerRadius ?? I.geometry.corner_radius ?? I.geometry.cornerRadius ?? 0,
4713
+ opacity: I.opacity !== void 0 ? I.opacity : 100,
4714
4714
  visible: I.visible !== void 0 ? I.visible : I.isVisible !== void 0 ? I.isVisible : !0,
4715
4715
  blendMode: I.blendMode || "Normal",
4716
4716
  // We need to store style state to animate it
@@ -4819,10 +4819,10 @@ class xC {
4819
4819
  const B = this.activeStateMachine.layers.find((i) => i.name === A);
4820
4820
  if (B)
4821
4821
  for (const i of I) {
4822
- const o = B.states.find((w) => w.id === i);
4822
+ const o = B.states.find((h) => h.id === i);
4823
4823
  if (o) {
4824
- let w = null;
4825
- o.animationId && (w = this.artboard.animations.find((G) => G.id === o.animationId) || null), w || (w = this.artboard.animations.find((G) => G.name === o.name || G.id === o.name || o.name === "Entry" && G.name === "Rotate") || null), w && (g.push({ animation: w, state: o }), Q = Math.max(Q, w.duration));
4824
+ let h = null;
4825
+ o.animationId && (h = this.artboard.animations.find((s) => s.id === o.animationId) || null), h || (h = this.artboard.animations.find((s) => s.name === o.name || s.id === o.name || o.name === "Entry" && s.name === "Rotate") || null), h && (g.push({ animation: h, state: o }), Q = Math.max(Q, h.duration));
4826
4826
  }
4827
4827
  }
4828
4828
  }
@@ -4856,22 +4856,22 @@ class xC {
4856
4856
  var B, i, o;
4857
4857
  let C;
4858
4858
  if (this.inputs.has(A)) {
4859
- const w = (B = this.activeStateMachine) == null ? void 0 : B.inputs.find((G) => G.id === A);
4860
- w && typeof w.value == "object" && (C = w.value.type);
4859
+ const h = (B = this.activeStateMachine) == null ? void 0 : B.inputs.find((s) => s.id === A);
4860
+ h && typeof h.value == "object" && (C = h.value.type);
4861
4861
  } else {
4862
- const w = this.inputNameMap.get(A);
4863
- if (w && w.length > 0) {
4864
- const G = (i = this.activeStateMachine) == null ? void 0 : i.inputs.find((h) => h.id === w[0]);
4865
- G && typeof G.value == "object" && (C = G.value.type);
4862
+ const h = this.inputNameMap.get(A);
4863
+ if (h && h.length > 0) {
4864
+ const s = (i = this.activeStateMachine) == null ? void 0 : i.inputs.find((G) => G.id === h[0]);
4865
+ s && typeof s.value == "object" && (C = s.value.type);
4866
4866
  }
4867
4867
  }
4868
4868
  let g = I;
4869
4869
  C === "Trigger" && (I === 1 ? g = !0 : I === 0 && (g = !1)), this.inputs.has(A) && this.setInternalInput(A, g);
4870
4870
  const Q = this.inputNameMap.get(A);
4871
- Q && Q.forEach((w) => this.setInternalInput(w, g)), C === "Trigger" && g === !0 && (this.justFiredTriggers.add(A), Q && Q.forEach((w) => this.justFiredTriggers.add(w))), Array.isArray(g) && ((o = this.artboard) == null || o.objects.forEach((w) => {
4872
- if (w.inputId === A || w.name === A) {
4873
- const G = this.objectStates.get(w.id);
4874
- G && G.options && (w.type === "ListView" || w.variant === "listview" ? G.options.items = g : (w.type === "Dropdown" || w.variant === "dropdown") && (G.options.optionsList = g));
4871
+ Q && Q.forEach((h) => this.setInternalInput(h, g)), C === "Trigger" && g === !0 && (this.justFiredTriggers.add(A), Q && Q.forEach((h) => this.justFiredTriggers.add(h))), Array.isArray(g) && ((o = this.artboard) == null || o.objects.forEach((h) => {
4872
+ if (h.inputId === A || h.name === A) {
4873
+ const s = this.objectStates.get(h.id);
4874
+ s && s.options && (h.type === "ListView" || h.variant === "listview" ? s.options.items = g : (h.type === "Dropdown" || h.variant === "dropdown") && (s.options.optionsList = g));
4875
4875
  }
4876
4876
  })), this.evaluateTransitions();
4877
4877
  }
@@ -4886,12 +4886,12 @@ class xC {
4886
4886
  if (!B) continue;
4887
4887
  let i = !1;
4888
4888
  for (const o of B.transitions)
4889
- this.checkConditions(o.conditions) && (C.push(o.targetStateId), i = !0, g = !0, o.conditions && o.conditions.forEach((w) => {
4890
- var h;
4891
- const G = (h = this.activeStateMachine) == null ? void 0 : h.inputs.find((s) => s.id === w.inputId);
4892
- if (G && typeof G.value == "object" && G.value.type === "Number" && (this.setInternalInput(w.inputId, 0), this.inputNameMap.has(G.name))) {
4893
- const s = this.inputNameMap.get(G.name);
4894
- s == null || s.forEach((a) => this.setInternalInput(a, 0));
4889
+ this.checkConditions(o.conditions) && (C.push(o.targetStateId), i = !0, g = !0, o.conditions && o.conditions.forEach((h) => {
4890
+ var G;
4891
+ const s = (G = this.activeStateMachine) == null ? void 0 : G.inputs.find((w) => w.id === h.inputId);
4892
+ if (s && typeof s.value == "object" && s.value.type === "Number" && (this.setInternalInput(h.inputId, 0), this.inputNameMap.has(s.name))) {
4893
+ const w = this.inputNameMap.get(s.name);
4894
+ w == null || w.forEach((a) => this.setInternalInput(a, 0));
4895
4895
  }
4896
4896
  }));
4897
4897
  i || C.push(Q);
@@ -4900,10 +4900,10 @@ class xC {
4900
4900
  const Q = this.findGlobalTransition(A, I.currentStateIds);
4901
4901
  Q && (C.length = 0, C.push(Q.targetStateId), g = !0, Q.conditions && Q.conditions.forEach((B) => {
4902
4902
  var o;
4903
- const i = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((w) => w.id === B.inputId);
4903
+ const i = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((h) => h.id === B.inputId);
4904
4904
  if (i && typeof i.value == "object" && i.value.type === "Number" && (this.setInternalInput(B.inputId, 0), this.inputNameMap.has(i.name))) {
4905
- const w = this.inputNameMap.get(i.name);
4906
- w == null || w.forEach((G) => this.setInternalInput(G, 0));
4905
+ const h = this.inputNameMap.get(i.name);
4906
+ h == null || h.forEach((s) => this.setInternalInput(s, 0));
4907
4907
  }
4908
4908
  }));
4909
4909
  }
@@ -4977,33 +4977,33 @@ class xC {
4977
4977
  var B, i, o;
4978
4978
  if (C.has(A)) return !1;
4979
4979
  C.add(A);
4980
- const g = (i = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : i.find((w) => w.id === A);
4980
+ const g = (i = (B = this.activeStateMachine) == null ? void 0 : B.logicNodes) == null ? void 0 : i.find((h) => h.id === A);
4981
4981
  if (g) {
4982
- const w = (G, h) => {
4983
- const s = g.inputs.find((a) => a.id === G);
4984
- return s ? s.sourceId ? this.evaluateLogicTree(s.sourceId, s.sourceHandleId, C) : s.value !== void 0 ? s.value : h : h;
4982
+ const h = (s, G) => {
4983
+ const w = g.inputs.find((a) => a.id === s);
4984
+ return w ? w.sourceId ? this.evaluateLogicTree(w.sourceId, w.sourceHandleId, C) : w.value !== void 0 ? w.value : G : G;
4985
4985
  };
4986
4986
  switch (g.op) {
4987
4987
  case VA.AND:
4988
- return w("a", !1) && w("b", !1);
4988
+ return h("a", !1) && h("b", !1);
4989
4989
  case VA.OR:
4990
- return w("a", !1) || w("b", !1);
4990
+ return h("a", !1) || h("b", !1);
4991
4991
  case VA.NOT:
4992
- return !w("in", !1);
4992
+ return !h("in", !1);
4993
4993
  case VA.XOR:
4994
- return !!w("a", !1) != !!w("b", !1);
4994
+ return !!h("a", !1) != !!h("b", !1);
4995
4995
  default:
4996
4996
  return 0;
4997
4997
  }
4998
4998
  }
4999
4999
  let Q = this.inputs.get(A);
5000
5000
  if (this.justFiredTriggers.has(A) && (Q = !0), I && Q !== void 0) {
5001
- const w = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((G) => G.id === A);
5002
- if (w && w.value.type === "Number" && typeof Q == "number") {
5003
- const G = w.value.defaultValue ?? w.value.value;
5004
- if (I === "source-greater") return Q > G;
5005
- if (I === "source-less") return Q < G;
5006
- if (I === "source-equal") return Q === G;
5001
+ const h = (o = this.activeStateMachine) == null ? void 0 : o.inputs.find((s) => s.id === A);
5002
+ if (h && h.value.type === "Number" && typeof Q == "number") {
5003
+ const s = h.value.defaultValue ?? h.value.value;
5004
+ if (I === "source-greater") return Q > s;
5005
+ if (I === "source-less") return Q < s;
5006
+ if (I === "source-equal") return Q === s;
5007
5007
  }
5008
5008
  if (I === "source-true") return Q === !0;
5009
5009
  if (I === "source-false") return Q === !1;
@@ -5027,14 +5027,14 @@ class xC {
5027
5027
  this.applyAnimation(C.animation, I.time);
5028
5028
  }));
5029
5029
  })), this.solveConstraints(A), this.activeTriggers.forEach((I, C) => {
5030
- var g, Q, B, i, o, w, G;
5030
+ var g, Q, B, i, o, h, s;
5031
5031
  if (I.phase === "entry")
5032
- I.time += A, I.time >= I.animation.duration && ((B = (Q = (g = this.artboard) == null ? void 0 : g.objects.find((h) => h.id === C)) == null ? void 0 : Q.triggers) == null || B.find((h) => h.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
5032
+ I.time += A, I.time >= I.animation.duration && ((B = (Q = (g = this.artboard) == null ? void 0 : g.objects.find((G) => G.id === C)) == null ? void 0 : Q.triggers) == null || B.find((G) => G.id === I.triggerId), I.phase = "hold", I.elapsedHold = 0, I.time = I.animation.duration), this.applyAnimation(I.animation, I.time);
5033
5033
  else if (I.phase === "hold") {
5034
- const h = (w = (o = (i = this.artboard) == null ? void 0 : i.objects.find((a) => a.id === C)) == null ? void 0 : o.triggers) == null ? void 0 : w.find((a) => a.id === I.triggerId), s = (h == null ? void 0 : h.duration) || 0;
5035
- if (I.elapsedHold += A * 1e3, I.elapsedHold >= s)
5036
- if (h != null && h.exitAnimationId) {
5037
- const a = (G = this.artboard) == null ? void 0 : G.animations.find((N) => N.id === h.exitAnimationId);
5034
+ const G = (h = (o = (i = this.artboard) == null ? void 0 : i.objects.find((a) => a.id === C)) == null ? void 0 : o.triggers) == null ? void 0 : h.find((a) => a.id === I.triggerId), w = (G == null ? void 0 : G.duration) || 0;
5035
+ if (I.elapsedHold += A * 1e3, I.elapsedHold >= w)
5036
+ if (G != null && G.exitAnimationId) {
5037
+ const a = (s = this.artboard) == null ? void 0 : s.animations.find((N) => N.id === G.exitAnimationId);
5038
5038
  a ? (I.phase = "exit", I.animation = a, I.time = 0) : this.activeTriggers.delete(C);
5039
5039
  } else
5040
5040
  this.activeTriggers.delete(C);
@@ -5046,58 +5046,58 @@ class xC {
5046
5046
  if (!I.constraints || I.constraints.length === 0) return;
5047
5047
  const C = this.objectStates.get(I.id);
5048
5048
  C && I.constraints.forEach((g) => {
5049
- var B, i, o, w, G, h;
5049
+ var B, i, o, h, s, G;
5050
5050
  const Q = g.strength ?? 1;
5051
5051
  if (g.type === "Translation") {
5052
- const s = this.objectStates.get(g.targetId);
5053
- if (s) {
5052
+ const w = this.objectStates.get(g.targetId);
5053
+ if (w) {
5054
5054
  const a = g.useSpring, N = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 };
5055
5055
  if (a) {
5056
- const { x: S, y: F, vx: M, vy: R } = this.computeSpring(C.x, C.y, N.vx, N.vy, s.x, s.y, g, A);
5057
- g.copyX && (C.x = S), g.copyY && (C.y = F), this.objectVelocities.set(I.id, { vx: M, vy: R });
5056
+ const { x: S, y: k, vx: y, vy: U } = this.computeSpring(C.x, C.y, N.vx, N.vy, w.x, w.y, g, A);
5057
+ g.copyX && (C.x = S), g.copyY && (C.y = k), this.objectVelocities.set(I.id, { vx: y, vy: U });
5058
5058
  } else
5059
- g.copyX && (C.x = C.x + (s.x - C.x) * Q), g.copyY && (C.y = C.y + (s.y - C.y) * Q);
5059
+ g.copyX && (C.x = C.x + (w.x - C.x) * Q), g.copyY && (C.y = C.y + (w.y - C.y) * Q);
5060
5060
  (B = g.limitX) != null && B.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (i = g.limitY) != null && i.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
5061
5061
  }
5062
5062
  } else if (g.type === "FollowPointer") {
5063
- const s = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? C.x, a = ((w = this._lastPointerPos) == null ? void 0 : w.y) ?? C.y;
5063
+ const w = ((o = this._lastPointerPos) == null ? void 0 : o.x) ?? C.x, a = ((h = this._lastPointerPos) == null ? void 0 : h.y) ?? C.y;
5064
5064
  if (g.useSpring) {
5065
- const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: F, y: M, vx: R, vy: Y } = this.computeSpring(C.x, C.y, S.vx, S.vy, s, a, g, A);
5066
- C.x = F, C.y = M, this.objectVelocities.set(I.id, { vx: R, vy: Y });
5065
+ const S = this.objectVelocities.get(I.id) || { vx: 0, vy: 0 }, { x: k, y, vx: U, vy: c } = this.computeSpring(C.x, C.y, S.vx, S.vy, w, a, g, A);
5066
+ C.x = k, C.y = y, this.objectVelocities.set(I.id, { vx: U, vy: c });
5067
5067
  } else
5068
- C.x = C.x + (s - C.x) * Q, C.y = C.y + (a - C.y) * Q;
5069
- (G = g.limitX) != null && G.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (h = g.limitY) != null && h.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
5068
+ C.x = C.x + (w - C.x) * Q, C.y = C.y + (a - C.y) * Q;
5069
+ (s = g.limitX) != null && s.enabled && (C.x = Math.max(g.limitX.min, Math.min(g.limitX.max, C.x))), (G = g.limitY) != null && G.enabled && (C.y = Math.max(g.limitY.min, Math.min(g.limitY.max, C.y)));
5070
5070
  } else if (g.type === "Distance") {
5071
- const s = this.objectStates.get(g.targetId);
5072
- if (s) {
5073
- const a = C.x - s.x, N = C.y - s.y, S = Math.sqrt(a * a + N * N), F = g.distance || 0;
5074
- let M = S;
5071
+ const w = this.objectStates.get(g.targetId);
5072
+ if (w) {
5073
+ const a = C.x - w.x, N = C.y - w.y, S = Math.sqrt(a * a + N * N), k = g.distance || 0;
5074
+ let y = S;
5075
5075
  switch (g.mode) {
5076
5076
  case "exact":
5077
- M = F;
5077
+ y = k;
5078
5078
  break;
5079
5079
  case "minimum":
5080
- M = Math.max(F, S);
5080
+ y = Math.max(k, S);
5081
5081
  break;
5082
5082
  case "maximum":
5083
- M = Math.min(F, S);
5083
+ y = Math.min(k, S);
5084
5084
  break;
5085
5085
  case "clamped":
5086
- M = Math.max(0, Math.min(F, S));
5086
+ y = Math.max(0, Math.min(k, S));
5087
5087
  break;
5088
5088
  }
5089
5089
  if (S > 0) {
5090
- const R = M / S;
5091
- C.x = s.x + a * R, C.y = s.y + N * R;
5092
- } else S === 0 && M > 0 && (C.x = s.x + M);
5090
+ const U = y / S;
5091
+ C.x = w.x + a * U, C.y = w.y + N * U;
5092
+ } else S === 0 && y > 0 && (C.x = w.x + y);
5093
5093
  }
5094
5094
  }
5095
5095
  });
5096
5096
  });
5097
5097
  }
5098
5098
  computeSpring(A, I, C, g, Q, B, i, o) {
5099
- const w = i.stiffness ?? 100, G = i.damping ?? 10, h = i.mass ?? 1, s = -w * (A - Q), a = -w * (I - B), N = -G * C, S = -G * g, F = (s + N) / h, M = (a + S) / h, R = C + F * o, Y = g + M * o, t = A + R * o, J = I + Y * o;
5100
- return { x: t, y: J, vx: R, vy: Y };
5099
+ const h = i.stiffness ?? 100, s = i.damping ?? 10, G = i.mass ?? 1, w = -h * (A - Q), a = -h * (I - B), N = -s * C, S = -s * g, k = (w + N) / G, y = (a + S) / G, U = C + k * o, c = g + y * o, t = A + U * o, J = I + c * o;
5100
+ return { x: t, y: J, vx: U, vy: c };
5101
5101
  }
5102
5102
  handlePointerInput(A, I, C, g, Q) {
5103
5103
  if (!this.artboard) return;
@@ -5112,21 +5112,21 @@ class xC {
5112
5112
  this._prevPointerPos = this._lastPointerPos, this._lastPointerPos = { x: i, y: o }, this.updateInput("mouseX", i), this.updateInput("mouseY", o), this.handlePointerEvent(A, i, o);
5113
5113
  }
5114
5114
  handlePointerEvent(A, I, C) {
5115
- var o, w, G, h;
5115
+ var o, h, s, G;
5116
5116
  if (!this.artboard) return;
5117
5117
  let g = null;
5118
- const Q = (s, a) => {
5119
- var Y;
5118
+ const Q = (w, a) => {
5119
+ var c;
5120
5120
  let N = a;
5121
5121
  a === "click" ? N = "onClick" : a === "down" ? N = "onPointerDown" : a === "up" ? N = "onPointerUp" : a === "blur" && (N = "onPointerLeave");
5122
5122
  const S = /* @__PURE__ */ new Set([N]);
5123
5123
  a === "move" && S.add("onPointerEnter").add("hover").add("onPointerLeave").add("blur"), N === "onClick" && S.add("click"), N === "onPointerDown" && S.add("pointerDown"), N === "onPointerUp" && S.add("pointerUp");
5124
- const F = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider"];
5125
- return !!(s.type === "Component" && F.includes(s.variant) || F.includes((Y = s.type) == null ? void 0 : Y.toLowerCase()) || (s.interactions || []).some((t) => S.has(t.event)) || (s.triggers || []).some((t) => S.has(t.eventType)));
5124
+ const k = ["button", "toggle", "toggle_button", "dropdown", "listview", "inputbox", "slider"];
5125
+ return !!(w.type === "Component" && k.includes(w.variant) || k.includes((c = w.type) == null ? void 0 : c.toLowerCase()) || (w.interactions || []).some((t) => S.has(t.event)) || (w.triggers || []).some((t) => S.has(t.eventType)));
5126
5126
  };
5127
5127
  let B = null;
5128
- for (let s = this.artboard.objects.length - 1; s >= 0; s--) {
5129
- const a = this.artboard.objects[s], N = this.objectStates.get(a.id);
5128
+ for (let w = this.artboard.objects.length - 1; w >= 0; w--) {
5129
+ const a = this.artboard.objects[w], N = this.objectStates.get(a.id);
5130
5130
  if (N && N.visible !== !1 && N.opacity > 0 && this.hitTest(a, I, C) && (B || (B = a), Q(a, A))) {
5131
5131
  g = a;
5132
5132
  break;
@@ -5136,29 +5136,29 @@ class xC {
5136
5136
  const i = (g == null ? void 0 : g.id) || null;
5137
5137
  if (A === "move") {
5138
5138
  if (this.draggingSliderId) {
5139
- const s = this.artboard.objects.find((a) => a.id === this.draggingSliderId);
5140
- s && this.updateSliderValueFromPointer(s, I, C);
5139
+ const w = this.artboard.objects.find((a) => a.id === this.draggingSliderId);
5140
+ w && this.updateSliderValueFromPointer(w, I, C);
5141
5141
  return;
5142
5142
  }
5143
5143
  if (this.draggingListViewId) {
5144
- const s = this.artboard.objects.find((a) => a.id === this.draggingListViewId);
5145
- s && this.updateListViewScrollFromPointer(s);
5144
+ const w = this.artboard.objects.find((a) => a.id === this.draggingListViewId);
5145
+ w && this.updateListViewScrollFromPointer(w);
5146
5146
  return;
5147
5147
  }
5148
5148
  g && g.type === "Component" && g.variant === "listview" && this.updateListViewHoverFromPointer(g, I, C), i !== this.lastHoveredObjectId && (console.log(`[Engine] HOVER CHANGE: ${this.lastHoveredObjectId} -> ${i}`), this.lastHoveredObjectId && this.fireEventForObject(this.lastHoveredObjectId, "onPointerLeave"), i && this.fireEventForObject(i, "onPointerEnter"), this.lastHoveredObjectId = i);
5149
5149
  return;
5150
5150
  }
5151
5151
  if ((A === "up" || A === "blur") && (this.draggingSliderId = null, this.draggingListViewId = null), this.activeDropdownId && A === "down") {
5152
- const s = this.artboard.objects.find((a) => a.id === this.activeDropdownId);
5153
- if (s && (s.type === "Dropdown" || s.variant === "dropdown")) {
5154
- const a = this.objectStates.get(s.id), N = (a == null ? void 0 : a.options) || s.options || {}, S = s.geometry || {}, F = S.width ?? s.width ?? 200, M = S.height ?? s.height ?? 40, R = N.optionsList || [], Y = N.itemHeight || 32, t = N.listPadding ?? 4, J = R.length * Y + t * 2, U = this.getWorldTransform(s.id), c = F * Math.abs(U.scaleX), e = M * Math.abs(U.scaleY), r = U.y + e / 2 + 4, L = Math.abs(I - U.x) <= c / 2, b = C >= r && C <= r + J * Math.abs(U.scaleY);
5152
+ const w = this.artboard.objects.find((a) => a.id === this.activeDropdownId);
5153
+ if (w && (w.type === "Dropdown" || w.variant === "dropdown")) {
5154
+ const a = this.objectStates.get(w.id), N = (a == null ? void 0 : a.options) || w.options || {}, S = w.geometry || {}, k = S.width ?? w.width ?? 200, y = S.height ?? w.height ?? 40, U = N.optionsList || [], c = N.itemHeight || 32, t = N.listPadding ?? 4, J = U.length * c + t * 2, R = this.getWorldTransform(w.id), e = k * Math.abs(R.scaleX), Y = y * Math.abs(R.scaleY), r = R.y + Y / 2 + 4, L = Math.abs(I - R.x) <= e / 2, b = C >= r && C <= r + J * Math.abs(R.scaleY);
5155
5155
  if (L && b) {
5156
- const z = Math.abs(U.scaleY), IA = C - (r + t * z), m = Math.floor(IA / (Y * z));
5157
- if (m >= 0 && m < R.length) {
5158
- const QA = R[m];
5159
- N.selectedOption = QA, N.isOpen = !1, this.activeDropdownId = null, s.inputId && this.setInternalInput(s.inputId, QA), this.onComponentChange && this.onComponentChange({
5160
- objectId: s.id,
5161
- componentName: s.name,
5156
+ const P = Math.abs(R.scaleY), IA = C - (r + t * P), m = Math.floor(IA / (c * P));
5157
+ if (m >= 0 && m < U.length) {
5158
+ const QA = U[m];
5159
+ N.selectedOption = QA, N.isOpen = !1, this.activeDropdownId = null, w.inputId && this.setInternalInput(w.inputId, QA), this.onComponentChange && this.onComponentChange({
5160
+ objectId: w.id,
5161
+ componentName: w.name,
5162
5162
  variant: "dropdown",
5163
5163
  property: "selectedOption",
5164
5164
  value: QA
@@ -5169,43 +5169,43 @@ class xC {
5169
5169
  }
5170
5170
  }
5171
5171
  if (g) {
5172
- let s = g, a = g;
5172
+ let w = g, a = g;
5173
5173
  for (; a && a.parentId; ) {
5174
- const S = this.artboard.objects.find((F) => F.id === a.parentId);
5174
+ const S = this.artboard.objects.find((k) => k.id === a.parentId);
5175
5175
  if (S && S.type === "Component") {
5176
- s = S;
5176
+ w = S;
5177
5177
  break;
5178
5178
  }
5179
5179
  a = S;
5180
5180
  }
5181
5181
  let N = A;
5182
- if (A === "click" ? N = "onClick" : A === "down" ? N = "onPointerDown" : A === "up" ? N = "onPointerUp" : A === "blur" && (N = "onPointerLeave"), this.fireEventForObject(g.id, N), s !== g && this.fireEventForObject(s.id, N), s.type === "Component" && s.variant === "toggle_button" && A === "down") {
5183
- const S = this.objectStates.get(s.id), F = (S == null ? void 0 : S.options) || s.options || {};
5184
- F.checked = !F.checked, s.inputId && this.setInternalInput(s.inputId, F.checked), this.onComponentChange && this.onComponentChange({
5185
- objectId: s.id,
5186
- componentName: s.name,
5182
+ if (A === "click" ? N = "onClick" : A === "down" ? N = "onPointerDown" : A === "up" ? N = "onPointerUp" : A === "blur" && (N = "onPointerLeave"), this.fireEventForObject(g.id, N), w !== g && this.fireEventForObject(w.id, N), w.type === "Component" && w.variant === "toggle_button" && A === "down") {
5183
+ const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {};
5184
+ k.checked = !k.checked, w.inputId && this.setInternalInput(w.inputId, k.checked), this.onComponentChange && this.onComponentChange({
5185
+ objectId: w.id,
5186
+ componentName: w.name,
5187
5187
  variant: "toggle_button",
5188
5188
  property: "checked",
5189
- value: F.checked
5189
+ value: k.checked
5190
5190
  });
5191
5191
  }
5192
- if (s.type === "Component" && s.variant === "toggle" && A === "down") {
5193
- const S = this.objectStates.get(s.id), F = (S == null ? void 0 : S.options) || s.options || {};
5194
- F.checked = !F.checked, s.inputId && this.setInternalInput(s.inputId, F.checked), this.onComponentChange && this.onComponentChange({
5195
- objectId: s.id,
5196
- componentName: s.name,
5192
+ if (w.type === "Component" && w.variant === "toggle" && A === "down") {
5193
+ const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {};
5194
+ k.checked = !k.checked, w.inputId && this.setInternalInput(w.inputId, k.checked), this.onComponentChange && this.onComponentChange({
5195
+ objectId: w.id,
5196
+ componentName: w.name,
5197
5197
  variant: "toggle",
5198
5198
  property: "checked",
5199
- value: F.checked
5200
- }), this.onToggle && this.onToggle(s.name, F.checked);
5199
+ value: k.checked
5200
+ }), this.onToggle && this.onToggle(w.name, k.checked);
5201
5201
  }
5202
- if (s.type === "Component" && s.variant === "dropdown" && A === "down") {
5203
- const S = this.objectStates.get(s.id), F = (S == null ? void 0 : S.options) || s.options || {}, M = !F.isOpen;
5204
- if (M && this.activeDropdownId && this.activeDropdownId !== s.id) {
5205
- const R = this.artboard.objects.find((Y) => Y.id === this.activeDropdownId);
5206
- R && R.options && (R.options.isOpen = !1);
5202
+ if (w.type === "Component" && w.variant === "dropdown" && A === "down") {
5203
+ const S = this.objectStates.get(w.id), k = (S == null ? void 0 : S.options) || w.options || {}, y = !k.isOpen;
5204
+ if (y && this.activeDropdownId && this.activeDropdownId !== w.id) {
5205
+ const U = this.artboard.objects.find((c) => c.id === this.activeDropdownId);
5206
+ U && U.options && (U.options.isOpen = !1);
5207
5207
  }
5208
- F.isOpen = M, this.activeDropdownId = M ? s.id : null;
5208
+ k.isOpen = y, this.activeDropdownId = y ? w.id : null;
5209
5209
  }
5210
5210
  if (g.type === "Component" && g.variant === "button" && A === "down" && this.onComponentChange && this.onComponentChange({
5211
5211
  objectId: g.id,
@@ -5217,12 +5217,12 @@ class xC {
5217
5217
  this.draggingListViewId = g.id;
5218
5218
  const S = this.getListViewItemIndexAtPointer(g, I, C);
5219
5219
  if (S !== null) {
5220
- const F = g.options || {};
5221
- F.activeItemIndex = S;
5222
- const M = this.objectStates.get(g.id);
5223
- M && M.options && (M.options.activeItemIndex = S);
5224
- const R = (F.items || [])[S], Y = typeof R == "string" ? R : R.label || R.value || S;
5225
- M && M.options && (M.options.selectedValue = Y), g.inputId && this.setInternalInput(g.inputId, Y), this.onComponentChange && (this.onComponentChange({
5220
+ const k = g.options || {};
5221
+ k.activeItemIndex = S;
5222
+ const y = this.objectStates.get(g.id);
5223
+ y && y.options && (y.options.activeItemIndex = S);
5224
+ const U = (k.items || [])[S], c = typeof U == "string" ? U : U.label || U.value || S;
5225
+ y && y.options && (y.options.selectedValue = c), g.inputId && this.setInternalInput(g.inputId, c), this.onComponentChange && (this.onComponentChange({
5226
5226
  objectId: g.id,
5227
5227
  componentName: g.name,
5228
5228
  variant: "listview",
@@ -5233,29 +5233,29 @@ class xC {
5233
5233
  componentName: g.name,
5234
5234
  variant: "listview",
5235
5235
  property: "selected",
5236
- value: Y
5236
+ value: c
5237
5237
  }));
5238
5238
  }
5239
5239
  }
5240
5240
  if (g.type === "Component" && g.variant === "slider" && A === "down" && (this.draggingSliderId = g.id, this.updateSliderValueFromPointer(g, I, C)), A === "click") {
5241
- const S = (o = this.artboard) == null ? void 0 : o.objects.find((M) => M.id === g.id), F = this.focusedId;
5241
+ const S = (o = this.artboard) == null ? void 0 : o.objects.find((y) => y.id === g.id), k = this.focusedId;
5242
5242
  if ((S == null ? void 0 : S.type) === "Component" && S.variant === "inputbox") {
5243
- if (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`), F !== this.focusedId) {
5244
- if (F) {
5245
- const M = (w = this.artboard) == null ? void 0 : w.objects.find((R) => R.id === F);
5246
- M && this.onInputBlur && this.onInputBlur(M.name);
5243
+ if (this.focusedId = g.id, console.log(`[Engine] Focus set to: ${g.id}`), k !== this.focusedId) {
5244
+ if (k) {
5245
+ const y = (h = this.artboard) == null ? void 0 : h.objects.find((U) => U.id === k);
5246
+ y && this.onInputBlur && this.onInputBlur(y.name);
5247
5247
  }
5248
5248
  this.onInputFocus && this.onInputFocus(S.name);
5249
5249
  }
5250
- } else if (this.focusedId = null, F) {
5251
- const M = (G = this.artboard) == null ? void 0 : G.objects.find((R) => R.id === F);
5252
- M && this.onInputBlur && this.onInputBlur(M.name);
5250
+ } else if (this.focusedId = null, k) {
5251
+ const y = (s = this.artboard) == null ? void 0 : s.objects.find((U) => U.id === k);
5252
+ y && this.onInputBlur && this.onInputBlur(y.name);
5253
5253
  }
5254
5254
  }
5255
5255
  } else if (A === "click") {
5256
- const s = this.focusedId;
5257
- if (this.focusedId = null, s) {
5258
- const a = (h = this.artboard) == null ? void 0 : h.objects.find((N) => N.id === s);
5256
+ const w = this.focusedId;
5257
+ if (this.focusedId = null, w) {
5258
+ const a = (G = this.artboard) == null ? void 0 : G.objects.find((N) => N.id === w);
5259
5259
  a && this.onInputBlur && this.onInputBlur(a.name);
5260
5260
  }
5261
5261
  }
@@ -5292,35 +5292,35 @@ class xC {
5292
5292
  }
5293
5293
  fireEventForObject(A, I) {
5294
5294
  if (!this.artboard) return;
5295
- const C = this.artboard.objects.find((w) => w.id === A);
5295
+ const C = this.artboard.objects.find((h) => h.id === A);
5296
5296
  if (!C) return;
5297
5297
  console.log(`[Engine] Firing event ${I} on ${C.name}`);
5298
5298
  const g = /* @__PURE__ */ new Set([I]);
5299
5299
  I === "onPointerEnter" && g.add("hover"), I === "onPointerLeave" && g.add("blur"), I === "onPointerDown" && g.add("pointerDown"), I === "onPointerUp" && g.add("pointerUp");
5300
- const B = (C.interactions || []).find((w) => g.has(w.event));
5300
+ const B = (C.interactions || []).find((h) => g.has(h.event));
5301
5301
  if (B)
5302
5302
  if (console.log(`[Engine] Interaction matched: ${I} (as ${B.event}) -> ${B.targetInputId}`), B.action === "setInput") {
5303
- let w = B.value;
5304
- w === "toggle" && (w = !this.inputs.get(B.targetInputId)), this.updateInput(B.targetInputId, w);
5303
+ let h = B.value;
5304
+ h === "toggle" && (h = !this.inputs.get(B.targetInputId)), this.updateInput(B.targetInputId, h);
5305
5305
  } else B.action === "fireTrigger" && this.updateInput(B.targetInputId, !0);
5306
- const o = (C.triggers || []).find((w) => g.has(w.eventType));
5306
+ const o = (C.triggers || []).find((h) => g.has(h.eventType));
5307
5307
  if (o && o.entryAnimationId) {
5308
5308
  console.log(`[Engine] Trigger matched: ${I} (as ${o.eventType}) -> Animation ${o.entryAnimationId}`);
5309
- const w = this.artboard.animations.find((G) => G.id === o.entryAnimationId);
5310
- w && (this.activeTriggers.set(C.id, {
5309
+ const h = this.artboard.animations.find((s) => s.id === o.entryAnimationId);
5310
+ h && (this.activeTriggers.set(C.id, {
5311
5311
  triggerId: o.id,
5312
- animation: w,
5312
+ animation: h,
5313
5313
  time: 0,
5314
5314
  phase: "entry",
5315
5315
  elapsedHold: 0
5316
- }), this.onTrigger && this.onTrigger(o.name, w.name));
5316
+ }), this.onTrigger && this.onTrigger(o.name, h.name));
5317
5317
  }
5318
5318
  }
5319
5319
  getWorldTransform(A) {
5320
- var s;
5320
+ var w;
5321
5321
  const I = this.objectStates.get(A);
5322
5322
  if (!I) return { x: 0, y: 0, scaleX: 1, scaleY: 1, rotation: 0 };
5323
- const C = (s = this.artboard) == null ? void 0 : s.objects.find((a) => a.id === A);
5323
+ const C = (w = this.artboard) == null ? void 0 : w.objects.find((a) => a.id === A);
5324
5324
  if (!C || !C.parentId)
5325
5325
  return {
5326
5326
  x: I.x,
@@ -5329,33 +5329,33 @@ class xC {
5329
5329
  scaleY: I.scale_y ?? 1,
5330
5330
  rotation: I.rotation ?? 0
5331
5331
  };
5332
- const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), i = Math.sin(Q), o = I.x * g.scaleX, w = I.y * g.scaleY, G = g.x + (o * B - w * i), h = g.y + (o * i + w * B);
5332
+ const g = this.getWorldTransform(C.parentId), Q = g.rotation * (Math.PI / 180), B = Math.cos(Q), i = Math.sin(Q), o = I.x * g.scaleX, h = I.y * g.scaleY, s = g.x + (o * B - h * i), G = g.y + (o * i + h * B);
5333
5333
  return {
5334
- x: G,
5335
- y: h,
5334
+ x: s,
5335
+ y: G,
5336
5336
  scaleX: (I.scale_x ?? 1) * g.scaleX,
5337
5337
  scaleY: (I.scale_y ?? 1) * g.scaleY,
5338
5338
  rotation: g.rotation + (I.rotation ?? 0)
5339
5339
  };
5340
5340
  }
5341
5341
  hitTest(A, I, C) {
5342
- var Y, t;
5342
+ var c, t;
5343
5343
  if (!this.objectStates.get(A.id)) return !1;
5344
- const Q = ((Y = A.geometry) == null ? void 0 : Y.width) ?? A.width ?? 100, B = ((t = A.geometry) == null ? void 0 : t.height) ?? A.height ?? 100, i = this.getWorldTransform(A.id), o = I - i.x, w = C - i.y, G = -i.rotation * (Math.PI / 180), h = Math.cos(G), s = Math.sin(G), a = o * h - w * s, N = o * s + w * h, S = i.scaleX, F = i.scaleY, M = Q * Math.abs(S), R = B * Math.abs(F);
5345
- return Math.abs(a) <= M / 2 && Math.abs(N) <= R / 2;
5344
+ const Q = ((c = A.geometry) == null ? void 0 : c.width) ?? A.width ?? 100, B = ((t = A.geometry) == null ? void 0 : t.height) ?? A.height ?? 100, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = o * w + h * G, S = i.scaleX, k = i.scaleY, y = Q * Math.abs(S), U = B * Math.abs(k);
5345
+ return Math.abs(a) <= y / 2 && Math.abs(N) <= U / 2;
5346
5346
  }
5347
5347
  updateSliderValueFromPointer(A, I, C) {
5348
- var c;
5348
+ var e;
5349
5349
  const g = this.objectStates.get(A.id);
5350
5350
  if (!g) return;
5351
- const Q = A.options || {}, B = ((c = A.geometry) == null ? void 0 : c.width) ?? A.width ?? 200, i = this.getWorldTransform(A.id), o = I - i.x, w = C - i.y, G = -i.rotation * (Math.PI / 180), h = Math.cos(G), s = Math.sin(G), a = o * h - w * s, N = Q.thumbWidth ?? 16, S = B - N;
5352
- let M = (a + S / 2) / S;
5353
- M = Math.max(0, Math.min(1, M));
5354
- const R = Q.min ?? 0, Y = Q.max ?? 100, t = Q.step || 1;
5355
- let J = R + M * (Y - R);
5356
- t > 0 && (J = Math.round(J / t) * t), J = Math.max(R, Math.min(Y, J));
5357
- const U = g.options || {};
5358
- U.value !== J && (g.options = { ...U, value: J }, A.inputId && this.setInternalInput(A.inputId, J), this.onComponentChange && this.onComponentChange({
5351
+ const Q = A.options || {}, B = ((e = A.geometry) == null ? void 0 : e.width) ?? A.width ?? 200, i = this.getWorldTransform(A.id), o = I - i.x, h = C - i.y, s = -i.rotation * (Math.PI / 180), G = Math.cos(s), w = Math.sin(s), a = o * G - h * w, N = Q.thumbWidth ?? 16, S = B - N;
5352
+ let y = (a + S / 2) / S;
5353
+ y = Math.max(0, Math.min(1, y));
5354
+ const U = Q.min ?? 0, c = Q.max ?? 100, t = Q.step || 1;
5355
+ let J = U + y * (c - U);
5356
+ t > 0 && (J = Math.round(J / t) * t), J = Math.max(U, Math.min(c, J));
5357
+ const R = g.options || {};
5358
+ R.value !== J && (g.options = { ...R, value: J }, A.inputId && this.setInternalInput(A.inputId, J), this.onComponentChange && this.onComponentChange({
5359
5359
  objectId: A.id,
5360
5360
  componentName: A.name,
5361
5361
  variant: "slider",
@@ -5365,35 +5365,35 @@ class xC {
5365
5365
  }
5366
5366
  applyAnimation(A, I) {
5367
5367
  A.tracks.forEach((C) => {
5368
- var o, w, G;
5369
- const g = (o = this.artboard) == null ? void 0 : o.objects.find((h) => h.id === C.object_id);
5370
- if (((w = g == null ? void 0 : g.physics) == null ? void 0 : w.enabled) && g.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(C.property) || C.property.startsWith("transform.")))
5368
+ var o, h, s;
5369
+ const g = (o = this.artboard) == null ? void 0 : o.objects.find((G) => G.id === C.object_id);
5370
+ if (((h = g == null ? void 0 : g.physics) == null ? void 0 : h.enabled) && g.physics.bodyType !== "Static" && (["x", "y", "rotation"].includes(C.property) || C.property.startsWith("transform.")))
5371
5371
  return;
5372
5372
  const B = this.objectStates.get(C.object_id);
5373
5373
  if (!B) return;
5374
5374
  const i = this.interpolate(C.keyframes, I);
5375
5375
  if (C.property.includes(".")) {
5376
- const h = (C.property || "").split(".");
5377
- let s = B;
5378
- for (let a = 0; a < h.length - 1; a++) {
5379
- if (typeof s[h[a]] != "object" || s[h[a]] === null) {
5376
+ const G = (C.property || "").split(".");
5377
+ let w = B;
5378
+ for (let a = 0; a < G.length - 1; a++) {
5379
+ if (typeof w[G[a]] != "object" || w[G[a]] === null) {
5380
5380
  let N = g;
5381
5381
  for (let S = 0; S <= a; S++)
5382
- N = N ? N[h[S]] : null;
5383
- s[h[a]] = N ? JSON.parse(JSON.stringify(N)) : {};
5382
+ N = N ? N[G[S]] : null;
5383
+ w[G[a]] = N ? JSON.parse(JSON.stringify(N)) : {};
5384
5384
  }
5385
- s = s[h[a]];
5385
+ w = w[G[a]];
5386
5386
  }
5387
- s[h[h.length - 1]] = i;
5387
+ w[G[G.length - 1]] = i;
5388
5388
  } else
5389
5389
  B[C.property] = i;
5390
- if (this.physicsEngine && ((G = g == null ? void 0 : g.physics) != null && G.enabled) && g.physics.bodyType === "Static")
5390
+ if (this.physicsEngine && ((s = g == null ? void 0 : g.physics) != null && s.enabled) && g.physics.bodyType === "Static")
5391
5391
  if (C.property === "x" || C.property === "transform.x") {
5392
- const h = this.physicsEngine.getPosition(C.object_id);
5393
- h && this.physicsEngine.setPosition(C.object_id, i, h.y);
5392
+ const G = this.physicsEngine.getPosition(C.object_id);
5393
+ G && this.physicsEngine.setPosition(C.object_id, i, G.y);
5394
5394
  } else if (C.property === "y" || C.property === "transform.y") {
5395
- const h = this.physicsEngine.getPosition(C.object_id);
5396
- h && this.physicsEngine.setPosition(C.object_id, h.x, i);
5395
+ const G = this.physicsEngine.getPosition(C.object_id);
5396
+ G && this.physicsEngine.setPosition(C.object_id, G.x, i);
5397
5397
  } else (C.property === "rotation" || C.property === "transform.rotation") && this.physicsEngine.setRotation(C.object_id, i * (Math.PI / 180));
5398
5398
  });
5399
5399
  }
@@ -5415,29 +5415,29 @@ class xC {
5415
5415
  return !isNaN(i) && !isNaN(o) ? Math.round(i + (o - i) * B).toString() : C.value;
5416
5416
  }
5417
5417
  return Array.isArray(C.value) && Array.isArray(g.value) ? C.value.length === g.value.length ? C.value.map((i, o) => {
5418
- const w = g.value[o];
5419
- return typeof i == "number" && typeof w == "number" ? i + (w - i) * B : B < 0.5 ? i : w;
5418
+ const h = g.value[o];
5419
+ return typeof i == "number" && typeof h == "number" ? i + (h - i) * B : B < 0.5 ? i : h;
5420
5420
  }) : B < 0.5 ? C.value : g.value : typeof C.value == "object" && typeof g.value == "object" && C.value !== null && g.value !== null ? C.value.type && g.value.type ? this.interpolateFill(C.value, g.value, B) : B < 0.5 ? C.value : g.value : typeof C.value == "number" && typeof g.value == "number" ? C.value + (g.value - C.value) * B : B < 0.5 ? C.value : g.value;
5421
5421
  }
5422
5422
  interpolateColor(A, I, C) {
5423
5423
  var N, S;
5424
- const g = ((S = (N = this.artboard) == null ? void 0 : N.tokens) == null ? void 0 : S.colors) || {}, Q = g[A] || A, B = g[I] || I, i = (F) => {
5425
- if (!F) return { r: 0, g: 0, b: 0 };
5426
- const M = F.startsWith("#") ? F.replace("#", "") : "000000";
5427
- return M.length === 3 ? {
5428
- r: parseInt(M[0] + M[0], 16),
5429
- g: parseInt(M[1] + M[1], 16),
5430
- b: parseInt(M[2] + M[2], 16)
5424
+ const g = ((S = (N = this.artboard) == null ? void 0 : N.tokens) == null ? void 0 : S.colors) || {}, Q = g[A] || A, B = g[I] || I, i = (k) => {
5425
+ if (!k) return { r: 0, g: 0, b: 0 };
5426
+ const y = k.startsWith("#") ? k.replace("#", "") : "000000";
5427
+ return y.length === 3 ? {
5428
+ r: parseInt(y[0] + y[0], 16),
5429
+ g: parseInt(y[1] + y[1], 16),
5430
+ b: parseInt(y[2] + y[2], 16)
5431
5431
  } : {
5432
- r: parseInt(M.substring(0, 2), 16),
5433
- g: parseInt(M.substring(2, 4), 16),
5434
- b: parseInt(M.substring(4, 6), 16)
5432
+ r: parseInt(y.substring(0, 2), 16),
5433
+ g: parseInt(y.substring(2, 4), 16),
5434
+ b: parseInt(y.substring(4, 6), 16)
5435
5435
  };
5436
- }, o = i(Q), w = i(B), G = Math.round(o.r + (w.r - o.r) * C), h = Math.round(o.g + (w.g - o.g) * C), s = Math.round(o.b + (w.b - o.b) * C), a = (F) => {
5437
- const M = Math.max(0, Math.min(255, F)).toString(16);
5438
- return M.length === 1 ? "0" + M : M;
5436
+ }, o = i(Q), h = i(B), s = Math.round(o.r + (h.r - o.r) * C), G = Math.round(o.g + (h.g - o.g) * C), w = Math.round(o.b + (h.b - o.b) * C), a = (k) => {
5437
+ const y = Math.max(0, Math.min(255, k)).toString(16);
5438
+ return y.length === 1 ? "0" + y : y;
5439
5439
  };
5440
- return `#${a(G)}${a(h)}${a(s)}`;
5440
+ return `#${a(s)}${a(G)}${a(w)}`;
5441
5441
  }
5442
5442
  interpolateStops(A, I, C) {
5443
5443
  return !A || !I || A.length !== I.length ? C < 0.5 ? A : I : A.map((g, Q) => {
@@ -5476,101 +5476,100 @@ class xC {
5476
5476
  this.layout.alignment
5477
5477
  );
5478
5478
  if (A.save(), A.translate(B.tx, B.ty), A.scale(B.scaleX, B.scaleY), A.translate(g / 2, Q / 2), this.artboard.backgroundVisible !== !1 && (A.fillStyle = this.artboard.backgroundColor || "#000000", A.fillRect(-g / 2, -Q / 2, g, Q)), this.artboard.backgroundImage) {
5479
- const w = this.artboard.backgroundImage;
5480
- let G = this.imageCache.get(w);
5481
- if (G || (G = new Image(), G.src = w, this.imageCache.set(w, G)), G.complete && G.naturalWidth > 0) {
5482
- A.save(), A.globalAlpha = this.artboard.backgroundOpacity ?? 1;
5483
- const h = G.naturalWidth / G.naturalHeight, s = g / Q;
5484
- let a, N, S, F;
5485
- s > h ? (a = g, N = g / h) : (N = Q, a = Q * h), S = -a / 2, F = -N / 2, A.drawImage(G, S, F, a, N), A.restore();
5479
+ const h = this.artboard.backgroundImage;
5480
+ let s = this.imageCache.get(h);
5481
+ if (s || (s = new Image(), s.src = h, this.imageCache.set(h, s)), s.complete && s.naturalWidth > 0) {
5482
+ A.save(), A.globalAlpha = this.normalizeOpacity(this.artboard.backgroundOpacity ?? 100);
5483
+ const G = s.naturalWidth / s.naturalHeight, w = g / Q;
5484
+ let a, N, S, k;
5485
+ w > G ? (a = g, N = g / G) : (N = Q, a = Q * G), S = -a / 2, k = -N / 2, A.drawImage(s, S, k, a, N), A.restore();
5486
5486
  }
5487
5487
  }
5488
5488
  A.beginPath(), A.rect(-g / 2, -Q / 2, g, Q), A.clip();
5489
5489
  const i = /* @__PURE__ */ new Map();
5490
- this.artboard.objects.forEach((w) => i.set(w.id, w));
5490
+ this.artboard.objects.forEach((h) => i.set(h.id, h));
5491
5491
  let o = 0;
5492
- for (this.artboard.objects.forEach((w) => {
5493
- var G, h;
5494
- if (!w.parentId) {
5495
- const s = this.objectStates.get(w.id), a = (s == null ? void 0 : s.geometry) || w.geometry;
5496
- if (a && a.isMask && (s == null ? void 0 : s.visible) !== !1) {
5497
- A.save(), this.applyObjectTransform(A, w.id);
5498
- const N = (a == null ? void 0 : a.width) || ((G = w.geometry) == null ? void 0 : G.width) || w.width || 0, S = (a == null ? void 0 : a.height) || ((h = w.geometry) == null ? void 0 : h.height) || w.height || 0;
5492
+ for (this.artboard.objects.forEach((h) => {
5493
+ var s, G;
5494
+ if (!h.parentId) {
5495
+ const w = this.objectStates.get(h.id), a = (w == null ? void 0 : w.geometry) || h.geometry;
5496
+ if (a && a.isMask && (w == null ? void 0 : w.visible) !== !1) {
5497
+ A.save(), this.applyObjectTransform(A, h.id);
5498
+ const N = (a == null ? void 0 : a.width) || ((s = h.geometry) == null ? void 0 : s.width) || h.width || 0, S = (a == null ? void 0 : a.height) || ((G = h.geometry) == null ? void 0 : G.height) || h.height || 0;
5499
5499
  this.applyPath(A, a, N, S), A.clip(), o++;
5500
5500
  } else
5501
- this.renderObject(A, w, i);
5501
+ this.renderObject(A, h, i);
5502
5502
  }
5503
5503
  }); o > 0; )
5504
5504
  A.restore(), o--;
5505
5505
  A.restore();
5506
5506
  }
5507
5507
  calculateTransform(A, I, C, g, Q, B) {
5508
- let i = 1, o = 1, w = 1;
5509
- const G = C / g, h = A / I;
5508
+ let i = 1, o = 1, h = 1;
5509
+ const s = C / g, G = A / I;
5510
5510
  switch (Q) {
5511
5511
  case "Contain":
5512
- h > G ? w = I / g : w = A / C, i = o = w;
5512
+ G > s ? h = I / g : h = A / C, i = o = h;
5513
5513
  break;
5514
5514
  case "Cover":
5515
- h > G ? w = A / C : w = I / g, i = o = w;
5515
+ G > s ? h = A / C : h = I / g, i = o = h;
5516
5516
  break;
5517
5517
  case "Fill":
5518
5518
  i = A / C, o = I / g;
5519
5519
  break;
5520
5520
  case "FitWidth":
5521
- w = A / C, i = o = w;
5521
+ h = A / C, i = o = h;
5522
5522
  break;
5523
5523
  case "FitHeight":
5524
- w = I / g, i = o = w;
5524
+ h = I / g, i = o = h;
5525
5525
  break;
5526
5526
  case "None":
5527
5527
  i = o = 1;
5528
5528
  break;
5529
5529
  case "ScaleDown":
5530
- w = Math.min(A / C, I / g), w > 1 && (w = 1), i = o = w;
5530
+ h = Math.min(A / C, I / g), h > 1 && (h = 1), i = o = h;
5531
5531
  break;
5532
5532
  default:
5533
5533
  i = o = 1;
5534
5534
  break;
5535
5535
  }
5536
- const s = C * i, a = g * o;
5536
+ const w = C * i, a = g * o;
5537
5537
  let N = 0, S = 0;
5538
- return B.includes("Left") ? N = 0 : B.includes("Right") ? N = A - s : N = (A - s) / 2, B.includes("Top") ? S = 0 : B.includes("Bottom") ? S = I - a : S = (I - a) / 2, { scaleX: i, scaleY: o, tx: N, ty: S };
5538
+ return B.includes("Left") ? N = 0 : B.includes("Right") ? N = A - w : N = (A - w) / 2, B.includes("Top") ? S = 0 : B.includes("Bottom") ? S = I - a : S = (I - a) / 2, { scaleX: i, scaleY: o, tx: N, ty: S };
5539
5539
  }
5540
5540
  mapFontWeight(A) {
5541
5541
  const I = A.toLowerCase();
5542
5542
  return /^\d+$/.test(I) ? I : I.includes("thin") ? "100" : I.includes("extra light") || I.includes("extralight") ? "200" : I.includes("light") ? "300" : I.includes("medium") ? "500" : I.includes("semibold") || I.includes("semi bold") ? "600" : I.includes("bold") ? "700" : I.includes("extra bold") || I.includes("extrabold") ? "800" : I.includes("black") || I.includes("heavy") ? "900" : "400";
5543
5543
  }
5544
5544
  renderObject(A, I, C) {
5545
- var R, Y, t;
5545
+ var U, c, t;
5546
5546
  const g = this.objectStates.get(I.id);
5547
5547
  if (!g) {
5548
5548
  console.warn("No state for object:", I.id);
5549
5549
  return;
5550
5550
  }
5551
- A.roundRect || (A.roundRect = (J, U, c, e, r) => (this.drawRoundRect(A, J, U, c, e, r), A));
5551
+ A.roundRect || (A.roundRect = (J, R, e, Y, r) => (this.drawRoundRect(A, J, R, e, Y, r), A));
5552
5552
  const Q = g.geometry ? { ...I.geometry, ...g.geometry } : I.geometry, B = g.style ? { ...I.style, ...g.style } : I.style;
5553
- let i = (Q == null ? void 0 : Q.width) || ((R = I.geometry) == null ? void 0 : R.width) || I.width || 0, o = (Q == null ? void 0 : Q.height) || ((Y = I.geometry) == null ? void 0 : Y.height) || I.height || 0;
5553
+ let i = (Q == null ? void 0 : Q.width) || ((U = I.geometry) == null ? void 0 : U.width) || I.width || 0, o = (Q == null ? void 0 : Q.height) || ((c = I.geometry) == null ? void 0 : c.height) || I.height || 0;
5554
5554
  if ((i === 0 || o === 0) && (Q != null && Q.points) && Array.isArray(Q.points) && Q.points.length > 0) {
5555
- let J = 1 / 0, U = -1 / 0, c = 1 / 0, e = -1 / 0;
5555
+ let J = 1 / 0, R = -1 / 0, e = 1 / 0, Y = -1 / 0;
5556
5556
  Q.points.forEach((r) => {
5557
- J = Math.min(J, r.x), U = Math.max(U, r.x), c = Math.min(c, r.y), e = Math.max(e, r.y);
5558
- }), i === 0 && (i = U - J), o === 0 && (o = e - c);
5557
+ J = Math.min(J, r.x), R = Math.max(R, r.x), e = Math.min(e, r.y), Y = Math.max(Y, r.y);
5558
+ }), i === 0 && (i = R - J), o === 0 && (o = Y - e);
5559
5559
  }
5560
- const w = (J) => {
5561
- if (!J) return;
5562
- const U = J.corner_radius, c = J.cornerRadius;
5563
- return Array.isArray(U) || typeof U == "number" && U !== 0 ? U : Array.isArray(c) || typeof c == "number" && c !== 0 ? c : U !== void 0 ? U : c;
5564
- }, G = w(g) ?? w(B) ?? w(Q) ?? w(I.style) ?? w(I.geometry) ?? 0, h = { ...Q, width: i, height: o };
5565
- if (delete h.cornerRadius, h.corner_radius = G, g.visible === !1)
5560
+ const h = (J) => {
5561
+ if (J)
5562
+ return J.corner_radius ?? J.cornerRadius;
5563
+ }, s = h(g) ?? h(B) ?? h(Q) ?? h(I.style) ?? h(I.geometry) ?? 0, G = { ...Q, width: i, height: o };
5564
+ if (delete G.cornerRadius, G.corner_radius = s, g.visible === !1)
5566
5565
  return;
5567
- const s = g.x, a = g.y;
5566
+ const w = g.x, a = g.y;
5568
5567
  A.save();
5569
- const N = A.globalAlpha, S = g.opacity !== void 0 ? g.opacity : 1;
5568
+ const N = A.globalAlpha, S = this.normalizeOpacity(g.opacity !== void 0 ? g.opacity : 100);
5570
5569
  A.globalAlpha = N * S;
5571
- const F = g.compositeOperation || g.blendMode;
5572
- if (F && F !== "Normal") {
5573
- const J = F.toLowerCase();
5570
+ const k = g.compositeOperation || g.blendMode;
5571
+ if (k && k !== "Normal") {
5572
+ const J = k.toLowerCase();
5574
5573
  [
5575
5574
  "multiply",
5576
5575
  "screen",
@@ -5602,23 +5601,23 @@ class xC {
5602
5601
  "screen"
5603
5602
  ].includes(J) && (A.globalCompositeOperation = J);
5604
5603
  }
5605
- if (A.translate(s, a), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
5604
+ if (A.translate(w, a), A.rotate(g.rotation * Math.PI / 180), A.scale(g.scale_x, g.scale_y), Q.type === "Text") {
5606
5605
  let J = Q.text || "";
5607
5606
  if (Q.textInputId) {
5608
5607
  const p = this.inputs.get(Q.textInputId);
5609
5608
  p !== void 0 && (J = String(p), g.geometry && g.geometry.type === "Text" && (g.geometry.text = J));
5610
5609
  }
5611
- let U = J || "";
5612
- Q.segments && Array.isArray(Q.segments) && (U = Q.segments.map((p) => p && p.text ? p.text : "").join(""));
5613
- const c = Q.textCase || "none";
5614
- c === "uppercase" ? U = U.toUpperCase() : c === "lowercase" ? U = U.toLowerCase() : c === "capitalize" && (U = U.replace(/\b\w/g, (p) => p.toUpperCase()));
5615
- let e = ((t = Q.fontWeight) == null ? void 0 : t.toString()) || "400", r = "normal";
5616
- e.toLowerCase().includes("italic") && (r = "italic", e = e.replace(/italic/gi, "").trim() || "400");
5617
- const L = this.mapFontWeight(e), b = Math.max(1, Q.fontSize || 16);
5610
+ let R = J || "";
5611
+ Q.segments && Array.isArray(Q.segments) && (R = Q.segments.map((p) => p && p.text ? p.text : "").join(""));
5612
+ const e = Q.textCase || "none";
5613
+ e === "uppercase" ? R = R.toUpperCase() : e === "lowercase" ? R = R.toLowerCase() : e === "capitalize" && (R = R.replace(/\b\w/g, (p) => p.toUpperCase()));
5614
+ let Y = ((t = Q.fontWeight) == null ? void 0 : t.toString()) || "400", r = "normal";
5615
+ Y.toLowerCase().includes("italic") && (r = "italic", Y = Y.replace(/italic/gi, "").trim() || "400");
5616
+ const L = this.mapFontWeight(Y), b = Math.max(1, Q.fontSize || 16);
5618
5617
  A.font = `${r} ${L} ${b}px "${Q.fontFamily || "Inter"}", sans-serif`;
5619
- const z = Q.textVerticalAlign || "top";
5618
+ const P = Q.textVerticalAlign || "top";
5620
5619
  let IA = -o / 2;
5621
- z === "middle" || z === "center" ? (A.textBaseline = "middle", IA = 0) : z === "bottom" ? (A.textBaseline = "bottom", IA = o / 2) : (A.textBaseline = "top", IA = -o / 2);
5620
+ P === "middle" || P === "center" ? (A.textBaseline = "middle", IA = 0) : P === "bottom" ? (A.textBaseline = "bottom", IA = o / 2) : (A.textBaseline = "top", IA = -o / 2);
5622
5621
  const m = Q.textAlign || "left";
5623
5622
  A.textAlign = m;
5624
5623
  let QA = -i / 2;
@@ -5629,7 +5628,7 @@ class xC {
5629
5628
  for (let d = 0; d < p.length; d++)
5630
5629
  iA += A.measureText(p[d]).width + _;
5631
5630
  return iA - _;
5632
- }, n = [], W = String(U || "").split(`
5631
+ }, q = [], W = String(R || "").split(`
5633
5632
  `);
5634
5633
  W.forEach((p, iA) => {
5635
5634
  const d = String(p || "").split(" ");
@@ -5651,30 +5650,30 @@ class xC {
5651
5650
  }
5652
5651
  if (sA !== -1) {
5653
5652
  const oA = x.substring(0, sA + 1), NA = x.substring(sA + 1);
5654
- n.push({ text: l + oA, isParaEnd: !1 }), l = "", d[Z] = NA, Z--;
5653
+ q.push({ text: l + oA, isParaEnd: !1 }), l = "", d[Z] = NA, Z--;
5655
5654
  continue;
5656
5655
  } else {
5657
- n.push({ text: l.trim(), isParaEnd: !1 }), l = "", Z--;
5656
+ q.push({ text: l.trim(), isParaEnd: !1 }), l = "", Z--;
5658
5657
  continue;
5659
5658
  }
5660
5659
  }
5661
5660
  let hA = "";
5662
5661
  for (let sA = 0; sA < x.length; sA++) {
5663
5662
  const oA = hA + x[sA];
5664
- O(oA) > gA && hA !== "" ? (n.push({ text: hA, isParaEnd: !1 }), hA = x[sA]) : hA = oA;
5663
+ O(oA) > gA && hA !== "" ? (q.push({ text: hA, isParaEnd: !1 }), hA = x[sA]) : hA = oA;
5665
5664
  }
5666
5665
  l = hA + " ";
5667
5666
  }
5668
5667
  }
5669
- n.push({ text: l.trim(), isParaEnd: iA < W.length - 1 });
5668
+ q.push({ text: l.trim(), isParaEnd: iA < W.length - 1 });
5670
5669
  });
5671
- let f = IA, T = n.length * X;
5670
+ let f = IA, T = q.length * X;
5672
5671
  if (BA > 0) {
5673
- const p = n.filter((iA, d) => iA.isParaEnd && d < n.length - 1).length;
5672
+ const p = q.filter((iA, d) => iA.isParaEnd && d < q.length - 1).length;
5674
5673
  T += p * BA;
5675
5674
  }
5676
- z === "middle" || z === "center" ? f -= T / 2 - b / 2 : z === "bottom" && (f -= T - b);
5677
- const P = (p, iA, d, l, Z) => {
5675
+ P === "middle" || P === "center" ? f -= T / 2 - b / 2 : P === "bottom" && (f -= T - b);
5676
+ const V = (p, iA, d, l, Z) => {
5678
5677
  var x, aA;
5679
5678
  if (_ === 0 && (Q.enableSegments !== !0 || !Q.segments || Q.segments.length === 0))
5680
5679
  l ? A.strokeText(p, iA, d) : A.fillText(p, iA, d);
@@ -5710,124 +5709,131 @@ class xC {
5710
5709
  };
5711
5710
  if (B.fill) {
5712
5711
  const p = A.globalAlpha, iA = this.createCanvasFill(A, B.fill, i, o);
5713
- A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha = p * (B.fill.opacity ?? 1);
5712
+ A.fillStyle = iA || B.fill.color || "#000000", A.globalAlpha = p * this.normalizeOpacity(B.fill.opacity ?? 100);
5714
5713
  let d = 0, l = f;
5715
- n.forEach((Z) => {
5716
- const x = U.indexOf(Z.text, d);
5717
- x !== -1 && (P(Z.text, QA, l, !1, x), d = x + Z.text.length, l += X + (Z.isParaEnd ? BA : 0));
5714
+ q.forEach((Z) => {
5715
+ const x = R.indexOf(Z.text, d);
5716
+ x !== -1 && (V(Z.text, QA, l, !1, x), d = x + Z.text.length, l += X + (Z.isParaEnd ? BA : 0));
5718
5717
  }), A.globalAlpha = p;
5719
5718
  }
5720
5719
  if (B.stroke && B.stroke.width > 0) {
5721
5720
  const p = A.globalAlpha;
5722
- A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = p * (B.stroke.opacity ?? 1);
5721
+ A.strokeStyle = B.stroke.color, A.lineWidth = B.stroke.width, A.globalAlpha = p * this.normalizeOpacity(B.stroke.opacity ?? 100);
5723
5722
  let iA = 0, d = f;
5724
- n.forEach((l) => {
5725
- const Z = U.indexOf(l.text, iA);
5726
- Z !== -1 && (P(l.text, QA, d, !0, Z), iA = Z + l.text.length, d += X + (l.isParaEnd ? BA : 0));
5723
+ q.forEach((l) => {
5724
+ const Z = R.indexOf(l.text, iA);
5725
+ Z !== -1 && (V(l.text, QA, d, !0, Z), iA = Z + l.text.length, d += X + (l.isParaEnd ? BA : 0));
5727
5726
  }), A.globalAlpha = p;
5728
5727
  }
5729
5728
  } else if (Q.type === "Image") {
5730
5729
  const J = Q.src;
5731
5730
  if (J) {
5732
- let U = this.imageCache.get(J);
5733
- U || (U = new Image(), U.onload = () => {
5734
- }, U.onerror = () => {
5731
+ let R = this.imageCache.get(J);
5732
+ R || (R = new Image(), R.onload = () => {
5733
+ }, R.onerror = () => {
5735
5734
  console.error(`[ExodeUI] Image load failed: ${J.substring(0, 100)}${J.length > 100 ? "..." : ""}`);
5736
- }, U.src = J, this.imageCache.set(J, U)), U.complete && U.naturalWidth > 0 && (G !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, G), A.clip(), A.drawImage(U, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(U, -i / 2, -o / 2, i, o));
5735
+ }, R.src = J, this.imageCache.set(J, R)), R.complete && R.naturalWidth > 0 && (s !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, s), A.clip(), A.drawImage(R, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(R, -i / 2, -o / 2, i, o));
5737
5736
  }
5738
5737
  } else if (Q.type === "SVG") {
5739
5738
  const J = Q.svgContent;
5740
5739
  if (J) {
5741
- const U = B.palette || [], c = I.id + "_" + U.join("_");
5742
- let e = this.imageCache.get(c);
5743
- if (!e) {
5744
- e = new Image();
5740
+ const R = B.palette || [], e = I.id + "_" + R.join("_");
5741
+ let Y = this.imageCache.get(e);
5742
+ if (!Y) {
5743
+ Y = new Image();
5745
5744
  let r = J;
5746
- Q.colors && Q.colors.length > 0 && U.length > 0 && Q.colors.forEach((z, IA) => {
5747
- if (U[IA]) {
5748
- const m = z.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), QA = new RegExp(m, "gi");
5749
- r = r.replace(QA, U[IA]);
5745
+ Q.colors && Q.colors.length > 0 && R.length > 0 && Q.colors.forEach((P, IA) => {
5746
+ if (R[IA]) {
5747
+ const m = P.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), QA = new RegExp(m, "gi");
5748
+ r = r.replace(QA, R[IA]);
5750
5749
  }
5751
5750
  });
5752
5751
  const L = new Blob([r], { type: "image/svg+xml" }), b = URL.createObjectURL(L);
5753
- e.onload = () => {
5752
+ Y.onload = () => {
5754
5753
  this.artboard && this.reset();
5755
- }, e.src = b, this.imageCache.set(c, e);
5754
+ }, Y.src = b, this.imageCache.set(e, Y);
5756
5755
  }
5757
- e.complete && e.naturalWidth > 0 && (G !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, G), A.clip(), A.drawImage(e, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(e, -i / 2, -o / 2, i, o));
5756
+ Y.complete && Y.naturalWidth > 0 && (s !== 0 ? (A.save(), this.drawRoundRect(A, -i / 2, -o / 2, i, o, s), A.clip(), A.drawImage(Y, -i / 2, -o / 2, i, o), A.restore()) : A.drawImage(Y, -i / 2, -o / 2, i, o));
5758
5757
  }
5759
- } else if (h.type === "LineGraph")
5760
- this.renderLineGraph(A, h, i, o);
5758
+ } else if (G.type === "LineGraph")
5759
+ this.renderLineGraph(A, G, i, o);
5761
5760
  else if (I.type === "Shape") {
5762
- if (this.applyPath(A, h, i, o), A.save(), B.shadow && B.shadow.opacity > 0) {
5763
- const J = B.shadow.color || "#000000", U = B.shadow.opacity ?? 1;
5764
- let c = J;
5761
+ if (this.applyPath(A, G, i, o, s), A.save(), B.shadow && B.shadow.opacity > 0) {
5762
+ const J = B.shadow.color || "#000000", R = B.shadow.opacity ?? 1;
5763
+ let e = J;
5765
5764
  if (J.startsWith("#")) {
5766
- const e = parseInt(J.slice(1, 3), 16), r = parseInt(J.slice(3, 5), 16), L = parseInt(J.slice(5, 7), 16);
5767
- c = `rgba(${e}, ${r}, ${L}, ${U})`;
5768
- } else J.startsWith("rgba") && (c = J.replace(/[\d.]+\)$/g, `${U})`));
5769
- A.shadowColor = c, A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
5765
+ const Y = parseInt(J.slice(1, 3), 16), r = parseInt(J.slice(3, 5), 16), L = parseInt(J.slice(5, 7), 16);
5766
+ e = `rgba(${Y}, ${r}, ${L}, ${R})`;
5767
+ } else J.startsWith("rgba") && (e = J.replace(/[\d.]+\)$/g, `${R})`));
5768
+ A.shadowColor = e, A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
5770
5769
  }
5771
5770
  if (B.blur && B.blur.amount > 0 && (A.filter = `blur(${B.blur.amount}px)`), B.fill) {
5772
- const J = A.globalAlpha, U = this.createCanvasFill(A, B.fill, i, o);
5773
- U ? A.fillStyle = U : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = J * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = J;
5771
+ const J = A.globalAlpha, R = this.createCanvasFill(A, B.fill, i, o);
5772
+ R ? A.fillStyle = R : A.fillStyle = B.fill.color || "transparent", A.globalAlpha = J * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = J;
5774
5773
  }
5775
- A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B, h, i, o);
5774
+ A.restore(), B.stroke && B.stroke.width > 0 && this.applyStrokeAlignment(A, B, G, i, o);
5776
5775
  } else if (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) {
5777
- const J = g.width ?? Q.width ?? I.width ?? i, U = g.height ?? Q.height ?? I.height ?? o, c = G;
5776
+ const J = g.width ?? Q.width ?? I.width ?? i, R = g.height ?? Q.height ?? I.height ?? o, e = s;
5778
5777
  if (A.save(), B.shadow && B.shadow.opacity > 0) {
5779
5778
  const r = B.shadow.color || "#000000", L = B.shadow.opacity ?? 1;
5780
5779
  let b = r;
5781
5780
  if (r.startsWith("#")) {
5782
- const z = parseInt(r.slice(1, 3), 16), IA = parseInt(r.slice(3, 5), 16), m = parseInt(r.slice(5, 7), 16);
5783
- b = `rgba(${z}, ${IA}, ${m}, ${L})`;
5781
+ const P = parseInt(r.slice(1, 3), 16), IA = parseInt(r.slice(3, 5), 16), m = parseInt(r.slice(5, 7), 16);
5782
+ b = `rgba(${P}, ${IA}, ${m}, ${L})`;
5784
5783
  }
5785
5784
  A.shadowColor = b, A.shadowBlur = B.shadow.blur, A.shadowOffsetX = B.shadow.offsetX, A.shadowOffsetY = B.shadow.offsetY;
5786
5785
  }
5787
- if (A.beginPath(), this.drawRoundRect(A, -J / 2, -U / 2, J, U, c), B.fill && B.fill.type !== "None") {
5788
- const r = A.globalAlpha, L = this.createCanvasFill(A, B.fill, J, U);
5789
- A.fillStyle = L || B.fill.color || "transparent", A.globalAlpha = r * (B.fill.opacity ?? 1), A.fill(), A.globalAlpha = r;
5786
+ if (A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), B.fill && B.fill.type !== "None") {
5787
+ const r = A.globalAlpha, L = this.createCanvasFill(A, B.fill, J, R);
5788
+ A.fillStyle = L || B.fill.color || "transparent", A.globalAlpha = r * this.normalizeOpacity(B.fill.opacity ?? 100), A.fill(), A.globalAlpha = r;
5790
5789
  }
5791
5790
  if (A.restore(), B.stroke && B.stroke.width > 0 && B.stroke.isEnabled !== !1) {
5792
- const r = { type: "Rectangle", corner_radius: c };
5793
- this.applyStrokeAlignment(A, B, r, J, U);
5791
+ const r = { type: "Rectangle" };
5792
+ this.applyStrokeAlignment(A, B, r, J, R, e);
5794
5793
  }
5795
- (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), this.drawRoundRect(A, -J / 2, -U / 2, J, U, c), A.clip());
5794
+ (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0 && (A.save(), A.beginPath(), this.drawRoundRect(A, -J / 2, -R / 2, J, R, e), A.clip());
5796
5795
  } else I.type === "Component" && I.variant === "inputbox" ? this.renderInputBox(A, I) : I.type === "Component" && I.variant === "button" ? this.renderButton(A, I) : I.type === "Component" && I.variant === "toggle_button" ? this.renderToggleButton(A, I) : I.type === "Toggle" || I.type === "Component" && I.variant === "toggle" ? this.renderToggle(A, I) : I.type === "Slider" || I.type === "Component" && I.variant === "slider" ? this.renderSlider(A, I) : I.type === "Dropdown" || I.type === "Component" && I.variant === "dropdown" ? this.renderDropdown(A, I) : (I.type === "ListView" || I.type === "Component" && I.variant === "listview") && this.renderListView(A, I);
5797
- const M = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
5796
+ const y = (I.type === "Frame" || I.type === "Group" && !I.isStructuralGroup) && (I.clipsContent !== !1 || I.clipContent === !0) && I.children && I.children.length > 0;
5798
5797
  if (I.children && I.children.length > 0) {
5799
5798
  let J = 0;
5800
- for (I.children.forEach((U) => {
5801
- const c = C.get(U);
5802
- if (!c) return;
5803
- const e = this.objectStates.get(U), r = (e == null ? void 0 : e.geometry) || c.geometry;
5804
- if (r && r.isMask && (e == null ? void 0 : e.visible) !== !1) {
5799
+ for (I.children.forEach((R) => {
5800
+ const e = C.get(R);
5801
+ if (!e) return;
5802
+ const Y = this.objectStates.get(R), r = (Y == null ? void 0 : Y.geometry) || e.geometry;
5803
+ if (r && r.isMask && (Y == null ? void 0 : Y.visible) !== !1) {
5805
5804
  const L = r.width || 0, b = r.height || 0;
5806
- this.applyObjectTransform(A, U), this.applyPath(A, r, L, b), A.clip(), J++;
5805
+ this.applyObjectTransform(A, R);
5806
+ const P = (Y == null ? void 0 : Y.corner_radius) ?? (r == null ? void 0 : r.corner_radius) ?? 0;
5807
+ this.applyPath(A, r, L, b, P), A.clip(), J++;
5807
5808
  } else
5808
- this.renderObject(A, c, C);
5809
+ this.renderObject(A, e, C);
5809
5810
  }); J > 0; )
5810
5811
  A.restore(), J--;
5811
5812
  }
5812
- M && A.restore(), A.restore();
5813
+ y && A.restore(), A.restore();
5813
5814
  }
5814
- applyStrokeAlignment(A, I, C, g, Q) {
5815
+ applyStrokeAlignment(A, I, C, g, Q, B) {
5815
5816
  if (!I.stroke || I.stroke.width <= 0 || I.stroke.isEnabled === !1) return;
5816
- const B = A.globalAlpha, i = I.stroke.width, o = I.stroke.alignment || "center", w = I.stroke;
5817
- A.save(), A.strokeStyle = w.color || "#000000", A.globalAlpha = B * (w.opacity ?? 1), A.lineCap = w.lineCap || "round", A.lineJoin = w.lineJoin || "round", w.miterLimit !== void 0 && (A.miterLimit = w.miterLimit);
5818
- const G = w.trimStart ?? 0, h = w.trimEnd ?? 1, s = w.trimOffset ?? 0, a = w.dashOffset ?? 0, N = w.dashArray || [];
5819
- if (G !== 0 || h !== 1 || s !== 0) {
5820
- const S = this.getPerimeter(C, g, Q);
5821
- if (S > 0) {
5822
- const F = Math.max(0, Math.min(1, G)), M = Math.max(0, Math.min(1, h));
5823
- if (F < M) {
5824
- const R = S * (M - F), Y = S - R, t = -(S * (F + s % 1 + a % 1));
5825
- A.setLineDash([R, Y]), A.lineDashOffset = t;
5817
+ const i = A.globalAlpha, o = I.stroke.width, h = I.stroke.alignment || "center", s = I.stroke;
5818
+ if (A.save(), s.fill) {
5819
+ const k = this.createCanvasFill(A, s.fill, g, Q);
5820
+ k ? A.strokeStyle = k : A.strokeStyle = s.color || "#000000";
5821
+ } else
5822
+ A.strokeStyle = s.color || "#000000";
5823
+ A.globalAlpha = i * this.normalizeOpacity(s.opacity ?? 100), A.lineCap = s.lineCap || "round", A.lineJoin = s.lineJoin || "round", s.miterLimit !== void 0 && (A.miterLimit = s.miterLimit);
5824
+ const G = s.trimStart ?? 0, w = s.trimEnd ?? 1, a = s.trimOffset ?? 0, N = s.dashOffset ?? 0, S = s.dashArray || [];
5825
+ if (G !== 0 || w !== 1 || a !== 0) {
5826
+ const k = this.getPerimeter(C, g, Q);
5827
+ if (k > 0) {
5828
+ const y = Math.max(0, Math.min(1, G)), U = Math.max(0, Math.min(1, w));
5829
+ if (y < U) {
5830
+ const c = k * (U - y), t = k - c, J = -(k * (y + a % 1 + N % 1));
5831
+ A.setLineDash([c, t]), A.lineDashOffset = J;
5826
5832
  } else
5827
- A.setLineDash([0, S]);
5833
+ A.setLineDash([0, k]);
5828
5834
  }
5829
- } else N.length > 0 && (A.setLineDash(N), A.lineDashOffset = a);
5830
- o === "inside" ? (A.lineWidth = i * 2, this.applyPath(A, C, g, Q), A.clip(), A.stroke()) : o === "outside" ? (A.lineWidth = i * 2, A.beginPath(), A.rect(-1e5, -1e5, 2e5, 2e5), this._tracePath(A, C, g, Q), A.clip("evenodd"), A.stroke()) : (A.lineWidth = i, this.applyPath(A, C, g, Q), A.stroke()), A.restore(), A.globalAlpha = B;
5835
+ } else S.length > 0 && (A.setLineDash(S), A.lineDashOffset = N);
5836
+ h === "inside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.clip(), A.stroke()) : h === "outside" ? (A.lineWidth = o * 2, this.applyPath(A, C, g, Q, B), A.stroke(), A.save(), A.globalCompositeOperation = "destination-out", this.applyPath(A, C, g, Q, B), A.fill(), A.restore()) : (A.lineWidth = o, this.applyPath(A, C, g, Q, B), A.stroke()), A.restore(), A.globalAlpha = i;
5831
5837
  }
5832
5838
  getPerimeter(A, I, C) {
5833
5839
  switch (A.type) {
@@ -5869,70 +5875,73 @@ class xC {
5869
5875
  }
5870
5876
  applyObjectTransform(A, I) {
5871
5877
  const C = this.objectStates.get(I);
5872
- C && (A.translate(C.x, C.y), A.rotate(C.rotation * Math.PI / 180), A.scale(C.scale_x, C.scale_y));
5878
+ if (!C) return;
5879
+ A.translate(C.x, C.y), A.rotate(C.rotation * Math.PI / 180);
5880
+ const g = (C.scale_x ?? 1) * (C.flip_x === !0 ? -1 : 1), Q = (C.scale_y ?? 1) * (C.flip_y === !0 ? -1 : 1);
5881
+ A.scale(g, Q);
5882
+ }
5883
+ applyPath(A, I, C, g, Q) {
5884
+ A.beginPath(), this._tracePath(A, I, C, g, Q);
5873
5885
  }
5874
- _tracePath(A, I, C, g) {
5886
+ _tracePath(A, I, C, g, Q) {
5875
5887
  if (I.type === "Rectangle") {
5876
- const Q = I.cornerRadius ?? I.corner_radius ?? 0;
5877
- this.drawRoundRect(A, -C / 2, -g / 2, C, g, Q);
5888
+ const B = Q !== void 0 ? Q : I.corner_radius ?? 0;
5889
+ this.drawRoundRect(A, -C / 2, -g / 2, C, g, B);
5878
5890
  } else if (I.type === "Ellipse")
5879
5891
  A.ellipse(0, 0, C / 2, g / 2, 0, 0, Math.PI * 2);
5880
5892
  else if (I.type === "Triangle")
5881
5893
  A.moveTo(0, -g / 2), A.lineTo(C / 2, g / 2), A.lineTo(-C / 2, g / 2), A.closePath();
5882
5894
  else if (I.type === "Star") {
5883
- const Q = I.inner_radius || 20, B = I.outer_radius || 50, i = I.points || 5;
5884
- for (let o = 0; o < i * 2; o++) {
5885
- const w = o * Math.PI / i - Math.PI / 2, G = o % 2 === 0 ? B : Q, h = G * Math.cos(w), s = G * Math.sin(w);
5886
- o === 0 ? A.moveTo(h, s) : A.lineTo(h, s);
5895
+ const B = I.inner_radius || 20, i = I.outer_radius || 50, o = I.points || 5;
5896
+ for (let h = 0; h < o * 2; h++) {
5897
+ const s = h * Math.PI / o - Math.PI / 2, G = h % 2 === 0 ? i : B, w = G * Math.cos(s), a = G * Math.sin(s);
5898
+ h === 0 ? A.moveTo(w, a) : A.lineTo(w, a);
5887
5899
  }
5888
5900
  A.closePath();
5889
5901
  } else if ((I.type === "Path" || I.type === "Subtract" || I.type === "Union" || I.type === "Intersect" || I.type === "Exclude" || I.type === "BooleanOperation") && I.points) {
5890
- let Q = 1 / 0, B = -1 / 0, i = 1 / 0, o = -1 / 0;
5891
- I.points.forEach((h) => {
5892
- Q = Math.min(Q, h.x), B = Math.max(B, h.x), i = Math.min(i, h.y), o = Math.max(o, h.y);
5902
+ let B = 1 / 0, i = -1 / 0, o = 1 / 0, h = -1 / 0;
5903
+ I.points.forEach((w) => {
5904
+ B = Math.min(B, w.x), i = Math.max(i, w.x), o = Math.min(o, w.y), h = Math.max(h, w.y);
5893
5905
  });
5894
- const w = (Q + B) / 2, G = (i + o) / 2;
5895
- I.points.forEach((h, s) => {
5896
- if (s === 0)
5897
- A.moveTo(h.x - w, h.y - G);
5906
+ const s = (B + i) / 2, G = (o + h) / 2;
5907
+ I.points.forEach((w, a) => {
5908
+ if (a === 0)
5909
+ A.moveTo(w.x - s, w.y - G);
5898
5910
  else {
5899
- const a = I.points[s - 1], N = (a.out_x ?? a.x) - w, S = (a.out_y ?? a.y) - G, F = (h.in_x ?? h.x) - w, M = (h.in_y ?? h.y) - G;
5900
- A.bezierCurveTo(N, S, F, M, h.x - w, h.y - G);
5911
+ const N = I.points[a - 1], S = (N.out_x ?? N.x) - s, k = (N.out_y ?? N.y) - G, y = (w.in_x ?? w.x) - s, U = (w.in_y ?? w.y) - G;
5912
+ A.bezierCurveTo(S, k, y, U, w.x - s, w.y - G);
5901
5913
  }
5902
5914
  }), I.is_closed && A.closePath();
5903
5915
  } else if (I.points && Array.isArray(I.points)) {
5904
- let Q = 1 / 0, B = -1 / 0, i = 1 / 0, o = -1 / 0;
5905
- I.points.forEach((h) => {
5906
- Q = Math.min(Q, h.x), B = Math.max(B, h.x), i = Math.min(i, h.y), o = Math.max(o, h.y);
5916
+ let B = 1 / 0, i = -1 / 0, o = 1 / 0, h = -1 / 0;
5917
+ I.points.forEach((w) => {
5918
+ B = Math.min(B, w.x), i = Math.max(i, w.x), o = Math.min(o, w.y), h = Math.max(h, w.y);
5907
5919
  });
5908
- const w = (Q + B) / 2, G = (i + o) / 2;
5909
- I.points.forEach((h, s) => {
5910
- if (s === 0) A.moveTo(h.x - w, h.y - G);
5920
+ const s = (B + i) / 2, G = (o + h) / 2;
5921
+ I.points.forEach((w, a) => {
5922
+ if (a === 0) A.moveTo(w.x - s, w.y - G);
5911
5923
  else {
5912
- const a = I.points[s - 1];
5913
- a.out_x !== void 0 || h.in_x !== void 0 ? A.bezierCurveTo(
5914
- (a.out_x ?? a.x) - w,
5915
- (a.out_y ?? a.y) - G,
5916
- (h.in_x ?? h.x) - w,
5917
- (h.in_y ?? h.y) - G,
5918
- h.x - w,
5919
- h.y - G
5920
- ) : A.lineTo(h.x - w, h.y - G);
5924
+ const N = I.points[a - 1];
5925
+ N.out_x !== void 0 || w.in_x !== void 0 ? A.bezierCurveTo(
5926
+ (N.out_x ?? N.x) - s,
5927
+ (N.out_y ?? N.y) - G,
5928
+ (w.in_x ?? w.x) - s,
5929
+ (w.in_y ?? w.y) - G,
5930
+ w.x - s,
5931
+ w.y - G
5932
+ ) : A.lineTo(w.x - s, w.y - G);
5921
5933
  }
5922
5934
  }), I.is_closed && A.closePath();
5923
5935
  }
5924
5936
  }
5925
- applyPath(A, I, C, g) {
5926
- A.beginPath(), this._tracePath(A, I, C, g);
5927
- }
5928
5937
  renderInputBox(A, I) {
5929
5938
  var p, iA;
5930
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((p = I.geometry) == null ? void 0 : p.width) || 250, B = ((iA = I.geometry) == null ? void 0 : iA.height) || 45, i = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id, w = g.previewState || "default", G = w !== "default" ? w : i ? "focused" : o ? "hovered" : "default", h = g.label || { visible: !0, text: "Label" }, s = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, S = g.multiline === !0, F = g.cornerRadius ?? 8, M = g.corners || { tl: F, tr: F, bl: F, br: F }, R = [M.tl, M.tr, M.br, M.bl];
5931
- let Y = g.backgroundColor || "rgba(31, 41, 55, 1)", t = g.borderColor || "rgba(55, 65, 81, 1)", J = g.borderWidth ?? 1.5, U = g.color || "#ffffff", c = g.placeholderColor || "rgba(156, 163, 175, 1)", e = g.fontSize || 14;
5932
- const r = `${G}Style`, L = g[r];
5933
- if (L ? (L.backgroundColor !== void 0 && (Y = L.backgroundColor), L.borderColor !== void 0 && (t = L.borderColor), L.borderWidth !== void 0 && (J = L.borderWidth), L.color !== void 0 && (U = L.color), L.placeholderColor !== void 0 && (c = L.placeholderColor), L.fontSize !== void 0 && (e = L.fontSize)) : G === "focused" ? (t = g.focusBorderColor || "rgba(59, 130, 246, 1)", J = Math.max(J, 2)) : G === "hovered" || G === "hover" ? (t = g.hoverBorderColor || t, Y = g.hoverBackgroundColor || Y) : G === "disabled" ? (Y = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", t = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : G === "error" && (t = "rgba(239, 68, 68, 1)", J = Math.max(J, 2)), A.beginPath(), this.drawRoundRect(A, -Q / 2, -B / 2, Q, B, R), A.fillStyle = Y, A.fill(), J > 0 && (A.strokeStyle = t, A.lineWidth = J, A.stroke(), G === "focused" || G === "focus")) {
5939
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((p = I.geometry) == null ? void 0 : p.width) || 250, B = ((iA = I.geometry) == null ? void 0 : iA.height) || 45, i = this.focusedId === I.id, o = this.lastHoveredObjectId === I.id, h = g.previewState || "default", s = h !== "default" ? h : i ? "focused" : o ? "hovered" : "default", G = g.label || { visible: !0, text: "Label" }, w = g.helperText || { visible: !1, text: "Helper text" }, a = g.leftIcon || { visible: !1 }, N = g.rightIcon || { visible: !1 }, S = g.multiline === !0, k = g.corner_radius ?? 8, y = g.corners || { tl: k, tr: k, bl: k, br: k }, U = [y.tl, y.tr, y.br, y.bl];
5940
+ let c = g.backgroundColor || "rgba(31, 41, 55, 1)", t = g.borderColor || "rgba(55, 65, 81, 1)", J = g.borderWidth ?? 1.5, R = g.color || "#ffffff", e = g.placeholderColor || "rgba(156, 163, 175, 1)", Y = g.fontSize || 14;
5941
+ const r = `${s}Style`, L = g[r];
5942
+ if (L ? (L.backgroundColor !== void 0 && (c = L.backgroundColor), L.borderColor !== void 0 && (t = L.borderColor), L.borderWidth !== void 0 && (J = L.borderWidth), L.color !== void 0 && (R = L.color), L.placeholderColor !== void 0 && (e = L.placeholderColor), L.fontSize !== void 0 && (Y = L.fontSize)) : s === "focused" ? (t = g.focusBorderColor || "rgba(59, 130, 246, 1)", J = Math.max(J, 2)) : s === "hovered" || s === "hover" ? (t = g.hoverBorderColor || t, c = g.hoverBackgroundColor || c) : s === "disabled" ? (c = g.disabledBackgroundColor || "rgba(31, 41, 55, 0.6)", t = g.disabledBorderColor || "rgba(55, 65, 81, 0.4)") : s === "error" && (t = "rgba(239, 68, 68, 1)", J = Math.max(J, 2)), A.beginPath(), this.drawRoundRect(A, -Q / 2, -B / 2, Q, B, U), A.fillStyle = c, A.fill(), J > 0 && (A.strokeStyle = t, A.lineWidth = J, A.stroke(), s === "focused" || s === "focus")) {
5934
5943
  A.save(), A.beginPath();
5935
- const d = R.map((l) => l + 2);
5944
+ const d = U.map((l) => l + 2);
5936
5945
  this.drawRoundRect(A, -Q / 2 - 2, -B / 2 - 2, Q + 4, B + 4, d), A.strokeStyle = "rgba(59, 130, 246, 0.3)", A.lineWidth = 2, A.stroke(), A.restore();
5937
5946
  }
5938
5947
  const b = (d, l) => {
@@ -5945,11 +5954,11 @@ class xC {
5945
5954
  A.restore();
5946
5955
  };
5947
5956
  b(a, !0), b(N, !1);
5948
- const z = g.text || "", IA = g.placeholder || "Enter text...", m = !z, QA = z || IA, _ = m ? c : U, BA = e, X = g.fontFamily || "Inter", gA = g.fontWeight || 400;
5957
+ const P = g.text || "", IA = g.placeholder || "Enter text...", m = !P, QA = P || IA, _ = m ? e : R, BA = Y, X = g.fontFamily || "Inter", gA = g.fontWeight || 400;
5949
5958
  A.font = `${gA} ${BA}px "${X}", sans-serif`, A.fillStyle = _, A.textAlign = "left", A.textBaseline = S ? "top" : "middle";
5950
- const O = g.inputPadding ?? 16, n = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : O, W = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : O, f = -(Q / 2) + n, T = Q - n - W, P = g.inputType === "password" ? "•".repeat(QA.length) : QA;
5959
+ const O = g.inputPadding ?? 16, q = a.visible ? (a.offset ?? 16) + (a.size || 14) / 2 + 8 : O, W = N.visible ? (N.offset ?? 16) + (N.size || 14) / 2 + 8 : O, f = -(Q / 2) + q, T = Q - q - W, V = g.inputType === "password" ? "•".repeat(QA.length) : QA;
5951
5960
  if (A.save(), A.beginPath(), A.rect(f - 2, -B / 2 + 4, T + 4, B - 8), A.clip(), S) {
5952
- const d = P.split(`
5961
+ const d = V.split(`
5953
5962
  `);
5954
5963
  let l = -B / 2 + O;
5955
5964
  const Z = BA * 1.2;
@@ -5964,33 +5973,33 @@ class xC {
5964
5973
  A.fillText(oA, f, l), x = A.measureText(oA).width, hA < d.length - 1 && (l += Z, x = 0);
5965
5974
  }), i && !m && Math.floor(performance.now() / 500) % 2 === 0 && A.fillRect(f + x, l, 1.5, BA);
5966
5975
  } else {
5967
- const l = A.measureText(P).width;
5976
+ const l = A.measureText(V).width;
5968
5977
  let Z = 0;
5969
- if (l > T && (Z = l - T), A.fillText(P, f - Z, 0), i && !m && Math.floor(performance.now() / 500) % 2 === 0) {
5978
+ if (l > T && (Z = l - T), A.fillText(V, f - Z, 0), i && !m && Math.floor(performance.now() / 500) % 2 === 0) {
5970
5979
  const aA = f + l - Z;
5971
5980
  A.fillRect(aA, -(BA / 2), 1.5, BA);
5972
5981
  }
5973
5982
  }
5974
- if (A.restore(), h.visible !== !1) {
5975
- const d = h.text || "Label", l = h.fontSize || 12, Z = h.color || "rgba(156, 163, 175, 1)", x = h.offset ?? 8;
5983
+ if (A.restore(), G.visible !== !1) {
5984
+ const d = G.text || "Label", l = G.fontSize || 12, Z = G.color || "rgba(156, 163, 175, 1)", x = G.offset ?? 8;
5976
5985
  A.font = `600 ${l}px "${X}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "bottom";
5977
5986
  const aA = -(Q / 2), hA = -(B / 2) - x;
5978
5987
  A.fillText(d, aA, hA);
5979
5988
  }
5980
- if (s.visible === !0) {
5981
- const d = s.text || "Helper text", l = s.fontSize || 11, Z = G === "error" ? "rgba(239, 68, 68, 1)" : s.color || "rgba(156, 163, 175, 1)", x = s.offset ?? 6;
5989
+ if (w.visible === !0) {
5990
+ const d = w.text || "Helper text", l = w.fontSize || 11, Z = s === "error" ? "rgba(239, 68, 68, 1)" : w.color || "rgba(156, 163, 175, 1)", x = w.offset ?? 6;
5982
5991
  A.font = `400 ${l}px "${X}", sans-serif`, A.fillStyle = Z, A.textAlign = "left", A.textBaseline = "top";
5983
5992
  const aA = -(Q / 2), hA = B / 2 + x;
5984
5993
  A.fillText(d, aA, hA);
5985
5994
  }
5986
5995
  }
5987
5996
  renderSlider(A, I) {
5988
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0, G = (Q.max ?? 100) - o, h = G === 0 ? 0 : (i - o) / G, s = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, N = Q.trackShape ?? "Rectangle", S = Q.trackPath || "", F = Q.activeColor || "#3b82f6", M = Q.inactiveColor || "#374151", R = Q.thumbShape || "Ellipse", Y = Q.thumbWidth ?? 16, t = Q.thumbHeight ?? 16, J = Q.thumbRoundedness ?? 0, U = Q.thumbColor || "#ffffff", c = Q.thumbPath || "", e = Q.thumbIcon || "", r = Q.showValueTooltip ?? !1, L = Q.tooltipBgColor || "#333333", b = Q.tooltipColor || "#ffffff", z = Q.tooltipOffsetX ?? 0, IA = Q.tooltipOffsetY ?? -25, m = (n, W, f, T, P, p, iA) => {
5989
- if ((n === "Custom" || n === "Icon") && iA)
5997
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.geometry) || I.geometry, Q = (C == null ? void 0 : C.options) || I.options || {}, B = g.width || 200, i = Q.value ?? 50, o = Q.min ?? 0, s = (Q.max ?? 100) - o, G = s === 0 ? 0 : (i - o) / s, w = Q.trackHeight || 4, a = Q.trackRoundedness ?? 2, N = Q.trackShape ?? "Rectangle", S = Q.trackPath || "", k = Q.activeColor || "#3b82f6", y = Q.inactiveColor || "#374151", U = Q.thumbShape || "Ellipse", c = Q.thumbWidth ?? 16, t = Q.thumbHeight ?? 16, J = Q.thumbRoundedness ?? 0, R = Q.thumbColor || "#ffffff", e = Q.thumbPath || "", Y = Q.thumbIcon || "", r = Q.showValueTooltip ?? !1, L = Q.tooltipBgColor || "#333333", b = Q.tooltipColor || "#ffffff", P = Q.tooltipOffsetX ?? 0, IA = Q.tooltipOffsetY ?? -25, m = (q, W, f, T, V, p, iA) => {
5998
+ if ((q === "Custom" || q === "Icon") && iA)
5990
5999
  try {
5991
6000
  const d = new Path2D(iA);
5992
- if (A.save(), A.translate(W, f), n === "Icon") {
5993
- const l = Math.min(T, P) / 24;
6001
+ if (A.save(), A.translate(W, f), q === "Icon") {
6002
+ const l = Math.min(T, V) / 24;
5994
6003
  A.scale(l, l), A.translate(-12, -12);
5995
6004
  }
5996
6005
  A.fill(d), A.restore();
@@ -5998,67 +6007,67 @@ class xC {
5998
6007
  } catch (d) {
5999
6008
  console.error("Error drawing slider shape in engine:", d);
6000
6009
  }
6001
- if (A.beginPath(), n === "Ellipse")
6002
- A.ellipse(W, f, T / 2, P / 2, 0, 0, Math.PI * 2);
6003
- else if (n === "Rectangle")
6004
- this.drawRoundRect(A, W - T / 2, f - P / 2, T, P, p);
6005
- else if (n === "Triangle")
6006
- A.moveTo(W, f - P / 2), A.lineTo(W + T / 2, f + P / 2), A.lineTo(W - T / 2, f + P / 2), A.closePath();
6007
- else if (n === "Diamond")
6008
- A.moveTo(W, f - P / 2), A.lineTo(W + T / 2, f), A.lineTo(W, f + P / 2), A.lineTo(W - T / 2, f), A.closePath();
6009
- else if (n === "Star") {
6010
- const l = Math.min(T, P) / 2, Z = l / 2;
6010
+ if (A.beginPath(), q === "Ellipse")
6011
+ A.ellipse(W, f, T / 2, V / 2, 0, 0, Math.PI * 2);
6012
+ else if (q === "Rectangle")
6013
+ this.drawRoundRect(A, W - T / 2, f - V / 2, T, V, p);
6014
+ else if (q === "Triangle")
6015
+ A.moveTo(W, f - V / 2), A.lineTo(W + T / 2, f + V / 2), A.lineTo(W - T / 2, f + V / 2), A.closePath();
6016
+ else if (q === "Diamond")
6017
+ A.moveTo(W, f - V / 2), A.lineTo(W + T / 2, f), A.lineTo(W, f + V / 2), A.lineTo(W - T / 2, f), A.closePath();
6018
+ else if (q === "Star") {
6019
+ const l = Math.min(T, V) / 2, Z = l / 2;
6011
6020
  for (let x = 0; x < 5 * 2; x++) {
6012
6021
  const aA = x % 2 === 0 ? l : Z, hA = x * Math.PI / 5 - Math.PI / 2;
6013
6022
  A.lineTo(W + aA * Math.cos(hA), f + aA * Math.sin(hA));
6014
6023
  }
6015
6024
  A.closePath();
6016
- } else n === "Line" && (A.moveTo(W - T / 2, f), A.lineTo(W + T / 2, f));
6025
+ } else q === "Line" && (A.moveTo(W - T / 2, f), A.lineTo(W + T / 2, f));
6017
6026
  A.fill();
6018
6027
  };
6019
- A.fillStyle = M, N === "Line" ? (A.strokeStyle = M, A.lineWidth = s, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : m(N, 0, 0, B, s, a, S);
6020
- const QA = B - Y, _ = -B / 2 + Y / 2 + h * QA, BA = _ - -B / 2;
6021
- if (BA > 0 && (A.fillStyle = F, N === "Line" ? (A.strokeStyle = F, A.lineWidth = s, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(_, 0), A.stroke()) : N === "Rectangle" && (A.beginPath(), this.drawRoundRect(A, -B / 2, -s / 2, BA, s, a), A.fill())), A.save(), A.translate(_, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = U, m(R, 0, 0, Y, t, J, R === "Icon" ? e : c), A.restore(), r) {
6022
- A.save(), A.translate(_ + z, IA);
6023
- const n = Math.round(i).toString();
6028
+ A.fillStyle = y, N === "Line" ? (A.strokeStyle = y, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(B / 2, 0), A.stroke()) : m(N, 0, 0, B, w, a, S);
6029
+ const QA = B - c, _ = -B / 2 + c / 2 + G * QA, BA = _ - -B / 2;
6030
+ if (BA > 0 && (A.fillStyle = k, N === "Line" ? (A.strokeStyle = k, A.lineWidth = w, A.beginPath(), A.moveTo(-B / 2, 0), A.lineTo(_, 0), A.stroke()) : N === "Rectangle" && (A.beginPath(), this.drawRoundRect(A, -B / 2, -w / 2, BA, w, a), A.fill())), A.save(), A.translate(_, 0), A.shadowColor = "rgba(0,0,0,0.2)", A.shadowBlur = 4, A.shadowOffsetY = 1, A.fillStyle = R, m(U, 0, 0, c, t, J, U === "Icon" ? Y : e), A.restore(), r) {
6031
+ A.save(), A.translate(_ + P, IA);
6032
+ const q = Math.round(i).toString();
6024
6033
  A.font = "10px Inter, sans-serif";
6025
- const W = A.measureText(n), f = 6, T = 4, P = W.width + f * 2, p = 14 + T;
6026
- A.beginPath(), this.drawRoundRect(A, -P / 2, -p / 2, P, p, 4), A.fillStyle = L, A.fill(), A.fillStyle = b, A.textAlign = "center", A.textBaseline = "middle", A.fillText(n, 0, 0), A.restore();
6034
+ const W = A.measureText(q), f = 6, T = 4, V = W.width + f * 2, p = 14 + T;
6035
+ A.beginPath(), this.drawRoundRect(A, -V / 2, -p / 2, V, p, 4), A.fillStyle = L, A.fill(), A.fillStyle = b, A.textAlign = "center", A.textBaseline = "middle", A.fillText(q, 0, 0), A.restore();
6027
6036
  }
6028
6037
  const X = Q.label || {}, gA = Q.helperText || {}, O = Q.fontFamily || "Inter";
6029
6038
  if (X.visible !== !1) {
6030
- const n = X.text || "Label", W = X.fontSize || 12, f = X.color || "rgba(156, 163, 175, 1)", T = X.offset ?? 8;
6039
+ const q = X.text || "Label", W = X.fontSize || 12, f = X.color || "rgba(156, 163, 175, 1)", T = X.offset ?? 8;
6031
6040
  A.font = `600 ${W}px "${O}", sans-serif`, A.fillStyle = f, A.textAlign = "left", A.textBaseline = "bottom";
6032
- const P = -(B / 2), p = -(s / 2) - T;
6033
- A.fillText(n, P, p);
6041
+ const V = -(B / 2), p = -(w / 2) - T;
6042
+ A.fillText(q, V, p);
6034
6043
  }
6035
6044
  if (gA.visible === !0) {
6036
- const n = gA.text || "Helper text", W = gA.fontSize || 11, f = gA.color || "rgba(156, 163, 175, 1)", T = gA.offset ?? 6;
6045
+ const q = gA.text || "Helper text", W = gA.fontSize || 11, f = gA.color || "rgba(156, 163, 175, 1)", T = gA.offset ?? 6;
6037
6046
  A.font = `400 ${W}px "${O}", sans-serif`, A.fillStyle = f, A.textAlign = "left", A.textBaseline = "top";
6038
- const P = -(B / 2), p = s / 2 + T;
6039
- A.fillText(n, P, p);
6047
+ const V = -(B / 2), p = w / 2 + T;
6048
+ A.fillText(q, V, p);
6040
6049
  }
6041
6050
  }
6042
6051
  renderDropdown(A, I) {
6043
6052
  var IA;
6044
6053
  const C = this.objectStates.get(I.id);
6045
6054
  if (!C) return;
6046
- const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, i = -Q / 2, o = -B / 2, w = g.cornerRadius ?? 6, G = g.disabled || g.previewState === "disabled", h = this.lastHoveredObjectId === I.id || g.previewState === "hover", s = (g.isOpen || g.previewState === "active") && !G;
6055
+ const g = C.options || I.options || {}, Q = I.geometry.width || 160, B = I.geometry.height || 40, i = -Q / 2, o = -B / 2, h = g.corner_radius ?? 6, s = g.disabled || g.previewState === "disabled", G = this.lastHoveredObjectId === I.id || g.previewState === "hover", w = (g.isOpen || g.previewState === "active") && !s;
6047
6056
  let a = g.backgroundColor, N = g.borderColor, S = g.color || "#333333";
6048
- G ? (a = g.disabledBackgroundColor || "#f3f4f6", N = g.disabledBorderColor || "#e5e7eb", S = g.disabledColor || "#9ca3af") : s ? (a = g.activeBackgroundColor || a, N = g.activeBorderColor || N, S = g.activeColor || S) : h && (a = g.hoverBackgroundColor || a, N = g.hoverBorderColor || N, S = g.hoverColor || S), a || (a = "#ffffff"), N || (N = "#e5e7eb");
6049
- const F = A.globalAlpha;
6050
- A.globalAlpha = F * (g.opacity ?? 1), this.drawRoundRect(A, i, o, Q, B, w), A.fillStyle = this.createCanvasFill(A, typeof a == "string" ? { type: "Solid", color: a } : a, Q, B) || "#ffffff", A.fill();
6051
- const M = g.borderWidth ?? 1;
6052
- M > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof N == "string" ? { type: "Solid", color: N } : N, Q, B) || "#e5e7eb", A.lineWidth = M, A.stroke());
6053
- const R = 12, Y = g.chevronType || "chevron", t = g.chevronSize || 16, J = (s ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
6054
- if (Y !== "none") {
6055
- const m = i + Q - R - t / 2;
6057
+ s ? (a = g.disabledBackgroundColor || "#f3f4f6", N = g.disabledBorderColor || "#e5e7eb", S = g.disabledColor || "#9ca3af") : w ? (a = g.activeBackgroundColor || a, N = g.activeBorderColor || N, S = g.activeColor || S) : G && (a = g.hoverBackgroundColor || a, N = g.hoverBorderColor || N, S = g.hoverColor || S), a || (a = "#ffffff"), N || (N = "#e5e7eb");
6058
+ const k = A.globalAlpha;
6059
+ A.globalAlpha = k * (g.opacity ?? 1), this.drawRoundRect(A, i, o, Q, B, h), A.fillStyle = this.createCanvasFill(A, typeof a == "string" ? { type: "Solid", color: a } : a, Q, B) || "#ffffff", A.fill();
6060
+ const y = g.borderWidth ?? 1;
6061
+ y > 0 && (A.strokeStyle = this.createCanvasFill(A, typeof N == "string" ? { type: "Solid", color: N } : N, Q, B) || "#e5e7eb", A.lineWidth = y, A.stroke());
6062
+ const U = 12, c = g.chevronType || "chevron", t = g.chevronSize || 16, J = (w ? g.openIconColor : g.closedIconColor) || g.chevronColor || "#6b7280";
6063
+ if (c !== "none") {
6064
+ const m = i + Q - U - t / 2;
6056
6065
  A.save(), A.translate(m, 0);
6057
- const QA = s ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
6058
- if (A.rotate(QA * Math.PI / 180), A.strokeStyle = J, A.fillStyle = J, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", Y === "chevron")
6066
+ const QA = w ? g.openIconAngle ?? 180 : g.closedIconAngle ?? 0;
6067
+ if (A.rotate(QA * Math.PI / 180), A.strokeStyle = J, A.fillStyle = J, A.lineWidth = 1.5, A.lineCap = "round", A.lineJoin = "round", c === "chevron")
6059
6068
  A.beginPath(), A.moveTo(-t / 2, -t * 0.2), A.lineTo(0, t * 0.2), A.lineTo(t / 2, -t * 0.2), A.stroke();
6060
- else if (Y === "custom" || Y === "path") {
6061
- const _ = s && g.openIconPath || g.closedIconPath;
6069
+ else if (c === "custom" || c === "path") {
6070
+ const _ = w && g.openIconPath || g.closedIconPath;
6062
6071
  if (_) {
6063
6072
  const BA = new Path2D(_);
6064
6073
  A.save();
@@ -6068,65 +6077,65 @@ class xC {
6068
6077
  }
6069
6078
  A.restore();
6070
6079
  }
6071
- const U = g.selectedOption || g.placeholder || "Select...", c = g.fontSize || 14, e = g.fontWeight || 400, r = g.fontFamily || "Inter, sans-serif";
6072
- A.font = `${e} ${c}px ${r}`;
6073
- const L = G ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : S;
6080
+ const R = g.selectedOption || g.placeholder || "Select...", e = g.fontSize || 14, Y = g.fontWeight || 400, r = g.fontFamily || "Inter, sans-serif";
6081
+ A.font = `${Y} ${e}px ${r}`;
6082
+ const L = s ? g.disabledColor || "#9ca3af" : !g.selectedOption && g.placeholder ? "#9ca3af" : S;
6074
6083
  A.fillStyle = this.createCanvasFill(A, typeof L == "string" ? { type: "Solid", color: L } : L, Q, B) || "#333333", A.textAlign = "left", A.textBaseline = "middle";
6075
- const b = Y === "none" ? 0 : t + 8, z = Q - R * 2 - b;
6076
- if (A.save(), A.beginPath(), A.rect(i + R, o, z, B), A.clip(), A.fillText(U, i + R, 0), A.restore(), s && !G) {
6077
- const m = o + B + 4, QA = g.optionsList || [], _ = g.itemHeight || 32, BA = g.listPadding ?? 4, X = QA.length * _ + BA * 2, gA = g.listCornerRadius ?? w;
6084
+ const b = c === "none" ? 0 : t + 8, P = Q - U * 2 - b;
6085
+ if (A.save(), A.beginPath(), A.rect(i + U, o, P, B), A.clip(), A.fillText(R, i + U, 0), A.restore(), w && !s) {
6086
+ const m = o + B + 4, QA = g.optionsList || [], _ = g.itemHeight || 32, BA = g.listPadding ?? 4, X = QA.length * _ + BA * 2, gA = g.listCornerRadius ?? h;
6078
6087
  A.save();
6079
6088
  const O = g.listShadow || {};
6080
6089
  A.shadowColor = typeof O.color == "string" ? O.color : ((IA = O.color) == null ? void 0 : IA.color) || "rgba(0,0,0,0.15)", A.shadowBlur = O.blur ?? 12, A.shadowOffsetY = O.offsetY ?? 6, A.beginPath(), this.drawRoundRect(A, i, m, Q, X, gA), A.fillStyle = this.createCanvasFill(A, typeof g.listBackgroundColor == "string" ? { type: "Solid", color: g.listBackgroundColor } : g.listBackgroundColor || { type: "Solid", color: "#ffffff" }, Q, X) || "#ffffff", A.fill();
6081
- const n = g.listBorderWidth ?? 1;
6082
- n > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: N }, Q, X) || "#e5e7eb", A.lineWidth = n, A.stroke()), A.restore();
6083
- const W = g.itemFontSize || c, f = g.itemFontFamily || r;
6084
- A.font = `${e} ${W}px ${f}`, QA.forEach((T, P) => {
6085
- const p = m + BA + P * _;
6090
+ const q = g.listBorderWidth ?? 1;
6091
+ q > 0 && (A.shadowColor = "transparent", A.strokeStyle = this.createCanvasFill(A, typeof g.listBorderColor == "string" ? { type: "Solid", color: g.listBorderColor } : g.listBorderColor || { type: "Solid", color: N }, Q, X) || "#e5e7eb", A.lineWidth = q, A.stroke()), A.restore();
6092
+ const W = g.itemFontSize || e, f = g.itemFontFamily || r;
6093
+ A.font = `${Y} ${W}px ${f}`, QA.forEach((T, V) => {
6094
+ const p = m + BA + V * _;
6086
6095
  if (T === g.selectedOption)
6087
- A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, _) || "#f3f4f6", A.fillRect(i + n, p, Q - n * 2, _), A.fillStyle = g.itemSelectedColor || g.activeColor || S || "#374151";
6096
+ A.fillStyle = this.createCanvasFill(A, typeof g.itemSelectedBackgroundColor == "string" ? { type: "Solid", color: g.itemSelectedBackgroundColor } : g.itemSelectedBackgroundColor || { type: "Solid", color: "#f3f4f6" }, Q, _) || "#f3f4f6", A.fillRect(i + q, p, Q - q * 2, _), A.fillStyle = g.itemSelectedColor || g.activeColor || S || "#374151";
6088
6097
  else if (A.fillStyle = g.listTextColor || S || "#333333", this.activeDropdownId === I.id && this._lastPointerPos) {
6089
6098
  const d = this._lastPointerPos.y - (m + BA), l = Math.floor(d / _);
6090
- P === l && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, _) || "#f9fafb", A.fillRect(i + n, p, Q - n * 2, _), A.fillStyle = g.itemHoverColor || S);
6099
+ V === l && (A.fillStyle = this.createCanvasFill(A, typeof g.itemHoverBackgroundColor == "string" ? { type: "Solid", color: g.itemHoverBackgroundColor } : g.itemHoverBackgroundColor || { type: "Solid", color: "#f9fafb" }, Q, _) || "#f9fafb", A.fillRect(i + q, p, Q - q * 2, _), A.fillStyle = g.itemHoverColor || S);
6091
6100
  }
6092
- A.fillText(T, i + R, p + _ / 2);
6101
+ A.fillText(T, i + U, p + _ / 2);
6093
6102
  });
6094
6103
  }
6095
- A.globalAlpha = F;
6104
+ A.globalAlpha = k;
6096
6105
  }
6097
6106
  renderButton(A, I) {
6098
- var Y, t, J, U;
6099
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((Y = I.geometry) == null ? void 0 : Y.width) || 120, B = ((t = I.geometry) == null ? void 0 : t.height) || 40, i = -Q / 2, o = -B / 2, w = this.lastHoveredObjectId === I.id, G = g.cornerRadius ?? 8, h = g.bgShape || "Rectangle", s = w ? ((J = g.hoverStyle) == null ? void 0 : J.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, N = w ? ((U = g.hoverStyle) == null ? void 0 : U.textColor) || a.color || "#ffffff" : a.color || "#ffffff", S = g.icon || { enabled: !1 };
6100
- A.save(), A.beginPath(), h === "Rectangle" ? this.drawRoundRect(A, i, o, Q, B, G) : h === "Ellipse" || h === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : h === "Pill" && this.drawRoundRect(A, i, o, Q, B, B / 2), A.fillStyle = s, A.fill();
6101
- const F = a.fontSize || 14, M = a.fontFamily || "Inter";
6102
- A.font = `${a.fontWeight || 400} ${F}px "${M}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
6103
- let R = 0;
6107
+ var c, t, J, R;
6108
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((c = I.geometry) == null ? void 0 : c.width) || 120, B = ((t = I.geometry) == null ? void 0 : t.height) || 40, i = -Q / 2, o = -B / 2, h = this.lastHoveredObjectId === I.id, s = g.corner_radius ?? 8, G = g.bgShape || "Rectangle", w = h ? ((J = g.hoverStyle) == null ? void 0 : J.backgroundColor) || g.buttonBgColor || "#3b82f6" : g.buttonBgColor || "#3b82f6", a = g.label || {}, N = h ? ((R = g.hoverStyle) == null ? void 0 : R.textColor) || a.color || "#ffffff" : a.color || "#ffffff", S = g.icon || { enabled: !1 };
6109
+ A.save(), A.beginPath(), G === "Rectangle" ? this.drawRoundRect(A, i, o, Q, B, s) : G === "Ellipse" || G === "Circle" ? A.ellipse(0, 0, Q / 2, B / 2, 0, 0, Math.PI * 2) : G === "Pill" && this.drawRoundRect(A, i, o, Q, B, B / 2), A.fillStyle = w, A.fill();
6110
+ const k = a.fontSize || 14, y = a.fontFamily || "Inter";
6111
+ A.font = `${a.fontWeight || 400} ${k}px "${y}", sans-serif`, A.fillStyle = N, A.textAlign = "center", A.textBaseline = "middle";
6112
+ let U = 0;
6104
6113
  if (S.enabled && S.svgPath) {
6105
- const c = S.size || 16, e = S.gap || 8, r = S.position === "left" ? -(A.measureText(a.text || "").width / 2 + c / 2 + e / 2) : A.measureText(a.text || "").width / 2 + c / 2 + e / 2;
6114
+ const e = S.size || 16, Y = S.gap || 8, r = S.position === "left" ? -(A.measureText(a.text || "").width / 2 + e / 2 + Y / 2) : A.measureText(a.text || "").width / 2 + e / 2 + Y / 2;
6106
6115
  A.save(), A.translate(r, 0);
6107
- const L = new Path2D(S.svgPath), b = c / 24;
6108
- A.scale(b, b), A.translate(-12, -12), A.fillStyle = S.color || N, A.fill(L), A.restore(), R = S.position === "left" ? c / 2 + e / 2 : -(c / 2 + e / 2);
6116
+ const L = new Path2D(S.svgPath), b = e / 24;
6117
+ A.scale(b, b), A.translate(-12, -12), A.fillStyle = S.color || N, A.fill(L), A.restore(), U = S.position === "left" ? e / 2 + Y / 2 : -(e / 2 + Y / 2);
6109
6118
  }
6110
- A.fillText(a.text || "Button", R, 0), A.restore();
6119
+ A.fillText(a.text || "Button", U, 0), A.restore();
6111
6120
  }
6112
6121
  renderToggleButton(A, I) {
6113
- var F, M;
6114
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((F = I.geometry) == null ? void 0 : F.width) || 120, i = ((M = I.geometry) == null ? void 0 : M.height) || 40, o = -B / 2, w = -i / 2, G = g.cornerRadius ?? 8, h = g.label || {}, s = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
6115
- A.save(), A.beginPath(), this.drawRoundRect(A, o, w, B, i, G), A.fillStyle = s, A.fill();
6116
- const N = h.fontSize || 14, S = h.fontFamily || "Inter";
6117
- A.font = `${h.fontWeight || 600} ${N}px "${S}", sans-serif`, A.fillStyle = a, A.textAlign = "center", A.textBaseline = "middle", A.fillText(h.text || "Toggle", 0, 0), A.restore();
6122
+ var k, y;
6123
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = g.checked ?? !1, B = ((k = I.geometry) == null ? void 0 : k.width) || 120, i = ((y = I.geometry) == null ? void 0 : y.height) || 40, o = -B / 2, h = -i / 2, s = g.corner_radius ?? 8, G = g.label || {}, w = Q ? g.activeColor || "#3b82f6" : g.inactiveColor || "#374151", a = Q ? g.activeTextColor || "#ffffff" : g.inactiveTextColor || "#9ca3af";
6124
+ A.save(), A.beginPath(), this.drawRoundRect(A, o, h, B, i, s), A.fillStyle = w, A.fill();
6125
+ const N = G.fontSize || 14, S = G.fontFamily || "Inter";
6126
+ A.font = `${G.fontWeight || 600} ${N}px "${S}", sans-serif`, A.fillStyle = a, A.textAlign = "center", A.textBaseline = "middle", A.fillText(G.text || "Toggle", 0, 0), A.restore();
6118
6127
  }
6119
6128
  renderToggle(A, I) {
6120
- var R, Y;
6121
- const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((R = I.geometry) == null ? void 0 : R.width) || 52, B = ((Y = I.geometry) == null ? void 0 : Y.height) || 30, i = -Q / 2, o = -B / 2, w = g.checked ?? !1, G = g.cornerRadius ?? B / 2;
6122
- A.beginPath(), this.drawRoundRect(A, i, o, Q, B, G), A.fillStyle = w ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
6123
- const h = 3, s = B - h * 2, a = s / 2, N = i + h, S = i + Q - h - s, F = w ? S : N, M = o + h;
6124
- if (A.beginPath(), A.arc(F + a, M + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
6125
- const t = g.label, J = t.fontSize || 14, U = t.fontWeight || 400, c = t.fontFamily || "Inter";
6126
- A.font = `${U} ${J}px "${c}", sans-serif`, A.fillStyle = t.color || "#f3f4f6", A.textBaseline = "middle";
6127
- const e = t.gap || 10;
6129
+ var U, c;
6130
+ const C = this.objectStates.get(I.id), g = (C == null ? void 0 : C.options) || I.options || {}, Q = ((U = I.geometry) == null ? void 0 : U.width) || 52, B = ((c = I.geometry) == null ? void 0 : c.height) || 30, i = -Q / 2, o = -B / 2, h = g.checked ?? !1, s = g.corner_radius ?? B / 2;
6131
+ A.beginPath(), this.drawRoundRect(A, i, o, Q, B, s), A.fillStyle = h ? g.activeColor || "#10b981" : g.inactiveColor || "#374151", g.disabled && (A.globalAlpha *= 0.5), A.fill();
6132
+ const G = 3, w = B - G * 2, a = w / 2, N = i + G, S = i + Q - G - w, k = h ? S : N, y = o + G;
6133
+ if (A.beginPath(), A.arc(k + a, y + a, a, 0, Math.PI * 2), A.fillStyle = g.knobColor || "#ffffff", A.fill(), g.disabled && (A.globalAlpha *= 2), g.label && g.label.text) {
6134
+ const t = g.label, J = t.fontSize || 14, R = t.fontWeight || 400, e = t.fontFamily || "Inter";
6135
+ A.font = `${R} ${J}px "${e}", sans-serif`, A.fillStyle = t.color || "#f3f4f6", A.textBaseline = "middle";
6136
+ const Y = t.gap || 10;
6128
6137
  let r = 0, L = 0;
6129
- t.position === "left" ? (A.textAlign = "right", r = i - e, L = 0) : t.position === "right" ? (A.textAlign = "left", r = i + Q + e, L = 0) : t.position === "top" ? (A.textAlign = "center", r = 0, L = o - e, A.textBaseline = "bottom") : t.position === "bottom" ? (A.textAlign = "center", r = 0, L = o + B + e, A.textBaseline = "top") : (A.textAlign = "left", r = i + Q + e, L = 0), A.fillText(t.text, r, L);
6138
+ t.position === "left" ? (A.textAlign = "right", r = i - Y, L = 0) : t.position === "right" ? (A.textAlign = "left", r = i + Q + Y, L = 0) : t.position === "top" ? (A.textAlign = "center", r = 0, L = o - Y, A.textBaseline = "bottom") : t.position === "bottom" ? (A.textAlign = "center", r = 0, L = o + B + Y, A.textBaseline = "top") : (A.textAlign = "left", r = i + Q + Y, L = 0), A.fillText(t.text, r, L);
6130
6139
  }
6131
6140
  }
6132
6141
  renderLineGraph(A, I, C, g) {
@@ -6151,122 +6160,157 @@ class xC {
6151
6160
  }
6152
6161
  let B = 1 / 0, i = -1 / 0, o = 0;
6153
6162
  if (Q.forEach((S) => {
6154
- let F = S.data;
6163
+ let k = S.data;
6155
6164
  if (S.isVarEnabled && S.inputId) {
6156
- let M = this.inputs.get(S.inputId);
6157
- if (M === void 0) {
6158
- const R = this.inputNameMap.get(S.inputId);
6159
- R && R.length > 0 && (M = this.inputs.get(R[0]));
6165
+ let y = this.inputs.get(S.inputId);
6166
+ if (y === void 0) {
6167
+ const U = this.inputNameMap.get(S.inputId);
6168
+ U && U.length > 0 && (y = this.inputs.get(U[0]));
6160
6169
  }
6161
- M && Array.isArray(M) && (F = M);
6170
+ y && Array.isArray(y) && (k = y);
6162
6171
  }
6163
- if (F && F.length > 0) {
6164
- const M = F.filter((R) => typeof R == "number" && !isNaN(R));
6165
- M.length > 0 && (B = Math.min(B, ...M), i = Math.max(i, ...M), o = Math.max(o, F.length));
6172
+ if (k && k.length > 0) {
6173
+ const y = k.filter((U) => typeof U == "number" && !isNaN(U));
6174
+ y.length > 0 && (B = Math.min(B, ...y), i = Math.max(i, ...y), o = Math.max(o, k.length));
6166
6175
  }
6167
- S._resolvedData = F;
6176
+ S._resolvedData = k;
6168
6177
  }), o < 2) return;
6169
- const w = i - B, G = C / (o - 1), h = (S) => {
6170
- const F = w === 0 ? 0.5 : (S - B) / w;
6171
- return g / 2 - F * g;
6172
- }, s = (S) => S * G - C / 2, a = I.axisColor || "#333333";
6178
+ const h = i - B, s = C / (o - 1), G = (S) => {
6179
+ const k = h === 0 ? 0.5 : (S - B) / h;
6180
+ return g / 2 - k * g;
6181
+ }, w = (S) => S * s - C / 2, a = I.axisColor || "#333333";
6173
6182
  if (I.showXAxis && (A.beginPath(), A.strokeStyle = I.xAxisColor || a, A.lineWidth = 1, A.moveTo(-C / 2, g / 2), A.lineTo(C / 2, g / 2), A.stroke()), I.showYAxis && (A.beginPath(), A.strokeStyle = I.yAxisColor || a, A.lineWidth = 1, A.moveTo(-C / 2, -g / 2), A.lineTo(-C / 2, g / 2), A.stroke()), A.fillStyle = I.axisLabelColor || "#333333", A.font = `${I.axisLabelFontSize || 10}px Inter, sans-serif`, I.showXLabels) {
6174
6183
  A.textAlign = "center", A.textBaseline = "top";
6175
6184
  for (let S = 0; S < o; S++) {
6176
- const F = s(S);
6177
- A.fillText(`${S + 1}`, F, g / 2 + 5);
6185
+ const k = w(S);
6186
+ A.fillText(`${S + 1}`, k, g / 2 + 5);
6178
6187
  }
6179
6188
  }
6180
6189
  if (I.showYLabels) {
6181
6190
  A.textAlign = "right", A.textBaseline = "middle";
6182
- const S = -C / 2 - 5, F = (i + B) / 2;
6183
- A.fillText(i.toFixed(1), S, h(i)), A.fillText(F.toFixed(1), S, h(F)), A.fillText(B.toFixed(1), S, h(B));
6191
+ const S = -C / 2 - 5, k = (i + B) / 2;
6192
+ A.fillText(i.toFixed(1), S, G(i)), A.fillText(k.toFixed(1), S, G(k)), A.fillText(B.toFixed(1), S, G(B));
6184
6193
  }
6185
6194
  const N = 10;
6186
6195
  if (Q.forEach((S) => {
6187
- const F = S._resolvedData;
6188
- if (!(!F || F.length < 2)) {
6196
+ const k = S._resolvedData;
6197
+ if (!(!k || k.length < 2)) {
6189
6198
  if (S.showArea) {
6190
- if (A.beginPath(), A.moveTo(s(0), g / 2), A.lineTo(s(0), h(F[0])), S.smoothing && F.length > 2)
6191
- for (let R = 0; R < F.length - 1; R++) {
6192
- const Y = F[R === 0 ? R : R - 1], t = F[R], J = F[R + 1], U = F[R + 1 === F.length - 1 ? R + 1 : R + 2];
6193
- for (let c = 1; c <= N; c++) {
6194
- const e = c / N, r = this._catmullRom(Y, t, J, U, e);
6195
- A.lineTo(s(R + e), h(r));
6199
+ if (A.beginPath(), A.moveTo(w(0), g / 2), A.lineTo(w(0), G(k[0])), S.smoothing && k.length > 2)
6200
+ for (let U = 0; U < k.length - 1; U++) {
6201
+ const c = k[U === 0 ? U : U - 1], t = k[U], J = k[U + 1], R = k[U + 1 === k.length - 1 ? U + 1 : U + 2];
6202
+ for (let e = 1; e <= N; e++) {
6203
+ const Y = e / N, r = this._catmullRom(c, t, J, R, Y);
6204
+ A.lineTo(w(U + Y), G(r));
6196
6205
  }
6197
6206
  }
6198
6207
  else
6199
- for (let R = 1; R < F.length; R++)
6200
- A.lineTo(s(R), h(F[R]));
6201
- A.lineTo(s(F.length - 1), g / 2), A.closePath();
6202
- const M = A.globalAlpha;
6203
- A.globalAlpha = M * (I.areaOpacity ?? 0.3), A.fillStyle = S.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = M;
6208
+ for (let U = 1; U < k.length; U++)
6209
+ A.lineTo(w(U), G(k[U]));
6210
+ A.lineTo(w(k.length - 1), g / 2), A.closePath();
6211
+ const y = A.globalAlpha;
6212
+ A.globalAlpha = y * (I.areaOpacity ?? 0.3), A.fillStyle = S.areaColor || "rgba(139, 92, 246, 0.2)", A.fill(), A.globalAlpha = y;
6204
6213
  }
6205
- if (A.beginPath(), A.strokeStyle = S.lineColor || "#3b82f6", A.lineWidth = S.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(s(0), h(F[0])), S.smoothing && F.length > 2)
6206
- for (let M = 0; M < F.length - 1; M++) {
6207
- const R = F[M === 0 ? M : M - 1], Y = F[M], t = F[M + 1], J = F[M + 1 === F.length - 1 ? M + 1 : M + 2];
6208
- for (let U = 1; U <= N; U++) {
6209
- const c = U / N, e = this._catmullRom(R, Y, t, J, c);
6210
- A.lineTo(s(M + c), h(e));
6214
+ if (A.beginPath(), A.strokeStyle = S.lineColor || "#3b82f6", A.lineWidth = S.lineWidth || 2, A.lineJoin = "round", A.lineCap = "round", A.moveTo(w(0), G(k[0])), S.smoothing && k.length > 2)
6215
+ for (let y = 0; y < k.length - 1; y++) {
6216
+ const U = k[y === 0 ? y : y - 1], c = k[y], t = k[y + 1], J = k[y + 1 === k.length - 1 ? y + 1 : y + 2];
6217
+ for (let R = 1; R <= N; R++) {
6218
+ const e = R / N, Y = this._catmullRom(U, c, t, J, e);
6219
+ A.lineTo(w(y + e), G(Y));
6211
6220
  }
6212
6221
  }
6213
6222
  else
6214
- for (let M = 1; M < F.length; M++)
6215
- A.lineTo(s(M), h(F[M]));
6216
- A.stroke(), S.showPoints && F.forEach((M, R) => {
6217
- const Y = s(R), t = h(M);
6218
- A.beginPath(), A.arc(Y, t, (S.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = S.pointFill || "#ffffff", A.fill(), A.strokeStyle = S.pointStrokeColor || S.lineColor || "#3b82f6", A.lineWidth = S.pointStrokeWidth || 1, A.stroke();
6223
+ for (let y = 1; y < k.length; y++)
6224
+ A.lineTo(w(y), G(k[y]));
6225
+ A.stroke(), S.showPoints && k.forEach((y, U) => {
6226
+ const c = w(U), t = G(y);
6227
+ A.beginPath(), A.arc(c, t, (S.pointSize || 6) / 2, 0, Math.PI * 2), A.fillStyle = S.pointFill || "#ffffff", A.fill(), A.strokeStyle = S.pointStrokeColor || S.lineColor || "#3b82f6", A.lineWidth = S.pointStrokeWidth || 1, A.stroke();
6219
6228
  });
6220
6229
  }
6221
6230
  }), I.showLegend && Q.length > 0) {
6222
6231
  const S = C / 2 - 10;
6223
- let F = -g / 2 + 15;
6224
- const M = I.legendFontSize || 10, R = M + 5;
6225
- A.font = `${M}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((Y) => {
6226
- const J = Y.label || "Series", U = A.measureText(J).width;
6227
- A.beginPath(), A.rect(S - U - 8 - 5, F - (8 / 2 + 2), 8, 8), A.fillStyle = Y.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(J, S, F), F += R;
6232
+ let k = -g / 2 + 15;
6233
+ const y = I.legendFontSize || 10, U = y + 5;
6234
+ A.font = `${y}px Inter, sans-serif`, A.textAlign = "right", A.textBaseline = "alphabetic", Q.forEach((c) => {
6235
+ const J = c.label || "Series", R = A.measureText(J).width;
6236
+ A.beginPath(), A.rect(S - R - 8 - 5, k - (8 / 2 + 2), 8, 8), A.fillStyle = c.lineColor || "#3b82f6", A.fill(), A.fillStyle = I.legendColor || "#333333", A.fillText(J, S, k), k += U;
6228
6237
  });
6229
6238
  }
6230
6239
  }
6231
6240
  _catmullRom(A, I, C, g, Q) {
6232
- const B = (C - A) * 0.5, i = (g - I) * 0.5, o = Q * Q, w = Q * o;
6233
- return (2 * I - 2 * C + B + i) * w + (-3 * I + 3 * C - 2 * B - i) * o + B * Q + I;
6241
+ const B = (C - A) * 0.5, i = (g - I) * 0.5, o = Q * Q, h = Q * o;
6242
+ return (2 * I - 2 * C + B + i) * h + (-3 * I + 3 * C - 2 * B - i) * o + B * Q + I;
6243
+ }
6244
+ normalizeOpacity(A) {
6245
+ const I = typeof A == "number" ? A : parseFloat(String(A)) || 100;
6246
+ return I > 1 ? I / 100 : I;
6234
6247
  }
6235
6248
  createCanvasFill(A, I, C, g) {
6249
+ var Q;
6236
6250
  if (!I || I.type === "None") return null;
6237
6251
  if (I.type === "Solid")
6238
6252
  return I.color;
6239
- if ((I.type === "LinearGradient" || I.type === "RadialGradient") && I.stops) {
6240
- const Q = (B, i = 1) => {
6241
- var N, S;
6242
- const w = (((S = (N = this.artboard) == null ? void 0 : N.tokens) == null ? void 0 : S.colors) || {})[B] || B;
6243
- if (i >= 1 && w.startsWith("#")) return w;
6244
- const G = w.startsWith("#") ? w.replace("#", "") : "ffffff", h = parseInt(G.substring(0, 2), 16), s = parseInt(G.substring(2, 4), 16), a = parseInt(G.substring(4, 6), 16);
6245
- return `rgba(${h}, ${s}, ${a}, ${i})`;
6253
+ if ((I.type === "LinearGradient" || I.type === "RadialGradient" || I.type === "AngularGradient" || I.type === "DiamondGradient") && I.stops) {
6254
+ const B = (i, o = 100) => {
6255
+ var k, y;
6256
+ const s = (((y = (k = this.artboard) == null ? void 0 : k.tokens) == null ? void 0 : y.colors) || {})[i] || i, G = this.normalizeOpacity(o);
6257
+ if (G >= 1 && s.startsWith("#")) return s;
6258
+ const w = s.startsWith("#") ? s.replace("#", "") : "ffffff", a = parseInt(w.substring(0, 2), 16), N = parseInt(w.substring(2, 4), 16), S = parseInt(w.substring(4, 6), 16);
6259
+ return `rgba(${a}, ${N}, ${S}, ${G})`;
6246
6260
  };
6247
6261
  if (I.type === "LinearGradient") {
6248
- const B = (s, a, N) => Array.isArray(s) ? s[a] ?? (a === 0 ? 0 : 1) : s && typeof s == "object" ? s[N] ?? (a === 0 ? 0 : 1) : a === 0 ? 0 : 1, i = B(I.start, 0, "x") * C - C / 2, o = B(I.start, 1, "y") * g - g / 2, w = B(I.end, 0, "x") * C - C / 2, G = B(I.end, 1, "y") * g - g / 2, h = A.createLinearGradient(i, o, w, G);
6249
- return I.stops.forEach((s) => {
6250
- const a = s.offset !== void 0 ? s.offset : s.pos !== void 0 ? s.pos : s.position !== void 0 ? s.position : 0, N = Q(s.color || "#000000", s.opacity ?? 1);
6251
- h.addColorStop(Math.max(0, Math.min(1, a)), N);
6252
- }), h;
6253
- } else {
6254
- const B = (h, s, a) => Array.isArray(h) ? h[s] ?? 0.5 : h && typeof h == "object" ? h[a] ?? 0.5 : 0.5, i = B(I.center, 0, "x") * C - C / 2, o = B(I.center, 1, "y") * g - g / 2, w = (I.radius ?? 0.5) * Math.max(C, g), G = A.createRadialGradient(i, o, 0, i, o, w);
6255
- return I.stops.forEach((h) => {
6256
- const s = h.offset !== void 0 ? h.offset : h.pos !== void 0 ? h.pos : h.position !== void 0 ? h.position : 0, a = Q(h.color || "#000000", h.opacity ?? 1);
6257
- G.addColorStop(Math.max(0, Math.min(1, s)), a);
6258
- }), G;
6262
+ const i = (a, N, S) => Array.isArray(a) ? a[N] ?? (N === 0 ? 0 : 1) : a && typeof a == "object" ? a[S] ?? (N === 0 ? 0 : 1) : N === 0 ? 0 : 1, o = i(I.start, 0, "x") * C - C / 2, h = i(I.start, 1, "y") * g - g / 2, s = i(I.end, 0, "x") * C - C / 2, G = i(I.end, 1, "y") * g - g / 2, w = A.createLinearGradient(o, h, s, G);
6263
+ if (I.stops.forEach((a) => {
6264
+ const N = a.offset !== void 0 ? a.offset : a.pos !== void 0 ? a.pos : a.position !== void 0 ? a.position : 0, S = B(a.color || "#000000", a.opacity ?? 100);
6265
+ w.addColorStop(Math.max(0, Math.min(1, N)), S);
6266
+ }), I.gradientTransform && w.setTransform) {
6267
+ const [a, N, S, k, y, U] = I.gradientTransform;
6268
+ w.setTransform({ a, b: N, c: S, d: k, e: y, f: U });
6269
+ }
6270
+ return w;
6271
+ } else if (I.type === "RadialGradient") {
6272
+ const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center, 0, "x") * C - C / 2, h = i(I.center, 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g), G = A.createRadialGradient(o, h, 0, o, h, s);
6273
+ if (I.stops.forEach((w) => {
6274
+ const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
6275
+ G.addColorStop(Math.max(0, Math.min(1, a)), N);
6276
+ }), I.gradientTransform && G.setTransform) {
6277
+ const [w, a, N, S, k, y] = I.gradientTransform;
6278
+ G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
6279
+ }
6280
+ return G;
6281
+ } else if (I.type === "AngularGradient") {
6282
+ const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.degree || I.angle || 0) * (Math.PI / 180), G = (Q = A.createConicGradient) == null ? void 0 : Q.call(A, s, o, h);
6283
+ if (G) {
6284
+ if (I.stops.forEach((w) => {
6285
+ const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
6286
+ G.addColorStop(Math.max(0, Math.min(1, a)), N);
6287
+ }), I.gradientTransform && G.setTransform) {
6288
+ const [w, a, N, S, k, y] = I.gradientTransform;
6289
+ G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
6290
+ }
6291
+ return G;
6292
+ }
6293
+ } else if (I.type === "DiamondGradient") {
6294
+ const i = (w, a, N) => Array.isArray(w) ? w[a] ?? 0.5 : w && typeof w == "object" ? w[N] ?? 0.5 : 0.5, o = i(I.center || [0.5, 0.5], 0, "x") * C - C / 2, h = i(I.center || [0.5, 0.5], 1, "y") * g - g / 2, s = (I.radius ?? 0.5) * Math.max(C, g), G = A.createRadialGradient(o, h, 0, o, h, s);
6295
+ if (I.stops.forEach((w) => {
6296
+ const a = w.offset !== void 0 ? w.offset : w.pos !== void 0 ? w.pos : w.position !== void 0 ? w.position : 0, N = B(w.color || "#000000", w.opacity ?? 100);
6297
+ G.addColorStop(Math.max(0, Math.min(1, a)), N);
6298
+ }), I.gradientTransform && G.setTransform) {
6299
+ const [w, a, N, S, k, y] = I.gradientTransform;
6300
+ G.setTransform({ a: w, b: a, c: N, d: S, e: k, f: y });
6301
+ }
6302
+ return G;
6259
6303
  }
6260
6304
  }
6261
6305
  if (I.type === "Pattern" && I.url) {
6262
- let Q = this.imageCache.get(I.url);
6263
- if (Q || (Q = new Image(), Q.src = I.url, this.imageCache.set(I.url, Q)), Q.complete && Q.naturalWidth > 0) {
6264
- const B = A.createPattern(Q, "repeat");
6265
- if (B && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
6266
- const i = new DOMMatrix(), o = I.scaleX ?? 1, w = I.scaleY ?? 1, G = I.offsetX ?? 0, h = I.offsetY ?? 0, s = I.rotation ?? 0;
6267
- i.translateSelf(G, h), i.rotateSelf(s), i.scaleSelf(o, w), B.setTransform(i);
6306
+ let B = this.imageCache.get(I.url);
6307
+ if (B || (B = new Image(), B.src = I.url, this.imageCache.set(I.url, B)), B.complete && B.naturalWidth > 0) {
6308
+ const i = A.createPattern(B, "repeat");
6309
+ if (i && (I.scaleX !== void 0 || I.offsetX !== void 0)) {
6310
+ const o = new DOMMatrix(), h = I.scaleX ?? 1, s = I.scaleY ?? 1, G = I.offsetX ?? 0, w = I.offsetY ?? 0, a = I.rotation ?? 0;
6311
+ o.translateSelf(G, w), o.rotateSelf(a), o.scaleSelf(h, s), i.setTransform(o);
6268
6312
  }
6269
- return B;
6313
+ return i;
6270
6314
  }
6271
6315
  }
6272
6316
  return I.color || null;
@@ -6283,64 +6327,68 @@ class xC {
6283
6327
  } catch {
6284
6328
  i = parseFloat(i) || 0;
6285
6329
  }
6286
- let o = 0, w = 0, G = 0, h = 0;
6287
- typeof i == "number" ? o = w = G = h = i : Array.isArray(i) && (i.length === 1 ? o = w = G = h = i[0] : i.length === 2 ? (o = G = i[0], w = h = i[1]) : i.length === 3 ? (o = i[0], w = h = i[1], G = i[2]) : i.length >= 4 && (o = i[0], w = i[1], G = i[2], h = i[3]));
6288
- const s = Math.min(Math.abs(g) / 2, Math.abs(Q) / 2);
6289
- o = Math.min(Math.max(0, o), s), w = Math.min(Math.max(0, w), s), G = Math.min(Math.max(0, G), s), h = Math.min(Math.max(0, h), s), A.moveTo(I + o, C), A.lineTo(I + g - w, C), A.quadraticCurveTo(I + g, C, I + g, C + w), A.lineTo(I + g, C + Q - G), A.quadraticCurveTo(I + g, C + Q, I + g - G, C + Q), A.lineTo(I + h, C + Q), A.quadraticCurveTo(I, C + Q, I, C + Q - h), A.lineTo(I, C + o), A.quadraticCurveTo(I, C, I + o, C), A.closePath();
6330
+ let o = 0, h = 0, s = 0, G = 0;
6331
+ typeof i == "number" ? o = h = s = G = i : Array.isArray(i) ? i.length === 1 ? o = h = s = G = i[0] : i.length === 2 ? (o = s = i[0], h = G = i[1]) : i.length === 3 ? (o = i[0], h = G = i[1], s = i[2]) : i.length >= 4 && (o = i[0], h = i[1], s = i[2], G = i[3]) : i && typeof i == "object" && (o = i.tl ?? i.corner_radius ?? i.cornerRadius ?? 0, h = i.tr ?? i.corner_radius ?? i.cornerRadius ?? 0, s = i.br ?? i.corner_radius ?? i.cornerRadius ?? 0, G = i.bl ?? i.corner_radius ?? i.cornerRadius ?? 0);
6332
+ const w = Math.min(Math.abs(g) / 2, Math.abs(Q) / 2);
6333
+ if (o = Math.min(Math.max(0, o), w), h = Math.min(Math.max(0, h), w), s = Math.min(Math.max(0, s), w), G = Math.min(Math.max(0, G), w), A.roundRect) {
6334
+ A.roundRect(I, C, g, Q, [o, h, s, G]);
6335
+ return;
6336
+ }
6337
+ A.moveTo(I + o, C), A.lineTo(I + g - h, C), A.arcTo(I + g, C, I + g, C + h, h), A.lineTo(I + g, C + Q - s), A.arcTo(I + g, C + Q, I + g - s, C + Q, s), A.lineTo(I + G, C + Q), A.arcTo(I, C + Q, I, C + Q - G, G), A.lineTo(I, C + o), A.arcTo(I, C, I + o, C, o), A.closePath();
6290
6338
  }
6291
6339
  renderListView(A, I) {
6292
6340
  var m, QA, _, BA;
6293
- const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((m = I.geometry) == null ? void 0 : m.width) || 200, B = C.height !== void 0 ? C.height : ((QA = I.geometry) == null ? void 0 : QA.height) || 300, i = -Q / 2, o = -B / 2, w = C.cornerRadius !== void 0 ? C.cornerRadius : g.cornerRadius ?? 0, G = g.orientation || "vertical", h = g.items || [], s = g.itemGap ?? 10, a = g.itemHeight ?? 50, N = g.itemWidth ?? 200, S = g.scrollOffset ?? 0, F = g.padding ?? 0, M = g.glassEffect !== !1, R = g.accentColor || "#3b82f6", Y = g.itemTextColor || "#333333", t = g.itemBackgroundColor || "#ffffff", J = g.hoveredIndex ?? null, U = g.activeItemIndex ?? null, c = g.glowIntensity ?? 0, e = g.glowColor || "#3b82f6", r = typeof e == "string" ? e : e.color || ((BA = (_ = e.stops) == null ? void 0 : _[0]) == null ? void 0 : BA.color) || "#3b82f6", L = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
6294
- if (A.save(), A.globalAlpha *= L, c > 0 && (A.shadowColor = r, A.shadowBlur = c * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), M) {
6341
+ const C = this.objectStates.get(I.id) || {}, g = C.options || I.options || {}, Q = C.width !== void 0 ? C.width : ((m = I.geometry) == null ? void 0 : m.width) || 200, B = C.height !== void 0 ? C.height : ((QA = I.geometry) == null ? void 0 : QA.height) || 300, i = -Q / 2, o = -B / 2, h = C.corner_radius !== void 0 ? C.corner_radius : g.corner_radius ?? 0, s = g.orientation || "vertical", G = g.items || [], w = g.itemGap ?? 10, a = g.itemHeight ?? 50, N = g.itemWidth ?? 200, S = g.scrollOffset ?? 0, k = g.padding ?? 0, y = g.glassEffect !== !1, U = g.accentColor || "#3b82f6", c = g.itemTextColor || "#333333", t = g.itemBackgroundColor || "#ffffff", J = g.hoveredIndex ?? null, R = g.activeItemIndex ?? null, e = g.glowIntensity ?? 0, Y = g.glowColor || "#3b82f6", r = typeof Y == "string" ? Y : Y.color || ((BA = (_ = Y.stops) == null ? void 0 : _[0]) == null ? void 0 : BA.color) || "#3b82f6", L = g.opacity !== void 0 ? g.opacity : I.opacity !== void 0 ? I.opacity : 1;
6342
+ if (A.save(), A.globalAlpha *= L, e > 0 && (A.shadowColor = r, A.shadowBlur = e * 2, A.shadowOffsetX = 0, A.shadowOffsetY = 0), y) {
6295
6343
  const X = g.listBackgroundColor || "rgba(31, 41, 55, 0.4)", gA = this.createCanvasFill(A, X, Q, B);
6296
- A.fillStyle = gA || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, i, o, Q, B, w), A.fill();
6344
+ A.fillStyle = gA || "rgba(31, 41, 55, 0.4)", this.drawListViewRect(A, i, o, Q, B, h), A.fill();
6297
6345
  const O = A.createLinearGradient(i, o, i + Q, o + B);
6298
- O.addColorStop(0, "rgba(255, 255, 255, 0.15)"), O.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), O.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = O, this.drawListViewRect(A, i, o, Q, B, w), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, i, o, Q, B, w), A.stroke();
6346
+ O.addColorStop(0, "rgba(255, 255, 255, 0.15)"), O.addColorStop(0.5, "rgba(255, 255, 255, 0.08)"), O.addColorStop(1, "rgba(255, 255, 255, 0.03)"), A.fillStyle = O, this.drawListViewRect(A, i, o, Q, B, h), A.fill(), A.strokeStyle = "rgba(255, 255, 255, 0.25)", A.lineWidth = 1, this.drawListViewRect(A, i, o, Q, B, h), A.stroke();
6299
6347
  } else {
6300
6348
  const X = g.listBackgroundColor || "transparent", gA = this.createCanvasFill(A, X, Q, B);
6301
- gA && (A.fillStyle = gA, this.drawListViewRect(A, i, o, Q, B, w), A.fill());
6349
+ gA && (A.fillStyle = gA, this.drawListViewRect(A, i, o, Q, B, h), A.fill());
6302
6350
  const O = g.borderWidth ?? 0;
6303
- O > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = O, this.drawListViewRect(A, i, o, Q, B, w), A.stroke());
6351
+ O > 0 && (A.strokeStyle = g.borderColor || "#cccccc", A.lineWidth = O, this.drawListViewRect(A, i, o, Q, B, h), A.stroke());
6304
6352
  }
6305
- A.shadowBlur = 0, A.save(), this.drawListViewRect(A, i, o, Q, B, w), A.clip();
6306
- const b = typeof F == "number" ? F : G === "vertical" ? F[0] : F[3];
6307
- let z = (G === "vertical" ? o : i) + S + b;
6308
- if (A.textBaseline = "middle", h.forEach((X, gA) => {
6309
- const O = G === "vertical" ? Q : N, n = G === "vertical" ? a : B, W = G === "vertical" ? i : z, f = G === "vertical" ? z : o, T = J === gA, P = U === gA;
6310
- if (P) {
6311
- const Z = this.createCanvasFill(A, R, O, n);
6312
- A.fillStyle = Z || R;
6353
+ A.shadowBlur = 0, A.save(), this.drawListViewRect(A, i, o, Q, B, h), A.clip();
6354
+ const b = typeof k == "number" ? k : s === "vertical" ? k[0] : k[3];
6355
+ let P = (s === "vertical" ? o : i) + S + b;
6356
+ if (A.textBaseline = "middle", G.forEach((X, gA) => {
6357
+ const O = s === "vertical" ? Q : N, q = s === "vertical" ? a : B, W = s === "vertical" ? i : P, f = s === "vertical" ? P : o, T = J === gA, V = R === gA;
6358
+ if (V) {
6359
+ const Z = this.createCanvasFill(A, U, O, q);
6360
+ A.fillStyle = Z || U;
6313
6361
  const x = A.globalAlpha;
6314
- A.globalAlpha = x * 0.8, A.fillRect(W, f, O, n), A.globalAlpha = x;
6362
+ A.globalAlpha = x * 0.8, A.fillRect(W, f, O, q), A.globalAlpha = x;
6315
6363
  } else if (T)
6316
- A.fillStyle = M ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(W, f, O, n);
6364
+ A.fillStyle = y ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.05)", A.fillRect(W, f, O, q);
6317
6365
  else if (t !== "transparent") {
6318
- const Z = this.createCanvasFill(A, t, O, n);
6319
- A.fillStyle = Z || t, A.fillRect(W, f, O, n);
6366
+ const Z = this.createCanvasFill(A, t, O, q);
6367
+ A.fillStyle = Z || t, A.fillRect(W, f, O, q);
6320
6368
  }
6321
- if (P || T) {
6322
- const Z = this.createCanvasFill(A, R, G === "vertical" ? 3 : O, G === "vertical" ? n : 3);
6323
- A.fillStyle = Z || R, G === "vertical" ? A.fillRect(W, f, 3, n) : A.fillRect(W, f + n - 3, O, 3);
6369
+ if (V || T) {
6370
+ const Z = this.createCanvasFill(A, U, s === "vertical" ? 3 : O, s === "vertical" ? q : 3);
6371
+ A.fillStyle = Z || U, s === "vertical" ? A.fillRect(W, f, 3, q) : A.fillRect(W, f + q - 3, O, 3);
6324
6372
  }
6325
- const p = P ? "#ffffff" : M ? "rgba(255, 255, 255, 0.9)" : Y;
6326
- A.fillStyle = p, A.font = P || T ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
6327
- const iA = typeof X == "string" ? X : (X == null ? void 0 : X.label) || `Item ${gA + 1}`, d = W + (G === "vertical" ? 16 : O / 2), l = f + n / 2;
6328
- G === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(iA, d, l), z += (G === "vertical" ? a : N) + s;
6373
+ const p = V ? "#ffffff" : y ? "rgba(255, 255, 255, 0.9)" : c;
6374
+ A.fillStyle = p, A.font = V || T ? "600 14px Inter, sans-serif" : "400 14px Inter, sans-serif";
6375
+ const iA = typeof X == "string" ? X : (X == null ? void 0 : X.label) || `Item ${gA + 1}`, d = W + (s === "vertical" ? 16 : O / 2), l = f + q / 2;
6376
+ s === "horizontal" ? A.textAlign = "center" : A.textAlign = "left", A.fillText(iA, d, l), P += (s === "vertical" ? a : N) + w;
6329
6377
  }), A.restore(), g.showScrollbar !== !1) {
6330
- const X = (h.length || 0) * (G === "vertical" ? a : N) + ((h.length || 0) - 1) * s, gA = G === "vertical" ? B : Q;
6378
+ const X = (G.length || 0) * (s === "vertical" ? a : N) + ((G.length || 0) - 1) * w, gA = s === "vertical" ? B : Q;
6331
6379
  if (X > gA) {
6332
- const O = gA / X, n = gA * O, W = -S / X * gA, f = g.scrollbarColor || "rgba(255,255,255,0.3)", T = g.scrollbarWidth || 4;
6333
- A.fillStyle = f, G === "vertical" ? A.fillRect(i + Q - T - 2, o + W, T, n) : A.fillRect(i + W, o + B - T - 2, n, T);
6380
+ const O = gA / X, q = gA * O, W = -S / X * gA, f = g.scrollbarColor || "rgba(255,255,255,0.3)", T = g.scrollbarWidth || 4;
6381
+ A.fillStyle = f, s === "vertical" ? A.fillRect(i + Q - T - 2, o + W, T, q) : A.fillRect(i + W, o + B - T - 2, q, T);
6334
6382
  }
6335
6383
  }
6336
6384
  A.restore();
6337
6385
  }
6338
6386
  updateListViewScrollFromPointer(A) {
6339
- var F, M;
6387
+ var k, y;
6340
6388
  if (!this._lastPointerPos || !this._prevPointerPos) return;
6341
6389
  const I = A.options || {}, C = I.orientation || "vertical", g = this._lastPointerPos.x - this._prevPointerPos.x, Q = this._lastPointerPos.y - this._prevPointerPos.y;
6342
6390
  C === "vertical" ? I.scrollOffset = (I.scrollOffset || 0) + Q : I.scrollOffset = (I.scrollOffset || 0) + g;
6343
- const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10, w = I.itemHeight ?? 50, G = I.itemWidth ?? 200, h = B.width !== void 0 ? B.width : ((F = A.geometry) == null ? void 0 : F.width) || 200, s = B.height !== void 0 ? B.height : ((M = A.geometry) == null ? void 0 : M.height) || 300, a = (i.length || 0) * (C === "vertical" ? w : G) + ((i.length || 0) - 1) * o, S = Math.max(0, a - (C === "vertical" ? s : h) + (I.padding * 2 || 0));
6391
+ const B = this.objectStates.get(A.id) || {}, i = I.items || [], o = I.itemGap ?? 10, h = I.itemHeight ?? 50, s = I.itemWidth ?? 200, G = B.width !== void 0 ? B.width : ((k = A.geometry) == null ? void 0 : k.width) || 200, w = B.height !== void 0 ? B.height : ((y = A.geometry) == null ? void 0 : y.height) || 300, a = (i.length || 0) * (C === "vertical" ? h : s) + ((i.length || 0) - 1) * o, S = Math.max(0, a - (C === "vertical" ? w : G) + (I.padding * 2 || 0));
6344
6392
  I.scrollOffset > 0 && (I.scrollOffset = 0), I.scrollOffset < -S && (I.scrollOffset = -S);
6345
6393
  }
6346
6394
  updateListViewHoverFromPointer(A, I, C) {
@@ -6348,16 +6396,16 @@ class xC {
6348
6396
  Q.hoveredIndex !== g && (Q.hoveredIndex = g);
6349
6397
  }
6350
6398
  getListViewItemIndexAtPointer(A, I, C) {
6351
- var b, z;
6399
+ var b, P;
6352
6400
  const g = A.options || {}, Q = this.objectStates.get(A.id) || {}, B = g.items || [];
6353
6401
  if (B.length === 0) return null;
6354
- const i = Q.width !== void 0 ? Q.width : ((b = A.geometry) == null ? void 0 : b.width) || 200, o = Q.height !== void 0 ? Q.height : ((z = A.geometry) == null ? void 0 : z.height) || 300, w = g.orientation || "vertical", G = g.itemGap ?? 10, h = g.itemHeight ?? 50, s = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, N = g.padding ?? 0, S = this.getWorldTransform(A.id), F = I - S.x, M = C - S.y, R = -S.rotation * (Math.PI / 180), Y = Math.cos(R), t = Math.sin(R), J = F * Y - M * t, U = F * t + M * Y, c = -i / 2, e = -o / 2, r = typeof N == "number" ? N : w === "vertical" ? N[0] : N[3];
6355
- let L = (w === "vertical" ? e : c) + a + r;
6402
+ const i = Q.width !== void 0 ? Q.width : ((b = A.geometry) == null ? void 0 : b.width) || 200, o = Q.height !== void 0 ? Q.height : ((P = A.geometry) == null ? void 0 : P.height) || 300, h = g.orientation || "vertical", s = g.itemGap ?? 10, G = g.itemHeight ?? 50, w = g.itemWidth ?? 200, a = g.scrollOffset ?? 0, N = g.padding ?? 0, S = this.getWorldTransform(A.id), k = I - S.x, y = C - S.y, U = -S.rotation * (Math.PI / 180), c = Math.cos(U), t = Math.sin(U), J = k * c - y * t, R = k * t + y * c, e = -i / 2, Y = -o / 2, r = typeof N == "number" ? N : h === "vertical" ? N[0] : N[3];
6403
+ let L = (h === "vertical" ? Y : e) + a + r;
6356
6404
  for (let IA = 0; IA < B.length; IA++) {
6357
- const m = w === "vertical" ? i : s, QA = w === "vertical" ? h : o, _ = w === "vertical" ? c : L, BA = w === "vertical" ? L : e;
6358
- if (J >= _ && J <= _ + m && U >= BA && U <= BA + QA)
6405
+ const m = h === "vertical" ? i : w, QA = h === "vertical" ? G : o, _ = h === "vertical" ? e : L, BA = h === "vertical" ? L : Y;
6406
+ if (J >= _ && J <= _ + m && R >= BA && R <= BA + QA)
6359
6407
  return IA;
6360
- L += (w === "vertical" ? h : s) + G;
6408
+ L += (h === "vertical" ? G : w) + s;
6361
6409
  }
6362
6410
  return null;
6363
6411
  }
@@ -6376,104 +6424,104 @@ const PC = RC(
6376
6424
  alignment: B = "Center",
6377
6425
  onReady: i,
6378
6426
  onTrigger: o,
6379
- onInputUpdate: w,
6380
- onComponentChange: G,
6381
- onToggle: h,
6382
- onInputChange: s,
6427
+ onInputUpdate: h,
6428
+ onComponentChange: s,
6429
+ onToggle: G,
6430
+ onInputChange: w,
6383
6431
  onInputFocus: a,
6384
6432
  onInputBlur: N
6385
6433
  }, S) => {
6386
- const F = wI(null), M = wI(new xC()), R = wI(), Y = wI(0);
6387
- tC(S, () => F.current), eA(() => {
6388
- console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), M.current.setLayout(Q, B);
6434
+ const k = wI(null), y = wI(new xC()), U = wI(), c = wI(0);
6435
+ tC(S, () => k.current), eA(() => {
6436
+ console.log("[ExodeUI] Layout Effect - Component Updated/Mounted"), y.current.setLayout(Q, B);
6389
6437
  }, [Q, B]), eA(() => {
6390
- o && M.current.setTriggerCallback(o);
6438
+ o && y.current.setTriggerCallback(o);
6391
6439
  }, [o]), eA(() => {
6392
- w && M.current.setInputUpdateCallback(w);
6393
- }, [w]), eA(() => {
6394
- G && M.current.setComponentChangeCallback(G);
6395
- }, [G]), eA(() => {
6396
- h && M.current.setToggleCallback(h);
6440
+ h && y.current.setInputUpdateCallback(h);
6397
6441
  }, [h]), eA(() => {
6398
- s && M.current.setInputChangeCallback(s);
6442
+ s && y.current.setComponentChangeCallback(s);
6399
6443
  }, [s]), eA(() => {
6400
- a && M.current.setInputFocusCallback(a);
6444
+ G && y.current.setToggleCallback(G);
6445
+ }, [G]), eA(() => {
6446
+ w && y.current.setInputChangeCallback(w);
6447
+ }, [w]), eA(() => {
6448
+ a && y.current.setInputFocusCallback(a);
6401
6449
  }, [a]), eA(() => {
6402
- N && M.current.setInputBlurCallback(N);
6450
+ N && y.current.setInputBlurCallback(N);
6403
6451
  }, [N]), eA(() => {
6404
6452
  (async () => {
6405
- const U = M.current;
6406
- let c = D;
6407
- if (!c && A)
6453
+ const R = y.current;
6454
+ let e = D;
6455
+ if (!e && A)
6408
6456
  try {
6409
- c = await (await fetch(A)).json();
6410
- } catch (e) {
6411
- console.error("Failed to load ExodeUI animation:", e);
6457
+ e = await (await fetch(A)).json();
6458
+ } catch (Y) {
6459
+ console.error("Failed to load ExodeUI animation:", Y);
6412
6460
  return;
6413
6461
  }
6414
- c && (U.load(c), i && i(U));
6462
+ e && (R.load(e), i && i(R));
6415
6463
  })();
6416
6464
  }, [D, A]), eA(() => {
6417
- const J = M.current, U = F.current;
6418
- if (!U) return;
6419
- const c = U.getContext("2d");
6420
- if (!c) return;
6421
- const e = (r) => {
6422
- Y.current || (Y.current = r);
6423
- const L = (r - Y.current) / 1e3;
6424
- Y.current = r, g && J.advance(L);
6425
- const b = window.devicePixelRatio || 1, z = U.getBoundingClientRect(), IA = Math.floor(z.width * b), m = Math.floor(z.height * b);
6426
- (U.width !== IA || U.height !== m) && (U.width = IA, U.height = m), J.render(c, IA, m), R.current = requestAnimationFrame(e);
6465
+ const J = y.current, R = k.current;
6466
+ if (!R) return;
6467
+ const e = R.getContext("2d");
6468
+ if (!e) return;
6469
+ const Y = (r) => {
6470
+ c.current || (c.current = r);
6471
+ const L = (r - c.current) / 1e3;
6472
+ c.current = r, g && J.advance(L);
6473
+ const b = window.devicePixelRatio || 1, P = R.getBoundingClientRect(), IA = Math.floor(P.width * b), m = Math.floor(P.height * b);
6474
+ (R.width !== IA || R.height !== m) && (R.width = IA, R.height = m), J.render(e, IA, m), U.current = requestAnimationFrame(Y);
6427
6475
  };
6428
- return R.current = requestAnimationFrame(e), () => {
6429
- R.current && cancelAnimationFrame(R.current);
6476
+ return U.current = requestAnimationFrame(Y), () => {
6477
+ U.current && cancelAnimationFrame(U.current);
6430
6478
  };
6431
6479
  }, [g]);
6432
- const t = (J, U) => {
6433
- const c = J.currentTarget.getBoundingClientRect(), e = J.clientX - c.left, r = J.clientY - c.top, L = c.width, b = c.height;
6434
- M.current.handlePointerInput(U, e, r, L, b);
6480
+ const t = (J, R) => {
6481
+ const e = J.currentTarget.getBoundingClientRect(), Y = J.clientX - e.left, r = J.clientY - e.top, L = e.width, b = e.height;
6482
+ y.current.handlePointerInput(R, Y, r, L, b);
6435
6483
  };
6436
6484
  return /* @__PURE__ */ UC(
6437
6485
  "canvas",
6438
6486
  {
6439
- ref: F,
6487
+ ref: k,
6440
6488
  style: { width: "100%", height: "100%", outline: "none", ...C },
6441
6489
  className: I,
6442
6490
  tabIndex: 0,
6443
6491
  onPointerDown: (J) => {
6444
- var U;
6445
- t(J, "down"), (U = F.current) == null || U.focus();
6492
+ var R;
6493
+ t(J, "down"), (R = k.current) == null || R.focus();
6446
6494
  },
6447
6495
  onPointerUp: (J) => t(J, "up"),
6448
6496
  onPointerMove: (J) => t(J, "move"),
6449
6497
  onPointerLeave: (J) => t(J, "blur"),
6450
6498
  onClick: (J) => t(J, "click"),
6451
6499
  onKeyDown: (J) => {
6452
- J.key === "Backspace" || J.key === "Enter" || J.key, M.current.handleKeyDown(J.nativeEvent);
6500
+ J.key === "Backspace" || J.key === "Enter" || J.key, y.current.handleKeyDown(J.nativeEvent);
6453
6501
  }
6454
6502
  }
6455
6503
  );
6456
6504
  }
6457
6505
  );
6458
6506
  function VC() {
6459
- const [D, A] = cC(null), I = qA((h, s) => {
6460
- D == null || D.setInputBool(h, s);
6461
- }, [D]), C = qA((h, s) => {
6462
- D == null || D.setInputNumber(h, s);
6463
- }, [D]), g = qA((h) => {
6464
- D == null || D.fireTrigger(h);
6465
- }, [D]), Q = qA((h, s) => {
6466
- D == null || D.setInputText(h, s);
6467
- }, [D]), B = qA((h, s) => {
6468
- D == null || D.setInputNumberArray(h, s);
6469
- }, [D]), i = qA((h, s) => {
6470
- D == null || D.setInputStringArray(h, s);
6471
- }, [D]), o = qA((h, s) => {
6472
- D == null || D.updateObjectOptions(h, s);
6473
- }, [D]), w = qA((h, s, a) => {
6474
- D == null || D.updateConstraint(h, s, a);
6475
- }, [D]), G = qA((h, s) => {
6476
- D == null || D.updateGraphData(h, s);
6507
+ const [D, A] = cC(null), I = nA((G, w) => {
6508
+ D == null || D.setInputBool(G, w);
6509
+ }, [D]), C = nA((G, w) => {
6510
+ D == null || D.setInputNumber(G, w);
6511
+ }, [D]), g = nA((G) => {
6512
+ D == null || D.fireTrigger(G);
6513
+ }, [D]), Q = nA((G, w) => {
6514
+ D == null || D.setInputText(G, w);
6515
+ }, [D]), B = nA((G, w) => {
6516
+ D == null || D.setInputNumberArray(G, w);
6517
+ }, [D]), i = nA((G, w) => {
6518
+ D == null || D.setInputStringArray(G, w);
6519
+ }, [D]), o = nA((G, w) => {
6520
+ D == null || D.updateObjectOptions(G, w);
6521
+ }, [D]), h = nA((G, w, a) => {
6522
+ D == null || D.updateConstraint(G, w, a);
6523
+ }, [D]), s = nA((G, w) => {
6524
+ D == null || D.updateGraphData(G, w);
6477
6525
  }, [D]);
6478
6526
  return {
6479
6527
  setEngine: A,
@@ -6485,8 +6533,8 @@ function VC() {
6485
6533
  setInputText: Q,
6486
6534
  setInputNumberArray: B,
6487
6535
  setInputStringArray: i,
6488
- updateConstraint: w,
6489
- updateGraphData: G,
6536
+ updateConstraint: h,
6537
+ updateGraphData: s,
6490
6538
  updateObjectOptions: o
6491
6539
  };
6492
6540
  }