@wonderyard/vivarium 0.1.0

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.
@@ -0,0 +1,2565 @@
1
+ var _t = "0.7.1", n = Symbol(`typegpu:${_t}:$internal`), Ge = Symbol(`typegpu:${_t}:$wgslDataType`), th = Symbol(`typegpu:${_t}:$gpuValueOf`), Le = Symbol(`typegpu:${_t}:$getNameForward`), ps = Symbol(`typegpu:${_t}:$providing`), Vs = Symbol(`typegpu:${_t}:$repr`), Ot = globalThis.process.env.NODE_ENV === "development", bs = globalThis.process.env.NODE_ENV === "test";
2
+ Object.assign(globalThis, { __TYPEGPU_AUTONAME__: (t, e) => Ms(t) && t?.[n] && !pt(t) ? t.$name(e) : t });
3
+ var Nt = globalThis, eh = (Ot || bs) && { get enabled() {
4
+ return !!Nt.__TYPEGPU_MEASURE_PERF__;
5
+ }, record(t, e) {
6
+ let s = Nt.__TYPEGPU_PERF_RECORDS__ ??= /* @__PURE__ */ new Map(), i = s.get(t);
7
+ i || (i = [], s.set(t, i)), i.push(e);
8
+ } } || void 0;
9
+ function ds(t) {
10
+ return !!t?.[Le];
11
+ }
12
+ function pt(t) {
13
+ return ds(t) ? pt(t[Le]) : Ts(t)?.name;
14
+ }
15
+ function Ue(t, e) {
16
+ Es(t, { name: e });
17
+ }
18
+ function Ms(t) {
19
+ return !!t?.$name;
20
+ }
21
+ function Ts(t) {
22
+ return Nt.__TYPEGPU_META__.get(t);
23
+ }
24
+ function Es(t, e) {
25
+ Nt.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap();
26
+ let s = Nt.__TYPEGPU_META__;
27
+ s.set(t, { ...s.get(t), ...e });
28
+ }
29
+ var te = "Invariant failed";
30
+ function Re(t, e) {
31
+ if (t) return;
32
+ if (!Ot) throw new Error(te);
33
+ let s = typeof e == "function" ? e() : e, i = s ? `${te}: ${s}` : te;
34
+ throw new Error(i);
35
+ }
36
+ var sh = class ee extends Error {
37
+ constructor(e, s) {
38
+ let i = s.map((h) => `- ${h}`);
39
+ i.length > 20 && (i = [...i.slice(0, 11), "...", ...i.slice(-10)]), super(`Resolution of the following tree failed:
40
+ ${i.join(`
41
+ `)}: ${e && typeof e == "object" && "message" in e ? e.message : e}`), this.cause = e, this.trace = s, Object.setPrototypeOf(this, ee.prototype);
42
+ }
43
+ appendToTrace(e) {
44
+ let s = [e, ...this.trace];
45
+ return new ee(this.cause, s);
46
+ }
47
+ }, ih = class se extends Error {
48
+ constructor(e, s) {
49
+ let i = s.map((h) => `- ${h}`);
50
+ i.length > 20 && (i = [...i.slice(0, 11), "...", ...i.slice(-10)]), super(`Execution of the following tree failed:
51
+ ${i.join(`
52
+ `)}: ${e && typeof e == "object" && "message" in e ? e.message : e}`), this.cause = e, this.trace = s, Object.setPrototypeOf(this, se.prototype);
53
+ }
54
+ appendToTrace(e) {
55
+ let s = [e, ...this.trace];
56
+ return new se(this.cause, s);
57
+ }
58
+ }, hh = class Ye extends Error {
59
+ constructor(e) {
60
+ super(`Missing value for '${e}'`), this.slot = e, Object.setPrototypeOf(this, Ye.prototype);
61
+ }
62
+ }, nh = class Be extends Error {
63
+ constructor(e) {
64
+ super(`Buffer '${pt(e) ?? "<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`), Object.setPrototypeOf(this, Be.prototype);
65
+ }
66
+ }, rh = class He extends Error {
67
+ constructor(e, s) {
68
+ super(`The function '${e ?? "<unnamed>"}' is missing links to the following external values: ${s}.`), Object.setPrototypeOf(this, He.prototype);
69
+ }
70
+ }, ch = class De extends Error {
71
+ constructor(e) {
72
+ super(`Missing bind groups for layouts: '${[...e].map((s) => pt(s) ?? "<unnamed>").join(", ")}'. Please provide it using pipeline.with(layout, bindGroup).(...)`), Object.setPrototypeOf(this, De.prototype);
73
+ }
74
+ }, ah = class We extends Error {
75
+ constructor(e) {
76
+ super(`Missing vertex buffers for layouts: '${[...e].map((s) => pt(s) ?? "<unnamed>").join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`), Object.setPrototypeOf(this, We.prototype);
77
+ }
78
+ }, uh = class Ke extends Error {
79
+ constructor(e) {
80
+ super(e), Object.setPrototypeOf(this, Ke.prototype);
81
+ }
82
+ }, yh = class Ze extends Error {
83
+ constructor(e) {
84
+ super(e), Object.setPrototypeOf(this, Ze.prototype);
85
+ }
86
+ }, Is = class qe extends Error {
87
+ constructor(e) {
88
+ super(e), Object.setPrototypeOf(this, qe.prototype);
89
+ }
90
+ };
91
+ function $s(t) {
92
+ return t?.resourceType === "slot";
93
+ }
94
+ function ks(t) {
95
+ return t?.resourceType === "derived";
96
+ }
97
+ function Os(t) {
98
+ return t?.[ps] !== void 0;
99
+ }
100
+ function oh(t) {
101
+ return t?.resourceType === "accessor";
102
+ }
103
+ function Ns(t) {
104
+ return !!t?.[Ge];
105
+ }
106
+ var xh = { [n]: !0, type: "void" }, js = ["bool", "f32", "f16", "i32", "u32", "u16", "vec2f", "vec2h", "vec2i", "vec2u", "vec2<bool>", "vec3f", "vec3h", "vec3i", "vec3u", "vec3<bool>", "vec4f", "vec4h", "vec4i", "vec4u", "vec4<bool>", "mat2x2f", "mat3x3f", "mat4x4f", "struct", "array", "ptr", "atomic", "decorated", "abstractInt", "abstractFloat", "void"];
107
+ function w(t) {
108
+ let e = t;
109
+ return !!e?.[n] && typeof e.kind == "string" && e.kind.startsWith("vec");
110
+ }
111
+ function Ps(t) {
112
+ let e = t;
113
+ return !!e?.[n] && typeof e.type == "string" && e.type.startsWith("vec2");
114
+ }
115
+ function Ss(t) {
116
+ let e = t;
117
+ return !!e?.[n] && typeof e.type == "string" && e.type.startsWith("vec3");
118
+ }
119
+ function Cs(t) {
120
+ let e = t;
121
+ return !!e?.[n] && typeof e.type == "string" && e.type.startsWith("vec4");
122
+ }
123
+ function jt(t) {
124
+ return Ps(t) || Ss(t) || Cs(t);
125
+ }
126
+ function T(t) {
127
+ let e = t;
128
+ return !!e?.[n] && typeof e.kind?.startsWith == "function" && e.kind.startsWith("mat");
129
+ }
130
+ function Fs(t) {
131
+ return t?.[n] && t?.type === "mat2x2f";
132
+ }
133
+ function As(t) {
134
+ return t?.[n] && t?.type === "mat3x3f";
135
+ }
136
+ function Gs(t) {
137
+ return t?.[n] && t?.type === "mat4x4f";
138
+ }
139
+ function Ie(t) {
140
+ return Fs(t) || As(t) || Gs(t);
141
+ }
142
+ function $e(t) {
143
+ return w(t) && ["vec2f", "vec3f", "vec4f"].includes(t.kind);
144
+ }
145
+ function Xe(t) {
146
+ return t?.[n] && js.includes(t?.type);
147
+ }
148
+ function Ls(t) {
149
+ return t?.[n] && t?.type === "array";
150
+ }
151
+ function Us(t) {
152
+ return t?.[n] && t?.type === "struct";
153
+ }
154
+ function wh(t) {
155
+ return t?.[n] && t?.type === "ptr";
156
+ }
157
+ function lh(t) {
158
+ return t?.[n] && t?.type === "atomic";
159
+ }
160
+ function Rs(t) {
161
+ return t?.[n] && t?.type === "@align";
162
+ }
163
+ function Ys(t) {
164
+ return t?.[n] && t?.type === "@size";
165
+ }
166
+ function Bs(t) {
167
+ return t?.[n] && t?.type === "@location";
168
+ }
169
+ function vh(t) {
170
+ return t?.[n] && t?.type === "@interpolate";
171
+ }
172
+ function zh(t) {
173
+ return t?.[n] && t?.type === "@builtin";
174
+ }
175
+ function Hs(t) {
176
+ return t?.[n] && t?.type === "decorated";
177
+ }
178
+ function gh(t) {
179
+ return t?.[n] && t.type === "void";
180
+ }
181
+ function Je(t) {
182
+ let e = t?.type;
183
+ return !!t?.[n] && (e === "abstractInt" || e === "abstractFloat" || e === "f32" || e === "f16" || e === "i32" || e === "u32");
184
+ }
185
+ var Ds = ["uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra"], fh = { f32: "float32", vec2f: "float32x2", vec3f: "float32x3", vec4f: "float32x4", f16: "float16", vec2h: "float16x2", vec4h: "float16x4", u32: "uint32", vec2u: "uint32x2", vec3u: "uint32x3", vec4u: "uint32x4", i32: "sint32", vec2i: "sint32x2", vec3i: "sint32x3", vec4i: "sint32x4" }, Ws = ["unstruct", "disarray", "loose-decorated", ...Ds];
186
+ function Ks(t) {
187
+ return t?.[n] && Ws.includes(t?.type);
188
+ }
189
+ function Zs(t) {
190
+ return t?.[n] && t?.type === "disarray";
191
+ }
192
+ function qs(t) {
193
+ return t?.[n] && t?.type === "unstruct";
194
+ }
195
+ function mh(t) {
196
+ return t?.[n] && t?.type === "loose-decorated";
197
+ }
198
+ function _h(t) {
199
+ return t.attribs?.find(Rs)?.params[0];
200
+ }
201
+ function ph(t) {
202
+ return t.attribs?.find(Ys)?.params[0];
203
+ }
204
+ function Vh(t) {
205
+ return t.attribs?.find(Bs)?.params[0];
206
+ }
207
+ function bh(t) {
208
+ return Xe(t) || Ks(t);
209
+ }
210
+ var J = { type: "unknown", toString() {
211
+ return "unknown";
212
+ } }, dh = class {
213
+ constructor(t, e, s) {
214
+ this.name = t, this.lhs = e, this.operator = s;
215
+ }
216
+ }, Xs = class {
217
+ type = "normal";
218
+ }, Mh = class {
219
+ type = "codegen";
220
+ }, Th = class {
221
+ constructor(t, e) {
222
+ this.buffers = t, this.vars = e;
223
+ }
224
+ type = "simulate";
225
+ };
226
+ function Js(t) {
227
+ return Qs(t) && typeof t?.["~resolve"] == "function";
228
+ }
229
+ function Eh(t) {
230
+ return typeof t == "number" || typeof t == "boolean" || typeof t == "string" || Js(t) || Xe(t) || $s(t) || ks(t) || Os(t);
231
+ }
232
+ function Ih(t) {
233
+ return !!t && typeof t == "object" && "getMappedRange" in t && "mapAsync" in t;
234
+ }
235
+ function $h(t) {
236
+ return t?.resourceType === "buffer-usage";
237
+ }
238
+ function Qs(t) {
239
+ return !!t?.[n];
240
+ }
241
+ var Bt = !1;
242
+ function kh(t) {
243
+ if (Bt) return t();
244
+ try {
245
+ return Bt = !0, t();
246
+ } finally {
247
+ Bt = !1;
248
+ }
249
+ }
250
+ function Oh() {
251
+ return Bt;
252
+ }
253
+ var K;
254
+ function Nh(t, e) {
255
+ if (Re(K === void 0 || K === t, "Cannot nest context providers"), K === t) return e();
256
+ K = t;
257
+ try {
258
+ return e();
259
+ } finally {
260
+ K = void 0;
261
+ }
262
+ }
263
+ function Qe() {
264
+ return K;
265
+ }
266
+ var ti = new Xs();
267
+ function jh() {
268
+ return K?.mode ?? ti;
269
+ }
270
+ function ei() {
271
+ return K?.mode.type === "codegen";
272
+ }
273
+ function p(t, ...e) {
274
+ let s = Qe();
275
+ function i(r) {
276
+ return typeof r == "string" ? r : s.resolve(r.value, r.dataType);
277
+ }
278
+ let h = "";
279
+ for (let r = 0; r < t.length; ++r) {
280
+ h += t[r];
281
+ let o = e[r];
282
+ Array.isArray(o) ? h += o.filter((g) => g !== void 0).map(i).join(", ") : o && (h += i(o));
283
+ }
284
+ return h;
285
+ }
286
+ function V(t, e, s, i = "keep") {
287
+ let h = (...r) => ei() ? e(...r) : t(...r);
288
+ return Ue(h, s), h.toString = () => s, Object.defineProperty(h, n, { value: { jsImpl: t, gpuImpl: e, argConversionHint: i } }), h;
289
+ }
290
+ function st(t) {
291
+ return t.type === "decorated" || t.type === "loose-decorated" ? t.inner : t;
292
+ }
293
+ var ts = class {
294
+ constructor(t, e) {
295
+ this.value = t, this.dataType = e;
296
+ }
297
+ };
298
+ function es(t) {
299
+ return t instanceof ts;
300
+ }
301
+ function Pt(t) {
302
+ return Je(t.dataType);
303
+ }
304
+ function a(t, e) {
305
+ if (Ot && es(t)) throw new Error("Cannot nest snippets");
306
+ return new ts(t, st(e));
307
+ }
308
+ var si = { [n]: !0, type: "abstractInt" }, ii = { [n]: !0, type: "abstractFloat" }, hi = V((t) => t === void 0 ? !1 : typeof t == "boolean" ? t : !!t, (t) => a(p`bool(${t})`, O), "boolCast"), O = Object.assign(hi, { type: "bool" }), ni = V((t) => t === void 0 ? 0 : typeof t == "boolean" ? t ? 1 : 0 : (t & 4294967295) >>> 0, (t) => a(p`u32(${t})`, z), "u32Cast"), z = Object.assign(ni, { type: "u32" }), ri = V((t) => t === void 0 ? 0 : typeof t == "boolean" ? t ? 1 : 0 : t | 0, (t) => a(p`i32(${t})`, E), "i32Cast"), Ph = { [n]: !0, type: "u16" }, E = Object.assign(ri, { type: "i32" }), ci = V((t) => t === void 0 ? 0 : typeof t == "boolean" ? t ? 1 : 0 : Math.fround(t), (t) => a(p`f32(${t})`, b), "f32Cast"), b = Object.assign(ci, { type: "f32" }), ss = new ArrayBuffer(4), ai = new Float32Array(ss), ui = new Uint32Array(ss);
309
+ function yi(t) {
310
+ ai[0] = t;
311
+ let e = ui[0], s = e >>> 31 & 1, i = e >>> 23 & 255, h = e & 8388607;
312
+ return i === 255 ? s << 15 | 31744 | (h ? 512 : 0) : (i = i - 127 + 15, i <= 0 ? i < -10 ? s << 15 : (h = (h | 8388608) >> 1 - i, h = h + 4096 >> 13, s << 15 | h) : i >= 31 || (h = h + 4096, h & 8388608 && (h = 0, ++i, i >= 31)) ? s << 15 | 31744 : s << 15 | i << 10 | h >> 13);
313
+ }
314
+ function oi(t) {
315
+ let e = t & 32768 ? -1 : 1, s = t >> 10 & 31, i = t & 1023;
316
+ return s === 0 ? i ? e * i * 2 ** -24 : e * 0 : s === 31 ? i ? Number.NaN : e === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : e * (1 + i / 1024) * 2 ** (s - 15);
317
+ }
318
+ function xi(t) {
319
+ return oi(yi(t));
320
+ }
321
+ var wi = V((t) => t === void 0 ? 0 : typeof t == "boolean" ? t ? 1 : 0 : xi(t), (t) => a(p`f16(${t})`, F), "f16Cast"), F = Object.assign(wi, { type: "f16" }), re = class extends Array {
322
+ [n] = !0;
323
+ "~resolve"() {
324
+ return this.every((t) => !t) ? `${this.kind}()` : this.every((t) => this[0] === t) ? `${this.kind}(${this[0]})` : `${this.kind}(${this.join(", ")})`;
325
+ }
326
+ toString() {
327
+ return this["~resolve"]();
328
+ }
329
+ get xx() {
330
+ return new this._Vec2(this[0], this[0]);
331
+ }
332
+ get xy() {
333
+ return new this._Vec2(this[0], this[1]);
334
+ }
335
+ get xz() {
336
+ return new this._Vec2(this[0], this[2]);
337
+ }
338
+ get xw() {
339
+ return new this._Vec2(this[0], this[3]);
340
+ }
341
+ get yx() {
342
+ return new this._Vec2(this[1], this[0]);
343
+ }
344
+ get yy() {
345
+ return new this._Vec2(this[1], this[1]);
346
+ }
347
+ get yz() {
348
+ return new this._Vec2(this[1], this[2]);
349
+ }
350
+ get yw() {
351
+ return new this._Vec2(this[1], this[3]);
352
+ }
353
+ get zx() {
354
+ return new this._Vec2(this[2], this[0]);
355
+ }
356
+ get zy() {
357
+ return new this._Vec2(this[2], this[1]);
358
+ }
359
+ get zz() {
360
+ return new this._Vec2(this[2], this[2]);
361
+ }
362
+ get zw() {
363
+ return new this._Vec2(this[2], this[3]);
364
+ }
365
+ get wx() {
366
+ return new this._Vec2(this[3], this[0]);
367
+ }
368
+ get wy() {
369
+ return new this._Vec2(this[3], this[1]);
370
+ }
371
+ get wz() {
372
+ return new this._Vec2(this[3], this[2]);
373
+ }
374
+ get ww() {
375
+ return new this._Vec2(this[3], this[3]);
376
+ }
377
+ get xxx() {
378
+ return new this._Vec3(this[0], this[0], this[0]);
379
+ }
380
+ get xxy() {
381
+ return new this._Vec3(this[0], this[0], this[1]);
382
+ }
383
+ get xxz() {
384
+ return new this._Vec3(this[0], this[0], this[2]);
385
+ }
386
+ get xxw() {
387
+ return new this._Vec3(this[0], this[0], this[3]);
388
+ }
389
+ get xyx() {
390
+ return new this._Vec3(this[0], this[1], this[0]);
391
+ }
392
+ get xyy() {
393
+ return new this._Vec3(this[0], this[1], this[1]);
394
+ }
395
+ get xyz() {
396
+ return new this._Vec3(this[0], this[1], this[2]);
397
+ }
398
+ get xyw() {
399
+ return new this._Vec3(this[0], this[1], this[3]);
400
+ }
401
+ get xzx() {
402
+ return new this._Vec3(this[0], this[2], this[0]);
403
+ }
404
+ get xzy() {
405
+ return new this._Vec3(this[0], this[2], this[1]);
406
+ }
407
+ get xzz() {
408
+ return new this._Vec3(this[0], this[2], this[2]);
409
+ }
410
+ get xzw() {
411
+ return new this._Vec3(this[0], this[2], this[3]);
412
+ }
413
+ get xwx() {
414
+ return new this._Vec3(this[0], this[3], this[0]);
415
+ }
416
+ get xwy() {
417
+ return new this._Vec3(this[0], this[3], this[1]);
418
+ }
419
+ get xwz() {
420
+ return new this._Vec3(this[0], this[3], this[2]);
421
+ }
422
+ get xww() {
423
+ return new this._Vec3(this[0], this[3], this[3]);
424
+ }
425
+ get yxx() {
426
+ return new this._Vec3(this[1], this[0], this[0]);
427
+ }
428
+ get yxy() {
429
+ return new this._Vec3(this[1], this[0], this[1]);
430
+ }
431
+ get yxz() {
432
+ return new this._Vec3(this[1], this[0], this[2]);
433
+ }
434
+ get yxw() {
435
+ return new this._Vec3(this[1], this[0], this[3]);
436
+ }
437
+ get yyx() {
438
+ return new this._Vec3(this[1], this[1], this[0]);
439
+ }
440
+ get yyy() {
441
+ return new this._Vec3(this[1], this[1], this[1]);
442
+ }
443
+ get yyz() {
444
+ return new this._Vec3(this[1], this[1], this[2]);
445
+ }
446
+ get yyw() {
447
+ return new this._Vec3(this[1], this[1], this[3]);
448
+ }
449
+ get yzx() {
450
+ return new this._Vec3(this[1], this[2], this[0]);
451
+ }
452
+ get yzy() {
453
+ return new this._Vec3(this[1], this[2], this[1]);
454
+ }
455
+ get yzz() {
456
+ return new this._Vec3(this[1], this[2], this[2]);
457
+ }
458
+ get yzw() {
459
+ return new this._Vec3(this[1], this[2], this[3]);
460
+ }
461
+ get ywx() {
462
+ return new this._Vec3(this[1], this[3], this[0]);
463
+ }
464
+ get ywy() {
465
+ return new this._Vec3(this[1], this[3], this[1]);
466
+ }
467
+ get ywz() {
468
+ return new this._Vec3(this[1], this[3], this[2]);
469
+ }
470
+ get yww() {
471
+ return new this._Vec3(this[1], this[3], this[3]);
472
+ }
473
+ get zxx() {
474
+ return new this._Vec3(this[2], this[0], this[0]);
475
+ }
476
+ get zxy() {
477
+ return new this._Vec3(this[2], this[0], this[1]);
478
+ }
479
+ get zxz() {
480
+ return new this._Vec3(this[2], this[0], this[2]);
481
+ }
482
+ get zxw() {
483
+ return new this._Vec3(this[2], this[0], this[3]);
484
+ }
485
+ get zyx() {
486
+ return new this._Vec3(this[2], this[1], this[0]);
487
+ }
488
+ get zyy() {
489
+ return new this._Vec3(this[2], this[1], this[1]);
490
+ }
491
+ get zyz() {
492
+ return new this._Vec3(this[2], this[1], this[2]);
493
+ }
494
+ get zyw() {
495
+ return new this._Vec3(this[2], this[1], this[3]);
496
+ }
497
+ get zzx() {
498
+ return new this._Vec3(this[2], this[2], this[0]);
499
+ }
500
+ get zzy() {
501
+ return new this._Vec3(this[2], this[2], this[1]);
502
+ }
503
+ get zzz() {
504
+ return new this._Vec3(this[2], this[2], this[2]);
505
+ }
506
+ get zzw() {
507
+ return new this._Vec3(this[2], this[2], this[3]);
508
+ }
509
+ get zwx() {
510
+ return new this._Vec3(this[2], this[3], this[0]);
511
+ }
512
+ get zwy() {
513
+ return new this._Vec3(this[2], this[3], this[1]);
514
+ }
515
+ get zwz() {
516
+ return new this._Vec3(this[2], this[3], this[2]);
517
+ }
518
+ get zww() {
519
+ return new this._Vec3(this[2], this[3], this[3]);
520
+ }
521
+ get wxx() {
522
+ return new this._Vec3(this[3], this[0], this[0]);
523
+ }
524
+ get wxy() {
525
+ return new this._Vec3(this[3], this[0], this[1]);
526
+ }
527
+ get wxz() {
528
+ return new this._Vec3(this[3], this[0], this[2]);
529
+ }
530
+ get wxw() {
531
+ return new this._Vec3(this[3], this[0], this[3]);
532
+ }
533
+ get wyx() {
534
+ return new this._Vec3(this[3], this[1], this[0]);
535
+ }
536
+ get wyy() {
537
+ return new this._Vec3(this[3], this[1], this[1]);
538
+ }
539
+ get wyz() {
540
+ return new this._Vec3(this[3], this[1], this[2]);
541
+ }
542
+ get wyw() {
543
+ return new this._Vec3(this[3], this[1], this[3]);
544
+ }
545
+ get wzx() {
546
+ return new this._Vec3(this[3], this[2], this[0]);
547
+ }
548
+ get wzy() {
549
+ return new this._Vec3(this[3], this[2], this[1]);
550
+ }
551
+ get wzz() {
552
+ return new this._Vec3(this[3], this[2], this[2]);
553
+ }
554
+ get wzw() {
555
+ return new this._Vec3(this[3], this[2], this[3]);
556
+ }
557
+ get wwx() {
558
+ return new this._Vec3(this[3], this[3], this[0]);
559
+ }
560
+ get wwy() {
561
+ return new this._Vec3(this[3], this[3], this[1]);
562
+ }
563
+ get wwz() {
564
+ return new this._Vec3(this[3], this[3], this[2]);
565
+ }
566
+ get www() {
567
+ return new this._Vec3(this[3], this[3], this[3]);
568
+ }
569
+ get xxxx() {
570
+ return new this._Vec4(this[0], this[0], this[0], this[0]);
571
+ }
572
+ get xxxy() {
573
+ return new this._Vec4(this[0], this[0], this[0], this[1]);
574
+ }
575
+ get xxxz() {
576
+ return new this._Vec4(this[0], this[0], this[0], this[2]);
577
+ }
578
+ get xxxw() {
579
+ return new this._Vec4(this[0], this[0], this[0], this[3]);
580
+ }
581
+ get xxyx() {
582
+ return new this._Vec4(this[0], this[0], this[1], this[0]);
583
+ }
584
+ get xxyy() {
585
+ return new this._Vec4(this[0], this[0], this[1], this[1]);
586
+ }
587
+ get xxyz() {
588
+ return new this._Vec4(this[0], this[0], this[1], this[2]);
589
+ }
590
+ get xxyw() {
591
+ return new this._Vec4(this[0], this[0], this[1], this[3]);
592
+ }
593
+ get xxzx() {
594
+ return new this._Vec4(this[0], this[0], this[2], this[0]);
595
+ }
596
+ get xxzy() {
597
+ return new this._Vec4(this[0], this[0], this[2], this[1]);
598
+ }
599
+ get xxzz() {
600
+ return new this._Vec4(this[0], this[0], this[2], this[2]);
601
+ }
602
+ get xxzw() {
603
+ return new this._Vec4(this[0], this[0], this[2], this[3]);
604
+ }
605
+ get xxwx() {
606
+ return new this._Vec4(this[0], this[0], this[3], this[0]);
607
+ }
608
+ get xxwy() {
609
+ return new this._Vec4(this[0], this[0], this[3], this[1]);
610
+ }
611
+ get xxwz() {
612
+ return new this._Vec4(this[0], this[0], this[3], this[2]);
613
+ }
614
+ get xxww() {
615
+ return new this._Vec4(this[0], this[0], this[3], this[3]);
616
+ }
617
+ get xyxx() {
618
+ return new this._Vec4(this[0], this[1], this[0], this[0]);
619
+ }
620
+ get xyxy() {
621
+ return new this._Vec4(this[0], this[1], this[0], this[1]);
622
+ }
623
+ get xyxz() {
624
+ return new this._Vec4(this[0], this[1], this[0], this[2]);
625
+ }
626
+ get xyxw() {
627
+ return new this._Vec4(this[0], this[1], this[0], this[3]);
628
+ }
629
+ get xyyx() {
630
+ return new this._Vec4(this[0], this[1], this[1], this[0]);
631
+ }
632
+ get xyyy() {
633
+ return new this._Vec4(this[0], this[1], this[1], this[1]);
634
+ }
635
+ get xyyz() {
636
+ return new this._Vec4(this[0], this[1], this[1], this[2]);
637
+ }
638
+ get xyyw() {
639
+ return new this._Vec4(this[0], this[1], this[1], this[3]);
640
+ }
641
+ get xyzx() {
642
+ return new this._Vec4(this[0], this[1], this[2], this[0]);
643
+ }
644
+ get xyzy() {
645
+ return new this._Vec4(this[0], this[1], this[2], this[1]);
646
+ }
647
+ get xyzz() {
648
+ return new this._Vec4(this[0], this[1], this[2], this[2]);
649
+ }
650
+ get xyzw() {
651
+ return new this._Vec4(this[0], this[1], this[2], this[3]);
652
+ }
653
+ get xywx() {
654
+ return new this._Vec4(this[0], this[1], this[3], this[0]);
655
+ }
656
+ get xywy() {
657
+ return new this._Vec4(this[0], this[1], this[3], this[1]);
658
+ }
659
+ get xywz() {
660
+ return new this._Vec4(this[0], this[1], this[3], this[2]);
661
+ }
662
+ get xyww() {
663
+ return new this._Vec4(this[0], this[1], this[3], this[3]);
664
+ }
665
+ get xzxx() {
666
+ return new this._Vec4(this[0], this[2], this[0], this[0]);
667
+ }
668
+ get xzxy() {
669
+ return new this._Vec4(this[0], this[2], this[0], this[1]);
670
+ }
671
+ get xzxz() {
672
+ return new this._Vec4(this[0], this[2], this[0], this[2]);
673
+ }
674
+ get xzxw() {
675
+ return new this._Vec4(this[0], this[2], this[0], this[3]);
676
+ }
677
+ get xzyx() {
678
+ return new this._Vec4(this[0], this[2], this[1], this[0]);
679
+ }
680
+ get xzyy() {
681
+ return new this._Vec4(this[0], this[2], this[1], this[1]);
682
+ }
683
+ get xzyz() {
684
+ return new this._Vec4(this[0], this[2], this[1], this[2]);
685
+ }
686
+ get xzyw() {
687
+ return new this._Vec4(this[0], this[2], this[1], this[3]);
688
+ }
689
+ get xzzx() {
690
+ return new this._Vec4(this[0], this[2], this[2], this[0]);
691
+ }
692
+ get xzzy() {
693
+ return new this._Vec4(this[0], this[2], this[2], this[1]);
694
+ }
695
+ get xzzz() {
696
+ return new this._Vec4(this[0], this[2], this[2], this[2]);
697
+ }
698
+ get xzzw() {
699
+ return new this._Vec4(this[0], this[2], this[2], this[3]);
700
+ }
701
+ get xzwx() {
702
+ return new this._Vec4(this[0], this[2], this[3], this[0]);
703
+ }
704
+ get xzwy() {
705
+ return new this._Vec4(this[0], this[2], this[3], this[1]);
706
+ }
707
+ get xzwz() {
708
+ return new this._Vec4(this[0], this[2], this[3], this[2]);
709
+ }
710
+ get xzww() {
711
+ return new this._Vec4(this[0], this[2], this[3], this[3]);
712
+ }
713
+ get xwxx() {
714
+ return new this._Vec4(this[0], this[3], this[0], this[0]);
715
+ }
716
+ get xwxy() {
717
+ return new this._Vec4(this[0], this[3], this[0], this[1]);
718
+ }
719
+ get xwxz() {
720
+ return new this._Vec4(this[0], this[3], this[0], this[2]);
721
+ }
722
+ get xwxw() {
723
+ return new this._Vec4(this[0], this[3], this[0], this[3]);
724
+ }
725
+ get xwyx() {
726
+ return new this._Vec4(this[0], this[3], this[1], this[0]);
727
+ }
728
+ get xwyy() {
729
+ return new this._Vec4(this[0], this[3], this[1], this[1]);
730
+ }
731
+ get xwyz() {
732
+ return new this._Vec4(this[0], this[3], this[1], this[2]);
733
+ }
734
+ get xwyw() {
735
+ return new this._Vec4(this[0], this[3], this[1], this[3]);
736
+ }
737
+ get xwzx() {
738
+ return new this._Vec4(this[0], this[3], this[2], this[0]);
739
+ }
740
+ get xwzy() {
741
+ return new this._Vec4(this[0], this[3], this[2], this[1]);
742
+ }
743
+ get xwzz() {
744
+ return new this._Vec4(this[0], this[3], this[2], this[2]);
745
+ }
746
+ get xwzw() {
747
+ return new this._Vec4(this[0], this[3], this[2], this[3]);
748
+ }
749
+ get xwwx() {
750
+ return new this._Vec4(this[0], this[3], this[3], this[0]);
751
+ }
752
+ get xwwy() {
753
+ return new this._Vec4(this[0], this[3], this[3], this[1]);
754
+ }
755
+ get xwwz() {
756
+ return new this._Vec4(this[0], this[3], this[3], this[2]);
757
+ }
758
+ get xwww() {
759
+ return new this._Vec4(this[0], this[3], this[3], this[3]);
760
+ }
761
+ get yxxx() {
762
+ return new this._Vec4(this[1], this[0], this[0], this[0]);
763
+ }
764
+ get yxxy() {
765
+ return new this._Vec4(this[1], this[0], this[0], this[1]);
766
+ }
767
+ get yxxz() {
768
+ return new this._Vec4(this[1], this[0], this[0], this[2]);
769
+ }
770
+ get yxxw() {
771
+ return new this._Vec4(this[1], this[0], this[0], this[3]);
772
+ }
773
+ get yxyx() {
774
+ return new this._Vec4(this[1], this[0], this[1], this[0]);
775
+ }
776
+ get yxyy() {
777
+ return new this._Vec4(this[1], this[0], this[1], this[1]);
778
+ }
779
+ get yxyz() {
780
+ return new this._Vec4(this[1], this[0], this[1], this[2]);
781
+ }
782
+ get yxyw() {
783
+ return new this._Vec4(this[1], this[0], this[1], this[3]);
784
+ }
785
+ get yxzx() {
786
+ return new this._Vec4(this[1], this[0], this[2], this[0]);
787
+ }
788
+ get yxzy() {
789
+ return new this._Vec4(this[1], this[0], this[2], this[1]);
790
+ }
791
+ get yxzz() {
792
+ return new this._Vec4(this[1], this[0], this[2], this[2]);
793
+ }
794
+ get yxzw() {
795
+ return new this._Vec4(this[1], this[0], this[2], this[3]);
796
+ }
797
+ get yxwx() {
798
+ return new this._Vec4(this[1], this[0], this[3], this[0]);
799
+ }
800
+ get yxwy() {
801
+ return new this._Vec4(this[1], this[0], this[3], this[1]);
802
+ }
803
+ get yxwz() {
804
+ return new this._Vec4(this[1], this[0], this[3], this[2]);
805
+ }
806
+ get yxww() {
807
+ return new this._Vec4(this[1], this[0], this[3], this[3]);
808
+ }
809
+ get yyxx() {
810
+ return new this._Vec4(this[1], this[1], this[0], this[0]);
811
+ }
812
+ get yyxy() {
813
+ return new this._Vec4(this[1], this[1], this[0], this[1]);
814
+ }
815
+ get yyxz() {
816
+ return new this._Vec4(this[1], this[1], this[0], this[2]);
817
+ }
818
+ get yyxw() {
819
+ return new this._Vec4(this[1], this[1], this[0], this[3]);
820
+ }
821
+ get yyyx() {
822
+ return new this._Vec4(this[1], this[1], this[1], this[0]);
823
+ }
824
+ get yyyy() {
825
+ return new this._Vec4(this[1], this[1], this[1], this[1]);
826
+ }
827
+ get yyyz() {
828
+ return new this._Vec4(this[1], this[1], this[1], this[2]);
829
+ }
830
+ get yyyw() {
831
+ return new this._Vec4(this[1], this[1], this[1], this[3]);
832
+ }
833
+ get yyzx() {
834
+ return new this._Vec4(this[1], this[1], this[2], this[0]);
835
+ }
836
+ get yyzy() {
837
+ return new this._Vec4(this[1], this[1], this[2], this[1]);
838
+ }
839
+ get yyzz() {
840
+ return new this._Vec4(this[1], this[1], this[2], this[2]);
841
+ }
842
+ get yyzw() {
843
+ return new this._Vec4(this[1], this[1], this[2], this[3]);
844
+ }
845
+ get yywx() {
846
+ return new this._Vec4(this[1], this[1], this[3], this[0]);
847
+ }
848
+ get yywy() {
849
+ return new this._Vec4(this[1], this[1], this[3], this[1]);
850
+ }
851
+ get yywz() {
852
+ return new this._Vec4(this[1], this[1], this[3], this[2]);
853
+ }
854
+ get yyww() {
855
+ return new this._Vec4(this[1], this[1], this[3], this[3]);
856
+ }
857
+ get yzxx() {
858
+ return new this._Vec4(this[1], this[2], this[0], this[0]);
859
+ }
860
+ get yzxy() {
861
+ return new this._Vec4(this[1], this[2], this[0], this[1]);
862
+ }
863
+ get yzxz() {
864
+ return new this._Vec4(this[1], this[2], this[0], this[2]);
865
+ }
866
+ get yzxw() {
867
+ return new this._Vec4(this[1], this[2], this[0], this[3]);
868
+ }
869
+ get yzyx() {
870
+ return new this._Vec4(this[1], this[2], this[1], this[0]);
871
+ }
872
+ get yzyy() {
873
+ return new this._Vec4(this[1], this[2], this[1], this[1]);
874
+ }
875
+ get yzyz() {
876
+ return new this._Vec4(this[1], this[2], this[1], this[2]);
877
+ }
878
+ get yzyw() {
879
+ return new this._Vec4(this[1], this[2], this[1], this[3]);
880
+ }
881
+ get yzzx() {
882
+ return new this._Vec4(this[1], this[2], this[2], this[0]);
883
+ }
884
+ get yzzy() {
885
+ return new this._Vec4(this[1], this[2], this[2], this[1]);
886
+ }
887
+ get yzzz() {
888
+ return new this._Vec4(this[1], this[2], this[2], this[2]);
889
+ }
890
+ get yzzw() {
891
+ return new this._Vec4(this[1], this[2], this[2], this[3]);
892
+ }
893
+ get yzwx() {
894
+ return new this._Vec4(this[1], this[2], this[3], this[0]);
895
+ }
896
+ get yzwy() {
897
+ return new this._Vec4(this[1], this[2], this[3], this[1]);
898
+ }
899
+ get yzwz() {
900
+ return new this._Vec4(this[1], this[2], this[3], this[2]);
901
+ }
902
+ get yzww() {
903
+ return new this._Vec4(this[1], this[2], this[3], this[3]);
904
+ }
905
+ get ywxx() {
906
+ return new this._Vec4(this[1], this[3], this[0], this[0]);
907
+ }
908
+ get ywxy() {
909
+ return new this._Vec4(this[1], this[3], this[0], this[1]);
910
+ }
911
+ get ywxz() {
912
+ return new this._Vec4(this[1], this[3], this[0], this[2]);
913
+ }
914
+ get ywxw() {
915
+ return new this._Vec4(this[1], this[3], this[0], this[3]);
916
+ }
917
+ get ywyx() {
918
+ return new this._Vec4(this[1], this[3], this[1], this[0]);
919
+ }
920
+ get ywyy() {
921
+ return new this._Vec4(this[1], this[3], this[1], this[1]);
922
+ }
923
+ get ywyz() {
924
+ return new this._Vec4(this[1], this[3], this[1], this[2]);
925
+ }
926
+ get ywyw() {
927
+ return new this._Vec4(this[1], this[3], this[1], this[3]);
928
+ }
929
+ get ywzx() {
930
+ return new this._Vec4(this[1], this[3], this[2], this[0]);
931
+ }
932
+ get ywzy() {
933
+ return new this._Vec4(this[1], this[3], this[2], this[1]);
934
+ }
935
+ get ywzz() {
936
+ return new this._Vec4(this[1], this[3], this[2], this[2]);
937
+ }
938
+ get ywzw() {
939
+ return new this._Vec4(this[1], this[3], this[2], this[3]);
940
+ }
941
+ get ywwx() {
942
+ return new this._Vec4(this[1], this[3], this[3], this[0]);
943
+ }
944
+ get ywwy() {
945
+ return new this._Vec4(this[1], this[3], this[3], this[1]);
946
+ }
947
+ get ywwz() {
948
+ return new this._Vec4(this[1], this[3], this[3], this[2]);
949
+ }
950
+ get ywww() {
951
+ return new this._Vec4(this[1], this[3], this[3], this[3]);
952
+ }
953
+ get zxxx() {
954
+ return new this._Vec4(this[2], this[0], this[0], this[0]);
955
+ }
956
+ get zxxy() {
957
+ return new this._Vec4(this[2], this[0], this[0], this[1]);
958
+ }
959
+ get zxxz() {
960
+ return new this._Vec4(this[2], this[0], this[0], this[2]);
961
+ }
962
+ get zxxw() {
963
+ return new this._Vec4(this[2], this[0], this[0], this[3]);
964
+ }
965
+ get zxyx() {
966
+ return new this._Vec4(this[2], this[0], this[1], this[0]);
967
+ }
968
+ get zxyy() {
969
+ return new this._Vec4(this[2], this[0], this[1], this[1]);
970
+ }
971
+ get zxyz() {
972
+ return new this._Vec4(this[2], this[0], this[1], this[2]);
973
+ }
974
+ get zxyw() {
975
+ return new this._Vec4(this[2], this[0], this[1], this[3]);
976
+ }
977
+ get zxzx() {
978
+ return new this._Vec4(this[2], this[0], this[2], this[0]);
979
+ }
980
+ get zxzy() {
981
+ return new this._Vec4(this[2], this[0], this[2], this[1]);
982
+ }
983
+ get zxzz() {
984
+ return new this._Vec4(this[2], this[0], this[2], this[2]);
985
+ }
986
+ get zxzw() {
987
+ return new this._Vec4(this[2], this[0], this[2], this[3]);
988
+ }
989
+ get zxwx() {
990
+ return new this._Vec4(this[2], this[0], this[3], this[0]);
991
+ }
992
+ get zxwy() {
993
+ return new this._Vec4(this[2], this[0], this[3], this[1]);
994
+ }
995
+ get zxwz() {
996
+ return new this._Vec4(this[2], this[0], this[3], this[2]);
997
+ }
998
+ get zxww() {
999
+ return new this._Vec4(this[2], this[0], this[3], this[3]);
1000
+ }
1001
+ get zyxx() {
1002
+ return new this._Vec4(this[2], this[1], this[0], this[0]);
1003
+ }
1004
+ get zyxy() {
1005
+ return new this._Vec4(this[2], this[1], this[0], this[1]);
1006
+ }
1007
+ get zyxz() {
1008
+ return new this._Vec4(this[2], this[1], this[0], this[2]);
1009
+ }
1010
+ get zyxw() {
1011
+ return new this._Vec4(this[2], this[1], this[0], this[3]);
1012
+ }
1013
+ get zyyx() {
1014
+ return new this._Vec4(this[2], this[1], this[1], this[0]);
1015
+ }
1016
+ get zyyy() {
1017
+ return new this._Vec4(this[2], this[1], this[1], this[1]);
1018
+ }
1019
+ get zyyz() {
1020
+ return new this._Vec4(this[2], this[1], this[1], this[2]);
1021
+ }
1022
+ get zyyw() {
1023
+ return new this._Vec4(this[2], this[1], this[1], this[3]);
1024
+ }
1025
+ get zyzx() {
1026
+ return new this._Vec4(this[2], this[1], this[2], this[0]);
1027
+ }
1028
+ get zyzy() {
1029
+ return new this._Vec4(this[2], this[1], this[2], this[1]);
1030
+ }
1031
+ get zyzz() {
1032
+ return new this._Vec4(this[2], this[1], this[2], this[2]);
1033
+ }
1034
+ get zyzw() {
1035
+ return new this._Vec4(this[2], this[1], this[2], this[3]);
1036
+ }
1037
+ get zywx() {
1038
+ return new this._Vec4(this[2], this[1], this[3], this[0]);
1039
+ }
1040
+ get zywy() {
1041
+ return new this._Vec4(this[2], this[1], this[3], this[1]);
1042
+ }
1043
+ get zywz() {
1044
+ return new this._Vec4(this[2], this[1], this[3], this[2]);
1045
+ }
1046
+ get zyww() {
1047
+ return new this._Vec4(this[2], this[1], this[3], this[3]);
1048
+ }
1049
+ get zzxx() {
1050
+ return new this._Vec4(this[2], this[2], this[0], this[0]);
1051
+ }
1052
+ get zzxy() {
1053
+ return new this._Vec4(this[2], this[2], this[0], this[1]);
1054
+ }
1055
+ get zzxz() {
1056
+ return new this._Vec4(this[2], this[2], this[0], this[2]);
1057
+ }
1058
+ get zzxw() {
1059
+ return new this._Vec4(this[2], this[2], this[0], this[3]);
1060
+ }
1061
+ get zzyx() {
1062
+ return new this._Vec4(this[2], this[2], this[1], this[0]);
1063
+ }
1064
+ get zzyy() {
1065
+ return new this._Vec4(this[2], this[2], this[1], this[1]);
1066
+ }
1067
+ get zzyz() {
1068
+ return new this._Vec4(this[2], this[2], this[1], this[2]);
1069
+ }
1070
+ get zzyw() {
1071
+ return new this._Vec4(this[2], this[2], this[1], this[3]);
1072
+ }
1073
+ get zzzx() {
1074
+ return new this._Vec4(this[2], this[2], this[2], this[0]);
1075
+ }
1076
+ get zzzy() {
1077
+ return new this._Vec4(this[2], this[2], this[2], this[1]);
1078
+ }
1079
+ get zzzz() {
1080
+ return new this._Vec4(this[2], this[2], this[2], this[2]);
1081
+ }
1082
+ get zzzw() {
1083
+ return new this._Vec4(this[2], this[2], this[2], this[3]);
1084
+ }
1085
+ get zzwx() {
1086
+ return new this._Vec4(this[2], this[2], this[3], this[0]);
1087
+ }
1088
+ get zzwy() {
1089
+ return new this._Vec4(this[2], this[2], this[3], this[1]);
1090
+ }
1091
+ get zzwz() {
1092
+ return new this._Vec4(this[2], this[2], this[3], this[2]);
1093
+ }
1094
+ get zzww() {
1095
+ return new this._Vec4(this[2], this[2], this[3], this[3]);
1096
+ }
1097
+ get zwxx() {
1098
+ return new this._Vec4(this[2], this[3], this[0], this[0]);
1099
+ }
1100
+ get zwxy() {
1101
+ return new this._Vec4(this[2], this[3], this[0], this[1]);
1102
+ }
1103
+ get zwxz() {
1104
+ return new this._Vec4(this[2], this[3], this[0], this[2]);
1105
+ }
1106
+ get zwxw() {
1107
+ return new this._Vec4(this[2], this[3], this[0], this[3]);
1108
+ }
1109
+ get zwyx() {
1110
+ return new this._Vec4(this[2], this[3], this[1], this[0]);
1111
+ }
1112
+ get zwyy() {
1113
+ return new this._Vec4(this[2], this[3], this[1], this[1]);
1114
+ }
1115
+ get zwyz() {
1116
+ return new this._Vec4(this[2], this[3], this[1], this[2]);
1117
+ }
1118
+ get zwyw() {
1119
+ return new this._Vec4(this[2], this[3], this[1], this[3]);
1120
+ }
1121
+ get zwzx() {
1122
+ return new this._Vec4(this[2], this[3], this[2], this[0]);
1123
+ }
1124
+ get zwzy() {
1125
+ return new this._Vec4(this[2], this[3], this[2], this[1]);
1126
+ }
1127
+ get zwzz() {
1128
+ return new this._Vec4(this[2], this[3], this[2], this[2]);
1129
+ }
1130
+ get zwzw() {
1131
+ return new this._Vec4(this[2], this[3], this[2], this[3]);
1132
+ }
1133
+ get zwwx() {
1134
+ return new this._Vec4(this[2], this[3], this[3], this[0]);
1135
+ }
1136
+ get zwwy() {
1137
+ return new this._Vec4(this[2], this[3], this[3], this[1]);
1138
+ }
1139
+ get zwwz() {
1140
+ return new this._Vec4(this[2], this[3], this[3], this[2]);
1141
+ }
1142
+ get zwww() {
1143
+ return new this._Vec4(this[2], this[3], this[3], this[3]);
1144
+ }
1145
+ get wxxx() {
1146
+ return new this._Vec4(this[3], this[0], this[0], this[0]);
1147
+ }
1148
+ get wxxy() {
1149
+ return new this._Vec4(this[3], this[0], this[0], this[1]);
1150
+ }
1151
+ get wxxz() {
1152
+ return new this._Vec4(this[3], this[0], this[0], this[2]);
1153
+ }
1154
+ get wxxw() {
1155
+ return new this._Vec4(this[3], this[0], this[0], this[3]);
1156
+ }
1157
+ get wxyx() {
1158
+ return new this._Vec4(this[3], this[0], this[1], this[0]);
1159
+ }
1160
+ get wxyy() {
1161
+ return new this._Vec4(this[3], this[0], this[1], this[1]);
1162
+ }
1163
+ get wxyz() {
1164
+ return new this._Vec4(this[3], this[0], this[1], this[2]);
1165
+ }
1166
+ get wxyw() {
1167
+ return new this._Vec4(this[3], this[0], this[1], this[3]);
1168
+ }
1169
+ get wxzx() {
1170
+ return new this._Vec4(this[3], this[0], this[2], this[0]);
1171
+ }
1172
+ get wxzy() {
1173
+ return new this._Vec4(this[3], this[0], this[2], this[1]);
1174
+ }
1175
+ get wxzz() {
1176
+ return new this._Vec4(this[3], this[0], this[2], this[2]);
1177
+ }
1178
+ get wxzw() {
1179
+ return new this._Vec4(this[3], this[0], this[2], this[3]);
1180
+ }
1181
+ get wxwx() {
1182
+ return new this._Vec4(this[3], this[0], this[3], this[0]);
1183
+ }
1184
+ get wxwy() {
1185
+ return new this._Vec4(this[3], this[0], this[3], this[1]);
1186
+ }
1187
+ get wxwz() {
1188
+ return new this._Vec4(this[3], this[0], this[3], this[2]);
1189
+ }
1190
+ get wxww() {
1191
+ return new this._Vec4(this[3], this[0], this[3], this[3]);
1192
+ }
1193
+ get wyxx() {
1194
+ return new this._Vec4(this[3], this[1], this[0], this[0]);
1195
+ }
1196
+ get wyxy() {
1197
+ return new this._Vec4(this[3], this[1], this[0], this[1]);
1198
+ }
1199
+ get wyxz() {
1200
+ return new this._Vec4(this[3], this[1], this[0], this[2]);
1201
+ }
1202
+ get wyxw() {
1203
+ return new this._Vec4(this[3], this[1], this[0], this[3]);
1204
+ }
1205
+ get wyyx() {
1206
+ return new this._Vec4(this[3], this[1], this[1], this[0]);
1207
+ }
1208
+ get wyyy() {
1209
+ return new this._Vec4(this[3], this[1], this[1], this[1]);
1210
+ }
1211
+ get wyyz() {
1212
+ return new this._Vec4(this[3], this[1], this[1], this[2]);
1213
+ }
1214
+ get wyyw() {
1215
+ return new this._Vec4(this[3], this[1], this[1], this[3]);
1216
+ }
1217
+ get wyzx() {
1218
+ return new this._Vec4(this[3], this[1], this[2], this[0]);
1219
+ }
1220
+ get wyzy() {
1221
+ return new this._Vec4(this[3], this[1], this[2], this[1]);
1222
+ }
1223
+ get wyzz() {
1224
+ return new this._Vec4(this[3], this[1], this[2], this[2]);
1225
+ }
1226
+ get wyzw() {
1227
+ return new this._Vec4(this[3], this[1], this[2], this[3]);
1228
+ }
1229
+ get wywx() {
1230
+ return new this._Vec4(this[3], this[1], this[3], this[0]);
1231
+ }
1232
+ get wywy() {
1233
+ return new this._Vec4(this[3], this[1], this[3], this[1]);
1234
+ }
1235
+ get wywz() {
1236
+ return new this._Vec4(this[3], this[1], this[3], this[2]);
1237
+ }
1238
+ get wyww() {
1239
+ return new this._Vec4(this[3], this[1], this[3], this[3]);
1240
+ }
1241
+ get wzxx() {
1242
+ return new this._Vec4(this[3], this[2], this[0], this[0]);
1243
+ }
1244
+ get wzxy() {
1245
+ return new this._Vec4(this[3], this[2], this[0], this[1]);
1246
+ }
1247
+ get wzxz() {
1248
+ return new this._Vec4(this[3], this[2], this[0], this[2]);
1249
+ }
1250
+ get wzxw() {
1251
+ return new this._Vec4(this[3], this[2], this[0], this[3]);
1252
+ }
1253
+ get wzyx() {
1254
+ return new this._Vec4(this[3], this[2], this[1], this[0]);
1255
+ }
1256
+ get wzyy() {
1257
+ return new this._Vec4(this[3], this[2], this[1], this[1]);
1258
+ }
1259
+ get wzyz() {
1260
+ return new this._Vec4(this[3], this[2], this[1], this[2]);
1261
+ }
1262
+ get wzyw() {
1263
+ return new this._Vec4(this[3], this[2], this[1], this[3]);
1264
+ }
1265
+ get wzzx() {
1266
+ return new this._Vec4(this[3], this[2], this[2], this[0]);
1267
+ }
1268
+ get wzzy() {
1269
+ return new this._Vec4(this[3], this[2], this[2], this[1]);
1270
+ }
1271
+ get wzzz() {
1272
+ return new this._Vec4(this[3], this[2], this[2], this[2]);
1273
+ }
1274
+ get wzzw() {
1275
+ return new this._Vec4(this[3], this[2], this[2], this[3]);
1276
+ }
1277
+ get wzwx() {
1278
+ return new this._Vec4(this[3], this[2], this[3], this[0]);
1279
+ }
1280
+ get wzwy() {
1281
+ return new this._Vec4(this[3], this[2], this[3], this[1]);
1282
+ }
1283
+ get wzwz() {
1284
+ return new this._Vec4(this[3], this[2], this[3], this[2]);
1285
+ }
1286
+ get wzww() {
1287
+ return new this._Vec4(this[3], this[2], this[3], this[3]);
1288
+ }
1289
+ get wwxx() {
1290
+ return new this._Vec4(this[3], this[3], this[0], this[0]);
1291
+ }
1292
+ get wwxy() {
1293
+ return new this._Vec4(this[3], this[3], this[0], this[1]);
1294
+ }
1295
+ get wwxz() {
1296
+ return new this._Vec4(this[3], this[3], this[0], this[2]);
1297
+ }
1298
+ get wwxw() {
1299
+ return new this._Vec4(this[3], this[3], this[0], this[3]);
1300
+ }
1301
+ get wwyx() {
1302
+ return new this._Vec4(this[3], this[3], this[1], this[0]);
1303
+ }
1304
+ get wwyy() {
1305
+ return new this._Vec4(this[3], this[3], this[1], this[1]);
1306
+ }
1307
+ get wwyz() {
1308
+ return new this._Vec4(this[3], this[3], this[1], this[2]);
1309
+ }
1310
+ get wwyw() {
1311
+ return new this._Vec4(this[3], this[3], this[1], this[3]);
1312
+ }
1313
+ get wwzx() {
1314
+ return new this._Vec4(this[3], this[3], this[2], this[0]);
1315
+ }
1316
+ get wwzy() {
1317
+ return new this._Vec4(this[3], this[3], this[2], this[1]);
1318
+ }
1319
+ get wwzz() {
1320
+ return new this._Vec4(this[3], this[3], this[2], this[2]);
1321
+ }
1322
+ get wwzw() {
1323
+ return new this._Vec4(this[3], this[3], this[2], this[3]);
1324
+ }
1325
+ get wwwx() {
1326
+ return new this._Vec4(this[3], this[3], this[3], this[0]);
1327
+ }
1328
+ get wwwy() {
1329
+ return new this._Vec4(this[3], this[3], this[3], this[1]);
1330
+ }
1331
+ get wwwz() {
1332
+ return new this._Vec4(this[3], this[3], this[3], this[2]);
1333
+ }
1334
+ get wwww() {
1335
+ return new this._Vec4(this[3], this[3], this[3], this[3]);
1336
+ }
1337
+ }, St = class extends re {
1338
+ e0;
1339
+ e1;
1340
+ constructor(t, e) {
1341
+ super(2), this.e0 = this.castElement()(t), this.e1 = this.castElement()(e ?? t);
1342
+ }
1343
+ get 0() {
1344
+ return this.e0;
1345
+ }
1346
+ get 1() {
1347
+ return this.e1;
1348
+ }
1349
+ set 0(t) {
1350
+ this.e0 = this.castElement()(t);
1351
+ }
1352
+ set 1(t) {
1353
+ this.e1 = this.castElement()(t);
1354
+ }
1355
+ get x() {
1356
+ return this[0];
1357
+ }
1358
+ get y() {
1359
+ return this[1];
1360
+ }
1361
+ set x(t) {
1362
+ this[0] = this.castElement()(t);
1363
+ }
1364
+ set y(t) {
1365
+ this[1] = this.castElement()(t);
1366
+ }
1367
+ }, Ct = class extends re {
1368
+ e0;
1369
+ e1;
1370
+ e2;
1371
+ constructor(t, e, s) {
1372
+ super(3), this.e0 = this.castElement()(t), this.e1 = this.castElement()(e ?? t), this.e2 = this.castElement()(s ?? t);
1373
+ }
1374
+ get 0() {
1375
+ return this.e0;
1376
+ }
1377
+ get 1() {
1378
+ return this.e1;
1379
+ }
1380
+ get 2() {
1381
+ return this.e2;
1382
+ }
1383
+ set 0(t) {
1384
+ this.e0 = this.castElement()(t);
1385
+ }
1386
+ set 1(t) {
1387
+ this.e1 = this.castElement()(t);
1388
+ }
1389
+ set 2(t) {
1390
+ this.e2 = this.castElement()(t);
1391
+ }
1392
+ get x() {
1393
+ return this[0];
1394
+ }
1395
+ get y() {
1396
+ return this[1];
1397
+ }
1398
+ get z() {
1399
+ return this[2];
1400
+ }
1401
+ set x(t) {
1402
+ this[0] = this.castElement()(t);
1403
+ }
1404
+ set y(t) {
1405
+ this[1] = this.castElement()(t);
1406
+ }
1407
+ set z(t) {
1408
+ this[2] = this.castElement()(t);
1409
+ }
1410
+ }, Ft = class extends re {
1411
+ e0;
1412
+ e1;
1413
+ e2;
1414
+ e3;
1415
+ constructor(t, e, s, i) {
1416
+ super(4), this.e0 = this.castElement()(t), this.e1 = this.castElement()(e ?? t), this.e2 = this.castElement()(s ?? t), this.e3 = this.castElement()(i ?? t);
1417
+ }
1418
+ get 0() {
1419
+ return this.e0;
1420
+ }
1421
+ get 1() {
1422
+ return this.e1;
1423
+ }
1424
+ get 2() {
1425
+ return this.e2;
1426
+ }
1427
+ get 3() {
1428
+ return this.e3;
1429
+ }
1430
+ set 0(t) {
1431
+ this.e0 = this.castElement()(t);
1432
+ }
1433
+ set 1(t) {
1434
+ this.e1 = this.castElement()(t);
1435
+ }
1436
+ set 2(t) {
1437
+ this.e2 = this.castElement()(t);
1438
+ }
1439
+ set 3(t) {
1440
+ this.e3 = this.castElement()(t);
1441
+ }
1442
+ get x() {
1443
+ return this[0];
1444
+ }
1445
+ get y() {
1446
+ return this[1];
1447
+ }
1448
+ get z() {
1449
+ return this[2];
1450
+ }
1451
+ get w() {
1452
+ return this[3];
1453
+ }
1454
+ set x(t) {
1455
+ this[0] = t;
1456
+ }
1457
+ set y(t) {
1458
+ this[1] = t;
1459
+ }
1460
+ set z(t) {
1461
+ this[2] = t;
1462
+ }
1463
+ set w(t) {
1464
+ this[3] = t;
1465
+ }
1466
+ }, ce = class is extends St {
1467
+ castElement() {
1468
+ return b[n].jsImpl;
1469
+ }
1470
+ get kind() {
1471
+ return "vec2f";
1472
+ }
1473
+ get _Vec2() {
1474
+ return is;
1475
+ }
1476
+ get _Vec3() {
1477
+ return xe;
1478
+ }
1479
+ get _Vec4() {
1480
+ return ge;
1481
+ }
1482
+ }, ae = class hs extends St {
1483
+ castElement() {
1484
+ return F[n].jsImpl;
1485
+ }
1486
+ get kind() {
1487
+ return "vec2h";
1488
+ }
1489
+ get _Vec2() {
1490
+ return hs;
1491
+ }
1492
+ get _Vec3() {
1493
+ return we;
1494
+ }
1495
+ get _Vec4() {
1496
+ return fe;
1497
+ }
1498
+ }, ue = class ns extends St {
1499
+ castElement() {
1500
+ return E[n].jsImpl;
1501
+ }
1502
+ get kind() {
1503
+ return "vec2i";
1504
+ }
1505
+ get _Vec2() {
1506
+ return ns;
1507
+ }
1508
+ get _Vec3() {
1509
+ return le;
1510
+ }
1511
+ get _Vec4() {
1512
+ return me;
1513
+ }
1514
+ }, ye = class rs extends St {
1515
+ castElement() {
1516
+ return z[n].jsImpl;
1517
+ }
1518
+ get kind() {
1519
+ return "vec2u";
1520
+ }
1521
+ get _Vec2() {
1522
+ return rs;
1523
+ }
1524
+ get _Vec3() {
1525
+ return ve;
1526
+ }
1527
+ get _Vec4() {
1528
+ return _e;
1529
+ }
1530
+ }, oe = class cs extends St {
1531
+ castElement() {
1532
+ return O[n].jsImpl;
1533
+ }
1534
+ get kind() {
1535
+ return "vec2<bool>";
1536
+ }
1537
+ get _Vec2() {
1538
+ return cs;
1539
+ }
1540
+ get _Vec3() {
1541
+ return ze;
1542
+ }
1543
+ get _Vec4() {
1544
+ return pe;
1545
+ }
1546
+ }, xe = class as extends Ct {
1547
+ castElement() {
1548
+ return b[n].jsImpl;
1549
+ }
1550
+ get kind() {
1551
+ return "vec3f";
1552
+ }
1553
+ get _Vec2() {
1554
+ return ce;
1555
+ }
1556
+ get _Vec3() {
1557
+ return as;
1558
+ }
1559
+ get _Vec4() {
1560
+ return ge;
1561
+ }
1562
+ }, we = class us extends Ct {
1563
+ castElement() {
1564
+ return F[n].jsImpl;
1565
+ }
1566
+ get kind() {
1567
+ return "vec3h";
1568
+ }
1569
+ get _Vec2() {
1570
+ return ae;
1571
+ }
1572
+ get _Vec3() {
1573
+ return us;
1574
+ }
1575
+ get _Vec4() {
1576
+ return fe;
1577
+ }
1578
+ }, le = class ys extends Ct {
1579
+ castElement() {
1580
+ return E[n].jsImpl;
1581
+ }
1582
+ get kind() {
1583
+ return "vec3i";
1584
+ }
1585
+ get _Vec2() {
1586
+ return ue;
1587
+ }
1588
+ get _Vec3() {
1589
+ return ys;
1590
+ }
1591
+ get _Vec4() {
1592
+ return me;
1593
+ }
1594
+ }, ve = class os extends Ct {
1595
+ castElement() {
1596
+ return z[n].jsImpl;
1597
+ }
1598
+ get kind() {
1599
+ return "vec3u";
1600
+ }
1601
+ get _Vec2() {
1602
+ return ye;
1603
+ }
1604
+ get _Vec3() {
1605
+ return os;
1606
+ }
1607
+ get _Vec4() {
1608
+ return _e;
1609
+ }
1610
+ }, ze = class xs extends Ct {
1611
+ castElement() {
1612
+ return O[n].jsImpl;
1613
+ }
1614
+ get kind() {
1615
+ return "vec3<bool>";
1616
+ }
1617
+ get _Vec2() {
1618
+ return oe;
1619
+ }
1620
+ get _Vec3() {
1621
+ return xs;
1622
+ }
1623
+ get _Vec4() {
1624
+ return pe;
1625
+ }
1626
+ }, ge = class ws extends Ft {
1627
+ castElement() {
1628
+ return b[n].jsImpl;
1629
+ }
1630
+ get kind() {
1631
+ return "vec4f";
1632
+ }
1633
+ get _Vec2() {
1634
+ return ce;
1635
+ }
1636
+ get _Vec3() {
1637
+ return xe;
1638
+ }
1639
+ get _Vec4() {
1640
+ return ws;
1641
+ }
1642
+ }, fe = class ls extends Ft {
1643
+ castElement() {
1644
+ return F[n].jsImpl;
1645
+ }
1646
+ get kind() {
1647
+ return "vec4h";
1648
+ }
1649
+ get _Vec2() {
1650
+ return ae;
1651
+ }
1652
+ get _Vec3() {
1653
+ return we;
1654
+ }
1655
+ get _Vec4() {
1656
+ return ls;
1657
+ }
1658
+ }, me = class vs extends Ft {
1659
+ castElement() {
1660
+ return E[n].jsImpl;
1661
+ }
1662
+ get kind() {
1663
+ return "vec4i";
1664
+ }
1665
+ get _Vec2() {
1666
+ return ue;
1667
+ }
1668
+ get _Vec3() {
1669
+ return le;
1670
+ }
1671
+ get _Vec4() {
1672
+ return vs;
1673
+ }
1674
+ }, _e = class zs extends Ft {
1675
+ castElement() {
1676
+ return z[n].jsImpl;
1677
+ }
1678
+ get kind() {
1679
+ return "vec4u";
1680
+ }
1681
+ get _Vec2() {
1682
+ return ye;
1683
+ }
1684
+ get _Vec3() {
1685
+ return ve;
1686
+ }
1687
+ get _Vec4() {
1688
+ return zs;
1689
+ }
1690
+ }, pe = class gs extends Ft {
1691
+ castElement() {
1692
+ return O[n].jsImpl;
1693
+ }
1694
+ get kind() {
1695
+ return "vec4<bool>";
1696
+ }
1697
+ get _Vec2() {
1698
+ return oe;
1699
+ }
1700
+ get _Vec3() {
1701
+ return ze;
1702
+ }
1703
+ get _Vec4() {
1704
+ return gs;
1705
+ }
1706
+ }, C = I(ce), Wt = I(ae), Q = I(ue), Y = I(ye), Kt = I(oe), it = I(xe), Zt = I(we), At = I(le), Gt = I(ve), qt = I(ze), $ = I(ge), Xt = I(fe), tt = I(me), et = I(_e), Jt = I(pe), Ht = { vec2f: C, vec2h: Wt, vec2i: Q, vec2u: Y, "vec2<bool>": Kt, vec3f: it, vec3h: Zt, vec3i: At, vec3u: Gt, "vec3<bool>": qt, vec4f: $, vec4h: Xt, vec4i: tt, vec4u: et, "vec4<bool>": Jt }, fs = { vec2f: b, vec2h: F, vec2i: E, vec2u: z, "vec2<bool>": O, vec3f: b, vec3h: F, vec3i: E, vec3u: z, "vec3<bool>": O, vec4f: b, vec4h: F, vec4i: E, vec4u: z, "vec4<bool>": O };
1707
+ function I(t) {
1708
+ let { kind: e, length: s } = new t(), i = (...o) => {
1709
+ let g = new Array(o.length), y = 0;
1710
+ for (let k of o) if (typeof k == "number" || typeof k == "boolean") g[y++] = k;
1711
+ else for (let B = 0; B < k.length; ++B) g[y++] = k[B];
1712
+ if (g.length <= 1 || g.length === s) return new t(...g);
1713
+ throw new Error(`'${e}' constructor called with invalid number of arguments.`);
1714
+ }, h = V(i, (...o) => {
1715
+ if (o.every((g) => typeof g.value == "number" || w(g.value))) {
1716
+ let g = o.map((y) => y.value);
1717
+ return a(i(...g), r);
1718
+ }
1719
+ return a(p`${e}(${o})`, r);
1720
+ }, e, (...o) => o.map((g) => {
1721
+ let y = g.dataType;
1722
+ return Hs(y) && (y = y.inner), jt(y) ? y : fs[e];
1723
+ })), r = Object.assign(h, { type: e, [Vs]: void 0 });
1724
+ return r;
1725
+ }
1726
+ var Ve = class {
1727
+ };
1728
+ function be(t) {
1729
+ let e = V((...i) => {
1730
+ let h = [];
1731
+ for (let r of i) if (typeof r == "number") h.push(r);
1732
+ else for (let o = 0; o < r.length; ++o) h.push(r[o]);
1733
+ if (h.length !== 0 && h.length !== t.columns * t.rows) throw new Error(`'${t.type}' constructor called with invalid number of arguments.`);
1734
+ for (let r = h.length; r < t.columns * t.rows; ++r) h.push(0);
1735
+ return new t.MatImpl(...h);
1736
+ }, (...i) => a(p`${t.type}(${i})`, s), t.type), s = Object.assign(e, { type: t.type, identity: bi[t.columns], translation: t.columns === 4 ? di : void 0, scaling: t.columns === 4 ? Mi : void 0, rotationX: t.columns === 4 ? Ti : void 0, rotationY: t.columns === 4 ? Ei : void 0, rotationZ: t.columns === 4 ? Ii : void 0 });
1737
+ return s;
1738
+ }
1739
+ var li = class extends Ve {
1740
+ [n] = !0;
1741
+ columns;
1742
+ length = 4;
1743
+ constructor(...t) {
1744
+ super(), this.columns = [this.makeColumn(t[0], t[1]), this.makeColumn(t[2], t[3])];
1745
+ }
1746
+ get 0() {
1747
+ return this.columns[0].x;
1748
+ }
1749
+ get 1() {
1750
+ return this.columns[0].y;
1751
+ }
1752
+ get 2() {
1753
+ return this.columns[1].x;
1754
+ }
1755
+ get 3() {
1756
+ return this.columns[1].y;
1757
+ }
1758
+ set 0(t) {
1759
+ this.columns[0].x = t;
1760
+ }
1761
+ set 1(t) {
1762
+ this.columns[0].y = t;
1763
+ }
1764
+ set 2(t) {
1765
+ this.columns[1].x = t;
1766
+ }
1767
+ set 3(t) {
1768
+ this.columns[1].y = t;
1769
+ }
1770
+ *[Symbol.iterator]() {
1771
+ yield this[0], yield this[1], yield this[2], yield this[3];
1772
+ }
1773
+ "~resolve"() {
1774
+ return `${this.kind}(${Array.from({ length: this.length }).map((t, e) => this[e]).join(", ")})`;
1775
+ }
1776
+ }, vi = class extends li {
1777
+ kind = "mat2x2f";
1778
+ makeColumn(t, e) {
1779
+ return C(t, e);
1780
+ }
1781
+ }, zi = class extends Ve {
1782
+ [n] = !0;
1783
+ columns;
1784
+ length = 12;
1785
+ constructor(...t) {
1786
+ super(), this.columns = [this.makeColumn(t[0], t[1], t[2]), this.makeColumn(t[3], t[4], t[5]), this.makeColumn(t[6], t[7], t[8])];
1787
+ }
1788
+ get 0() {
1789
+ return this.columns[0].x;
1790
+ }
1791
+ get 1() {
1792
+ return this.columns[0].y;
1793
+ }
1794
+ get 2() {
1795
+ return this.columns[0].z;
1796
+ }
1797
+ get 3() {
1798
+ return 0;
1799
+ }
1800
+ get 4() {
1801
+ return this.columns[1].x;
1802
+ }
1803
+ get 5() {
1804
+ return this.columns[1].y;
1805
+ }
1806
+ get 6() {
1807
+ return this.columns[1].z;
1808
+ }
1809
+ get 7() {
1810
+ return 0;
1811
+ }
1812
+ get 8() {
1813
+ return this.columns[2].x;
1814
+ }
1815
+ get 9() {
1816
+ return this.columns[2].y;
1817
+ }
1818
+ get 10() {
1819
+ return this.columns[2].z;
1820
+ }
1821
+ get 11() {
1822
+ return 0;
1823
+ }
1824
+ set 0(t) {
1825
+ this.columns[0].x = t;
1826
+ }
1827
+ set 1(t) {
1828
+ this.columns[0].y = t;
1829
+ }
1830
+ set 2(t) {
1831
+ this.columns[0].z = t;
1832
+ }
1833
+ set 3(t) {
1834
+ }
1835
+ set 4(t) {
1836
+ this.columns[1].x = t;
1837
+ }
1838
+ set 5(t) {
1839
+ this.columns[1].y = t;
1840
+ }
1841
+ set 6(t) {
1842
+ this.columns[1].z = t;
1843
+ }
1844
+ set 7(t) {
1845
+ }
1846
+ set 8(t) {
1847
+ this.columns[2].x = t;
1848
+ }
1849
+ set 9(t) {
1850
+ this.columns[2].y = t;
1851
+ }
1852
+ set 10(t) {
1853
+ this.columns[2].z = t;
1854
+ }
1855
+ set 11(t) {
1856
+ }
1857
+ *[Symbol.iterator]() {
1858
+ for (let t = 0; t < 12; t++) yield this[t];
1859
+ }
1860
+ "~resolve"() {
1861
+ return `${this.kind}(${this[0]}, ${this[1]}, ${this[2]}, ${this[4]}, ${this[5]}, ${this[6]}, ${this[8]}, ${this[9]}, ${this[10]})`;
1862
+ }
1863
+ }, gi = class extends zi {
1864
+ kind = "mat3x3f";
1865
+ makeColumn(t, e, s) {
1866
+ return it(t, e, s);
1867
+ }
1868
+ }, fi = class extends Ve {
1869
+ [n] = !0;
1870
+ columns;
1871
+ constructor(...t) {
1872
+ super(), this.columns = [this.makeColumn(t[0], t[1], t[2], t[3]), this.makeColumn(t[4], t[5], t[6], t[7]), this.makeColumn(t[8], t[9], t[10], t[11]), this.makeColumn(t[12], t[13], t[14], t[15])];
1873
+ }
1874
+ length = 16;
1875
+ get 0() {
1876
+ return this.columns[0].x;
1877
+ }
1878
+ get 1() {
1879
+ return this.columns[0].y;
1880
+ }
1881
+ get 2() {
1882
+ return this.columns[0].z;
1883
+ }
1884
+ get 3() {
1885
+ return this.columns[0].w;
1886
+ }
1887
+ get 4() {
1888
+ return this.columns[1].x;
1889
+ }
1890
+ get 5() {
1891
+ return this.columns[1].y;
1892
+ }
1893
+ get 6() {
1894
+ return this.columns[1].z;
1895
+ }
1896
+ get 7() {
1897
+ return this.columns[1].w;
1898
+ }
1899
+ get 8() {
1900
+ return this.columns[2].x;
1901
+ }
1902
+ get 9() {
1903
+ return this.columns[2].y;
1904
+ }
1905
+ get 10() {
1906
+ return this.columns[2].z;
1907
+ }
1908
+ get 11() {
1909
+ return this.columns[2].w;
1910
+ }
1911
+ get 12() {
1912
+ return this.columns[3].x;
1913
+ }
1914
+ get 13() {
1915
+ return this.columns[3].y;
1916
+ }
1917
+ get 14() {
1918
+ return this.columns[3].z;
1919
+ }
1920
+ get 15() {
1921
+ return this.columns[3].w;
1922
+ }
1923
+ set 0(t) {
1924
+ this.columns[0].x = t;
1925
+ }
1926
+ set 1(t) {
1927
+ this.columns[0].y = t;
1928
+ }
1929
+ set 2(t) {
1930
+ this.columns[0].z = t;
1931
+ }
1932
+ set 3(t) {
1933
+ this.columns[0].w = t;
1934
+ }
1935
+ set 4(t) {
1936
+ this.columns[1].x = t;
1937
+ }
1938
+ set 5(t) {
1939
+ this.columns[1].y = t;
1940
+ }
1941
+ set 6(t) {
1942
+ this.columns[1].z = t;
1943
+ }
1944
+ set 7(t) {
1945
+ this.columns[1].w = t;
1946
+ }
1947
+ set 8(t) {
1948
+ this.columns[2].x = t;
1949
+ }
1950
+ set 9(t) {
1951
+ this.columns[2].y = t;
1952
+ }
1953
+ set 10(t) {
1954
+ this.columns[2].z = t;
1955
+ }
1956
+ set 11(t) {
1957
+ this.columns[2].w = t;
1958
+ }
1959
+ set 12(t) {
1960
+ this.columns[3].x = t;
1961
+ }
1962
+ set 13(t) {
1963
+ this.columns[3].y = t;
1964
+ }
1965
+ set 14(t) {
1966
+ this.columns[3].z = t;
1967
+ }
1968
+ set 15(t) {
1969
+ this.columns[3].w = t;
1970
+ }
1971
+ *[Symbol.iterator]() {
1972
+ for (let t = 0; t < 16; t++) yield this[t];
1973
+ }
1974
+ "~resolve"() {
1975
+ return `${this.kind}(${Array.from({ length: this.length }).map((t, e) => this[e]).join(", ")})`;
1976
+ }
1977
+ }, mi = class extends fi {
1978
+ kind = "mat4x4f";
1979
+ makeColumn(t, e, s, i) {
1980
+ return $(t, e, s, i);
1981
+ }
1982
+ }, _i = V(() => ft(1, 0, 0, 1), () => a("mat2x2f(1, 0, 0, 1)", ft), "identity2"), pi = V(() => mt(1, 0, 0, 0, 1, 0, 0, 0, 1), () => a("mat3x3f(1, 0, 0, 0, 1, 0, 0, 0, 1)", mt), "identity3"), Vi = V(() => M(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), () => a("mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)", M), "identity4"), bi = { 2: _i, 3: pi, 4: Vi }, di = V((t) => M(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t.x, t.y, t.z, 1), (t) => a(p`mat4x4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, ${t}.x, ${t}.y, ${t}.z, 1)`, M), "translation4"), Mi = V((t) => M(t.x, 0, 0, 0, 0, t.y, 0, 0, 0, 0, t.z, 0, 0, 0, 0, 1), (t) => a(p`mat4x4f(${t}.x, 0, 0, 0, 0, ${t}.y, 0, 0, 0, 0, ${t}.z, 0, 0, 0, 0, 1)`, M), "scaling4"), Ti = V((t) => M(1, 0, 0, 0, 0, Math.cos(t), Math.sin(t), 0, 0, -Math.sin(t), Math.cos(t), 0, 0, 0, 0, 1), (t) => a(p`mat4x4f(1, 0, 0, 0, 0, cos(${t}), sin(${t}), 0, 0, -sin(${t}), cos(${t}), 0, 0, 0, 0, 1)`, M), "rotationX4"), Ei = V((t) => M(Math.cos(t), 0, -Math.sin(t), 0, 0, 1, 0, 0, Math.sin(t), 0, Math.cos(t), 0, 0, 0, 0, 1), (t) => a(p`mat4x4f(cos(${t}), 0, -sin(${t}), 0, 0, 1, 0, 0, sin(${t}), 0, cos(${t}), 0, 0, 0, 0, 1)`, M), "rotationY4"), Ii = V((t) => M(Math.cos(t), Math.sin(t), 0, 0, -Math.sin(t), Math.cos(t), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), (t) => a(p`mat4x4f(cos(${t}), sin(${t}), 0, 0, -sin(${t}), cos(${t}), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)`, M), "rotationZ4"), ft = be({ type: "mat2x2f", rows: 2, columns: 2, MatImpl: vi }), mt = be({ type: "mat3x3f", rows: 3, columns: 3, MatImpl: gi }), M = be({ type: "mat4x4f", rows: 4, columns: 4, MatImpl: mi });
1983
+ function Sh(t) {
1984
+ return t.kind === "mat3x3f" ? [t[0], t[1], t[2], t[4], t[5], t[6], t[8], t[9], t[10]] : Array.from({ length: t.length }).map((e, s) => t[s]);
1985
+ }
1986
+ var c = class {
1987
+ constructor(t) {
1988
+ this.type = t;
1989
+ }
1990
+ [n] = !0;
1991
+ }, ie = { uint8: z, uint8x2: Y, uint8x4: et, sint8: E, sint8x2: Q, sint8x4: tt, unorm8: b, unorm8x2: C, unorm8x4: $, snorm8: b, snorm8x2: C, snorm8x4: $, uint16: z, uint16x2: Y, uint16x4: et, sint16: E, sint16x2: Q, sint16x4: tt, unorm16: b, unorm16x2: C, unorm16x4: $, snorm16: b, snorm16x2: C, snorm16x4: $, float16: b, float16x2: C, float16x4: $, float32: b, float32x2: C, float32x3: it, float32x4: $, uint32: z, uint32x2: Y, uint32x3: Gt, uint32x4: et, sint32: E, sint32x2: Q, sint32x3: At, sint32x4: tt, "unorm10-10-10-2": $, "unorm8x4-bgra": $ }, $i = new Set(Object.keys(ie)), Ch = new c("uint8"), Fh = new c("uint8x2"), Ah = new c("uint8x4"), Gh = new c("sint8"), Lh = new c("sint8x2"), Uh = new c("sint8x4"), Rh = new c("unorm8"), Yh = new c("unorm8x2"), Bh = new c("unorm8x4"), Hh = new c("snorm8"), Dh = new c("snorm8x2"), Wh = new c("snorm8x4"), Kh = new c("uint16"), Zh = new c("uint16x2"), qh = new c("uint16x4"), Xh = new c("sint16"), Jh = new c("sint16x2"), Qh = new c("sint16x4"), tn = new c("unorm16"), en = new c("unorm16x2"), sn = new c("unorm16x4"), hn = new c("snorm16"), nn = new c("snorm16x2"), rn = new c("snorm16x4"), cn = new c("float16"), an = new c("float16x2"), un = new c("float16x4"), yn = new c("float32"), on = new c("float32x2"), xn = new c("float32x3"), wn = new c("float32x4"), ln = new c("uint32"), vn = new c("uint32x2"), zn = new c("uint32x3"), gn = new c("uint32x4"), fn = new c("sint32"), mn = new c("sint32x2"), _n = new c("sint32x3"), pn = new c("sint32x4"), Vn = new c("unorm10-10-10-2"), bn = new c("unorm8x4-bgra");
1992
+ function dn(t) {
1993
+ return t?.[n] && $i.has(t?.type);
1994
+ }
1995
+ function ki(t, e) {
1996
+ let s = t?.type;
1997
+ try {
1998
+ let i = s in ie ? ie[s] : t;
1999
+ return e === void 0 ? i() : i(e);
2000
+ } catch {
2001
+ throw new Error(`Schema of type ${s ?? "<unknown>"} is not callable or was called with invalid arguments.`);
2002
+ }
2003
+ }
2004
+ function de(t) {
2005
+ return ms(t, !1);
2006
+ }
2007
+ function Mn(t) {
2008
+ return ms(t, !0);
2009
+ }
2010
+ function ms(t, e) {
2011
+ let s = (i) => Object.fromEntries(Object.entries(t).map(([h, r]) => [h, ki(r, i?.[h])]));
2012
+ return Object.setPrototypeOf(s, Oi), s.propTypes = t, Object.defineProperty(s, n, { value: { isAbstruct: e } }), s;
2013
+ }
2014
+ var Oi = { type: "struct", $name(t) {
2015
+ return Ue(this, t), this;
2016
+ }, toString() {
2017
+ return `struct:${pt(this) ?? "<unnamed>"}`;
2018
+ } }, ht = (t, e, s) => {
2019
+ if (t === e) return 0;
2020
+ let i = u((s - t) / (e - t), 0, 1);
2021
+ return i * i * (3 - 2 * i);
2022
+ }, u = (t, e, s) => Math.min(Math.max(e, t), s), nt = (t, e) => e === 0 ? t : Math.trunc(t / e), N = Kt[n].jsImpl, A = C[n].jsImpl, D = Wt[n].jsImpl, Mt = Q[n].jsImpl, Tt = Y[n].jsImpl, j = qt[n].jsImpl, S = it[n].jsImpl, U = Zt[n].jsImpl, Et = At[n].jsImpl, It = Gt[n].jsImpl, P = Jt[n].jsImpl, G = $[n].jsImpl, W = Xt[n].jsImpl, $t = tt[n].jsImpl, kt = et[n].jsImpl, rt = (t) => Math.sqrt(t.x ** 2 + t.y ** 2), ct = (t) => Math.sqrt(t.x ** 2 + t.y ** 2 + t.z ** 2), at = (t) => Math.sqrt(t.x ** 2 + t.y ** 2 + t.z ** 2 + t.w ** 2), Ut = (t, e) => t.x * e.x + t.y * e.y, Rt = (t, e) => t.x * e.x + t.y * e.y + t.z * e.z, Yt = (t, e) => t.x * e.x + t.y * e.y + t.z * e.z + t.w * e.w, v = (t) => (e) => A(t(e.x), t(e.y)), f = (t) => (e) => D(t(e.x), t(e.y)), ut = (t) => (e) => Mt(t(e.x), t(e.y)), Vt = (t) => (e) => Tt(t(e.x), t(e.y)), l = (t) => (e) => S(t(e.x), t(e.y), t(e.z)), m = (t) => (e) => U(t(e.x), t(e.y), t(e.z)), yt = (t) => (e) => Et(t(e.x), t(e.y), t(e.z)), bt = (t) => (e) => It(t(e.x), t(e.y), t(e.z)), x = (t) => (e) => G(t(e.x), t(e.y), t(e.z), t(e.w)), _ = (t) => (e) => W(t(e.x), t(e.y), t(e.z), t(e.w)), ot = (t) => (e) => $t(t(e.x), t(e.y), t(e.z), t(e.w)), dt = (t) => (e) => kt(t(e.x), t(e.y), t(e.z), t(e.w)), ke = (t) => (e) => {
2023
+ let s = e.columns;
2024
+ return ft(v(t)(s[0]), v(t)(s[1]));
2025
+ }, Oe = (t) => (e) => {
2026
+ let s = e.columns;
2027
+ return mt(l(t)(s[0]), l(t)(s[1]), l(t)(s[2]));
2028
+ }, Ne = (t) => (e) => {
2029
+ let s = e.columns;
2030
+ return M(x(t)(s[0]), x(t)(s[1]), x(t)(s[2]), x(t)(s[3]));
2031
+ }, H = (t) => (e, s) => A(t(e.x, s.x), t(e.y, s.y)), Z = (t) => (e, s) => D(t(e.x, s.x), t(e.y, s.y)), xt = (t) => (e, s) => Mt(t(e.x, s.x), t(e.y, s.y)), wt = (t) => (e, s) => Tt(t(e.x, s.x), t(e.y, s.y)), R = (t) => (e, s) => S(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z)), q = (t) => (e, s) => U(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z)), lt = (t) => (e, s) => Et(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z)), vt = (t) => (e, s) => It(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z)), L = (t) => (e, s) => G(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z), t(e.w, s.w)), X = (t) => (e, s) => W(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z), t(e.w, s.w)), zt = (t) => (e, s) => $t(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z), t(e.w, s.w)), gt = (t) => (e, s) => kt(t(e.x, s.x), t(e.y, s.y), t(e.z, s.z), t(e.w, s.w)), Ni = (t) => (e, s) => {
2032
+ let i = e.columns, h = s.columns;
2033
+ return ft(H(t)(i[0], h[0]), H(t)(i[1], h[1]));
2034
+ }, ji = (t) => (e, s) => {
2035
+ let i = e.columns, h = s.columns;
2036
+ return mt(R(t)(i[0], h[0]), R(t)(i[1], h[1]), R(t)(i[2], h[2]));
2037
+ }, Pi = (t) => (e, s) => {
2038
+ let i = e.columns, h = s.columns;
2039
+ return M(L(t)(i[0], h[0]), L(t)(i[1], h[1]), L(t)(i[2], h[2]), L(t)(i[3], h[3]));
2040
+ }, Si = (t) => (e, s, i) => A(t(e.x, s.x, i.x), t(e.y, s.y, i.y)), Ci = (t) => (e, s, i) => D(t(e.x, s.x, i.x), t(e.y, s.y, i.y)), Fi = (t) => (e, s, i) => S(t(e.x, s.x, i.x), t(e.y, s.y, i.y), t(e.z, s.z, i.z)), Ai = (t) => (e, s, i) => U(t(e.x, s.x, i.x), t(e.y, s.y, i.y), t(e.z, s.z, i.z)), Gi = (t) => (e, s, i) => G(t(e.x, s.x, i.x), t(e.y, s.y, i.y), t(e.z, s.z, i.z), t(e.w, s.w, i.w)), Li = (t) => (e, s, i) => W(t(e.x, s.x, i.x), t(e.y, s.y, i.y), t(e.z, s.z, i.z), t(e.w, s.w, i.w)), d = { eq: { vec2f: (t, e) => N(t.x === e.x, t.y === e.y), vec2h: (t, e) => N(t.x === e.x, t.y === e.y), vec2i: (t, e) => N(t.x === e.x, t.y === e.y), vec2u: (t, e) => N(t.x === e.x, t.y === e.y), "vec2<bool>": (t, e) => N(t.x === e.x, t.y === e.y), vec3f: (t, e) => j(t.x === e.x, t.y === e.y, t.z === e.z), vec3h: (t, e) => j(t.x === e.x, t.y === e.y, t.z === e.z), vec3i: (t, e) => j(t.x === e.x, t.y === e.y, t.z === e.z), vec3u: (t, e) => j(t.x === e.x, t.y === e.y, t.z === e.z), "vec3<bool>": (t, e) => j(t.x === e.x, t.y === e.y, t.z === e.z), vec4f: (t, e) => P(t.x === e.x, t.y === e.y, t.z === e.z, t.w === e.w), vec4h: (t, e) => P(t.x === e.x, t.y === e.y, t.z === e.z, t.w === e.w), vec4i: (t, e) => P(t.x === e.x, t.y === e.y, t.z === e.z, t.w === e.w), vec4u: (t, e) => P(t.x === e.x, t.y === e.y, t.z === e.z, t.w === e.w), "vec4<bool>": (t, e) => P(t.x === e.x, t.y === e.y, t.z === e.z, t.w === e.w) }, lt: { vec2f: (t, e) => N(t.x < e.x, t.y < e.y), vec2h: (t, e) => N(t.x < e.x, t.y < e.y), vec2i: (t, e) => N(t.x < e.x, t.y < e.y), vec2u: (t, e) => N(t.x < e.x, t.y < e.y), vec3f: (t, e) => j(t.x < e.x, t.y < e.y, t.z < e.z), vec3h: (t, e) => j(t.x < e.x, t.y < e.y, t.z < e.z), vec3i: (t, e) => j(t.x < e.x, t.y < e.y, t.z < e.z), vec3u: (t, e) => j(t.x < e.x, t.y < e.y, t.z < e.z), vec4f: (t, e) => P(t.x < e.x, t.y < e.y, t.z < e.z, t.w < e.w), vec4h: (t, e) => P(t.x < e.x, t.y < e.y, t.z < e.z, t.w < e.w), vec4i: (t, e) => P(t.x < e.x, t.y < e.y, t.z < e.z, t.w < e.w), vec4u: (t, e) => P(t.x < e.x, t.y < e.y, t.z < e.z, t.w < e.w) }, or: { "vec2<bool>": (t, e) => N(t.x || e.x, t.y || e.y), "vec3<bool>": (t, e) => j(t.x || e.x, t.y || e.y, t.z || e.z), "vec4<bool>": (t, e) => P(t.x || e.x, t.y || e.y, t.z || e.z, t.w || e.w) }, all: { "vec2<bool>": (t) => t.x && t.y, "vec3<bool>": (t) => t.x && t.y && t.z, "vec4<bool>": (t) => t.x && t.y && t.z && t.w }, abs: { vec2f: v(Math.abs), vec2h: f(Math.abs), vec2i: ut(Math.abs), vec2u: Vt(Math.abs), vec3f: l(Math.abs), vec3h: m(Math.abs), vec3i: yt(Math.abs), vec3u: bt(Math.abs), vec4f: x(Math.abs), vec4h: _(Math.abs), vec4i: ot(Math.abs), vec4u: dt(Math.abs) }, atan2: { vec2f: H(Math.atan2), vec2h: Z(Math.atan2), vec3f: R(Math.atan2), vec3h: q(Math.atan2), vec4f: L(Math.atan2), vec4h: X(Math.atan2) }, acos: { vec2f: v(Math.acos), vec2h: f(Math.acos), vec2i: ut(Math.acos), vec2u: Vt(Math.acos), vec3f: l(Math.acos), vec3h: m(Math.acos), vec3i: yt(Math.acos), vec3u: bt(Math.acos), vec4f: x(Math.acos), vec4h: _(Math.acos), vec4i: ot(Math.acos), vec4u: dt(Math.acos) }, acosh: { vec2f: v(Math.acosh), vec2h: f(Math.acosh), vec3f: l(Math.acosh), vec3h: m(Math.acosh), vec4f: x(Math.acosh), vec4h: _(Math.acosh) }, asin: { vec2f: v(Math.asin), vec2h: f(Math.asin), vec3f: l(Math.asin), vec3h: m(Math.asin), vec4f: x(Math.asin), vec4h: _(Math.asin) }, asinh: { vec2f: v(Math.asinh), vec2h: f(Math.asinh), vec3f: l(Math.asinh), vec3h: m(Math.asinh), vec4f: x(Math.asinh), vec4h: _(Math.asinh) }, atan: { vec2f: v(Math.atan), vec2h: f(Math.atan), vec3f: l(Math.atan), vec3h: m(Math.atan), vec4f: x(Math.atan), vec4h: _(Math.atan) }, atanh: { vec2f: v(Math.atanh), vec2h: f(Math.atanh), vec3f: l(Math.atanh), vec3h: m(Math.atanh), vec4f: x(Math.atanh), vec4h: _(Math.atanh) }, ceil: { vec2f: v(Math.ceil), vec2h: f(Math.ceil), vec3f: l(Math.ceil), vec3h: m(Math.ceil), vec4f: x(Math.ceil), vec4h: _(Math.ceil) }, clamp: { vec2f: (t, e, s) => A(u(t.x, e.x, s.x), u(t.y, e.y, s.y)), vec2h: (t, e, s) => D(u(t.x, e.x, s.x), u(t.y, e.y, s.y)), vec2i: (t, e, s) => Mt(u(t.x, e.x, s.x), u(t.y, e.y, s.y)), vec2u: (t, e, s) => Tt(u(t.x, e.x, s.x), u(t.y, e.y, s.y)), vec3f: (t, e, s) => S(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z)), vec3h: (t, e, s) => U(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z)), vec3i: (t, e, s) => Et(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z)), vec3u: (t, e, s) => It(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z)), vec4f: (t, e, s) => G(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z), u(t.w, e.w, s.w)), vec4h: (t, e, s) => W(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z), u(t.w, e.w, s.w)), vec4i: (t, e, s) => $t(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z), u(t.w, e.w, s.w)), vec4u: (t, e, s) => kt(u(t.x, e.x, s.x), u(t.y, e.y, s.y), u(t.z, e.z, s.z), u(t.w, e.w, s.w)) }, length: { vec2f: rt, vec2h: rt, vec3f: ct, vec3h: ct, vec4f: at, vec4h: at }, add: { vec2f: H((t, e) => t + e), vec2h: Z((t, e) => t + e), vec2i: xt((t, e) => t + e), vec2u: wt((t, e) => t + e), vec3f: R((t, e) => t + e), vec3h: q((t, e) => t + e), vec3i: lt((t, e) => t + e), vec3u: vt((t, e) => t + e), vec4f: L((t, e) => t + e), vec4h: X((t, e) => t + e), vec4i: zt((t, e) => t + e), vec4u: gt((t, e) => t + e), mat2x2f: Ni((t, e) => t + e), mat3x3f: ji((t, e) => t + e), mat4x4f: Pi((t, e) => t + e) }, smoothstep: { vec2f: Si(ht), vec2h: Ci(ht), vec3f: Fi(ht), vec3h: Ai(ht), vec4f: Gi(ht), vec4h: Li(ht) }, addMixed: { vec2f: (t, e) => v((s) => s + e)(t), vec2h: (t, e) => f((s) => s + e)(t), vec2i: (t, e) => ut((s) => s + e)(t), vec2u: (t, e) => Vt((s) => s + e)(t), vec3f: (t, e) => l((s) => s + e)(t), vec3h: (t, e) => m((s) => s + e)(t), vec3i: (t, e) => yt((s) => s + e)(t), vec3u: (t, e) => bt((s) => s + e)(t), vec4f: (t, e) => x((s) => s + e)(t), vec4h: (t, e) => _((s) => s + e)(t), vec4i: (t, e) => ot((s) => s + e)(t), vec4u: (t, e) => dt((s) => s + e)(t), mat2x2f: (t, e) => ke((s) => s + e)(t), mat3x3f: (t, e) => Oe((s) => s + e)(t), mat4x4f: (t, e) => Ne((s) => s + e)(t) }, mulSxV: { vec2f: (t, e) => v((s) => t * s)(e), vec2h: (t, e) => f((s) => t * s)(e), vec2i: (t, e) => ut((s) => t * s)(e), vec2u: (t, e) => Vt((s) => t * s)(e), vec3f: (t, e) => l((s) => t * s)(e), vec3h: (t, e) => m((s) => t * s)(e), vec3i: (t, e) => yt((s) => t * s)(e), vec3u: (t, e) => bt((s) => t * s)(e), vec4f: (t, e) => x((s) => t * s)(e), vec4h: (t, e) => _((s) => t * s)(e), vec4i: (t, e) => ot((s) => t * s)(e), vec4u: (t, e) => dt((s) => t * s)(e), mat2x2f: (t, e) => ke((s) => t * s)(e), mat3x3f: (t, e) => Oe((s) => t * s)(e), mat4x4f: (t, e) => Ne((s) => t * s)(e) }, mulVxV: { vec2f: H((t, e) => t * e), vec2h: Z((t, e) => t * e), vec2i: xt((t, e) => t * e), vec2u: wt((t, e) => t * e), vec3f: R((t, e) => t * e), vec3h: q((t, e) => t * e), vec3i: lt((t, e) => t * e), vec3u: vt((t, e) => t * e), vec4f: L((t, e) => t * e), vec4h: X((t, e) => t * e), vec4i: zt((t, e) => t * e), vec4u: gt((t, e) => t * e), mat2x2f: (t, e) => {
2041
+ let s = t.columns, i = e.columns;
2042
+ return ft(s[0].x * i[0].x + s[1].x * i[0].y, s[0].y * i[0].x + s[1].y * i[0].y, s[0].x * i[1].x + s[1].x * i[1].y, s[0].y * i[1].x + s[1].y * i[1].y);
2043
+ }, mat3x3f: (t, e) => {
2044
+ let s = t.columns, i = e.columns;
2045
+ return mt(s[0].x * i[0].x + s[1].x * i[0].y + s[2].x * i[0].z, s[0].y * i[0].x + s[1].y * i[0].y + s[2].y * i[0].z, s[0].z * i[0].x + s[1].z * i[0].y + s[2].z * i[0].z, s[0].x * i[1].x + s[1].x * i[1].y + s[2].x * i[1].z, s[0].y * i[1].x + s[1].y * i[1].y + s[2].y * i[1].z, s[0].z * i[1].x + s[1].z * i[1].y + s[2].z * i[1].z, s[0].x * i[2].x + s[1].x * i[2].y + s[2].x * i[2].z, s[0].y * i[2].x + s[1].y * i[2].y + s[2].y * i[2].z, s[0].z * i[2].x + s[1].z * i[2].y + s[2].z * i[2].z);
2046
+ }, mat4x4f: (t, e) => {
2047
+ let s = t.columns, i = e.columns;
2048
+ return M(s[0].x * i[0].x + s[1].x * i[0].y + s[2].x * i[0].z + s[3].x * i[0].w, s[0].y * i[0].x + s[1].y * i[0].y + s[2].y * i[0].z + s[3].y * i[0].w, s[0].z * i[0].x + s[1].z * i[0].y + s[2].z * i[0].z + s[3].z * i[0].w, s[0].w * i[0].x + s[1].w * i[0].y + s[2].w * i[0].z + s[3].w * i[0].w, s[0].x * i[1].x + s[1].x * i[1].y + s[2].x * i[1].z + s[3].x * i[1].w, s[0].y * i[1].x + s[1].y * i[1].y + s[2].y * i[1].z + s[3].y * i[1].w, s[0].z * i[1].x + s[1].z * i[1].y + s[2].z * i[1].z + s[3].z * i[1].w, s[0].w * i[1].x + s[1].w * i[1].y + s[2].w * i[1].z + s[3].w * i[1].w, s[0].x * i[2].x + s[1].x * i[2].y + s[2].x * i[2].z + s[3].x * i[2].w, s[0].y * i[2].x + s[1].y * i[2].y + s[2].y * i[2].z + s[3].y * i[2].w, s[0].z * i[2].x + s[1].z * i[2].y + s[2].z * i[2].z + s[3].z * i[2].w, s[0].w * i[2].x + s[1].w * i[2].y + s[2].w * i[2].z + s[3].w * i[2].w, s[0].x * i[3].x + s[1].x * i[3].y + s[2].x * i[3].z + s[3].x * i[3].w, s[0].y * i[3].x + s[1].y * i[3].y + s[2].y * i[3].z + s[3].y * i[3].w, s[0].z * i[3].x + s[1].z * i[3].y + s[2].z * i[3].z + s[3].z * i[3].w, s[0].w * i[3].x + s[1].w * i[3].y + s[2].w * i[3].z + s[3].w * i[3].w);
2049
+ } }, mulMxV: { mat2x2f: (t, e) => {
2050
+ let s = t.columns;
2051
+ return A(s[0].x * e.x + s[1].x * e.y, s[0].y * e.x + s[1].y * e.y);
2052
+ }, mat3x3f: (t, e) => {
2053
+ let s = t.columns;
2054
+ return S(s[0].x * e.x + s[1].x * e.y + s[2].x * e.z, s[0].y * e.x + s[1].y * e.y + s[2].y * e.z, s[0].z * e.x + s[1].z * e.y + s[2].z * e.z);
2055
+ }, mat4x4f: (t, e) => {
2056
+ let s = t.columns;
2057
+ return G(s[0].x * e.x + s[1].x * e.y + s[2].x * e.z + s[3].x * e.w, s[0].y * e.x + s[1].y * e.y + s[2].y * e.z + s[3].y * e.w, s[0].z * e.x + s[1].z * e.y + s[2].z * e.z + s[3].z * e.w, s[0].w * e.x + s[1].w * e.y + s[2].w * e.z + s[3].w * e.w);
2058
+ } }, mulVxM: { mat2x2f: (t, e) => {
2059
+ let s = e.columns;
2060
+ return A(t.x * s[0].x + t.y * s[0].y, t.x * s[1].x + t.y * s[1].y);
2061
+ }, mat3x3f: (t, e) => {
2062
+ let s = e.columns;
2063
+ return S(t.x * s[0].x + t.y * s[0].y + t.z * s[0].z, t.x * s[1].x + t.y * s[1].y + t.z * s[1].z, t.x * s[2].x + t.y * s[2].y + t.z * s[2].z);
2064
+ }, mat4x4f: (t, e) => {
2065
+ let s = e.columns;
2066
+ return G(t.x * s[0].x + t.y * s[0].y + t.z * s[0].z + t.w * s[0].w, t.x * s[1].x + t.y * s[1].y + t.z * s[1].z + t.w * s[1].w, t.x * s[2].x + t.y * s[2].y + t.z * s[2].z + t.w * s[2].w, t.x * s[3].x + t.y * s[3].y + t.z * s[3].z + t.w * s[3].w);
2067
+ } }, div: { vec2f: H((t, e) => t / e), vec2h: Z((t, e) => t / e), vec2i: xt(nt), vec2u: wt(nt), vec3f: R((t, e) => t / e), vec3h: q((t, e) => t / e), vec3i: lt(nt), vec3u: vt(nt), vec4f: L((t, e) => t / e), vec4h: X((t, e) => t / e), vec4i: zt(nt), vec4u: gt(nt) }, dot: { vec2f: Ut, vec2h: Ut, vec2i: Ut, vec2u: Ut, vec3f: Rt, vec3h: Rt, vec3i: Rt, vec3u: Rt, vec4f: Yt, vec4h: Yt, vec4i: Yt, vec4u: Yt }, normalize: { vec2f: (t) => {
2068
+ let e = rt(t);
2069
+ return A(t.x / e, t.y / e);
2070
+ }, vec2h: (t) => {
2071
+ let e = rt(t);
2072
+ return D(t.x / e, t.y / e);
2073
+ }, vec2i: (t) => {
2074
+ let e = rt(t);
2075
+ return Mt(t.x / e, t.y / e);
2076
+ }, vec2u: (t) => {
2077
+ let e = rt(t);
2078
+ return Tt(t.x / e, t.y / e);
2079
+ }, vec3f: (t) => {
2080
+ let e = ct(t);
2081
+ return S(t.x / e, t.y / e, t.z / e);
2082
+ }, vec3h: (t) => {
2083
+ let e = ct(t);
2084
+ return U(t.x / e, t.y / e, t.z / e);
2085
+ }, vec3i: (t) => {
2086
+ let e = ct(t);
2087
+ return Et(t.x / e, t.y / e, t.z / e);
2088
+ }, vec3u: (t) => {
2089
+ let e = ct(t);
2090
+ return It(t.x / e, t.y / e, t.z / e);
2091
+ }, vec4f: (t) => {
2092
+ let e = at(t);
2093
+ return G(t.x / e, t.y / e, t.z / e, t.w / e);
2094
+ }, vec4h: (t) => {
2095
+ let e = at(t);
2096
+ return W(t.x / e, t.y / e, t.z / e, t.w / e);
2097
+ }, vec4i: (t) => {
2098
+ let e = at(t);
2099
+ return $t(t.x / e, t.y / e, t.z / e, t.w / e);
2100
+ }, vec4u: (t) => {
2101
+ let e = at(t);
2102
+ return kt(t.x / e, t.y / e, t.z / e, t.w / e);
2103
+ } }, cross: { vec3f: (t, e) => S(t.y * e.z - t.z * e.y, t.z * e.x - t.x * e.z, t.x * e.y - t.y * e.x), vec3h: (t, e) => U(t.y * e.z - t.z * e.y, t.z * e.x - t.x * e.z, t.x * e.y - t.y * e.x) }, mod: { vec2f: H((t, e) => t % e), vec2h: Z((t, e) => t % e), vec2i: xt((t, e) => t % e), vec2u: wt((t, e) => t % e), vec3f: R((t, e) => t % e), vec3h: q((t, e) => t % e), vec3i: lt((t, e) => t % e), vec3u: vt((t, e) => t % e), vec4f: L((t, e) => t % e), vec4h: X((t, e) => t % e), vec4i: zt((t, e) => t % e), vec4u: gt((t, e) => t % e) }, floor: { vec2f: v(Math.floor), vec2h: f(Math.floor), vec3f: l(Math.floor), vec3h: m(Math.floor), vec4f: x(Math.floor), vec4h: _(Math.floor) }, max: { vec2f: H(Math.max), vec2h: Z(Math.max), vec2i: xt(Math.max), vec2u: wt(Math.max), vec3f: R(Math.max), vec3h: q(Math.max), vec3i: lt(Math.max), vec3u: vt(Math.max), vec4f: L(Math.max), vec4h: X(Math.max), vec4i: zt(Math.max), vec4u: gt(Math.max) }, min: { vec2f: H(Math.min), vec2h: Z(Math.min), vec2i: xt(Math.min), vec2u: wt(Math.min), vec3f: R(Math.min), vec3h: q(Math.min), vec3i: lt(Math.min), vec3u: vt(Math.min), vec4f: L(Math.min), vec4h: X(Math.min), vec4i: zt(Math.min), vec4u: gt(Math.min) }, pow: { vec2f: (t, e) => A(t.x ** e.x, t.y ** e.y), vec2h: (t, e) => D(t.x ** e.x, t.y ** e.y), vec3f: (t, e) => S(t.x ** e.x, t.y ** e.y, t.z ** e.z), vec3h: (t, e) => U(t.x ** e.x, t.y ** e.y, t.z ** e.z), vec4f: (t, e) => G(t.x ** e.x, t.y ** e.y, t.z ** e.z, t.w ** e.w), vec4h: (t, e) => W(t.x ** e.x, t.y ** e.y, t.z ** e.z, t.w ** e.w) }, sign: { vec2f: v(Math.sign), vec2h: f(Math.sign), vec2i: ut(Math.sign), vec3f: l(Math.sign), vec3h: m(Math.sign), vec3i: yt(Math.sign), vec4f: x(Math.sign), vec4h: _(Math.sign), vec4i: ot(Math.sign) }, sqrt: { vec2f: v(Math.sqrt), vec2h: f(Math.sqrt), vec3f: l(Math.sqrt), vec3h: m(Math.sqrt), vec4f: x(Math.sqrt), vec4h: _(Math.sqrt) }, mix: { vec2f: (t, e, s) => typeof s == "number" ? A(t.x * (1 - s) + e.x * s, t.y * (1 - s) + e.y * s) : A(t.x * (1 - s.x) + e.x * s.x, t.y * (1 - s.y) + e.y * s.y), vec2h: (t, e, s) => typeof s == "number" ? D(t.x * (1 - s) + e.x * s, t.y * (1 - s) + e.y * s) : D(t.x * (1 - s.x) + e.x * s.x, t.y * (1 - s.y) + e.y * s.y), vec3f: (t, e, s) => typeof s == "number" ? S(t.x * (1 - s) + e.x * s, t.y * (1 - s) + e.y * s, t.z * (1 - s) + e.z * s) : S(t.x * (1 - s.x) + e.x * s.x, t.y * (1 - s.y) + e.y * s.y, t.z * (1 - s.z) + e.z * s.z), vec3h: (t, e, s) => typeof s == "number" ? U(t.x * (1 - s) + e.x * s, t.y * (1 - s) + e.y * s, t.z * (1 - s) + e.z * s) : U(t.x * (1 - s.x) + e.x * s.x, t.y * (1 - s.y) + e.y * s.y, t.z * (1 - s.z) + e.z * s.z), vec4f: (t, e, s) => typeof s == "number" ? G(t.x * (1 - s) + e.x * s, t.y * (1 - s) + e.y * s, t.z * (1 - s) + e.z * s, t.w * (1 - s) + e.w * s) : G(t.x * (1 - s.x) + e.x * s.x, t.y * (1 - s.y) + e.y * s.y, t.z * (1 - s.z) + e.z * s.z, t.w * (1 - s.w) + e.w * s.w), vec4h: (t, e, s) => typeof s == "number" ? W(t.x * (1 - s) + e.x * s, t.y * (1 - s) + e.y * s, t.z * (1 - s) + e.z * s, t.w * (1 - s) + e.w * s) : W(t.x * (1 - s.x) + e.x * s.x, t.y * (1 - s.y) + e.y * s.y, t.z * (1 - s.z) + e.z * s.z, t.w * (1 - s.w) + e.w * s.w) }, sin: { vec2f: v(Math.sin), vec2h: f(Math.sin), vec3f: l(Math.sin), vec3h: m(Math.sin), vec4f: x(Math.sin), vec4h: _(Math.sin) }, cos: { vec2f: v(Math.cos), vec2h: f(Math.cos), vec3f: l(Math.cos), vec3h: m(Math.cos), vec4f: x(Math.cos), vec4h: _(Math.cos) }, cosh: { vec2f: v(Math.cosh), vec2h: f(Math.cosh), vec3f: l(Math.cosh), vec3h: m(Math.cosh), vec4f: x(Math.cosh), vec4h: _(Math.cosh) }, exp: { vec2f: v(Math.exp), vec2h: f(Math.exp), vec3f: l(Math.exp), vec3h: m(Math.exp), vec4f: x(Math.exp), vec4h: _(Math.exp) }, exp2: { vec2f: v((t) => 2 ** t), vec2h: f((t) => 2 ** t), vec3f: l((t) => 2 ** t), vec3h: m((t) => 2 ** t), vec4f: x((t) => 2 ** t), vec4h: _((t) => 2 ** t) }, log: { vec2f: v(Math.log), vec2h: f(Math.log), vec3f: l(Math.log), vec3h: m(Math.log), vec4f: x(Math.log), vec4h: _(Math.log) }, log2: { vec2f: v(Math.log2), vec2h: f(Math.log2), vec3f: l(Math.log2), vec3h: m(Math.log2), vec4f: x(Math.log2), vec4h: _(Math.log2) }, fract: { vec2f: v((t) => t - Math.floor(t)), vec2h: f((t) => t - Math.floor(t)), vec3f: l((t) => t - Math.floor(t)), vec3h: m((t) => t - Math.floor(t)), vec4f: x((t) => t - Math.floor(t)), vec4h: _((t) => t - Math.floor(t)) }, isCloseToZero: { vec2f: (t, e) => Math.abs(t.x) <= e && Math.abs(t.y) <= e, vec2h: (t, e) => Math.abs(t.x) <= e && Math.abs(t.y) <= e, vec3f: (t, e) => Math.abs(t.x) <= e && Math.abs(t.y) <= e && Math.abs(t.z) <= e, vec3h: (t, e) => Math.abs(t.x) <= e && Math.abs(t.y) <= e && Math.abs(t.z) <= e, vec4f: (t, e) => Math.abs(t.x) <= e && Math.abs(t.y) <= e && Math.abs(t.z) <= e && Math.abs(t.w) <= e, vec4h: (t, e) => Math.abs(t.x) <= e && Math.abs(t.y) <= e && Math.abs(t.z) <= e && Math.abs(t.w) <= e }, neg: { vec2f: v((t) => -t), vec2h: f((t) => -t), vec2i: ut((t) => -t), vec2u: Vt((t) => -t), "vec2<bool>": (t) => N(!t.x, !t.y), vec3f: l((t) => -t), vec3h: m((t) => -t), vec3i: yt((t) => -t), vec3u: bt((t) => -t), "vec3<bool>": (t) => j(!t.x, !t.y, !t.z), vec4f: x((t) => -t), vec4h: _((t) => -t), vec4i: ot((t) => -t), vec4u: dt((t) => -t), "vec4<bool>": (t) => P(!t.x, !t.y, !t.z, !t.w) }, select: { vec2f: (t, e, s) => A(s.x ? e.x : t.x, s.y ? e.y : t.y), vec2h: (t, e, s) => D(s.x ? e.x : t.x, s.y ? e.y : t.y), vec2i: (t, e, s) => Mt(s.x ? e.x : t.x, s.y ? e.y : t.y), vec2u: (t, e, s) => Tt(s.x ? e.x : t.x, s.y ? e.y : t.y), "vec2<bool>": (t, e, s) => N(s.x ? e.x : t.x, s.y ? e.y : t.y), vec3f: (t, e, s) => S(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z), vec3h: (t, e, s) => U(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z), vec3i: (t, e, s) => Et(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z), vec3u: (t, e, s) => It(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z), "vec3<bool>": (t, e, s) => j(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z), vec4f: (t, e, s) => G(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z, s.w ? e.w : t.w), vec4h: (t, e, s) => W(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z, s.w ? e.w : t.w), vec4i: (t, e, s) => $t(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z, s.w ? e.w : t.w), vec4u: (t, e, s) => kt(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z, s.w ? e.w : t.w), "vec4<bool>": (t, e, s) => P(s.x ? e.x : t.x, s.y ? e.y : t.y, s.z ? e.z : t.z, s.w ? e.w : t.w) }, tanh: { vec2f: v(Math.tanh), vec2h: f(Math.tanh), vec3f: l(Math.tanh), vec3h: m(Math.tanh), vec4f: x(Math.tanh), vec4h: _(Math.tanh) } };
2104
+ function Ui(t, e) {
2105
+ throw new Error(`Failed to handle ${t} at ${e}`);
2106
+ }
2107
+ var Ri = { f: { 1: b, 2: C, 3: it, 4: $ }, h: { 1: F, 2: Wt, 3: Zt, 4: Xt }, i: { 1: E, 2: Q, 3: At, 4: tt }, u: { 1: z, 2: Y, 3: Gt, 4: et }, b: { 1: O, 2: Kt, 3: qt, 4: Jt } }, Yi = { vec2f: C, vec2h: Wt, vec2i: Q, vec2u: Y, "vec2<bool>": Kt, vec3f: it, vec3h: Zt, vec3i: At, vec3u: Gt, "vec3<bool>": qt, vec4f: $, vec4h: Xt, vec4i: tt, vec4u: et, "vec4<bool>": Jt, mat2x2f: ft, mat3x3f: mt, mat4x4f: M }, je = { vec2f: b, vec2h: F, vec2i: E, vec2u: z, "vec2<bool>": O, vec3f: b, vec3h: F, vec3i: E, vec3u: z, "vec3<bool>": O, vec4f: b, vec4h: F, vec4i: E, vec4u: z, "vec4<bool>": O, mat2x2f: C, mat3x3f: it, mat4x4f: $ };
2108
+ function Tn(t, e) {
2109
+ if (Us(t) || qs(t)) return t.propTypes[e] ?? J;
2110
+ if (t === O || Je(t)) return J;
2111
+ let s = e.length;
2112
+ if (jt(t) && s >= 1 && s <= 4) {
2113
+ let i = t.type.includes("bool") ? "b" : t.type[4], h = Ri[i][s];
2114
+ if (h) return h;
2115
+ }
2116
+ return J;
2117
+ }
2118
+ function En(t) {
2119
+ return Ls(t) || Zs(t) ? t.elementType : t.type in je ? je[t.type] : J;
2120
+ }
2121
+ function In(t) {
2122
+ return /^0x[0-9a-f]+$/i.test(t) ? Number.parseInt(t) : /^0b[01]+$/i.test(t) ? Number.parseInt(t.slice(2), 2) : Number.parseFloat(t);
2123
+ }
2124
+ function Bi(t) {
2125
+ return Number.isInteger(t) && t >= -2147483648 && t <= 2147483647 ? a(t, si) : a(t, ii);
2126
+ }
2127
+ var Me = { rank: Number.POSITIVE_INFINITY, action: "none" };
2128
+ function Pe(t) {
2129
+ return jt(t) ? fs[t.type] : void 0;
2130
+ }
2131
+ function Dt(t, e) {
2132
+ let s = st(t), i = st(e);
2133
+ if (s.type === i.type) return { rank: 0, action: "none" };
2134
+ if (s.type === "abstractFloat") {
2135
+ if (i.type === "f32") return { rank: 1, action: "none" };
2136
+ if (i.type === "f16") return { rank: 2, action: "none" };
2137
+ }
2138
+ if (s.type === "abstractInt") {
2139
+ if (i.type === "i32") return { rank: 3, action: "none" };
2140
+ if (i.type === "u32") return { rank: 4, action: "none" };
2141
+ if (i.type === "abstractFloat") return { rank: 5, action: "none" };
2142
+ if (i.type === "f32") return { rank: 6, action: "none" };
2143
+ if (i.type === "f16") return { rank: 7, action: "none" };
2144
+ }
2145
+ if (jt(s) && jt(i)) {
2146
+ let h = Pe(s), r = Pe(i);
2147
+ if (h && r) return Dt(h, r);
2148
+ }
2149
+ return Ie(s) && Ie(i) ? { rank: 0, action: "none" } : Me;
2150
+ }
2151
+ function Hi(t, e) {
2152
+ let s = st(t), i = st(e);
2153
+ if (s.type === "ptr" && Dt(s.inner, i).rank < Number.POSITIVE_INFINITY) return { rank: 0, action: "deref" };
2154
+ if (i.type === "ptr" && Dt(s, i.inner).rank < Number.POSITIVE_INFINITY) return { rank: 1, action: "ref" };
2155
+ let h = { f32: 0, f16: 1, i32: 2, u32: 3, bool: 4 };
2156
+ if (s.type in h && i.type in h) {
2157
+ let r = s.type, o = i.type;
2158
+ if (r !== o) {
2159
+ let g = h[r];
2160
+ return { rank: h[o] < g ? 10 : 20, action: "cast", targetType: i };
2161
+ }
2162
+ }
2163
+ return Me;
2164
+ }
2165
+ function Di(t, e, s) {
2166
+ let i = Dt(t, e);
2167
+ return i.rank < Number.POSITIVE_INFINITY ? i : s ? Hi(t, e) : Me;
2168
+ }
2169
+ function Se(t, e, s) {
2170
+ let i, h = Number.POSITIVE_INFINITY, r = /* @__PURE__ */ new Map();
2171
+ for (let y of e) {
2172
+ let k = 0, B = [], Ee = !0;
2173
+ for (let _s of t) {
2174
+ let Qt = Di(_s, y, s);
2175
+ if (Qt.rank === Number.POSITIVE_INFINITY) {
2176
+ Ee = !1;
2177
+ break;
2178
+ }
2179
+ k += Qt.rank, B.push(Qt);
2180
+ }
2181
+ Ee && k < h && (h = k, i = y, r.set(i, B));
2182
+ }
2183
+ if (!i) return;
2184
+ let o = r.get(i).map((y, k) => ({ sourceIndex: k, action: y.action, ...y.action === "cast" && { targetType: y.targetType } })), g = o.some((y) => y.action === "cast");
2185
+ return { targetType: i, actions: o, hasImplicitConversions: g };
2186
+ }
2187
+ function Ce(t) {
2188
+ return t.type === "abstractFloat" ? b : t.type === "abstractInt" ? E : t;
2189
+ }
2190
+ function Wi(t, e) {
2191
+ if (t.length === 0) return;
2192
+ let s = [...new Set(t.map(st))], i = e ? [...new Set(e.map(st))] : s, h = Se(t, i, !1);
2193
+ if (h) return h;
2194
+ let r = Se(t, i, !0);
2195
+ if (r) return r.hasImplicitConversions = r.actions.some((o) => o.action === "cast"), r;
2196
+ }
2197
+ function Ki(t, e, s, i) {
2198
+ if (s.action === "none") return a(e.value, i);
2199
+ switch (s.action) {
2200
+ case "ref":
2201
+ return a(p`&${e}`, i);
2202
+ case "deref":
2203
+ return a(p`*${e}`, i);
2204
+ case "cast":
2205
+ return a(p`${t.resolve(i)}(${e})`, i);
2206
+ default:
2207
+ Ui(s.action, "applyActionToSnippet");
2208
+ }
2209
+ }
2210
+ function Te({ ctx: t, values: e, restrictTo: s, concretizeTypes: i = !1, verbose: h = !0 }) {
2211
+ let r = i && !e.some((y) => Ce(y.dataType) === y.dataType), o = e.map((y) => r ? Ce(y.dataType) : y.dataType);
2212
+ if (o.some((y) => y === J)) return;
2213
+ Ot && h && Array.isArray(s) && s.length === 0 && console.warn("convertToCommonType was called with an empty restrictTo array, which prevents any conversions from being made. If you intend to allow all conversions, pass undefined instead. If this was intended call the function conditionally since the result will always be undefined.");
2214
+ let g = Wi(o, s);
2215
+ if (g) return Ot && h && g.hasImplicitConversions && console.warn(`Implicit conversions from [
2216
+ ${e.map((y) => ` ${y.value}: ${y.dataType.type}`).join(`,
2217
+ `)}
2218
+ ] to ${g.targetType.type} are supported, but not recommended.
2219
+ Consider using explicit conversions instead.`), e.map((y, k) => {
2220
+ let B = g.actions[k];
2221
+ return Re(B, "Action should not be undefined"), Ki(t, y, B, g.targetType);
2222
+ });
2223
+ }
2224
+ function $n(t, e, s) {
2225
+ if (s === e.dataType) return e;
2226
+ if (e.dataType.type === "unknown") return a(t.resolve(e.value, s), s);
2227
+ let i = Te({ ctx: t, values: [e], restrictTo: [s] });
2228
+ if (!i) throw new Is(`Cannot convert value of type '${e.dataType.type}' to type '${s.type}'`);
2229
+ return i[0];
2230
+ }
2231
+ function kn(t, e, s) {
2232
+ return Object.keys(e.propTypes).map((i) => {
2233
+ let h = s[i];
2234
+ if (!h) throw new Error(`Missing property ${i}`);
2235
+ let r = e.propTypes[i];
2236
+ return Te({ ctx: t, values: [h], restrictTo: [r] })?.[0] ?? h;
2237
+ });
2238
+ }
2239
+ function On(t) {
2240
+ return es(t) ? t : Ns(t) ? a(t, t[Ge]) : w(t) || T(t) ? a(t, Yi[t.kind]) : typeof t == "string" || typeof t == "function" || typeof t == "object" || typeof t == "symbol" || typeof t > "u" || t === null ? a(t, J) : typeof t == "number" ? Bi(t) : typeof t == "boolean" ? a(t, O) : a(t, J);
2241
+ }
2242
+ function Lt(t, e, s = !1, i = !0) {
2243
+ let h = Qe();
2244
+ return Te({ ctx: h, values: t, restrictTo: e, concretizeTypes: s, verbose: i }) ?? t;
2245
+ }
2246
+ function he(t, e) {
2247
+ if (typeof t == "number" && typeof e == "number") return t + e;
2248
+ if (typeof t == "number" && w(e)) return d.addMixed[e.kind](e, t);
2249
+ if (w(t) && typeof e == "number") return d.addMixed[t.kind](t, e);
2250
+ if (w(t) && w(e) || T(t) && T(e)) return d.add[t.kind](t, e);
2251
+ throw new Error("Add/Sub called with invalid arguments.");
2252
+ }
2253
+ var Nn = V(he, (t, e) => {
2254
+ let [s, i] = Lt([t, e]), h = Pt(s) ? i.dataType : s.dataType;
2255
+ return (typeof t.value == "number" || w(t.value) || T(t.value)) && (typeof e.value == "number" || w(e.value) || T(e.value)) ? a(he(t.value, e.value), h) : a(p`(${s} + ${i})`, h);
2256
+ }, "add");
2257
+ function Fe(t, e) {
2258
+ return he(t, ne(-1, e));
2259
+ }
2260
+ var jn = V(Fe, (t, e) => {
2261
+ let [s, i] = Lt([t, e]), h = Pt(s) ? i.dataType : s.dataType;
2262
+ return (typeof t.value == "number" || w(t.value) || T(t.value)) && (typeof e.value == "number" || w(e.value) || T(e.value)) ? a(Fe(t.value, e.value), h) : a(p`(${s} - ${i})`, h);
2263
+ }, "sub");
2264
+ function ne(t, e) {
2265
+ if (typeof t == "number" && typeof e == "number") return t * e;
2266
+ if (typeof t == "number" && (w(e) || T(e))) return d.mulSxV[e.kind](t, e);
2267
+ if ((w(t) || T(t)) && typeof e == "number") return d.mulSxV[t.kind](e, t);
2268
+ if (w(t) && w(e)) return d.mulVxV[t.kind](t, e);
2269
+ if ($e(t) && T(e)) return d.mulVxM[e.kind](t, e);
2270
+ if (T(t) && $e(e)) return d.mulMxV[t.kind](t, e);
2271
+ if (T(t) && T(e)) return d.mulVxV[t.kind](t, e);
2272
+ throw new Error("Mul called with invalid arguments.");
2273
+ }
2274
+ var Pn = V(ne, (t, e) => {
2275
+ let [s, i] = Lt([t, e]), h = Pt(s) ? i.dataType : Pt(i) || s.dataType.type.startsWith("vec") ? s.dataType : i.dataType.type.startsWith("vec") ? i.dataType : s.dataType;
2276
+ return (typeof t.value == "number" || w(t.value) || T(t.value)) && (typeof e.value == "number" || w(e.value) || T(e.value)) ? a(ne(t.value, e.value), h) : a(p`(${s} * ${i})`, h);
2277
+ }, "mul");
2278
+ function Ae(t, e) {
2279
+ if (typeof t == "number" && typeof e == "number") return t / e;
2280
+ if (typeof t == "number" && w(e)) {
2281
+ let s = Ht[e.kind][n].jsImpl;
2282
+ return d.div[e.kind](s(t), e);
2283
+ }
2284
+ if (w(t) && typeof e == "number") {
2285
+ let s = Ht[t.kind][n].jsImpl;
2286
+ return d.div[t.kind](t, s(e));
2287
+ }
2288
+ if (w(t) && w(e)) return d.div[t.kind](t, e);
2289
+ throw new Error("Div called with invalid arguments.");
2290
+ }
2291
+ var Sn = V(Ae, (t, e) => {
2292
+ let [s, i] = Lt([t, e], [b, F], !0, !1);
2293
+ return (typeof t.value == "number" || w(t.value)) && (typeof e.value == "number" || w(e.value)) ? a(Ae(t.value, e.value), s.dataType) : a(p`(${s} / ${i})`, s.dataType);
2294
+ }, "div"), Cn = V((t, e) => {
2295
+ if (typeof t == "number" && typeof e == "number") return t % e;
2296
+ if (typeof t == "number" && w(e)) {
2297
+ let s = Ht[e.kind];
2298
+ return d.mod[e.kind](s(t), e);
2299
+ }
2300
+ if (w(t) && typeof e == "number") {
2301
+ let s = Ht[t.kind];
2302
+ return d.mod[t.kind](t, s(e));
2303
+ }
2304
+ if (w(t) && w(e)) return d.mod[t.kind](t, e);
2305
+ throw new Error("Mod called with invalid arguments, expected types: number or vector.");
2306
+ }, (t, e) => {
2307
+ let [s, i] = Lt([t, e]), h = Pt(s) ? i.dataType : s.dataType;
2308
+ return a(p`(${s} % ${i})`, h);
2309
+ }, "mod"), Fn = V((t) => typeof t == "number" ? -t : d.neg[t.kind](t), (t) => a(p`-(${t})`, t.dataType), "neg");
2310
+ function An(t) {
2311
+ return { [n]: !0, type: "ptr", inner: t, addressSpace: "function", access: "read-write" };
2312
+ }
2313
+ function Gn(t) {
2314
+ return { [n]: !0, type: "ptr", inner: t, addressSpace: "private", access: "read-write" };
2315
+ }
2316
+ function Ln(t) {
2317
+ return { [n]: !0, type: "ptr", inner: t, addressSpace: "workgroup", access: "read-write" };
2318
+ }
2319
+ function Un(t, e = "read") {
2320
+ return { [n]: !0, type: "ptr", inner: t, addressSpace: "storage", access: e };
2321
+ }
2322
+ function Rn(t) {
2323
+ return { [n]: !0, type: "ptr", inner: t, addressSpace: "uniform", access: "read" };
2324
+ }
2325
+ function Yn(t) {
2326
+ return { [n]: !0, type: "ptr", inner: t, addressSpace: "handle", access: "read" };
2327
+ }
2328
+ var Zi = /* @__PURE__ */ ((t) => (t.TOP_LEFT = "TOP_LEFT", t.TOP = "TOP", t.TOP_RIGHT = "TOP_RIGHT", t.LEFT = "LEFT", t.SELF = "SELF", t.RIGHT = "RIGHT", t.BOTTOM_LEFT = "BOTTOM_LEFT", t.BOTTOM = "BOTTOM", t.BOTTOM_RIGHT = "BOTTOM_RIGHT", t))(Zi || {}), qi = /* @__PURE__ */ ((t) => (t.TOP = "TOP", t.LEFT = "LEFT", t.SELF = "SELF", t.RIGHT = "RIGHT", t.BOTTOM = "BOTTOM", t))(qi || {});
2329
+ const Bn = {
2330
+ TOP_LEFT: { x: -1, y: -1 },
2331
+ TOP: { x: 0, y: -1 },
2332
+ TOP_RIGHT: { x: 1, y: -1 },
2333
+ LEFT: { x: -1, y: 0 },
2334
+ SELF: { x: 0, y: 0 },
2335
+ RIGHT: { x: 1, y: 0 },
2336
+ BOTTOM_LEFT: { x: -1, y: 1 },
2337
+ BOTTOM: { x: 0, y: 1 },
2338
+ BOTTOM_RIGHT: { x: 1, y: 1 }
2339
+ };
2340
+ var Xi = /* @__PURE__ */ ((t) => (t[t.ELEMENT_ID = 0] = "ELEMENT_ID", t[t.POINT = 1] = "POINT", t))(Xi || {}), Ji = /* @__PURE__ */ ((t) => (t[t.NOOP = 0] = "NOOP", t[t.COUNT_ELEMENT = 1] = "COUNT_ELEMENT", t[t.COUNT_POINT = 2] = "COUNT_POINT", t[t.COUNT_KIND = 3] = "COUNT_KIND", t[t.IS_ELEMENT = 4] = "IS_ELEMENT", t[t.IS_POINT = 5] = "IS_POINT", t[t.IS_KIND = 6] = "IS_KIND", t[t.CHANCE = 7] = "CHANCE", t))(Ji || {}), Qi = /* @__PURE__ */ ((t) => (t[t.ALL = 0] = "ALL", t[t.ANY = 1] = "ANY", t[t.ONE = 2] = "ONE", t[t.NONE = 3] = "NONE", t))(Qi || {});
2341
+ const Hn = {
2342
+ all: 0,
2343
+ any: 1,
2344
+ one: 2,
2345
+ none: 3
2346
+ /* NONE */
2347
+ }, Dn = (globalThis.__TYPEGPU_AUTONAME__ ?? ((t) => t))(de({
2348
+ color: z,
2349
+ ruleStart: z,
2350
+ ruleEnd: z
2351
+ }), "GpuElement"), Wn = (globalThis.__TYPEGPU_AUTONAME__ ?? ((t) => t))(de({
2352
+ toType: z,
2353
+ toId: z,
2354
+ toNeighbor: Y,
2355
+ accept: z,
2356
+ conditionsStart: z,
2357
+ conditionsEnd: z
2358
+ }), "GpuRule"), Kn = (globalThis.__TYPEGPU_AUTONAME__ ?? ((t) => t))(de({
2359
+ opcode: z,
2360
+ checkId: z,
2361
+ countOrWithId: z,
2362
+ checkPointOrComparePoint: Y,
2363
+ withPoint: Y,
2364
+ chance: b
2365
+ }), "GpuCondition"), Zn = [8, 8];
2366
+ export {
2367
+ O as $,
2368
+ Qi as A,
2369
+ Ie as B,
2370
+ qi as C,
2371
+ jt as D,
2372
+ w as E,
2373
+ bh as F,
2374
+ In as G,
2375
+ Is as H,
2376
+ Qs as I,
2377
+ Ks as J,
2378
+ $n as K,
2379
+ En as L,
2380
+ es as M,
2381
+ sh as N,
2382
+ kn as O,
2383
+ Bi as P,
2384
+ si as Q,
2385
+ Gt as R,
2386
+ Zi as S,
2387
+ mh as T,
2388
+ b as U,
2389
+ z as V,
2390
+ Tn as W,
2391
+ $ as X,
2392
+ On as Y,
2393
+ re as Z,
2394
+ Te as _,
2395
+ ki as a,
2396
+ en as a$,
2397
+ Ve as a0,
2398
+ Dn as a1,
2399
+ Wn as a2,
2400
+ Y as a3,
2401
+ Xi as a4,
2402
+ Kn as a5,
2403
+ Ji as a6,
2404
+ Hn as a7,
2405
+ xh as a8,
2406
+ F as a9,
2407
+ fn as aA,
2408
+ mn as aB,
2409
+ _n as aC,
2410
+ pn as aD,
2411
+ Gh as aE,
2412
+ Lh as aF,
2413
+ Uh as aG,
2414
+ hn as aH,
2415
+ nn as aI,
2416
+ rn as aJ,
2417
+ Hh as aK,
2418
+ Dh as aL,
2419
+ Wh as aM,
2420
+ de as aN,
2421
+ Ph as aO,
2422
+ Kh as aP,
2423
+ Zh as aQ,
2424
+ qh as aR,
2425
+ ln as aS,
2426
+ vn as aT,
2427
+ zn as aU,
2428
+ gn as aV,
2429
+ Ch as aW,
2430
+ Fh as aX,
2431
+ Ah as aY,
2432
+ Vn as aZ,
2433
+ tn as a_,
2434
+ cn as aa,
2435
+ an as ab,
2436
+ un as ac,
2437
+ yn as ad,
2438
+ on as ae,
2439
+ xn as af,
2440
+ wn as ag,
2441
+ ie as ah,
2442
+ E as ai,
2443
+ lh as aj,
2444
+ vh as ak,
2445
+ Bs as al,
2446
+ dn as am,
2447
+ ft as an,
2448
+ mt as ao,
2449
+ M as ap,
2450
+ Sh as aq,
2451
+ An as ar,
2452
+ Yn as as,
2453
+ Gn as at,
2454
+ Un as au,
2455
+ Rn as av,
2456
+ Ln as aw,
2457
+ Xh as ax,
2458
+ Jh as ay,
2459
+ Qh as az,
2460
+ _h as b,
2461
+ Oh as b$,
2462
+ sn as b0,
2463
+ Rh as b1,
2464
+ Yh as b2,
2465
+ Bh as b3,
2466
+ bn as b4,
2467
+ Kt as b5,
2468
+ C as b6,
2469
+ Wt as b7,
2470
+ Q as b8,
2471
+ qt as b9,
2472
+ Le as bA,
2473
+ $h as bB,
2474
+ gh as bC,
2475
+ Vh as bD,
2476
+ Ms as bE,
2477
+ V as bF,
2478
+ kh as bG,
2479
+ Eh as bH,
2480
+ Ds as bI,
2481
+ fh as bJ,
2482
+ p as bK,
2483
+ ih as bL,
2484
+ oh as bM,
2485
+ ch as bN,
2486
+ ah as bO,
2487
+ nh as bP,
2488
+ Ts as bQ,
2489
+ rh as bR,
2490
+ st as bS,
2491
+ Ih as bT,
2492
+ eh as bU,
2493
+ Ps as bV,
2494
+ Ss as bW,
2495
+ Fs as bX,
2496
+ As as bY,
2497
+ Cs as bZ,
2498
+ yh as b_,
2499
+ it as ba,
2500
+ Zt as bb,
2501
+ At as bc,
2502
+ Jt as bd,
2503
+ Xt as be,
2504
+ tt as bf,
2505
+ et as bg,
2506
+ Th as bh,
2507
+ Nh as bi,
2508
+ th as bj,
2509
+ hh as bk,
2510
+ Os as bl,
2511
+ ps as bm,
2512
+ $s as bn,
2513
+ ks as bo,
2514
+ Xs as bp,
2515
+ Js as bq,
2516
+ Mh as br,
2517
+ Re as bs,
2518
+ ti as bt,
2519
+ Qe as bu,
2520
+ Ge as bv,
2521
+ ei as bw,
2522
+ jh as bx,
2523
+ uh as by,
2524
+ Ui as bz,
2525
+ $i as c,
2526
+ d as c0,
2527
+ Mn as c1,
2528
+ Pt as c2,
2529
+ ii as c3,
2530
+ Ti as c4,
2531
+ Ei as c5,
2532
+ Ii as c6,
2533
+ Mi as c7,
2534
+ ht as c8,
2535
+ di as c9,
2536
+ _i as ca,
2537
+ pi as cb,
2538
+ Vi as cc,
2539
+ Cn as cd,
2540
+ Fn as ce,
2541
+ Zn as cf,
2542
+ Ys as d,
2543
+ Xe as e,
2544
+ qs as f,
2545
+ Ce as g,
2546
+ Ue as h,
2547
+ n as i,
2548
+ Sn as j,
2549
+ Pn as k,
2550
+ Rs as l,
2551
+ zh as m,
2552
+ Bn as n,
2553
+ a as o,
2554
+ Hs as p,
2555
+ jn as q,
2556
+ Nn as r,
2557
+ J as s,
2558
+ pt as t,
2559
+ Ls as u,
2560
+ dh as v,
2561
+ Zs as w,
2562
+ wh as x,
2563
+ Us as y,
2564
+ ph as z
2565
+ };