@wonderyard/vivarium 1.5.0 → 2.0.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.
@@ -1,5 +1,5 @@
1
1
  var F = "0.10.0";
2
- const Ft = process.env.NODE_ENV === "development", ce = process.env.NODE_ENV === "test", i = /* @__PURE__ */ Symbol(`typegpu:${F}:$internal`), As = /* @__PURE__ */ Symbol(`typegpu:${F}:$gpuValueOf`), Jt = /* @__PURE__ */ Symbol(`typegpu:${F}:$getNameForward`), Yn = /* @__PURE__ */ Symbol(`typegpu:${F}:$providing`), De = /* @__PURE__ */ Symbol(`typegpu:${F}:$ownSnippet`), A = /* @__PURE__ */ Symbol(`typegpu:${F}:$resolve`), Ye = /* @__PURE__ */ Symbol(`typegpu:${F}:$cast`), ot = /* @__PURE__ */ Symbol(`typegpu:${F}:$gpuCallable`), qn = /* @__PURE__ */ Symbol(`typegpu:${F}:$repr`);
2
+ const Ft = process.env.NODE_ENV === "development", ce = process.env.NODE_ENV === "test", i = /* @__PURE__ */ Symbol(`typegpu:${F}:$internal`), Fs = /* @__PURE__ */ Symbol(`typegpu:${F}:$gpuValueOf`), Jt = /* @__PURE__ */ Symbol(`typegpu:${F}:$getNameForward`), Yn = /* @__PURE__ */ Symbol(`typegpu:${F}:$providing`), De = /* @__PURE__ */ Symbol(`typegpu:${F}:$ownSnippet`), A = /* @__PURE__ */ Symbol(`typegpu:${F}:$resolve`), Ye = /* @__PURE__ */ Symbol(`typegpu:${F}:$cast`), ot = /* @__PURE__ */ Symbol(`typegpu:${F}:$gpuCallable`), qn = /* @__PURE__ */ Symbol(`typegpu:${F}:$repr`);
3
3
  function m(t) {
4
4
  return !!t?.[i];
5
5
  }
@@ -7,7 +7,7 @@ const K = globalThis;
7
7
  K.__TYPEGPU_VERSION__ !== void 0 && console.warn(`Found duplicate TypeGPU version. First was ${K.__TYPEGPU_VERSION__}, this one is ${F}. This may cause unexpected behavior.`);
8
8
  K.__TYPEGPU_VERSION__ = F;
9
9
  K.__TYPEGPU_AUTONAME__ = (t, e) => Hn(t) && m(t) && !ut(t) ? t.$name(e) : t;
10
- const Fs = (Ft || ce) && {
10
+ const Us = (Ft || ce) && {
11
11
  get enabled() {
12
12
  return !!K.__TYPEGPU_MEASURE_PERF__;
13
13
  },
@@ -28,7 +28,7 @@ function yt(t, e) {
28
28
  yt(t[Jt], e);
29
29
  return;
30
30
  }
31
- Xn(t, { name: e });
31
+ Zn(t, { name: e });
32
32
  }
33
33
  function Hn(t) {
34
34
  return !!t?.$name;
@@ -39,7 +39,7 @@ function Kn(t) {
39
39
  function He(t) {
40
40
  return K.__TYPEGPU_META__.get(t);
41
41
  }
42
- function Xn(t, e) {
42
+ function Zn(t, e) {
43
43
  K.__TYPEGPU_META__ ??= /* @__PURE__ */ new WeakMap();
44
44
  const n = K.__TYPEGPU_META__;
45
45
  n.set(t, {
@@ -47,7 +47,7 @@ function Xn(t, e) {
47
47
  ...e
48
48
  });
49
49
  }
50
- const Zn = [
50
+ const Xn = [
51
51
  "uint8",
52
52
  "uint8x2",
53
53
  "uint8x4",
@@ -89,7 +89,7 @@ const Zn = [
89
89
  "sint32x4",
90
90
  "unorm10-10-10-2",
91
91
  "unorm8x4-bgra"
92
- ], Us = {
92
+ ], js = {
93
93
  f32: "float32",
94
94
  vec2f: "float32x2",
95
95
  vec3f: "float32x3",
@@ -105,7 +105,7 @@ const Zn = [
105
105
  vec2i: "sint32x2",
106
106
  vec3i: "sint32x3",
107
107
  vec4i: "sint32x4"
108
- }, js = {
108
+ }, Bs = {
109
109
  [i]: {},
110
110
  type: "void",
111
111
  toString() {
@@ -183,7 +183,7 @@ function er(t) {
183
183
  function C(t) {
184
184
  return Qn(t) || tr(t) || er(t);
185
185
  }
186
- function Bs(t) {
186
+ function Ls(t) {
187
187
  return C(t) && t.type.includes("b");
188
188
  }
189
189
  function L(t) {
@@ -212,16 +212,16 @@ function Ae(t) {
212
212
  function Ke(t) {
213
213
  return m(t) && Jn.includes(t?.type);
214
214
  }
215
- function Ls(t) {
215
+ function Rs(t) {
216
216
  return m(t) && t?.type === "array";
217
217
  }
218
- function Rs(t) {
218
+ function Ws(t) {
219
219
  return m(t) && t?.type === "struct";
220
220
  }
221
221
  function at(t) {
222
222
  return m(t) && t?.type === "ptr";
223
223
  }
224
- function Ws(t) {
224
+ function Gs(t) {
225
225
  return m(t) && t?.type === "atomic";
226
226
  }
227
227
  function cr(t) {
@@ -233,23 +233,23 @@ function or(t) {
233
233
  function ar(t) {
234
234
  return m(t) && t?.type === "@location";
235
235
  }
236
- function Gs(t) {
236
+ function Ds(t) {
237
237
  return m(t) && t?.type === "@interpolate";
238
238
  }
239
- function Ds(t) {
239
+ function Ys(t) {
240
240
  return m(t) && t?.type === "@builtin";
241
241
  }
242
242
  function ir(t) {
243
243
  return m(t) && t?.type === "decorated";
244
244
  }
245
- function Ys(t) {
245
+ function qs(t) {
246
246
  return m(t) && t.type === "void";
247
247
  }
248
248
  function ur(t) {
249
249
  const e = t?.type;
250
250
  return m(t) && (e === "abstractInt" || e === "abstractFloat" || e === "f32" || e === "f16" || e === "i32" || e === "u32");
251
251
  }
252
- function qs(t) {
252
+ function Hs(t) {
253
253
  const e = t?.type;
254
254
  return m(t) && (e === "f16" || e === "vec2h" || e === "vec3h" || e === "vec4h");
255
255
  }
@@ -262,7 +262,7 @@ const yr = [
262
262
  "u32",
263
263
  "bool"
264
264
  ];
265
- function Xe(t) {
265
+ function Ze(t) {
266
266
  return !m(t) || yr.includes(t?.type);
267
267
  }
268
268
  function fr(t) {
@@ -271,19 +271,19 @@ function fr(t) {
271
271
  function St(t) {
272
272
  return ir(t) || hr(t) ? t.inner : t;
273
273
  }
274
- function Hs(t) {
274
+ function Ks(t) {
275
275
  return at(t) ? t.inner : t;
276
276
  }
277
277
  const lr = [
278
278
  "unstruct",
279
279
  "disarray",
280
280
  "loose-decorated",
281
- ...Zn
281
+ ...Xn
282
282
  ];
283
283
  function mr(t) {
284
284
  return m(t) && lr.includes(t?.type);
285
285
  }
286
- function Ks(t) {
286
+ function Zs(t) {
287
287
  return m(t) && t?.type === "disarray";
288
288
  }
289
289
  function Xs(t) {
@@ -292,28 +292,28 @@ function Xs(t) {
292
292
  function hr(t) {
293
293
  return m(t) && t?.type === "loose-decorated";
294
294
  }
295
- function Zs(t) {
295
+ function Js(t) {
296
296
  return t.attribs?.find(cr)?.params[0];
297
297
  }
298
- function Js(t) {
298
+ function Qs(t) {
299
299
  return t.attribs?.find(or)?.params[0];
300
300
  }
301
- function Qs(t) {
301
+ function tc(t) {
302
302
  return t.attribs?.find(ar)?.params[0];
303
303
  }
304
- function tc(t) {
304
+ function ec(t) {
305
305
  return Ke(t) || mr(t);
306
306
  }
307
307
  const it = /* @__PURE__ */ Symbol("UNKNOWN");
308
- var ec = class {
308
+ var nc = class {
309
309
  constructor(t, e, n) {
310
310
  this.name = t, this.lhs = e, this.operator = n;
311
311
  }
312
- }, nc = class {
312
+ }, rc = class {
313
313
  constructor(t) {
314
314
  this.matrix = t;
315
315
  }
316
- }, rc = class {
316
+ }, sc = class {
317
317
  [i] = !0;
318
318
  constructor(t) {
319
319
  this.op = t, yt(this, "consoleLog");
@@ -355,20 +355,20 @@ const dr = {
355
355
  access: "read-write"
356
356
  }
357
357
  };
358
- var Ze = class {
358
+ var Xe = class {
359
359
  constructor(t, e, n) {
360
360
  this.value = t, this.dataType = e, this.origin = n;
361
361
  }
362
362
  };
363
363
  function oe(t) {
364
- return t instanceof Ze;
364
+ return t instanceof Xe;
365
365
  }
366
- function sc(t) {
366
+ function cc(t) {
367
367
  return ur(t.dataType);
368
368
  }
369
369
  function l(t, e, n) {
370
370
  if (Ft && oe(t)) throw new Error("Cannot nest snippets");
371
- return new Ze(t, St(e), n);
371
+ return new Xe(t, St(e), n);
372
372
  }
373
373
  const ee = "Invariant failed";
374
374
  function ae(t, e) {
@@ -377,7 +377,7 @@ function ae(t, e) {
377
377
  const n = typeof e == "function" ? e() : e, r = n ? `${ee}: ${n}` : ee;
378
378
  throw new Error(r);
379
379
  }
380
- var cc = class ne extends Error {
380
+ var oc = class ne extends Error {
381
381
  constructor(e, n) {
382
382
  let r = n.map((s) => `- ${Kn(s) ? `fn*:${ut(s)}` : s}`);
383
383
  r.length > 20 && (r = [
@@ -392,7 +392,7 @@ ${r.join(`
392
392
  const n = [e, ...this.trace];
393
393
  return new ne(this.cause, n);
394
394
  }
395
- }, oc = class re extends Error {
395
+ }, ac = class re extends Error {
396
396
  constructor(e, n) {
397
397
  let r = n.map((s) => `- ${s}`);
398
398
  r.length > 20 && (r = [
@@ -407,31 +407,31 @@ ${r.join(`
407
407
  const n = [e, ...this.trace];
408
408
  return new re(this.cause, n);
409
409
  }
410
- }, ac = class Je extends Error {
410
+ }, ic = class Je extends Error {
411
411
  constructor(e) {
412
412
  super(`Missing value for '${e}'`), this.slot = e, Object.setPrototypeOf(this, Je.prototype);
413
413
  }
414
- }, ic = class Qe extends Error {
414
+ }, uc = class Qe extends Error {
415
415
  constructor(e) {
416
416
  super(`Buffer '${ut(e) ?? "<unnamed>"}' is not bindable as a uniform. Use .$usage('uniform') to allow it.`), Object.setPrototypeOf(this, Qe.prototype);
417
417
  }
418
- }, uc = class tn extends Error {
418
+ }, yc = class tn extends Error {
419
419
  constructor(e, n) {
420
420
  super(`The function '${e ?? "<unnamed>"}' is missing links to the following external values: ${n}.`), Object.setPrototypeOf(this, tn.prototype);
421
421
  }
422
- }, yc = class en extends Error {
422
+ }, fc = class en extends Error {
423
423
  constructor(e) {
424
424
  super(`Missing bind groups for layouts: '${[...e].map((n) => ut(n) ?? "<unnamed>").join(", ")}'. Please provide it using pipeline.with(bindGroup).(...)`), Object.setPrototypeOf(this, en.prototype);
425
425
  }
426
- }, fc = class nn extends Error {
426
+ }, lc = class nn extends Error {
427
427
  constructor(e) {
428
428
  super(`Missing vertex buffers for layouts: '${[...e].map((n) => ut(n) ?? "<unnamed>").join(", ")}'. Please provide it using pipeline.with(layout, buffer).(...)`), Object.setPrototypeOf(this, nn.prototype);
429
429
  }
430
- }, lc = class rn extends Error {
430
+ }, mc = class rn extends Error {
431
431
  constructor(e) {
432
432
  super(e), Object.setPrototypeOf(this, rn.prototype);
433
433
  }
434
- }, mc = class sn extends Error {
434
+ }, hc = class sn extends Error {
435
435
  constructor(e) {
436
436
  super(e), Object.setPrototypeOf(this, sn.prototype);
437
437
  }
@@ -453,17 +453,17 @@ function br(t) {
453
453
  function zr(t) {
454
454
  return t?.[Yn] !== void 0;
455
455
  }
456
- function hc(t) {
456
+ function pc(t) {
457
457
  return t?.resourceType === "accessor";
458
458
  }
459
- function pc(t) {
459
+ function xc(t) {
460
460
  return t?.resourceType === "mutable-accessor";
461
461
  }
462
462
  var ie = class {
463
463
  type = "normal";
464
- }, xc = class {
465
- type = "codegen";
466
464
  }, dc = class {
465
+ type = "codegen";
466
+ }, gc = class {
467
467
  type = "simulate";
468
468
  constructor(t, e) {
469
469
  this.buffers = t, this.vars = e;
@@ -484,14 +484,14 @@ function Tr(t) {
484
484
  function Kt(t) {
485
485
  return (typeof t.value != "string" || t.dataType === it) && an(t.value) === void 0;
486
486
  }
487
- function gc(t) {
487
+ function vc(t) {
488
488
  return typeof t == "number" || typeof t == "boolean" || typeof t == "string" || wr(t) || Ke(t) || vr(t) || br(t) || zr(t);
489
489
  }
490
- function vc(t) {
490
+ function bc(t) {
491
491
  return !!t && typeof t == "object" && "getMappedRange" in t && "mapAsync" in t;
492
492
  }
493
493
  let Ht = !1;
494
- function bc(t) {
494
+ function zc(t) {
495
495
  if (Ht) return t();
496
496
  try {
497
497
  return Ht = !0, t();
@@ -499,11 +499,11 @@ function bc(t) {
499
499
  Ht = !1;
500
500
  }
501
501
  }
502
- function zc() {
502
+ function wc() {
503
503
  return Ht;
504
504
  }
505
505
  let et;
506
- function wc(t, e) {
506
+ function Mc(t, e) {
507
507
  if (ae(et === void 0 || et === t, "Cannot nest context providers"), et === t) return e();
508
508
  et = t;
509
509
  try {
@@ -516,10 +516,10 @@ function _r() {
516
516
  return et;
517
517
  }
518
518
  const Ir = new ie();
519
- function Mc() {
519
+ function Tc() {
520
520
  return et?.mode ?? Ir;
521
521
  }
522
- function Tc() {
522
+ function _c() {
523
523
  return et?.mode.type === "codegen";
524
524
  }
525
525
  function f(t, ...e) {
@@ -535,22 +535,22 @@ function f(t, ...e) {
535
535
  }
536
536
  return s;
537
537
  }
538
- function _c(t) {
538
+ function Ic(t) {
539
539
  return Q("function", t, "read-write");
540
540
  }
541
- function Ic(t) {
541
+ function $c(t) {
542
542
  return Q("private", t, "read-write");
543
543
  }
544
- function $c(t) {
544
+ function Ec(t) {
545
545
  return Q("workgroup", t, "read-write");
546
546
  }
547
- function Ec(t, e = "read") {
547
+ function Sc(t, e = "read") {
548
548
  return Q("storage", t, e);
549
549
  }
550
- function Sc(t) {
550
+ function kc(t) {
551
551
  return Q("uniform", t, "read");
552
552
  }
553
- function kc(t) {
553
+ function Vc(t) {
554
554
  return Q("handle", t, "read");
555
555
  }
556
556
  function Q(t, e, n, r = !1) {
@@ -568,13 +568,13 @@ function $r(t, e) {
568
568
  const n = dr[t];
569
569
  if (n) return Q(n.space, e, n.access);
570
570
  }
571
- function Vc(t) {
571
+ function Oc(t) {
572
572
  return Q(t.addressSpace, t.inner, t.access, !0);
573
573
  }
574
574
  function Er(t) {
575
575
  return Q(t.addressSpace, t.inner, t.access, !1);
576
576
  }
577
- const Oc = (() => {
577
+ const Nc = (() => {
578
578
  const t = ((e) => kr(e));
579
579
  return yt(t, "ref"), t.toString = () => "ref", t[i] = !0, t[ot] = { call(e, [n]) {
580
580
  if (n.origin === "argument") throw new Qt(f`d.ref(${n}) is illegal, cannot take a reference of an argument. Copy the value locally first, and take a reference of the copy.`);
@@ -625,7 +625,7 @@ var ue = class {
625
625
  };
626
626
  function Vr(t) {
627
627
  if (!at(t.dataType)) return t;
628
- const e = t.dataType.inner, n = Xe(e) ? "runtime" : t.origin;
628
+ const e = t.dataType.inner, n = Ze(e) ? "runtime" : t.origin;
629
629
  return t.value instanceof ue ? l(f`${t.value.snippet}`, e, n) : l(f`(*${t})`, e, n);
630
630
  }
631
631
  function Or(t, e) {
@@ -656,7 +656,7 @@ const ye = {
656
656
  rank: Number.POSITIVE_INFINITY,
657
657
  action: "none"
658
658
  };
659
- function Xt(t, e) {
659
+ function Zt(t, e) {
660
660
  const n = St(t), r = St(e);
661
661
  if (n.type === r.type) return {
662
662
  rank: 0,
@@ -694,18 +694,18 @@ function Xt(t, e) {
694
694
  action: "none"
695
695
  };
696
696
  }
697
- return C(n) && C(r) && n.type[3] === r.type[3] ? Xt(n.primitive, r.primitive) : ct(n) && ct(r) && n.type[3] === r.type[3] ? {
697
+ return C(n) && C(r) && n.type[3] === r.type[3] ? Zt(n.primitive, r.primitive) : ct(n) && ct(r) && n.type[3] === r.type[3] ? {
698
698
  rank: 0,
699
699
  action: "none"
700
700
  } : ye;
701
701
  }
702
702
  function Ar(t, e) {
703
703
  const n = St(t), r = St(e);
704
- if (at(n) && n.implicit && Xt(n.inner, r).rank < Number.POSITIVE_INFINITY) return {
704
+ if (at(n) && n.implicit && Zt(n.inner, r).rank < Number.POSITIVE_INFINITY) return {
705
705
  rank: 0,
706
706
  action: "deref"
707
707
  };
708
- if (at(r) && Xt(n, r.inner).rank < Number.POSITIVE_INFINITY) return {
708
+ if (at(r) && Zt(n, r.inner).rank < Number.POSITIVE_INFINITY) return {
709
709
  rank: 1,
710
710
  action: "ref"
711
711
  };
@@ -742,7 +742,7 @@ function Ar(t, e) {
742
742
  return ye;
743
743
  }
744
744
  function Fr(t, e, n) {
745
- const r = Xt(t, e);
745
+ const r = Zt(t, e);
746
746
  return r.rank < Number.POSITIVE_INFINITY ? r : n ? Ar(t, e) : ye;
747
747
  }
748
748
  function Ue(t, e, n) {
@@ -825,7 +825,7 @@ function fn(t, e, n, r = !0) {
825
825
  if (b) return b[0];
826
826
  throw new Qt(`Cannot convert value of type '${String(a)}' to any of the target types: [${s.map((y) => y.type).join(", ")}]`);
827
827
  }
828
- function Nc(t, e, n) {
828
+ function Pc(t, e, n) {
829
829
  return Object.entries(e.propTypes).map(([r, s]) => {
830
830
  const c = n[r];
831
831
  if (!c) throw new Error(`Missing property ${r}`);
@@ -871,13 +871,13 @@ const jr = {
871
871
  name: "bool",
872
872
  signature: (t) => ({
873
873
  argTypes: t ? [t] : [],
874
- returnType: X
874
+ returnType: Z
875
875
  }),
876
876
  normalImpl(t) {
877
877
  return t === void 0 ? !1 : typeof t == "boolean" ? t : !!t;
878
878
  },
879
- codegenImpl: (t, [e]) => e?.dataType === X ? f`${e}` : f`bool(${e})`
880
- }), X = Object.assign(Br, {
879
+ codegenImpl: (t, [e]) => e?.dataType === Z ? f`${e}` : f`bool(${e})`
880
+ }), Z = Object.assign(Br, {
881
881
  [i]: {},
882
882
  type: "bool"
883
883
  }), Lr = ft({
@@ -903,16 +903,16 @@ const jr = {
903
903
  name: "i32",
904
904
  signature: (t) => ({
905
905
  argTypes: t ? [t] : [],
906
- returnType: Z
906
+ returnType: X
907
907
  }),
908
908
  normalImpl(t) {
909
909
  return t === void 0 ? 0 : typeof t == "boolean" ? t ? 1 : 0 : t | 0;
910
910
  },
911
- codegenImpl: (t, [e]) => e?.dataType === Z ? f`${e}` : f`i32(${e})`
912
- }), Pc = {
911
+ codegenImpl: (t, [e]) => e?.dataType === X ? f`${e}` : f`i32(${e})`
912
+ }), Cc = {
913
913
  [i]: {},
914
914
  type: "u16"
915
- }, Z = Object.assign(Rr, {
915
+ }, X = Object.assign(Rr, {
916
916
  [i]: {},
917
917
  type: "i32"
918
918
  }), Wr = ft({
@@ -1219,7 +1219,7 @@ var P, fe = (P = class extends Array {
1219
1219
  }
1220
1220
  }, he = class pn extends jt {
1221
1221
  get [i]() {
1222
- return { elementSchema: Z };
1222
+ return { elementSchema: X };
1223
1223
  }
1224
1224
  get kind() {
1225
1225
  return "vec2i";
@@ -1251,7 +1251,7 @@ var P, fe = (P = class extends Array {
1251
1251
  }
1252
1252
  }, xe = class dn extends jt {
1253
1253
  get [i]() {
1254
- return { elementSchema: X };
1254
+ return { elementSchema: Z };
1255
1255
  }
1256
1256
  get kind() {
1257
1257
  return "vec2<bool>";
@@ -1299,7 +1299,7 @@ var P, fe = (P = class extends Array {
1299
1299
  }
1300
1300
  }, ve = class bn extends Bt {
1301
1301
  get [i]() {
1302
- return { elementSchema: Z };
1302
+ return { elementSchema: X };
1303
1303
  }
1304
1304
  get kind() {
1305
1305
  return "vec3i";
@@ -1331,7 +1331,7 @@ var P, fe = (P = class extends Array {
1331
1331
  }
1332
1332
  }, ze = class wn extends Bt {
1333
1333
  get [i]() {
1334
- return { elementSchema: X };
1334
+ return { elementSchema: Z };
1335
1335
  }
1336
1336
  get kind() {
1337
1337
  return "vec3<bool>";
@@ -1379,7 +1379,7 @@ var P, fe = (P = class extends Array {
1379
1379
  }
1380
1380
  }, Te = class _n extends Lt {
1381
1381
  get [i]() {
1382
- return { elementSchema: Z };
1382
+ return { elementSchema: X };
1383
1383
  }
1384
1384
  get kind() {
1385
1385
  return "vec4i";
@@ -1411,7 +1411,7 @@ var P, fe = (P = class extends Array {
1411
1411
  }
1412
1412
  }, Ie = class $n extends Lt {
1413
1413
  get [i]() {
1414
- return { elementSchema: X };
1414
+ return { elementSchema: Z };
1415
1415
  }
1416
1416
  get kind() {
1417
1417
  return "vec4<bool>";
@@ -1426,7 +1426,7 @@ var P, fe = (P = class extends Array {
1426
1426
  return $n;
1427
1427
  }
1428
1428
  };
1429
- const $e = I(le, T), En = I(me, J), Sn = I(he, Z), Ut = I(pe, z), kn = I(xe, X), Rt = I(de, T), Vn = I(ge, J), On = I(ve, Z), Nn = I(be, z), Pn = I(ze, X), Ee = I(we, T), Cn = I(Me, J), An = I(Te, Z), Fn = I(_e, z), Un = I(Ie, X), Zt = {
1429
+ const $e = I(le, T), En = I(me, J), Sn = I(he, X), Ut = I(pe, z), kn = I(xe, Z), Rt = I(de, T), Vn = I(ge, J), On = I(ve, X), Nn = I(be, z), Pn = I(ze, Z), Ee = I(we, T), Cn = I(Me, J), An = I(Te, X), Fn = I(_e, z), Un = I(Ie, Z), Xt = {
1430
1430
  vec2f: $e,
1431
1431
  vec2h: En,
1432
1432
  vec2i: Sn,
@@ -1810,10 +1810,10 @@ const Se = /* @__PURE__ */ new Set([
1810
1810
  "quadSwapX",
1811
1811
  "quadSwapY"
1812
1812
  ]);
1813
- function Xr(t) {
1813
+ function Zr(t) {
1814
1814
  return t ? t.replaceAll(/\s/g, "_").replaceAll(/[^\w\d]/g, "") : "item";
1815
1815
  }
1816
- function Zr(t) {
1816
+ function Xr(t) {
1817
1817
  if (t === "_" || t.startsWith("__") || /\s/.test(t)) throw new Error(`Invalid identifier '${t}'. Choose an identifier without whitespaces or leading underscores.`);
1818
1818
  const e = t.split("_")[0];
1819
1819
  return !Se.has(e) && !jn.has(e);
@@ -1833,7 +1833,7 @@ var Bn = class {
1833
1833
  return this.#e[this.#e.length - 1]?.usedBlockScopeNames;
1834
1834
  }
1835
1835
  makeUnique(t, e) {
1836
- const n = Xr(t), r = this.getUniqueVariant(n);
1836
+ const n = Zr(t), r = this.getUniqueVariant(n);
1837
1837
  return e ? this.#t.add(r) : this.#n?.add(r), r;
1838
1838
  }
1839
1839
  #r(t) {
@@ -1841,7 +1841,7 @@ var Bn = class {
1841
1841
  return this.#e.slice(e + 1).some((n) => n.usedBlockScopeNames.has(t));
1842
1842
  }
1843
1843
  makeValid(t) {
1844
- return Zr(t) && !this.#t.has(t) && !this.#r(t) ? (this.#n?.add(t), t) : this.makeUnique(t, !1);
1844
+ return Xr(t) && !this.#t.has(t) && !this.#r(t) ? (this.#n?.add(t), t) : this.makeUnique(t, !1);
1845
1845
  }
1846
1846
  isUsed(t) {
1847
1847
  return this.#t.has(t) || this.#r(t);
@@ -1866,14 +1866,14 @@ var Bn = class {
1866
1866
  popBlockScope() {
1867
1867
  ae(this.#e[this.#e.length - 1]?.type === "blockScope", "Tried to pop block scope, but it is not present"), this.#e.pop();
1868
1868
  }
1869
- }, Cc = class extends Bn {
1869
+ }, Ac = class extends Bn {
1870
1870
  #t = 0;
1871
1871
  getUniqueVariant(t) {
1872
1872
  let e = `${t}_${this.#t++}`;
1873
1873
  for (; this.isUsed(e); ) e = `${t}_${this.#t++}`;
1874
1874
  return e;
1875
1875
  }
1876
- }, Ac = class extends Bn {
1876
+ }, Fc = class extends Bn {
1877
1877
  getUniqueVariant(t) {
1878
1878
  let e = 0, n = t;
1879
1879
  for (; this.isUsed(n); )
@@ -1884,7 +1884,7 @@ var Bn = class {
1884
1884
  function ke(t) {
1885
1885
  return Ln(t, !1);
1886
1886
  }
1887
- function Fc(t) {
1887
+ function Uc(t) {
1888
1888
  return Ln(t, !0);
1889
1889
  }
1890
1890
  function Ln(t, e) {
@@ -1907,21 +1907,21 @@ function ts(t) {
1907
1907
  return t >= 2 ** 63 || t < -9223372036854776e3 ? l(t, se, "constant") : Number.isInteger(t) ? (Number.isSafeInteger(t) || console.warn(`The integer ${t} exceeds the safe integer range and may have lost precision.`), l(t, jr, "constant")) : l(t, se, "constant");
1908
1908
  }
1909
1909
  function Ve(t) {
1910
- return t.type === "abstractFloat" ? T : t.type === "abstractInt" ? Z : t;
1910
+ return t.type === "abstractFloat" ? T : t.type === "abstractInt" ? X : t;
1911
1911
  }
1912
1912
  function es(t) {
1913
1913
  return l(t.value, Ve(t.dataType), t.origin);
1914
1914
  }
1915
- function Uc(t) {
1915
+ function jc(t) {
1916
1916
  return t.map(es);
1917
1917
  }
1918
1918
  function ns(t) {
1919
1919
  if (oe(t)) return t;
1920
1920
  if (Sr(t)) throw new Error("Cannot use refs (d.ref(...)) from the outer scope.");
1921
1921
  const e = an(t);
1922
- return e || (w(t) || L(t) ? l(t, fr(t), "constant") : typeof t == "string" || typeof t == "function" || typeof t == "object" || typeof t == "symbol" || typeof t > "u" || t === null ? l(t, it, "constant") : typeof t == "number" ? ts(t) : typeof t == "boolean" ? l(t, X, "constant") : l(t, it, "constant"));
1922
+ return e || (w(t) || L(t) ? l(t, fr(t), "constant") : typeof t == "string" || typeof t == "function" || typeof t == "object" || typeof t == "symbol" || typeof t > "u" || t === null ? l(t, it, "constant") : typeof t == "number" ? ts(t) : typeof t == "boolean" ? l(t, Z, "constant") : l(t, it, "constant"));
1923
1923
  }
1924
- var jc = class {
1924
+ var Bc = class {
1925
1925
  [i] = !0;
1926
1926
  constructor(t, e) {
1927
1927
  this.type = t, this.elements = e;
@@ -1930,7 +1930,7 @@ var jc = class {
1930
1930
  return "ArrayExpression";
1931
1931
  }
1932
1932
  [A](t) {
1933
- for (const e of this.elements) if (e.origin === "argument" && !Xe(e.dataType) || !xr(e)) {
1933
+ for (const e of this.elements) if (e.origin === "argument" && !Ze(e.dataType) || !xr(e)) {
1934
1934
  const n = t.resolve(e.value, e.dataType).value, r = t.resolve(Ve(e.dataType)).value;
1935
1935
  throw new Qt(`'${n}' reference cannot be used in an array constructor.
1936
1936
  -----
@@ -2343,7 +2343,7 @@ const us = Oe(() => Wt(1, 0, 0, 1)).$name("identity2"), ys = Oe(() => Gt(1, 0, 0
2343
2343
  columns: 4,
2344
2344
  MatImpl: is
2345
2345
  });
2346
- function Bc(t) {
2346
+ function Lc(t) {
2347
2347
  return t.kind === "mat3x3f" ? [
2348
2348
  t[0],
2349
2349
  t[1],
@@ -2980,7 +2980,7 @@ function Gn(t, e) {
2980
2980
  if (w(t) && w(e) || L(t) && L(e)) return M.add[t.kind](t, e);
2981
2981
  throw new Error("Add/Sub called with invalid arguments.");
2982
2982
  }
2983
- const Lc = U({
2983
+ const Rc = U({
2984
2984
  name: "add",
2985
2985
  signature: Rn,
2986
2986
  normalImpl: Gn,
@@ -2989,7 +2989,7 @@ const Lc = U({
2989
2989
  function Es(t, e) {
2990
2990
  return Gn(t, Dn(-1, e));
2991
2991
  }
2992
- const Rc = U({
2992
+ const Wc = U({
2993
2993
  name: "sub",
2994
2994
  signature: Rn,
2995
2995
  normalImpl: Es,
@@ -3005,7 +3005,7 @@ function Dn(t, e) {
3005
3005
  if (L(t) && L(e)) return M.mulVxV[t.kind](t, e);
3006
3006
  throw new Error("Mul called with invalid arguments.");
3007
3007
  }
3008
- const Wc = U({
3008
+ const Gc = U({
3009
3009
  name: "mul",
3010
3010
  signature: $s,
3011
3011
  normalImpl: Dn,
@@ -3014,33 +3014,33 @@ const Wc = U({
3014
3014
  function Ss(t, e) {
3015
3015
  if (typeof t == "number" && typeof e == "number") return t / e;
3016
3016
  if (typeof t == "number" && w(e)) {
3017
- const n = Zt[e.kind];
3017
+ const n = Xt[e.kind];
3018
3018
  return M.div[e.kind](n(t), e);
3019
3019
  }
3020
3020
  if (w(t) && typeof e == "number") {
3021
- const n = Zt[t.kind];
3021
+ const n = Xt[t.kind];
3022
3022
  return M.div[t.kind](t, n(e));
3023
3023
  }
3024
3024
  if (w(t) && w(e)) return M.div[t.kind](t, e);
3025
3025
  throw new Error("Div called with invalid arguments.");
3026
3026
  }
3027
- const Gc = U({
3027
+ const Dc = U({
3028
3028
  name: "div",
3029
3029
  signature: Wn,
3030
3030
  normalImpl: Ss,
3031
3031
  codegenImpl: (t, [e, n]) => f`(${e} / ${n})`,
3032
3032
  ignoreImplicitCastWarning: !0
3033
- }), Dc = U({
3033
+ }), Yc = U({
3034
3034
  name: "mod",
3035
3035
  signature: Wn,
3036
3036
  normalImpl: ((t, e) => {
3037
3037
  if (typeof t == "number" && typeof e == "number") return t % e;
3038
3038
  if (typeof t == "number" && w(e)) {
3039
- const n = Zt[e.kind];
3039
+ const n = Xt[e.kind];
3040
3040
  return M.mod[e.kind](n(t), e);
3041
3041
  }
3042
3042
  if (w(t) && typeof e == "number") {
3043
- const n = Zt[t.kind];
3043
+ const n = Xt[t.kind];
3044
3044
  return M.mod[t.kind](t, n(e));
3045
3045
  }
3046
3046
  if (w(t) && w(e)) return M.mod[t.kind](t, e);
@@ -3051,7 +3051,7 @@ const Gc = U({
3051
3051
  function ks(t) {
3052
3052
  return typeof t == "number" ? -t : M.neg[t.kind](t);
3053
3053
  }
3054
- const Yc = U({
3054
+ const qc = U({
3055
3055
  name: "neg",
3056
3056
  signature: (t) => ({
3057
3057
  argTypes: [t],
@@ -3061,7 +3061,7 @@ const Yc = U({
3061
3061
  codegenImpl: (t, [e]) => f`-(${e})`
3062
3062
  });
3063
3063
  var Vs = /* @__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))(Vs || {}), Os = /* @__PURE__ */ ((t) => (t.TOP = "TOP", t.LEFT = "LEFT", t.SELF = "SELF", t.RIGHT = "RIGHT", t.BOTTOM = "BOTTOM", t))(Os || {});
3064
- const qc = {
3064
+ const Hc = {
3065
3065
  TOP_LEFT: { x: -1, y: -1 },
3066
3066
  TOP: { x: 0, y: -1 },
3067
3067
  TOP_RIGHT: { x: 1, y: -1 },
@@ -3073,13 +3073,13 @@ const qc = {
3073
3073
  BOTTOM_RIGHT: { x: 1, y: 1 }
3074
3074
  };
3075
3075
  var Ns = /* @__PURE__ */ ((t) => (t[t.ELEMENT_ID = 0] = "ELEMENT_ID", t[t.POINT = 1] = "POINT", t))(Ns || {}), Ps = /* @__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))(Ps || {}), Cs = /* @__PURE__ */ ((t) => (t[t.ALL = 0] = "ALL", t[t.ANY = 1] = "ANY", t[t.ONE = 2] = "ONE", t[t.NONE = 3] = "NONE", t))(Cs || {});
3076
- const Hc = {
3076
+ const Kc = {
3077
3077
  all: 0,
3078
3078
  any: 1,
3079
3079
  one: 2,
3080
3080
  none: 3
3081
3081
  /* NONE */
3082
- }, Kc = (globalThis.__TYPEGPU_AUTONAME__ ?? ((t) => t))(ke({
3082
+ }, Zc = (globalThis.__TYPEGPU_AUTONAME__ ?? ((t) => t))(ke({
3083
3083
  color: z,
3084
3084
  ruleStart: z,
3085
3085
  ruleEnd: z
@@ -3090,81 +3090,81 @@ const Hc = {
3090
3090
  accept: z,
3091
3091
  conditionsStart: z,
3092
3092
  conditionsEnd: z
3093
- }), "GpuRule"), Zc = (globalThis.__TYPEGPU_AUTONAME__ ?? ((t) => t))(ke({
3093
+ }), "GpuRule"), Jc = (globalThis.__TYPEGPU_AUTONAME__ ?? ((t) => t))(ke({
3094
3094
  opcode: z,
3095
3095
  checkId: z,
3096
3096
  countOrWithId: z,
3097
3097
  checkPointOrComparePoint: Ut,
3098
3098
  withPoint: Ut,
3099
3099
  chance: T
3100
- }), "GpuCondition"), Jc = [8, 8];
3100
+ }), "GpuCondition"), As = [8, 8], Qc = As[0];
3101
3101
  export {
3102
3102
  i as $,
3103
3103
  Cs as A,
3104
- Rs as B,
3104
+ Ws as B,
3105
3105
  Os as C,
3106
- Ls as D,
3106
+ Rs as D,
3107
3107
  Xs as E,
3108
- Zs as F,
3109
- Kc as G,
3110
- Ks as H,
3108
+ Js as F,
3109
+ Zc as G,
3110
+ Zs as H,
3111
3111
  Pr as I,
3112
3112
  cr as J,
3113
3113
  or as K,
3114
3114
  Ke as L,
3115
- Js as M,
3115
+ Qs as M,
3116
3116
  St as N,
3117
3117
  Ps as O,
3118
- X as P,
3119
- Dc as Q,
3120
- Gc as R,
3118
+ Z as P,
3119
+ Yc as Q,
3120
+ Dc as R,
3121
3121
  Vs as S,
3122
3122
  Ns as T,
3123
- Wc as U,
3124
- Rc as V,
3125
- Lc as W,
3126
- tc as X,
3127
- Ys as Y,
3128
- Qs as Z,
3123
+ Gc as U,
3124
+ Wc as V,
3125
+ Rc as W,
3126
+ ec as X,
3127
+ qs as Y,
3128
+ tc as Z,
3129
3129
  Ln as _,
3130
3130
  Xc as a,
3131
3131
  G as a$,
3132
3132
  l as a0,
3133
3133
  it as a1,
3134
- ec as a2,
3134
+ nc as a2,
3135
3135
  f as a3,
3136
3136
  jr as a4,
3137
3137
  ct as a5,
3138
- nc as a6,
3138
+ rc as a6,
3139
3139
  xr as a7,
3140
- Xe as a8,
3140
+ Ze as a8,
3141
3141
  at as a9,
3142
- Bc as aA,
3142
+ Lc as aA,
3143
3143
  _ as aB,
3144
3144
  Gt as aC,
3145
3145
  Wt as aD,
3146
3146
  ar as aE,
3147
- Gs as aF,
3148
- js as aG,
3147
+ Ds as aF,
3148
+ Bs as aG,
3149
3149
  fe as aH,
3150
3150
  Ne as aI,
3151
- As as aJ,
3151
+ Fs as aJ,
3152
3152
  an as aK,
3153
3153
  De as aL,
3154
3154
  Hn as aM,
3155
3155
  Jt as aN,
3156
- gc as aO,
3156
+ vc as aO,
3157
3157
  Kn as aP,
3158
3158
  He as aQ,
3159
- uc as aR,
3159
+ yc as aR,
3160
3160
  _r as aS,
3161
3161
  U as aT,
3162
3162
  M as aU,
3163
3163
  gr as aV,
3164
3164
  je as aW,
3165
3165
  se as aX,
3166
- qs as aY,
3167
- Fc as aZ,
3166
+ Hs as aY,
3167
+ Uc as aZ,
3168
3168
  Sr as a_,
3169
3169
  Vr as aa,
3170
3170
  C as ab,
@@ -3182,20 +3182,20 @@ export {
3182
3182
  yt as an,
3183
3183
  A as ao,
3184
3184
  qn as ap,
3185
- Ws as aq,
3186
- Pc as ar,
3185
+ Gs as aq,
3186
+ Cc as ar,
3187
3187
  ke as as,
3188
- Oc as at,
3189
- $c as au,
3190
- Sc as av,
3191
- Ec as aw,
3192
- Ic as ax,
3193
- kc as ay,
3194
- _c as az,
3195
- Zc as b,
3188
+ Nc as at,
3189
+ Ec as au,
3190
+ kc as av,
3191
+ Sc as aw,
3192
+ $c as ax,
3193
+ Vc as ay,
3194
+ Ic as az,
3195
+ Jc as b,
3196
3196
  rr as b$,
3197
3197
  D as b0,
3198
- sc as b1,
3198
+ cc as b1,
3199
3199
  w as b2,
3200
3200
  ms as b3,
3201
3201
  hs as b4,
@@ -3210,69 +3210,70 @@ export {
3210
3210
  ue as bD,
3211
3211
  fn as bE,
3212
3212
  yn as bF,
3213
- rc as bG,
3214
- jc as bH,
3213
+ sc as bG,
3214
+ Bc as bH,
3215
3215
  Mr as bI,
3216
- Nc as bJ,
3217
- Hs as bK,
3216
+ Pc as bJ,
3217
+ Ks as bK,
3218
3218
  $r as bL,
3219
- Vc as bM,
3220
- Tc as bN,
3221
- Zn as bO,
3222
- Us as bP,
3219
+ Oc as bM,
3220
+ _c as bN,
3221
+ Xn as bO,
3222
+ js as bP,
3223
3223
  oe as bQ,
3224
- yc as bR,
3225
- fc as bS,
3226
- ic as bT,
3227
- oc as bU,
3228
- Uc as bV,
3224
+ fc as bR,
3225
+ lc as bS,
3226
+ uc as bT,
3227
+ ac as bU,
3228
+ jc as bV,
3229
3229
  pr as bW,
3230
- vc as bX,
3231
- Fs as bY,
3232
- Bs as bZ,
3230
+ bc as bX,
3231
+ Us as bY,
3232
+ Ls as bZ,
3233
3233
  nr as b_,
3234
- Yc as ba,
3234
+ qc as ba,
3235
3235
  fs as bb,
3236
3236
  ys as bc,
3237
3237
  us as bd,
3238
- lc as be,
3238
+ mc as be,
3239
3239
  Cr as bf,
3240
3240
  Yn as bg,
3241
- dc as bh,
3242
- wc as bi,
3243
- Ac as bj,
3244
- Cc as bk,
3245
- hc as bl,
3246
- pc as bm,
3247
- Mc as bn,
3248
- bc as bo,
3241
+ gc as bh,
3242
+ Mc as bi,
3243
+ Fc as bj,
3244
+ Ac as bk,
3245
+ pc as bl,
3246
+ xc as bm,
3247
+ Tc as bn,
3248
+ zc as bo,
3249
3249
  ae as bp,
3250
3250
  un as bq,
3251
3251
  Ve as br,
3252
- ac as bs,
3252
+ ic as bs,
3253
3253
  zr as bt,
3254
3254
  vr as bu,
3255
3255
  br as bv,
3256
3256
  ie as bw,
3257
- cc as bx,
3257
+ oc as bx,
3258
3258
  wr as by,
3259
- xc as bz,
3260
- Hc as c,
3261
- mc as c0,
3259
+ dc as bz,
3260
+ Kc as c,
3261
+ hc as c0,
3262
3262
  Fe as c1,
3263
- zc as c2,
3264
- Jc as c3,
3263
+ wc as c2,
3264
+ As as c3,
3265
+ Qc as c4,
3265
3266
  Ee as d,
3266
3267
  An as e,
3267
3268
  On as f,
3268
3269
  Sn as g,
3269
3270
  Fn as h,
3270
- Z as i,
3271
+ X as i,
3271
3272
  Nn as j,
3272
3273
  Rt as k,
3273
3274
  $e as l,
3274
3275
  T as m,
3275
- qc as n,
3276
+ Hc as n,
3276
3277
  Oe as o,
3277
3278
  ot as p,
3278
3279
  Ye as q,
@@ -3282,7 +3283,7 @@ export {
3282
3283
  z as u,
3283
3284
  Ut as v,
3284
3285
  hr as w,
3285
- Ds as x,
3286
+ Ys as x,
3286
3287
  m as y,
3287
3288
  mr as z
3288
3289
  };