@konoui/mjimage 0.0.34 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ const Ps = "MS Gothic, sans-serif", Dt = {
12
12
  S: "s",
13
13
  Z: "z",
14
14
  BACK: "_"
15
- }, S = {
15
+ }, v = {
16
16
  TSUMO: "t",
17
17
  RON: "r",
18
18
  DORA: "d",
@@ -34,7 +34,7 @@ const Ps = "MS Gothic, sans-serif", Dt = {
34
34
  IMAGE_DORA: "dora",
35
35
  IMAGE_DISCARD: "simple-discard",
36
36
  UNKNOWN: "unknown"
37
- }, v = {
37
+ }, S = {
38
38
  E: "1w",
39
39
  S: "2w",
40
40
  W: "3w",
@@ -57,10 +57,10 @@ const Ps = "MS Gothic, sans-serif", Dt = {
57
57
  N3: "4w3",
58
58
  N4: "4w4"
59
59
  }, Ln = {
60
- [v.E]: "東",
61
- [v.S]: "南",
62
- [v.W]: "西",
63
- [v.N]: "北"
60
+ [S.E]: "東",
61
+ [S.S]: "南",
62
+ [S.W]: "西",
63
+ [S.N]: "北"
64
64
  }, js = {
65
65
  [P.E1]: "東1局",
66
66
  [P.E2]: "東2局",
@@ -149,7 +149,7 @@ class tr {
149
149
  }
150
150
  const Re = (s, t) => {
151
151
  if (s.t == t.t)
152
- return s.n == 0 ? 5 - t.n : t.n == 0 ? s.n - 5 : s.n - t.n;
152
+ return K(s) ? 5 - t.n : K(t) ? s.n - 5 : s.n - t.n;
153
153
  const e = {
154
154
  [d.M]: 1,
155
155
  [d.P]: 2,
@@ -170,7 +170,7 @@ class g {
170
170
  this.t = t, this.n = e, this.ops = n;
171
171
  }
172
172
  static from(t) {
173
- const e = new et(t).tiles();
173
+ const e = new nt(t).tiles();
174
174
  if (e.length != 1) throw new Error(`input is not a single tile ${t}`);
175
175
  return e[0];
176
176
  }
@@ -195,17 +195,17 @@ class g {
195
195
  return e && (n || (n = $e(this) && $e(t))), this.t == t.t && n;
196
196
  }
197
197
  imageSize(t) {
198
- const e = parseFloat((Dt.HEIGHT * t).toPrecision(5)), n = parseFloat((Dt.WIDTH * t).toPrecision(5)), i = this.has(S.HORIZONTAL) ? { width: e, height: n, baseWidth: n, baseHeight: e } : { width: n, height: e, w: n, baseWidth: n, baseHeight: e };
199
- return (this.has(S.TSUMO) || this.has(S.DORA)) && (i.width += n * Dt.TEXT_SCALE), i;
198
+ const e = parseFloat((Dt.HEIGHT * t).toPrecision(5)), n = parseFloat((Dt.WIDTH * t).toPrecision(5)), i = this.has(v.HORIZONTAL) ? { width: e, height: n, baseWidth: n, baseHeight: e } : { width: n, height: e, w: n, baseWidth: n, baseHeight: e };
199
+ return (this.has(v.TSUMO) || this.has(v.DORA)) && (i.width += n * Dt.TEXT_SCALE), i;
200
200
  }
201
201
  }
202
202
  function $e(s) {
203
- return it(s) || tt(s);
203
+ return K(s) || et(s);
204
204
  }
205
- function tt(s) {
205
+ function et(s) {
206
206
  return s.isNum() && s.n == 5;
207
207
  }
208
- function it(s) {
208
+ function K(s) {
209
209
  return s.isNum() && s.n == 0;
210
210
  }
211
211
  class z {
@@ -213,14 +213,14 @@ class z {
213
213
  b(this, "_tiles");
214
214
  b(this, "_type");
215
215
  if (this._tiles = t, this._type = e, this._type == _.CHI) {
216
- this._tiles = [...this._tiles].sort((n, i) => n.has(S.HORIZONTAL) ? -1 : i.has(S.HORIZONTAL) ? 1 : Re(n, i));
216
+ this._tiles = [...this._tiles].sort((n, i) => n.has(v.HORIZONTAL) ? -1 : i.has(v.HORIZONTAL) ? 1 : Re(n, i));
217
217
  return;
218
218
  }
219
219
  this._type != _.SHO_KAN && this._type != _.IMAGE_DISCARD && (this._tiles = [...this._tiles].sort(Re));
220
220
  }
221
221
  // deserialize json object. it validates the input type by comparing to parsed block type.
222
222
  static deserialize(t) {
223
- const e = new et(t.tiles).parse();
223
+ const e = new nt(t.tiles).parse();
224
224
  if (e.length != 1) throw new Error(`block must be 1: ${t.tiles}`);
225
225
  const n = e[0].type;
226
226
  if (!(t.type == _.PAIR || t.type == _.ISOLATED || t.type == _.THREE || t.type == _.RUN) && n != t.type)
@@ -311,7 +311,7 @@ class gt extends z {
311
311
  return zt(this.tiles);
312
312
  }
313
313
  }
314
- class F extends z {
314
+ class q extends z {
315
315
  constructor(t) {
316
316
  const e = t.filter((i) => i.t != d.BACK), n = e[0];
317
317
  if (e.length < t.length) {
@@ -363,7 +363,7 @@ class ht extends z {
363
363
  return zt(this.tiles);
364
364
  }
365
365
  }
366
- class X extends z {
366
+ class J extends z {
367
367
  constructor(t, e) {
368
368
  super([t, e], _.PAIR);
369
369
  }
@@ -424,7 +424,7 @@ const He = (s, t) => {
424
424
  case _.PON:
425
425
  return new gt([s[0], s[1], s[2]]);
426
426
  case _.AN_KAN:
427
- return new F(s);
427
+ return new q(s);
428
428
  case _.DAI_KAN:
429
429
  return new mt(s);
430
430
  case _.SHO_KAN:
@@ -434,7 +434,7 @@ const He = (s, t) => {
434
434
  case _.RUN:
435
435
  return new Nt(s);
436
436
  case _.PAIR:
437
- return new X(s[0], s[1]);
437
+ return new J(s[0], s[1]);
438
438
  case _.ISOLATED:
439
439
  return new Ls(s[0]);
440
440
  case _.HAND:
@@ -443,7 +443,7 @@ const He = (s, t) => {
443
443
  return new Ks(s, t);
444
444
  }
445
445
  };
446
- class et {
446
+ class nt {
447
447
  constructor(t) {
448
448
  b(this, "maxInputLength", 600);
449
449
  this.input = t, this.input = t.replace(/\s/g, "");
@@ -512,7 +512,9 @@ class et {
512
512
  if (t.length == 0) return;
513
513
  if (t.length > this.maxInputLength)
514
514
  throw new Error(`exceeded maximum input length(${t.length})`);
515
- const e = t.charAt(t.length - 1), [n, i] = ws(e, [new g(d.BACK, 1)]);
515
+ const e = t.charAt(t.length - 1), [n, i] = ws(e, [
516
+ new g(d.BACK, 1)
517
+ ]);
516
518
  if (!i)
517
519
  throw new Error(`last character(${e}) is not type value`);
518
520
  }
@@ -520,11 +522,11 @@ class et {
520
522
  function ys(s) {
521
523
  if (s.length === 0) return _.UNKNOWN;
522
524
  if (s.length === 1)
523
- return s[0].has(S.DORA) ? _.IMAGE_DORA : s[0].has(S.TSUMO) ? _.TSUMO : _.HAND;
525
+ return s[0].has(v.DORA) ? _.IMAGE_DORA : s[0].has(v.TSUMO) ? _.TSUMO : _.HAND;
524
526
  const t = s.every((r) => r.equals(s[0], !0)), e = s.filter(
525
- (r) => r.has(S.HORIZONTAL)
527
+ (r) => r.has(v.HORIZONTAL)
526
528
  ).length, n = s.filter(
527
- (r) => r.has(S.TSUMO) || r.has(S.DORA)
529
+ (r) => r.has(v.TSUMO) || r.has(v.DORA)
528
530
  ).length, i = s.filter((r) => r.t == d.BACK).length;
529
531
  if (n > 0) return _.UNKNOWN;
530
532
  if (e == 0 && i == 0) return _.HAND;
@@ -538,12 +540,11 @@ function ys(s) {
538
540
  return e == 1 ? _.IMAGE_DISCARD : _.UNKNOWN;
539
541
  }
540
542
  function nr(s) {
541
- s = [...s].sort(Re);
542
- for (let t = 0; t < s.length - 1; t++) {
543
- let e = s[t].n, n = s[t + 1].n;
544
- const i = s[t].t, r = s[t + 1].t;
545
- if (e == 0 && (e = 5), n == 0 && (n = 5), i !== r || e + 1 !== n) return !1;
546
- }
543
+ const t = [...s].sort(Re);
544
+ if (!t.every((n) => t[0].t == n.t)) return !1;
545
+ const e = t.map((n) => K(n) ? 5 : n.n);
546
+ for (let n = 0; n < e.length - 1; n++)
547
+ if (e[n] != e[n + 1] - 1) return !1;
547
548
  return !0;
548
549
  }
549
550
  function sr(s, t) {
@@ -566,7 +567,7 @@ function Us(s) {
566
567
  return [Number(s), t.includes(s)];
567
568
  }
568
569
  function ir(s) {
569
- const t = Object.values(S);
570
+ const t = Object.values(v);
570
571
  if (!t.includes(s.char)) return [new g(d.BACK, 0), !1];
571
572
  const e = [];
572
573
  for (let n = 0; n < 4; n++) {
@@ -581,6 +582,17 @@ function ir(s) {
581
582
  }
582
583
  return [new g(d.BACK, 0), !1];
583
584
  }
585
+ function Z(s, t = !1) {
586
+ const e = {
587
+ [S.E]: s,
588
+ [S.S]: s,
589
+ [S.W]: s,
590
+ [S.N]: s
591
+ };
592
+ if (t)
593
+ for (let n of Object.values(S)) e[n] = structuredClone(s);
594
+ return e;
595
+ }
584
596
  const De = (s) => {
585
597
  let t = s.substring(0, 2), e = Number(s.substring(2, 3));
586
598
  return e == 4 ? (e = 1, t = Ct(t)) : e++, `${t}${e}`;
@@ -604,7 +616,7 @@ function T(s, t) {
604
616
  }
605
617
  qs(Object.getOwnPropertyNames(t)), _n[s] = Object.assign(_n[s] || {}, t);
606
618
  }
607
- function G(s) {
619
+ function Y(s) {
608
620
  return _n[s] || {};
609
621
  }
610
622
  function or() {
@@ -681,7 +693,7 @@ const Rt = {}, Gn = "___SYMBOL___ROOT___";
681
693
  function de(s, t = qn) {
682
694
  return E.document.createElementNS(t, s);
683
695
  }
684
- function Z(s, t = !1) {
696
+ function G(s, t = !1) {
685
697
  if (s instanceof Zn) return s;
686
698
  if (typeof s == "object")
687
699
  return cn(s);
@@ -695,7 +707,7 @@ function Z(s, t = !1) {
695
707
  function $(s, t) {
696
708
  return t && (t instanceof E.window.Node || t.ownerDocument && t instanceof t.ownerDocument.defaultView.Node) ? t : de(s);
697
709
  }
698
- function nt(s) {
710
+ function st(s) {
699
711
  if (!s) return null;
700
712
  if (s.instance instanceof Zn) return s.instance;
701
713
  if (s.nodeName === "#document-fragment")
@@ -703,7 +715,7 @@ function nt(s) {
703
715
  let t = Zs(s.nodeName || "Dom");
704
716
  return t === "LinearGradient" || t === "RadialGradient" ? t = "Gradient" : Rt[t] || (t = "Dom"), new Rt[t](s);
705
717
  }
706
- let cn = nt;
718
+ let cn = st;
707
719
  function N(s, t = s.name, e = !1) {
708
720
  return Rt[t] = s, e && (Rt[Gn] = s), qs(Object.getOwnPropertyNames(s.prototype)), s;
709
721
  }
@@ -719,7 +731,7 @@ function Xs(s) {
719
731
  Xs(s.children[t]);
720
732
  return s.id && (s.id = Ys(s.nodeName)), s;
721
733
  }
722
- function I(s, t) {
734
+ function O(s, t) {
723
735
  let e, n;
724
736
  for (s = Array.isArray(s) ? s : [s], n = s.length - 1; n >= 0; n--)
725
737
  for (e in t)
@@ -758,20 +770,20 @@ function Sr() {
758
770
  return this.parent().add(this.remove(), 0), this;
759
771
  }
760
772
  function vr(s) {
761
- s = Z(s), s.remove();
773
+ s = G(s), s.remove();
762
774
  const t = this.position();
763
775
  return this.parent().add(s, t), this;
764
776
  }
765
777
  function xr(s) {
766
- s = Z(s), s.remove();
778
+ s = G(s), s.remove();
767
779
  const t = this.position();
768
780
  return this.parent().add(s, t + 1), this;
769
781
  }
770
782
  function Ar(s) {
771
- return s = Z(s), s.before(this), this;
783
+ return s = G(s), s.before(this), this;
772
784
  }
773
785
  function kr(s) {
774
- return s = Z(s), s.after(this), this;
786
+ return s = G(s), s.after(this), this;
775
787
  }
776
788
  T("Dom", {
777
789
  siblings: pr,
@@ -787,7 +799,7 @@ T("Dom", {
787
799
  insertBefore: Ar,
788
800
  insertAfter: kr
789
801
  });
790
- const Js = /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i, Tr = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, Or = /rgb\((\d+),(\d+),(\d+)\)/, Ir = /(#[a-z_][a-z0-9\-_]*)/i, Er = /\)\s*,?\s*/, Nr = /\s/g, _s = /^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i, bs = /^rgb\(/, Ss = /^(\s+)?$/, vs = /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Mr = /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i, yt = /[\s,]+/, Yn = /[MLHVCSQTAZ]/i;
802
+ const Js = /^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i, Tr = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, Ir = /rgb\((\d+),(\d+),(\d+)\)/, Or = /(#[a-z_][a-z0-9\-_]*)/i, Er = /\)\s*,?\s*/, Nr = /\s/g, _s = /^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i, bs = /^rgb\(/, Ss = /^(\s+)?$/, vs = /^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Mr = /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i, yt = /[\s,]+/, Yn = /[MLHVCSQTAZ]/i;
791
803
  function Dr() {
792
804
  const s = this.attr("class");
793
805
  return s == null ? [] : s.trim().split(yt);
@@ -1023,7 +1035,7 @@ class D {
1023
1035
  Object.assign(this, u);
1024
1036
  } else if (typeof t == "string")
1025
1037
  if (bs.test(t)) {
1026
- const u = t.replace(Nr, ""), [f, m, p] = Or.exec(u).slice(1, 4).map((y) => parseInt(y));
1038
+ const u = t.replace(Nr, ""), [f, m, p] = Ir.exec(u).slice(1, 4).map((y) => parseInt(y));
1027
1039
  Object.assign(this, { _a: f, _b: m, _c: p, _d: 0, space: "rgb" });
1028
1040
  } else if (_s.test(t)) {
1029
1041
  const u = (y) => parseInt(y, 16), [, f, m, p] = Tr.exec(Fr(t)).map(u);
@@ -1055,8 +1067,8 @@ class D {
1055
1067
  const { c: rt, h: ft } = this, Pt = Math.PI / 180;
1056
1068
  p = rt * Math.cos(Pt * ft), y = rt * Math.sin(Pt * ft);
1057
1069
  }
1058
- const w = (m + 16) / 116, A = p / 500 + w, O = w - y / 200, H = 16 / 116, Q = 8856e-6, L = 7.787;
1059
- t = 0.95047 * (A ** 3 > Q ? A ** 3 : (A - H) / L), e = 1 * (w ** 3 > Q ? w ** 3 : (w - H) / L), n = 1.08883 * (O ** 3 > Q ? O ** 3 : (O - H) / L);
1070
+ const w = (m + 16) / 116, A = p / 500 + w, I = w - y / 200, H = 16 / 116, tt = 8856e-6, L = 7.787;
1071
+ t = 0.95047 * (A ** 3 > tt ? A ** 3 : (A - H) / L), e = 1 * (w ** 3 > tt ? w ** 3 : (w - H) / L), n = 1.08883 * (I ** 3 > tt ? I ** 3 : (I - H) / L);
1060
1072
  }
1061
1073
  const i = t * 3.2406 + e * -1.5372 + n * -0.4986, r = t * -0.9689 + e * 1.8758 + n * 0.0415, o = t * 0.0557 + e * -0.204 + n * 1.057, a = Math.pow, c = 31308e-7, h = i > c ? 1.055 * a(i, 1 / 2.4) - 0.055 : 12.92 * i, l = r > c ? 1.055 * a(r, 1 / 2.4) - 0.055 : 12.92 * r, u = o > c ? 1.055 * a(o, 1 / 2.4) - 0.055 : 12.92 * o;
1062
1074
  return new D(255 * h, 255 * l, 255 * u);
@@ -1148,10 +1160,10 @@ class x {
1148
1160
  ), y = p.x, w = p.y, A = new W(
1149
1161
  t.translate || t.tx || t.translateX,
1150
1162
  t.ty || t.translateY
1151
- ), O = A.x, H = A.y, Q = new W(
1163
+ ), I = A.x, H = A.y, tt = new W(
1152
1164
  t.relative || t.rx || t.relativeX,
1153
1165
  t.ry || t.relativeY
1154
- ), L = Q.x, rt = Q.y;
1166
+ ), L = tt.x, rt = tt.y;
1155
1167
  return {
1156
1168
  scaleX: a,
1157
1169
  scaleY: c,
@@ -1161,7 +1173,7 @@ class x {
1161
1173
  theta: l,
1162
1174
  rx: L,
1163
1175
  ry: rt,
1164
- tx: O,
1176
+ tx: I,
1165
1177
  ty: H,
1166
1178
  ox: f,
1167
1179
  oy: m,
@@ -1194,14 +1206,14 @@ class x {
1194
1206
  }
1195
1207
  // Decomposes this matrix into its affine parameters
1196
1208
  decompose(t = 0, e = 0) {
1197
- const n = this.a, i = this.b, r = this.c, o = this.d, a = this.e, c = this.f, h = n * o - i * r, l = h > 0 ? 1 : -1, u = l * Math.sqrt(n * n + i * i), f = Math.atan2(l * i, l * n), m = 180 / Math.PI * f, p = Math.cos(f), y = Math.sin(f), w = (n * r + i * o) / h, A = r * u / (w * n - i) || o * u / (w * i + n), O = a - t + t * p * u + e * (w * p * u - y * A), H = c - e + t * y * u + e * (w * y * u + p * A);
1209
+ const n = this.a, i = this.b, r = this.c, o = this.d, a = this.e, c = this.f, h = n * o - i * r, l = h > 0 ? 1 : -1, u = l * Math.sqrt(n * n + i * i), f = Math.atan2(l * i, l * n), m = 180 / Math.PI * f, p = Math.cos(f), y = Math.sin(f), w = (n * r + i * o) / h, A = r * u / (w * n - i) || o * u / (w * i + n), I = a - t + t * p * u + e * (w * p * u - y * A), H = c - e + t * y * u + e * (w * y * u + p * A);
1198
1210
  return {
1199
1211
  // Return the affine parameters
1200
1212
  scaleX: u,
1201
1213
  scaleY: A,
1202
1214
  shear: w,
1203
1215
  rotate: m,
1204
- translateX: O,
1216
+ translateX: I,
1205
1217
  translateY: H,
1206
1218
  originX: t,
1207
1219
  originY: e,
@@ -1356,7 +1368,7 @@ function Jr() {
1356
1368
  N(x, "Matrix");
1357
1369
  function _t() {
1358
1370
  if (!_t.nodes) {
1359
- const s = Z().size(2, 0);
1371
+ const s = G().size(2, 0);
1360
1372
  s.node.style.cssText = [
1361
1373
  "opacity: 0",
1362
1374
  "position: absolute",
@@ -1491,7 +1503,7 @@ class $t extends Array {
1491
1503
  this.length = 0, this.push(...t);
1492
1504
  }
1493
1505
  }
1494
- I([$t], {
1506
+ O([$t], {
1495
1507
  each(s, ...t) {
1496
1508
  return typeof s == "function" ? this.map((e, n, i) => s.call(e, e, n, i)) : this.map((e) => e[s](...t));
1497
1509
  },
@@ -1503,12 +1515,12 @@ const no = ["toArray", "constructor", "each"];
1503
1515
  $t.extend = function(s) {
1504
1516
  s = s.reduce((t, e) => (no.includes(e) || e[0] === "_" || (e in Array.prototype && (t["$" + e] = Array.prototype[e]), t[e] = function(...n) {
1505
1517
  return this.each(e, ...n);
1506
- }), t), {}), I([$t], s);
1518
+ }), t), {}), O([$t], s);
1507
1519
  };
1508
1520
  function oe(s, t) {
1509
1521
  return new $t(
1510
1522
  Fn((t || E.document).querySelectorAll(s), function(e) {
1511
- return nt(e);
1523
+ return st(e);
1512
1524
  })
1513
1525
  );
1514
1526
  }
@@ -1516,7 +1528,7 @@ function so(s) {
1516
1528
  return oe(s, this.node);
1517
1529
  }
1518
1530
  function io(s) {
1519
- return nt(this.node.querySelector(s));
1531
+ return st(this.node.querySelector(s));
1520
1532
  }
1521
1533
  let ro = 0;
1522
1534
  const ti = {};
@@ -1532,14 +1544,14 @@ function oo(s) {
1532
1544
  t === E.window && (t = ti), t.events && (t.events = {});
1533
1545
  }
1534
1546
  function vn(s, t, e, n, i) {
1535
- const r = e.bind(n || s), o = Z(s), a = ei(o), c = Xn(o);
1547
+ const r = e.bind(n || s), o = G(s), a = ei(o), c = Xn(o);
1536
1548
  t = Array.isArray(t) ? t : t.split(yt), e._svgjsListenerId || (e._svgjsListenerId = ++ro), t.forEach(function(h) {
1537
1549
  const l = h.split(".")[0], u = h.split(".")[1] || "*";
1538
1550
  a[l] = a[l] || {}, a[l][u] = a[l][u] || {}, a[l][u][e._svgjsListenerId] = r, c.addEventListener(l, r, i || !1);
1539
1551
  });
1540
1552
  }
1541
1553
  function Ft(s, t, e, n) {
1542
- const i = Z(s), r = ei(i), o = Xn(i);
1554
+ const i = G(s), r = ei(i), o = Xn(i);
1543
1555
  typeof e == "function" && (e = e._svgjsListenerId, !e) || (t = Array.isArray(t) ? t : (t || "").split(yt), t.forEach(function(a) {
1544
1556
  const c = a && a.split(".")[0], h = a && a.split(".")[1];
1545
1557
  let l, u;
@@ -1760,17 +1772,17 @@ class St extends we {
1760
1772
  }
1761
1773
  // Add given element at a position
1762
1774
  add(t, e) {
1763
- return t = Z(t), t.removeNamespace && this.node instanceof E.window.SVGElement && t.removeNamespace(), e == null ? this.node.appendChild(t.node) : t.node !== this.node.childNodes[e] && this.node.insertBefore(t.node, this.node.childNodes[e]), this;
1775
+ return t = G(t), t.removeNamespace && this.node instanceof E.window.SVGElement && t.removeNamespace(), e == null ? this.node.appendChild(t.node) : t.node !== this.node.childNodes[e] && this.node.insertBefore(t.node, this.node.childNodes[e]), this;
1764
1776
  }
1765
1777
  // Add element to given container and return self
1766
1778
  addTo(t, e) {
1767
- return Z(t).put(this, e);
1779
+ return G(t).put(this, e);
1768
1780
  }
1769
1781
  // Returns all child elements
1770
1782
  children() {
1771
1783
  return new $t(
1772
1784
  Fn(this.node.children, function(t) {
1773
- return nt(t);
1785
+ return st(t);
1774
1786
  })
1775
1787
  );
1776
1788
  }
@@ -1799,11 +1811,11 @@ class St extends we {
1799
1811
  }
1800
1812
  // Get first child
1801
1813
  first() {
1802
- return nt(this.node.firstChild);
1814
+ return st(this.node.firstChild);
1803
1815
  }
1804
1816
  // Get a element at the given index
1805
1817
  get(t) {
1806
- return nt(this.node.childNodes[t]);
1818
+ return st(this.node.childNodes[t]);
1807
1819
  }
1808
1820
  getEventHolder() {
1809
1821
  return this.node;
@@ -1828,7 +1840,7 @@ class St extends we {
1828
1840
  }
1829
1841
  // Get the last child
1830
1842
  last() {
1831
- return nt(this.node.lastChild);
1843
+ return st(this.node.lastChild);
1832
1844
  }
1833
1845
  // matches the element vs a css selector
1834
1846
  matches(t) {
@@ -1839,20 +1851,20 @@ class St extends we {
1839
1851
  parent(t) {
1840
1852
  let e = this;
1841
1853
  if (!e.node.parentNode) return null;
1842
- if (e = nt(e.node.parentNode), !t) return e;
1854
+ if (e = st(e.node.parentNode), !t) return e;
1843
1855
  do
1844
1856
  if (typeof t == "string" ? e.matches(t) : e instanceof t)
1845
1857
  return e;
1846
- while (e = nt(e.node.parentNode));
1858
+ while (e = st(e.node.parentNode));
1847
1859
  return e;
1848
1860
  }
1849
1861
  // Basically does the same as `add()` but returns the added element instead
1850
1862
  put(t, e) {
1851
- return t = Z(t), this.add(t, e), t;
1863
+ return t = G(t), this.add(t, e), t;
1852
1864
  }
1853
1865
  // Add element to given container and return container
1854
1866
  putIn(t, e) {
1855
- return Z(t).add(this, e);
1867
+ return G(t).add(this, e);
1856
1868
  }
1857
1869
  // Remove element
1858
1870
  remove() {
@@ -1864,7 +1876,7 @@ class St extends we {
1864
1876
  }
1865
1877
  // Replace this with element
1866
1878
  replace(t) {
1867
- return t = Z(t), this.node.parentNode && this.node.parentNode.replaceChild(t.node, this.node), t;
1879
+ return t = G(t), this.node.parentNode && this.node.parentNode.replaceChild(t.node, this.node), t;
1868
1880
  }
1869
1881
  round(t = 2, e = null) {
1870
1882
  const n = 10 ** t, i = this.attr(e);
@@ -1902,7 +1914,7 @@ class St extends we {
1902
1914
  e = e ?? !0, this.writeDataToDom();
1903
1915
  let a = this;
1904
1916
  if (t != null) {
1905
- if (a = nt(a.node.cloneNode(!0)), e) {
1917
+ if (a = st(a.node.cloneNode(!0)), e) {
1906
1918
  const c = t(a);
1907
1919
  if (a = c || a, c === !1) return "";
1908
1920
  }
@@ -1922,7 +1934,7 @@ class St extends we {
1922
1934
  return e ? this.replace(r) && o : this.add(r);
1923
1935
  }
1924
1936
  }
1925
- I(St, { attr: uo, find: so, findOne: io });
1937
+ O(St, { attr: uo, find: so, findOne: io });
1926
1938
  N(St, "Dom");
1927
1939
  class ut extends St {
1928
1940
  constructor(t, e) {
@@ -1973,7 +1985,7 @@ class ut extends St {
1973
1985
  // return array of all ancestors of given type up to the root svg
1974
1986
  parents(t = this.root()) {
1975
1987
  const e = typeof t == "string";
1976
- e || (t = Z(t));
1988
+ e || (t = G(t));
1977
1989
  const n = new $t();
1978
1990
  let i = this;
1979
1991
  for (; (i = i.parent()) && i.node !== E.document && i.nodeName !== "#document-fragment" && (n.push(i), !(!e && i.node === t.node || e && i.matches(t))); )
@@ -1984,8 +1996,8 @@ class ut extends St {
1984
1996
  // Get referenced element form attribute value
1985
1997
  reference(t) {
1986
1998
  if (t = this.attr(t), !t) return null;
1987
- const e = (t + "").match(Ir);
1988
- return e ? Z(e[1]) : null;
1999
+ const e = (t + "").match(Or);
2000
+ return e ? G(e[1]) : null;
1989
2001
  }
1990
2002
  // Get parent document
1991
2003
  root() {
@@ -2018,7 +2030,7 @@ class ut extends St {
2018
2030
  return this.attr("y", t);
2019
2031
  }
2020
2032
  }
2021
- I(ut, {
2033
+ O(ut, {
2022
2034
  bbox: Qr,
2023
2035
  rbox: to,
2024
2036
  inside: eo,
@@ -2190,10 +2202,10 @@ T("Element", {
2190
2202
  toRoot: yo,
2191
2203
  transform: wo
2192
2204
  });
2193
- class Y extends ut {
2205
+ class X extends ut {
2194
2206
  flatten() {
2195
2207
  return this.each(function() {
2196
- if (this instanceof Y)
2208
+ if (this instanceof X)
2197
2209
  return this.flatten().ungroup();
2198
2210
  }), this;
2199
2211
  }
@@ -2203,8 +2215,8 @@ class Y extends ut {
2203
2215
  }), this.remove();
2204
2216
  }
2205
2217
  }
2206
- N(Y, "Container");
2207
- class Jn extends Y {
2218
+ N(X, "Container");
2219
+ class Jn extends X {
2208
2220
  constructor(t, e = t) {
2209
2221
  super($("defs", t), e);
2210
2222
  }
@@ -2216,9 +2228,9 @@ class Jn extends Y {
2216
2228
  }
2217
2229
  }
2218
2230
  N(Jn, "Defs");
2219
- class V extends ut {
2231
+ class Q extends ut {
2220
2232
  }
2221
- N(V, "Shape");
2233
+ N(Q, "Shape");
2222
2234
  function Vn(s) {
2223
2235
  return this.attr("rx", s);
2224
2236
  }
@@ -2254,7 +2266,7 @@ const _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2254
2266
  x: si,
2255
2267
  y: ii
2256
2268
  }, Symbol.toStringTag, { value: "Module" }));
2257
- class Xe extends V {
2269
+ class Xe extends Q {
2258
2270
  constructor(t, e = t) {
2259
2271
  super($("ellipse", t), e);
2260
2272
  }
@@ -2265,7 +2277,7 @@ class Xe extends V {
2265
2277
  );
2266
2278
  }
2267
2279
  }
2268
- I(Xe, _o);
2280
+ O(Xe, _o);
2269
2281
  T("Container", {
2270
2282
  // Create an ellipse
2271
2283
  ellipse: R(function(s = 0, t = s) {
@@ -2298,7 +2310,7 @@ const bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2298
2310
  from: li,
2299
2311
  to: ui
2300
2312
  }, Symbol.toStringTag, { value: "Module" }));
2301
- class _e extends Y {
2313
+ class _e extends X {
2302
2314
  constructor(t, e) {
2303
2315
  super(
2304
2316
  $(t + "Gradient", typeof t == "string" ? null : t),
@@ -2328,7 +2340,7 @@ class _e extends Y {
2328
2340
  return "url(#" + this.id() + ")";
2329
2341
  }
2330
2342
  }
2331
- I(_e, bo);
2343
+ O(_e, bo);
2332
2344
  T({
2333
2345
  Container: {
2334
2346
  // Create gradient element in defs
@@ -2344,7 +2356,7 @@ T({
2344
2356
  }
2345
2357
  });
2346
2358
  N(_e, "Gradient");
2347
- class pe extends Y {
2359
+ class pe extends X {
2348
2360
  // Initialize node
2349
2361
  constructor(t, e = t) {
2350
2362
  super($("pattern", t), e);
@@ -2392,7 +2404,7 @@ T({
2392
2404
  }
2393
2405
  });
2394
2406
  N(pe, "Pattern");
2395
- class be extends V {
2407
+ class be extends Q {
2396
2408
  constructor(t, e = t) {
2397
2409
  super($("image", t), e);
2398
2410
  }
@@ -2511,7 +2523,7 @@ const ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2511
2523
  x: vo,
2512
2524
  y: xo
2513
2525
  }, Symbol.toStringTag, { value: "Module" }));
2514
- class me extends V {
2526
+ class me extends Q {
2515
2527
  // Initialize node
2516
2528
  constructor(t, e = t) {
2517
2529
  super($("line", t), e);
@@ -2537,7 +2549,7 @@ class me extends V {
2537
2549
  return this.attr(this.array().size(n.width, n.height).toLine());
2538
2550
  }
2539
2551
  }
2540
- I(me, ts);
2552
+ O(me, ts);
2541
2553
  T({
2542
2554
  Container: {
2543
2555
  // Create a line element
@@ -2550,7 +2562,7 @@ T({
2550
2562
  }
2551
2563
  });
2552
2564
  N(me, "Line");
2553
- class We extends Y {
2565
+ class We extends X {
2554
2566
  // Initialize node
2555
2567
  constructor(t, e = t) {
2556
2568
  super($("marker", t), e);
@@ -2662,7 +2674,7 @@ function As() {
2662
2674
  const s = (this._duration || 500) / 1e3, t = this._overshoot || 0, e = 1e-10, n = Math.PI, i = Math.log(t / 100 + e), r = -i / Math.sqrt(n * n + i * i), o = 3.9 / (r * s);
2663
2675
  this.d = 2 * r * o, this.k = o * o;
2664
2676
  }
2665
- class Oo extends Be {
2677
+ class Io extends Be {
2666
2678
  constructor(t = 500, e = 0) {
2667
2679
  super(), this.duration(t).overshoot(e);
2668
2680
  }
@@ -2675,11 +2687,11 @@ class Oo extends Be {
2675
2687
  return i.velocity = r + o * n, i.done = Math.abs(e - a) + Math.abs(r) < 2e-3, i.done ? e : a;
2676
2688
  }
2677
2689
  }
2678
- I(Oo, {
2690
+ O(Io, {
2679
2691
  duration: qt("_duration", As),
2680
2692
  overshoot: qt("_overshoot", As)
2681
2693
  });
2682
- class Io extends Be {
2694
+ class Oo extends Be {
2683
2695
  constructor(t = 0.1, e = 0.01, n = 0, i = 1e3) {
2684
2696
  super(), this.p(t).i(e).d(n).windup(i);
2685
2697
  }
@@ -2693,7 +2705,7 @@ class Io extends Be {
2693
2705
  return c !== !1 && (o = Math.max(-c, Math.min(o, c))), i.error = r, i.integral = o, i.done = Math.abs(r) < 1e-3, i.done ? e : t + (this.P * r + this.I * o + this.D * a);
2694
2706
  }
2695
2707
  }
2696
- I(Io, {
2708
+ O(Oo, {
2697
2709
  windup: qt("_windup"),
2698
2710
  p: qt("P"),
2699
2711
  i: qt("I"),
@@ -2763,7 +2775,7 @@ function kn(s) {
2763
2775
  return s.segment.length && s.segment.length - 1 === Eo[s.segment[0].toUpperCase()];
2764
2776
  }
2765
2777
  function Mo(s, t) {
2766
- s.inNumber && Ot(s, !1);
2778
+ s.inNumber && It(s, !1);
2767
2779
  const e = Yn.test(t);
2768
2780
  if (e)
2769
2781
  s.segment = [t];
@@ -2773,7 +2785,7 @@ function Mo(s, t) {
2773
2785
  }
2774
2786
  return s.inSegment = !0, s.lastCommand = s.segment[0], e;
2775
2787
  }
2776
- function Ot(s, t) {
2788
+ function It(s, t) {
2777
2789
  if (!s.inNumber) throw new Error("Parser Error");
2778
2790
  s.number && s.segment.push(parseFloat(s.number)), s.inNumber = t, s.number = "", s.pointSeen = !1, s.hasExponent = !1, kn(s) && Tn(s);
2779
2791
  }
@@ -2809,7 +2821,7 @@ function $o(s, t = !0) {
2809
2821
  if (!(!i.inSegment && Mo(i, n))) {
2810
2822
  if (n === ".") {
2811
2823
  if (i.pointSeen || i.hasExponent) {
2812
- Ot(i, !1), --e;
2824
+ It(i, !1), --e;
2813
2825
  continue;
2814
2826
  }
2815
2827
  i.inNumber = !0, i.pointSeen = !0, i.number += n;
@@ -2817,19 +2829,19 @@ function $o(s, t = !0) {
2817
2829
  }
2818
2830
  if (!isNaN(parseInt(n))) {
2819
2831
  if (i.number === "0" || Do(i)) {
2820
- i.inNumber = !0, i.number = n, Ot(i, !0);
2832
+ i.inNumber = !0, i.number = n, It(i, !0);
2821
2833
  continue;
2822
2834
  }
2823
2835
  i.inNumber = !0, i.number += n;
2824
2836
  continue;
2825
2837
  }
2826
2838
  if (Ro.has(n)) {
2827
- i.inNumber && Ot(i, !1);
2839
+ i.inNumber && It(i, !1);
2828
2840
  continue;
2829
2841
  }
2830
2842
  if (n === "-" || n === "+") {
2831
2843
  if (i.inNumber && !Co(i)) {
2832
- Ot(i, !1), --e;
2844
+ It(i, !1), --e;
2833
2845
  continue;
2834
2846
  }
2835
2847
  i.number += n, i.inNumber = !0;
@@ -2841,7 +2853,7 @@ function $o(s, t = !0) {
2841
2853
  }
2842
2854
  if (Yn.test(n)) {
2843
2855
  if (i.inNumber)
2844
- Ot(i, !1);
2856
+ It(i, !1);
2845
2857
  else if (kn(i))
2846
2858
  Tn(i);
2847
2859
  else
@@ -2849,7 +2861,7 @@ function $o(s, t = !0) {
2849
2861
  --e;
2850
2862
  }
2851
2863
  }
2852
- return i.inNumber && Ot(i, !1), i.inSegment && kn(i) && Tn(i), i.segments;
2864
+ return i.inNumber && It(i, !1), i.inSegment && kn(i) && Tn(i), i.segments;
2853
2865
  }
2854
2866
  function Ho(s) {
2855
2867
  let t = "";
@@ -2889,9 +2901,9 @@ class Ht extends Yt {
2889
2901
  }
2890
2902
  const fi = (s) => {
2891
2903
  const t = typeof s;
2892
- return t === "number" ? k : t === "string" ? D.isColor(s) ? D : yt.test(s) ? Yn.test(s) ? Ht : Yt : Js.test(s) ? k : On : ns.indexOf(s.constructor) > -1 ? s.constructor : Array.isArray(s) ? Yt : t === "object" ? ge : On;
2904
+ return t === "number" ? k : t === "string" ? D.isColor(s) ? D : yt.test(s) ? Yn.test(s) ? Ht : Yt : Js.test(s) ? k : In : ns.indexOf(s.constructor) > -1 ? s.constructor : Array.isArray(s) ? Yt : t === "object" ? ge : In;
2893
2905
  };
2894
- class It {
2906
+ class Ot {
2895
2907
  constructor(t) {
2896
2908
  this._stepper = t || new xn("-"), this._from = null, this._to = null, this._type = null, this._context = null, this._morphObj = null;
2897
2909
  }
@@ -2929,7 +2941,7 @@ class It {
2929
2941
  }), e;
2930
2942
  }
2931
2943
  }
2932
- class On {
2944
+ class In {
2933
2945
  constructor(...t) {
2934
2946
  this.init(...t);
2935
2947
  }
@@ -3038,14 +3050,14 @@ class ge {
3038
3050
  return t;
3039
3051
  }
3040
3052
  }
3041
- const ns = [On, Se, ge];
3053
+ const ns = [In, Se, ge];
3042
3054
  function Bo(s = []) {
3043
3055
  ns.push(...[].concat(s));
3044
3056
  }
3045
3057
  function zo() {
3046
- I(ns, {
3058
+ O(ns, {
3047
3059
  to(s) {
3048
- return new It().type(this.constructor).from(this.toArray()).to(s);
3060
+ return new Ot().type(this.constructor).from(this.toArray()).to(s);
3049
3061
  },
3050
3062
  fromArray(s) {
3051
3063
  return this.init(s), this;
@@ -3061,7 +3073,7 @@ function zo() {
3061
3073
  }
3062
3074
  });
3063
3075
  }
3064
- class ae extends V {
3076
+ class ae extends Q {
3065
3077
  // Initialize node
3066
3078
  constructor(t, e = t) {
3067
3079
  super($("path", t), e);
@@ -3144,7 +3156,7 @@ const di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3144
3156
  plot: Ko,
3145
3157
  size: Uo
3146
3158
  }, Symbol.toStringTag, { value: "Module" }));
3147
- class ve extends V {
3159
+ class ve extends Q {
3148
3160
  // Initialize node
3149
3161
  constructor(t, e = t) {
3150
3162
  super($("polygon", t), e);
@@ -3158,10 +3170,10 @@ T({
3158
3170
  })
3159
3171
  }
3160
3172
  });
3161
- I(ve, ts);
3162
- I(ve, di);
3173
+ O(ve, ts);
3174
+ O(ve, di);
3163
3175
  N(ve, "Polygon");
3164
- class xe extends V {
3176
+ class xe extends Q {
3165
3177
  // Initialize node
3166
3178
  constructor(t, e = t) {
3167
3179
  super($("polyline", t), e);
@@ -3175,16 +3187,16 @@ T({
3175
3187
  })
3176
3188
  }
3177
3189
  });
3178
- I(xe, ts);
3179
- I(xe, di);
3190
+ O(xe, ts);
3191
+ O(xe, di);
3180
3192
  N(xe, "Polyline");
3181
- class Ae extends V {
3193
+ class Ae extends Q {
3182
3194
  // Initialize node
3183
3195
  constructor(t, e = t) {
3184
3196
  super($("rect", t), e);
3185
3197
  }
3186
3198
  }
3187
- I(Ae, { rx: Vn, ry: Qn });
3199
+ O(Ae, { rx: Vn, ry: Qn });
3188
3200
  T({
3189
3201
  Container: {
3190
3202
  // Create a rect element
@@ -3406,9 +3418,9 @@ T({
3406
3418
  }
3407
3419
  }
3408
3420
  });
3409
- class J extends we {
3421
+ class V extends we {
3410
3422
  constructor(t) {
3411
- super(), this.id = J.id++, t = t ?? le.duration, t = typeof t == "function" ? new Be(t) : t, this._element = null, this._timeline = null, this.done = !1, this._queue = [], this._duration = typeof t == "number" && t, this._isDeclarative = t instanceof Be, this._stepper = this._isDeclarative ? t : new xn(), this._history = {}, this.enabled = !0, this._time = 0, this._lastTime = 0, this._reseted = !0, this.transforms = new x(), this.transformId = 1, this._haveReversed = !1, this._reverse = !1, this._loopsDone = 0, this._swing = !1, this._wait = 0, this._times = 1, this._frameId = null, this._persist = this._isDeclarative ? !0 : null;
3423
+ super(), this.id = V.id++, t = t ?? le.duration, t = typeof t == "function" ? new Be(t) : t, this._element = null, this._timeline = null, this.done = !1, this._queue = [], this._duration = typeof t == "number" && t, this._isDeclarative = t instanceof Be, this._stepper = this._isDeclarative ? t : new xn(), this._history = {}, this.enabled = !0, this._time = 0, this._lastTime = 0, this._reseted = !0, this.transforms = new x(), this.transformId = 1, this._haveReversed = !1, this._reverse = !1, this._loopsDone = 0, this._swing = !1, this._wait = 0, this._times = 1, this._frameId = null, this._persist = this._isDeclarative ? !0 : null;
3412
3424
  }
3413
3425
  static sanitise(t, e, n) {
3414
3426
  let i = 1, r = !1, o = 0;
@@ -3436,7 +3448,7 @@ class J extends we {
3436
3448
  return this.on("finished", t);
3437
3449
  }
3438
3450
  animate(t, e, n) {
3439
- const i = J.sanitise(t, e, n), r = new J(i.duration);
3451
+ const i = V.sanitise(t, e, n), r = new V(i.duration);
3440
3452
  return this._timeline && r.timeline(this._timeline), this._element && r.element(this._element), r.loop(i).schedule(i.delay, i.when);
3441
3453
  }
3442
3454
  clearTransform() {
@@ -3599,7 +3611,7 @@ class J extends we {
3599
3611
  return !1;
3600
3612
  }
3601
3613
  }
3602
- J.id = 0;
3614
+ V.id = 0;
3603
3615
  class ze {
3604
3616
  constructor(t = new x(), e = -1, n = !0) {
3605
3617
  this.transforms = t, this.id = e, this.done = n;
@@ -3607,7 +3619,7 @@ class ze {
3607
3619
  clearTransformsFromQueue() {
3608
3620
  }
3609
3621
  }
3610
- I([J, ze], {
3622
+ O([V, ze], {
3611
3623
  mergeWith(s) {
3612
3624
  return new ze(
3613
3625
  s.transforms.lmultiply(this.transforms),
@@ -3665,8 +3677,8 @@ class Go {
3665
3677
  T({
3666
3678
  Element: {
3667
3679
  animate(s, t, e) {
3668
- const n = J.sanitise(s, t, e), i = this.timeline();
3669
- return new J(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay, n.when);
3680
+ const n = V.sanitise(s, t, e), i = this.timeline();
3681
+ return new V(n.duration).loop(n).element(this).timeline(i.play()).schedule(n.delay, n.when);
3670
3682
  },
3671
3683
  delay(s, t) {
3672
3684
  return this.animate(0, s, t);
@@ -3692,7 +3704,7 @@ T({
3692
3704
  }
3693
3705
  });
3694
3706
  const Yo = (s, t) => s.filter((e) => !t.includes(e));
3695
- I(J, {
3707
+ O(V, {
3696
3708
  attr(s, t) {
3697
3709
  return this.styleAttr("attr", s, t);
3698
3710
  },
@@ -3705,7 +3717,7 @@ I(J, {
3705
3717
  return this.styleAttr(s, { [t]: e });
3706
3718
  let n = t;
3707
3719
  if (this._tryRetarget(s, n)) return this;
3708
- let i = new It(this._stepper).to(n), r = Object.keys(n);
3720
+ let i = new Ot(this._stepper).to(n), r = Object.keys(n);
3709
3721
  return this.queue(
3710
3722
  function() {
3711
3723
  i = i.from(this.element()[s](r));
@@ -3726,7 +3738,7 @@ I(J, {
3726
3738
  },
3727
3739
  zoom(s, t) {
3728
3740
  if (this._tryRetarget("zoom", s, t)) return this;
3729
- let e = new It(this._stepper).to(new k(s));
3741
+ let e = new Ot(this._stepper).to(new k(s));
3730
3742
  return this.queue(
3731
3743
  function() {
3732
3744
  e = e.from(this.element().zoom());
@@ -3759,7 +3771,7 @@ I(J, {
3759
3771
  return this;
3760
3772
  const n = x.isMatrixLike(s);
3761
3773
  e = s.affine != null ? s.affine : e ?? !n;
3762
- const i = new It(this._stepper).type(
3774
+ const i = new Ot(this._stepper).type(
3763
3775
  e ? Se : x
3764
3776
  );
3765
3777
  let r, o, a, c, h;
@@ -3774,12 +3786,12 @@ I(J, {
3774
3786
  let w = new x({ ...s, origin: [p, y] }), A = this._isDeclarative && a ? a : h;
3775
3787
  if (e) {
3776
3788
  w = w.decompose(p, y), A = A.decompose(p, y);
3777
- const H = w.rotate, Q = A.rotate, L = [H - 360, H, H + 360], rt = L.map((rn) => Math.abs(rn - Q)), ft = Math.min(...rt), Pt = rt.indexOf(ft);
3789
+ const H = w.rotate, tt = A.rotate, L = [H - 360, H, H + 360], rt = L.map((rn) => Math.abs(rn - tt)), ft = Math.min(...rt), Pt = rt.indexOf(ft);
3778
3790
  w.rotate = L[Pt];
3779
3791
  }
3780
3792
  t && (n || (w.rotate = s.rotate || 0), this._isDeclarative && c && (A.rotate = c)), i.from(A), i.to(w);
3781
- const O = i.at(m);
3782
- return c = O.rotate, a = new x(O), this.addTransform(a), o._addRunner(this), i.done();
3793
+ const I = i.at(m);
3794
+ return c = I.rotate, a = new x(I), this.addTransform(a), o._addRunner(this), i.done();
3783
3795
  }
3784
3796
  function f(m) {
3785
3797
  (m.origin || "center").toString() !== (s.origin || "center").toString() && (r = bn(m, o)), s = { ...m, origin: r };
@@ -3811,7 +3823,7 @@ I(J, {
3811
3823
  },
3812
3824
  _queueNumberDelta(s, t) {
3813
3825
  if (t = new k(t), this._tryRetarget(s, t)) return this;
3814
- const e = new It(this._stepper).to(t);
3826
+ const e = new Ot(this._stepper).to(t);
3815
3827
  let n = null;
3816
3828
  return this.queue(
3817
3829
  function() {
@@ -3827,7 +3839,7 @@ I(J, {
3827
3839
  },
3828
3840
  _queueObject(s, t) {
3829
3841
  if (this._tryRetarget(s, t)) return this;
3830
- const e = new It(this._stepper).to(t);
3842
+ const e = new Ot(this._stepper).to(t);
3831
3843
  return this.queue(
3832
3844
  function() {
3833
3845
  e.from(this.element()[s]());
@@ -3877,7 +3889,7 @@ I(J, {
3877
3889
  if (arguments.length === 4)
3878
3890
  return this.plot([s, t, e, n]);
3879
3891
  if (this._tryRetarget("plot", s)) return this;
3880
- const i = new It(this._stepper).type(this._element.MorphArray).to(s);
3892
+ const i = new Ot(this._stepper).type(this._element.MorphArray).to(s);
3881
3893
  return this.queue(
3882
3894
  function() {
3883
3895
  i.from(this._element.array());
@@ -3903,15 +3915,15 @@ I(J, {
3903
3915
  }) : (s.opacity != null && this.attr("stop-opacity", s.opacity), s.color != null && this.attr("stop-color", s.color), s.offset != null && this.attr("offset", s.offset), this);
3904
3916
  }
3905
3917
  });
3906
- I(J, { rx: Vn, ry: Qn, from: li, to: ui });
3907
- N(J, "Runner");
3908
- class ss extends Y {
3918
+ O(V, { rx: Vn, ry: Qn, from: li, to: ui });
3919
+ N(V, "Runner");
3920
+ class ss extends X {
3909
3921
  constructor(t, e = t) {
3910
3922
  super($("svg", t), e), this.namespace();
3911
3923
  }
3912
3924
  // Creates and returns defs element
3913
3925
  defs() {
3914
- return this.isRoot() ? nt(this.node.querySelector("defs")) || this.put(new Jn()) : this.root().defs();
3926
+ return this.isRoot() ? st(this.node.querySelector("defs")) || this.put(new Jn()) : this.root().defs();
3915
3927
  }
3916
3928
  isRoot() {
3917
3929
  return !this.node.parentNode || !(this.node.parentNode instanceof E.window.SVGElement) && this.node.parentNode.nodeName !== "#document-fragment";
@@ -3942,7 +3954,7 @@ T({
3942
3954
  }
3943
3955
  });
3944
3956
  N(ss, "Svg", !0);
3945
- let Je = class extends Y {
3957
+ let Je = class extends X {
3946
3958
  // Initialize node
3947
3959
  constructor(t, e = t) {
3948
3960
  super($("symbol", t), e);
@@ -4007,7 +4019,7 @@ const yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4007
4019
  x: Vo,
4008
4020
  y: Qo
4009
4021
  }, Symbol.toStringTag, { value: "Module" }));
4010
- class K extends V {
4022
+ class U extends Q {
4011
4023
  // Initialize node
4012
4024
  constructor(t, e = t) {
4013
4025
  super($("text", t), e), this.dom.leading = this.dom.leading ?? new k(1.3), this._rebuild = !0, this._build = !1;
@@ -4049,7 +4061,7 @@ class K extends V {
4049
4061
  i === 0 && (n = i + 1);
4050
4062
  continue;
4051
4063
  }
4052
- i !== n && e[i].nodeType !== 3 && nt(e[i]).dom.newLined === !0 && (t += `
4064
+ i !== n && e[i].nodeType !== 3 && st(e[i]).dom.newLined === !0 && (t += `
4053
4065
  `), t += e[i].textContent;
4054
4066
  }
4055
4067
  return t;
@@ -4065,21 +4077,21 @@ class K extends V {
4065
4077
  return this.build(!1).rebuild();
4066
4078
  }
4067
4079
  }
4068
- I(K, yi);
4080
+ O(U, yi);
4069
4081
  T({
4070
4082
  Container: {
4071
4083
  // Create text element
4072
4084
  text: R(function(s = "") {
4073
- return this.put(new K()).text(s);
4085
+ return this.put(new U()).text(s);
4074
4086
  }),
4075
4087
  // Create plain text element
4076
4088
  plain: R(function(s = "") {
4077
- return this.put(new K()).plain(s);
4089
+ return this.put(new U()).plain(s);
4078
4090
  })
4079
4091
  }
4080
4092
  });
4081
- N(K, "Text");
4082
- class Ve extends V {
4093
+ N(U, "Text");
4094
+ class Ve extends Q {
4083
4095
  // Initialize node
4084
4096
  constructor(t, e = t) {
4085
4097
  super($("tspan", t), e), this._build = !1;
@@ -4096,7 +4108,7 @@ class Ve extends V {
4096
4108
  newLine() {
4097
4109
  this.dom.newLined = !0;
4098
4110
  const t = this.parent();
4099
- if (!(t instanceof K))
4111
+ if (!(t instanceof U))
4100
4112
  return this;
4101
4113
  const e = t.index(this), n = E.window.getComputedStyle(this.node).getPropertyValue("font-size"), i = t.dom.leading * new k(n);
4102
4114
  return this.dy(e ? i : 0).attr("x", t.x());
@@ -4107,7 +4119,7 @@ class Ve extends V {
4107
4119
  ` : "") : (typeof t == "function" ? (this.clear().build(!0), t.call(this, this), this.build(!1)) : this.plain(t), this);
4108
4120
  }
4109
4121
  }
4110
- I(Ve, yi);
4122
+ O(Ve, yi);
4111
4123
  T({
4112
4124
  Tspan: {
4113
4125
  tspan: R(function(s = "") {
@@ -4122,7 +4134,7 @@ T({
4122
4134
  }
4123
4135
  });
4124
4136
  N(Ve, "Tspan");
4125
- class is extends V {
4137
+ class is extends Q {
4126
4138
  constructor(t, e = t) {
4127
4139
  super($("circle", t), e);
4128
4140
  }
@@ -4141,7 +4153,7 @@ class is extends V {
4141
4153
  return this.radius(new k(t).divide(2));
4142
4154
  }
4143
4155
  }
4144
- I(is, { x: si, y: ii, cx: ri, cy: oi, width: ai, height: ci });
4156
+ O(is, { x: si, y: ii, cx: ri, cy: oi, width: ai, height: ci });
4145
4157
  T({
4146
4158
  Container: {
4147
4159
  // Create circle element
@@ -4151,7 +4163,7 @@ T({
4151
4163
  }
4152
4164
  });
4153
4165
  N(is, "Circle");
4154
- class In extends Y {
4166
+ class On extends X {
4155
4167
  constructor(t, e = t) {
4156
4168
  super($("clipPath", t), e);
4157
4169
  }
@@ -4169,7 +4181,7 @@ T({
4169
4181
  Container: {
4170
4182
  // Create clipping element
4171
4183
  clip: R(function() {
4172
- return this.defs().put(new In());
4184
+ return this.defs().put(new On());
4173
4185
  })
4174
4186
  },
4175
4187
  Element: {
@@ -4178,7 +4190,7 @@ T({
4178
4190
  return this.reference("clip-path");
4179
4191
  },
4180
4192
  clipWith(s) {
4181
- const t = s instanceof In ? s : this.parent().clip().add(s);
4193
+ const t = s instanceof On ? s : this.parent().clip().add(s);
4182
4194
  return this.attr("clip-path", "url(#" + t.id() + ")");
4183
4195
  },
4184
4196
  // Unclip element
@@ -4187,7 +4199,7 @@ T({
4187
4199
  }
4188
4200
  }
4189
4201
  });
4190
- N(In, "ClipPath");
4202
+ N(On, "ClipPath");
4191
4203
  class wi extends ut {
4192
4204
  constructor(t, e = t) {
4193
4205
  super($("foreignObject", t), e);
@@ -4254,12 +4266,12 @@ const _i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4254
4266
  x: ma,
4255
4267
  y: ga
4256
4268
  }, Symbol.toStringTag, { value: "Module" }));
4257
- class B extends Y {
4269
+ class B extends X {
4258
4270
  constructor(t, e = t) {
4259
4271
  super($("g", t), e);
4260
4272
  }
4261
4273
  }
4262
- I(B, _i);
4274
+ O(B, _i);
4263
4275
  T({
4264
4276
  Container: {
4265
4277
  // Create a group element
@@ -4269,7 +4281,7 @@ T({
4269
4281
  }
4270
4282
  });
4271
4283
  N(B, "G");
4272
- class Pe extends Y {
4284
+ class Pe extends X {
4273
4285
  constructor(t, e = t) {
4274
4286
  super($("a", t), e);
4275
4287
  }
@@ -4282,7 +4294,7 @@ class Pe extends Y {
4282
4294
  return this.attr("href", t, ye);
4283
4295
  }
4284
4296
  }
4285
- I(Pe, _i);
4297
+ O(Pe, _i);
4286
4298
  T({
4287
4299
  Container: {
4288
4300
  // Create a hyperlink element
@@ -4311,7 +4323,7 @@ T({
4311
4323
  }
4312
4324
  });
4313
4325
  N(Pe, "A");
4314
- class En extends Y {
4326
+ class En extends X {
4315
4327
  // Initialize node
4316
4328
  constructor(t, e = t) {
4317
4329
  super($("mask", t), e);
@@ -4405,7 +4417,7 @@ T("Dom", {
4405
4417
  }
4406
4418
  });
4407
4419
  N(Nn, "Style");
4408
- class rs extends K {
4420
+ class rs extends U {
4409
4421
  // Initialize node
4410
4422
  constructor(t, e = t) {
4411
4423
  super($("textPath", t), e);
@@ -4429,7 +4441,7 @@ class rs extends K {
4429
4441
  T({
4430
4442
  Container: {
4431
4443
  textPath: R(function(s, t) {
4432
- return s instanceof K || (s = this.text(s)), s.path(t);
4444
+ return s instanceof U || (s = this.text(s)), s.path(t);
4433
4445
  })
4434
4446
  },
4435
4447
  Text: {
@@ -4451,7 +4463,7 @@ T({
4451
4463
  Path: {
4452
4464
  // creates a textPath from this path
4453
4465
  text: R(function(s) {
4454
- return s instanceof K || (s = new K().addTo(this.parent()).text(s)), s.path(this);
4466
+ return s instanceof U || (s = new U().addTo(this.parent()).text(s)), s.path(this);
4455
4467
  }),
4456
4468
  targets() {
4457
4469
  return oe("svg textPath").filter((s) => (s.attr("href") || "").includes(this.id()));
@@ -4460,7 +4472,7 @@ T({
4460
4472
  });
4461
4473
  rs.prototype.MorphArray = Ht;
4462
4474
  N(rs, "TextPath");
4463
- class Qe extends V {
4475
+ class Qe extends Q {
4464
4476
  constructor(t, e = t) {
4465
4477
  super($("use", t), e);
4466
4478
  }
@@ -4478,20 +4490,20 @@ T({
4478
4490
  }
4479
4491
  });
4480
4492
  N(Qe, "Use");
4481
- I([ss, Je, be, pe, We], G("viewbox"));
4482
- I([me, xe, ve, ae], G("marker"));
4483
- I(K, G("Text"));
4484
- I(ae, G("Path"));
4485
- I(Jn, G("Defs"));
4486
- I([K, Ve], G("Tspan"));
4487
- I([Ae, Xe, _e, J], G("radius"));
4488
- I(we, G("EventTarget"));
4489
- I(St, G("Dom"));
4490
- I(ut, G("Element"));
4491
- I(V, G("Shape"));
4492
- I([Y, hi], G("Container"));
4493
- I(_e, G("Gradient"));
4494
- I(J, G("Runner"));
4493
+ O([ss, Je, be, pe, We], Y("viewbox"));
4494
+ O([me, xe, ve, ae], Y("marker"));
4495
+ O(U, Y("Text"));
4496
+ O(ae, Y("Path"));
4497
+ O(Jn, Y("Defs"));
4498
+ O([U, Ve], Y("Tspan"));
4499
+ O([Ae, Xe, _e, V], Y("radius"));
4500
+ O(we, Y("EventTarget"));
4501
+ O(St, Y("Dom"));
4502
+ O(ut, Y("Element"));
4503
+ O(Q, Y("Shape"));
4504
+ O([X, hi], Y("Container"));
4505
+ O(_e, Y("Gradient"));
4506
+ O(V, Y("Runner"));
4495
4507
  $t.extend(or());
4496
4508
  Bo([
4497
4509
  k,
@@ -4522,14 +4534,14 @@ class Xt {
4522
4534
  // image wrapper
4523
4535
  image(t) {
4524
4536
  let e = new be().load(this.buildURL(t));
4525
- return this.svgSprite && (e = new Qe().use(Xt.buildID(t))), t instanceof g && t.has(S.COLOR_GRAYSCALE) && e.css({ filter: "contrast(65%)" }), e;
4537
+ return this.svgSprite && (e = new Qe().use(Xt.buildID(t))), t instanceof g && t.has(v.COLOR_GRAYSCALE) && e.css({ filter: "contrast(65%)" }), e;
4526
4538
  }
4527
4539
  createImage(t, e, n) {
4528
4540
  const i = t.imageSize(this.scale);
4529
4541
  return this.image(t).dx(e).dy(n).size(i.baseWidth, i.baseHeight);
4530
4542
  }
4531
4543
  createTextImage(t, e, n, i) {
4532
- const r = this.createImage(t, e, n), o = t.imageSize(this.scale), a = o.baseHeight * 0.2, c = o.baseWidth, h = o.baseHeight, l = new K().text(i);
4544
+ const r = this.createImage(t, e, n), o = t.imageSize(this.scale), a = o.baseHeight * 0.2, c = o.baseWidth, h = o.baseHeight, l = new U().text(i);
4533
4545
  l.size(o.baseWidth, o.baseHeight).font({
4534
4546
  family: Ps,
4535
4547
  size: a
@@ -4564,19 +4576,19 @@ class Si extends Xt {
4564
4576
  const n = new B();
4565
4577
  let i = 0;
4566
4578
  for (let r of e.tiles) {
4567
- const o = r.imageSize(this.scale), a = r.has(S.HORIZONTAL) ? this.createRotate90Image.bind(this) : this.createImage.bind(this), c = r.has(S.HORIZONTAL) ? this.getDiffTileHeightWidth(r) : 0, h = a(r, i, c);
4579
+ const o = r.imageSize(this.scale), a = r.has(v.HORIZONTAL) ? this.createRotate90Image.bind(this) : this.createImage.bind(this), c = r.has(v.HORIZONTAL) ? this.getDiffTileHeightWidth(r) : 0, h = a(r, i, c);
4568
4580
  n.add(h), i += o.width;
4569
4581
  }
4570
4582
  return n;
4571
4583
  }
4572
4584
  createBlockPonChiKan(e) {
4573
- const n = e.tiles.findIndex((o) => o.has(S.HORIZONTAL));
4585
+ const n = e.tiles.findIndex((o) => o.has(v.HORIZONTAL));
4574
4586
  let i = 0;
4575
4587
  const r = new B();
4576
4588
  if (e.type == _.SHO_KAN) {
4577
4589
  let o = n;
4578
4590
  for (let a = 0; a < e.tiles.length; a++)
4579
- e.tiles[a].has(S.HORIZONTAL) && (o = a);
4591
+ e.tiles[a].has(v.HORIZONTAL) && (o = a);
4580
4592
  for (let a = 0; a < e.tiles.length; a++) {
4581
4593
  const c = e.tiles[a].imageSize(this.scale);
4582
4594
  if (a == o) continue;
@@ -4637,7 +4649,7 @@ const wa = (s) => {
4637
4649
  },
4638
4650
  [_.AN_KAN]: function(n) {
4639
4651
  assert(
4640
- n instanceof F,
4652
+ n instanceof q,
4641
4653
  `block type is not ankan: ${n.type}`
4642
4654
  );
4643
4655
  const i = n.imageSize(t), r = n.tilesWithBack.filter((a) => a.t !== d.BACK);
@@ -4646,7 +4658,7 @@ const wa = (s) => {
4646
4658
  `back tile must be two but ${n}`
4647
4659
  );
4648
4660
  const o = s.createBlockHandDiscard(
4649
- new F([r[0], r[1], r[0], r[1]])
4661
+ new q([r[0], r[1], r[0], r[1]])
4650
4662
  );
4651
4663
  return { ...i, e: o };
4652
4664
  },
@@ -4753,7 +4765,7 @@ const wa = (s) => {
4753
4765
  return o.rotate(n, 0, e).translate(a, c), o;
4754
4766
  }
4755
4767
  return o;
4756
- }, Oe = (s, t) => {
4768
+ }, Ie = (s, t) => {
4757
4769
  const e = new B(), n = ba(s);
4758
4770
  for (let i = 0; i < n.length; i++) {
4759
4771
  let r = n[i], o = i * t.tileHeight;
@@ -4768,12 +4780,12 @@ const wa = (s) => {
4768
4780
  }, Sa = (s, t, e) => {
4769
4781
  const n = t.font, i = t.textWidth, r = t.textHeight, o = new B(), a = e.sticks.dead, c = e.sticks.reach, h = 125 * s.scale, l = 27.5 * s.scale;
4770
4782
  let u = i * 3, f = r;
4771
- const m = (h + s.tileWidth + i - u) / 2, p = new K().plain(e.round).font(n).move(m, 0);
4783
+ const m = (h + s.tileWidth + i - u) / 2, p = new U().plain(e.round).font(n).move(m, 0);
4772
4784
  o.add(p), f += 25 * s.scale;
4773
- const y = s.tileHeight, w = new B().size(h, y).translate(0, f), A = { family: n.family, size: n.size * 0.7 }, O = s.createStick(1e3).size(h, l).move(0, 0), H = new K().plain(c.toString()).font(A).attr({ x: h, y: l });
4774
- w.add(O), w.add(H);
4775
- const Q = s.createStick(100).size(h, l).move(0, l + l), L = new K().plain(a.toString()).font(A).attr({ x: h, y: l * 3 });
4776
- w.add(Q), w.add(L);
4785
+ const y = s.tileHeight, w = new B().size(h, y).translate(0, f), A = { family: n.family, size: n.size * 0.7 }, I = s.createStick(1e3).size(h, l).move(0, 0), H = new U().plain(c.toString()).font(A).attr({ x: h, y: l });
4786
+ w.add(I), w.add(H);
4787
+ const tt = s.createStick(100).size(h, l).move(0, l + l), L = new U().plain(a.toString()).font(A).attr({ x: h, y: l * 3 });
4788
+ w.add(tt), w.add(L);
4777
4789
  const rt = s.createImage(e.doras[0], 0, 0).move(h + i, 0);
4778
4790
  return w.add(rt), o.add(p), o.add(w), {
4779
4791
  e: o,
@@ -4812,7 +4824,7 @@ const wa = (s) => {
4812
4824
  n / 2 - l.height / 2
4813
4825
  );
4814
4826
  const u = (rn, gs, Gi) => {
4815
- const Yi = `${rn} ${gs}`, Xi = new K().plain(Yi).font(o).attr(Gi);
4827
+ const Yi = `${rn} ${gs}`, Xi = new U().plain(Yi).font(o).attr(Gi);
4816
4828
  return {
4817
4829
  e: new B().add(Xi),
4818
4830
  width: a + h * gs.toString().length,
@@ -4820,7 +4832,7 @@ const wa = (s) => {
4820
4832
  };
4821
4833
  }, [f, m, p, y] = xa(
4822
4834
  e.frontPlace
4823
- ), w = e.scores, O = u(f, w.front, {
4835
+ ), w = e.scores, I = u(f, w.front, {
4824
4836
  x: n / 2,
4825
4837
  y: n,
4826
4838
  "dominant-baseline": "text-after-edge",
@@ -4830,7 +4842,7 @@ const wa = (s) => {
4830
4842
  "dominant-baseline": "text-after-edge",
4831
4843
  "text-anchor": "middle"
4832
4844
  });
4833
- const Q = ot(H.e, H.width, H.height, 270).translate(
4845
+ const tt = ot(H.e, H.width, H.height, 270).translate(
4834
4846
  n,
4835
4847
  n / 2 - H.width
4836
4848
  );
@@ -4850,10 +4862,10 @@ const wa = (s) => {
4850
4862
  -ft.height,
4851
4863
  n / 2
4852
4864
  );
4853
- return i.add(l.e), i.add(O), i.add(Q), i.add(rt), i.add(Pt), { e: i, width: n, height: n };
4865
+ return i.add(l.e), i.add(I), i.add(tt), i.add(rt), i.add(Pt), { e: i, width: n, height: n };
4854
4866
  }, ka = (s, t) => {
4855
- const e = Oe(t.front, s), n = Oe(t.right, s), i = Oe(t.opposite, s), r = Oe(t.left, s), o = [e.height, n.height, i.height, r.height].reduce(
4856
- (O, H) => Math.max(O, H)
4867
+ const e = Ie(t.front, s), n = Ie(t.right, s), i = Ie(t.opposite, s), r = Ie(t.left, s), o = [e.height, n.height, i.height, r.height].reduce(
4868
+ (I, H) => Math.max(I, H)
4857
4869
  ), a = s.tileWidth * 5 + s.tileHeight * 1, c = o, h = a + o * 2 + s.blockMargin, l = h, u = new B().size(h, l), f = h / 2 - a / 2, m = l / 2 - a / 2, p = ot(e.e, a, c, 0).translate(
4858
4870
  f,
4859
4871
  l - c
@@ -4884,7 +4896,7 @@ const wa = (s) => {
4884
4896
  i.responsive || s.size(l.width, l.height), s.viewbox(0, 0, l.width, l.height), s.add(l.e);
4885
4897
  };
4886
4898
  var dt;
4887
- function Oa(s) {
4899
+ function Ia(s) {
4888
4900
  return {
4889
4901
  lang: (s == null ? void 0 : s.lang) ?? (dt == null ? void 0 : dt.lang),
4890
4902
  message: s == null ? void 0 : s.message,
@@ -4893,7 +4905,7 @@ function Oa(s) {
4893
4905
  };
4894
4906
  }
4895
4907
  var fn;
4896
- function Ia(s) {
4908
+ function Oa(s) {
4897
4909
  return fn == null ? void 0 : fn.get(s);
4898
4910
  }
4899
4911
  var dn;
@@ -4918,16 +4930,17 @@ function Wt(s, t, e, n, i) {
4918
4930
  expected: o,
4919
4931
  received: a,
4920
4932
  message: `Invalid ${t}: ${o ? `Expected ${o} but r` : "R"}eceived ${a}`,
4921
- // @ts-expect-error
4922
4933
  requirement: s.requirement,
4923
4934
  path: i == null ? void 0 : i.path,
4924
4935
  issues: i == null ? void 0 : i.issues,
4925
4936
  lang: n.lang,
4926
4937
  abortEarly: n.abortEarly,
4927
4938
  abortPipeEarly: n.abortPipeEarly
4928
- }, h = s.kind === "schema", l = (i == null ? void 0 : i.message) ?? // @ts-expect-error
4929
- s.message ?? Na(s.reference, c.lang) ?? (h ? Ea(c.lang) : null) ?? n.message ?? Ia(c.lang);
4930
- l && (c.message = typeof l == "function" ? l(c) : l), h && (e.typed = !1), e.issues ? e.issues.push(c) : e.issues = [c];
4939
+ }, h = s.kind === "schema", l = (i == null ? void 0 : i.message) ?? s.message ?? Na(s.reference, c.lang) ?? (h ? Ea(c.lang) : null) ?? n.message ?? Oa(c.lang);
4940
+ l && (c.message = typeof l == "function" ? (
4941
+ // @ts-expect-error
4942
+ l(c)
4943
+ ) : l), h && (e.typed = !1), e.issues ? e.issues.push(c) : e.issues = [c];
4931
4944
  }
4932
4945
  function Ma(s, t) {
4933
4946
  const e = [...new Set(s)];
@@ -4987,11 +5000,11 @@ function je(s) {
4987
5000
  }
4988
5001
  };
4989
5002
  }
4990
- function st(s, ...t) {
5003
+ function it(s, ...t) {
4991
5004
  const e = {
4992
5005
  kind: "schema",
4993
5006
  type: "optional",
4994
- reference: st,
5007
+ reference: it,
4995
5008
  expects: `(${s.expects} | undefined)`,
4996
5009
  async: !1,
4997
5010
  wrapped: s,
@@ -5114,7 +5127,7 @@ function ks(...s) {
5114
5127
  function Ca(s, t, e) {
5115
5128
  const n = s._run(
5116
5129
  { typed: !1, value: t },
5117
- Oa(e)
5130
+ Ia(e)
5118
5131
  );
5119
5132
  return {
5120
5133
  typed: n.typed,
@@ -5123,44 +5136,44 @@ function Ca(s, t, e) {
5123
5136
  issues: n.issues
5124
5137
  };
5125
5138
  }
5126
- const Ie = st(
5139
+ const Oe = it(
5127
5140
  Vt({
5128
- discard: st(Le(), ""),
5129
- hand: st(Le(), ""),
5130
- score: st(je(), 25e3)
5141
+ discard: it(Le(), ""),
5142
+ hand: it(Le(), ""),
5143
+ score: it(je(), 25e3)
5131
5144
  }),
5132
5145
  { discard: "", hand: "", score: 25e3 }
5133
5146
  ), Ra = Vt({
5134
- [v.E]: Ie,
5135
- [v.S]: Ie,
5136
- [v.W]: Ie,
5137
- [v.N]: Ie
5147
+ [S.E]: Oe,
5148
+ [S.S]: Oe,
5149
+ [S.W]: Oe,
5150
+ [S.N]: Oe
5138
5151
  }), At = {
5139
5152
  round: P.E1,
5140
5153
  sticks: { reach: 0, dead: 0 },
5141
- doras: v.S,
5142
- front: v.E
5143
- }, $a = st(
5154
+ doras: S.S,
5155
+ front: S.E
5156
+ }, $a = it(
5144
5157
  Vt({
5145
- round: st(
5158
+ round: it(
5146
5159
  Cn(Object.keys(js)),
5147
5160
  At.round
5148
5161
  ),
5149
- sticks: st(
5162
+ sticks: it(
5150
5163
  Vt({
5151
- reach: st(
5164
+ reach: it(
5152
5165
  ks(je(), Dn(0, ""), Mn(9, "")),
5153
5166
  At.sticks.reach
5154
5167
  ),
5155
- dead: st(
5168
+ dead: it(
5156
5169
  ks(je(), Dn(0, ""), Mn(9, "")),
5157
5170
  At.sticks.dead
5158
5171
  )
5159
5172
  }),
5160
5173
  At.sticks
5161
5174
  ),
5162
- doras: st(Le(), At.doras),
5163
- front: st(
5175
+ doras: it(Le(), At.doras),
5176
+ front: it(
5164
5177
  Cn(Object.keys(Ln)),
5165
5178
  At.front
5166
5179
  )
@@ -5185,7 +5198,7 @@ const Ie = st(
5185
5198
  if (!i.startsWith(t))
5186
5199
  throw new Error(`input does not start with table: ${i}`);
5187
5200
  const r = {};
5188
- let o = [v.E, v.S, v.W, v.N, e];
5201
+ let o = [S.E, S.S, S.W, S.N, e];
5189
5202
  for (; ; ) {
5190
5203
  const a = n.shift();
5191
5204
  if (a == null) break;
@@ -5233,20 +5246,20 @@ const Ie = st(
5233
5246
  return [a, c];
5234
5247
  }, La = (s) => {
5235
5248
  const t = s.board.front, e = Ka(t), n = (a) => s[a].discard.replace(/\r?\n/g, ""), i = {
5236
- front: new et(n(e.front)).tiles(),
5237
- right: new et(n(e.right)).tiles(),
5238
- opposite: new et(n(e.opposite)).tiles(),
5239
- left: new et(n(e.left)).tiles()
5249
+ front: new nt(n(e.front)).tiles(),
5250
+ right: new nt(n(e.right)).tiles(),
5251
+ opposite: new nt(n(e.opposite)).tiles(),
5252
+ left: new nt(n(e.left)).tiles()
5240
5253
  }, r = {
5241
- front: new et(s[e.front].hand).parse(),
5242
- right: new et(s[e.right].hand).parse(),
5243
- opposite: new et(s[e.opposite].hand).parse(),
5244
- left: new et(s[e.left].hand).parse()
5254
+ front: new nt(s[e.front].hand).parse(),
5255
+ right: new nt(s[e.right].hand).parse(),
5256
+ opposite: new nt(s[e.opposite].hand).parse(),
5257
+ left: new nt(s[e.left].hand).parse()
5245
5258
  }, o = {
5246
5259
  round: js[s.board.round],
5247
5260
  frontPlace: Ln[t],
5248
5261
  sticks: s.board.sticks,
5249
- doras: new et(s.board.doras).tiles(),
5262
+ doras: new nt(s.board.doras).tiles(),
5250
5263
  scores: {
5251
5264
  front: s[e.front].score,
5252
5265
  right: s[e.right].score,
@@ -5261,17 +5274,6 @@ const Ie = st(
5261
5274
  opposite: Ct(Ct(s)),
5262
5275
  left: rr(s)
5263
5276
  });
5264
- function q(s, t = !1) {
5265
- const e = {
5266
- [v.E]: s,
5267
- [v.S]: s,
5268
- [v.W]: s,
5269
- [v.N]: s
5270
- };
5271
- if (t)
5272
- for (let n of Object.values(v)) e[n] = structuredClone(s);
5273
- return e;
5274
- }
5275
5277
  class tn {
5276
5278
  constructor(t, e = !1) {
5277
5279
  b(this, "data");
@@ -5287,7 +5289,7 @@ class tn {
5287
5289
  }, this.init(t, e);
5288
5290
  }
5289
5291
  init(t, e) {
5290
- const n = new et(t).parse();
5292
+ const n = new nt(t).parse();
5291
5293
  for (let i of n) {
5292
5294
  if (i.isCalled()) {
5293
5295
  this.data.called = [...this.called, i];
@@ -5323,7 +5325,7 @@ class tn {
5323
5325
  C(
5324
5326
  n >= 0,
5325
5327
  `hand has drawn: ${this.drawn} but no tile in hands: ${t.join("")}`
5326
- ), t[n] = t[n].clone({ add: S.TSUMO });
5328
+ ), t[n] = t[n].clone({ add: v.TSUMO });
5327
5329
  }
5328
5330
  return C(
5329
5331
  t.length > 0,
@@ -5335,7 +5337,7 @@ class tn {
5335
5337
  for (let r of this.called) t = `${t},${r.toString()}`;
5336
5338
  let e = "";
5337
5339
  this.drawn && (e = `,${this.drawn.toString()}`);
5338
- const n = this.hands.filter((r) => !r.has(S.TSUMO));
5340
+ const n = this.hands.filter((r) => !r.has(v.TSUMO));
5339
5341
  return `${new Un(n).toString()}${e}${t}`;
5340
5342
  }
5341
5343
  get called() {
@@ -5348,7 +5350,7 @@ class tn {
5348
5350
  return this.data.tsumo;
5349
5351
  }
5350
5352
  get menzen() {
5351
- return !this.called.some((t) => !(t instanceof F));
5353
+ return !this.called.some((t) => !(t instanceof q));
5352
5354
  }
5353
5355
  getArrayLen(t) {
5354
5356
  return this.data[t].length;
@@ -5366,7 +5368,7 @@ class tn {
5366
5368
  for (let n of t) {
5367
5369
  if (n.t != d.BACK && this.get(n.t, n.n) >= 4)
5368
5370
  throw this.dec(e), new Error(`unable to increase ${n} in ${this.toString()}`);
5369
- if (e.push(n), it(n) && (this.data[n.t][5] += 1), n.t == d.BACK ? this.data[n.t][1] += 1 : this.data[n.t][n.n] += 1, tt(n) && this.get(n.t, 5) == 4 && this.get(n.t, 0) == 0) {
5371
+ if (e.push(n), K(n) && (this.data[n.t][5] += 1), n.t == d.BACK ? this.data[n.t][1] += 1 : this.data[n.t][n.n] += 1, et(n) && this.get(n.t, 5) == 4 && this.get(n.t, 0) == 0) {
5370
5372
  this.data[n.t][0] = 1;
5371
5373
  const i = e.pop().clone({ n: 0 });
5372
5374
  e.push(i);
@@ -5381,7 +5383,7 @@ class tn {
5381
5383
  throw this.inc(e), new Error(
5382
5384
  `unable to decrease ${n.toString()} in ${this.toString()}`
5383
5385
  );
5384
- if (e.push(n), it(n) && (this.data[n.t][5] -= 1), n.t == d.BACK ? this.data[n.t][1] -= 1 : this.data[n.t][n.n] -= 1, tt(n) && this.get(n.t, 5) == 0 && this.get(n.t, 0) > 0) {
5386
+ if (e.push(n), K(n) && (this.data[n.t][5] -= 1), n.t == d.BACK ? this.data[n.t][1] -= 1 : this.data[n.t][n.n] -= 1, et(n) && this.get(n.t, 5) == 0 && this.get(n.t, 0) > 0) {
5385
5387
  this.data[n.t][0] = 0;
5386
5388
  const i = e.pop().clone({ n: 0 });
5387
5389
  e.push(i);
@@ -5390,7 +5392,7 @@ class tn {
5390
5392
  return e;
5391
5393
  }
5392
5394
  draw(t) {
5393
- const e = t.clone({ add: S.TSUMO });
5395
+ const e = t.clone({ add: v.TSUMO });
5394
5396
  this.inc([e]), this.data.tsumo = e;
5395
5397
  }
5396
5398
  discard(t) {
@@ -5404,15 +5406,15 @@ class tn {
5404
5406
  call(t) {
5405
5407
  if (!(t instanceof gt || t instanceof lt || t instanceof mt))
5406
5408
  throw new Error(`unexpected input ${t} ${t.type}`);
5407
- const e = t.tiles.filter((n) => !n.has(S.HORIZONTAL));
5409
+ const e = t.tiles.filter((n) => !n.has(v.HORIZONTAL));
5408
5410
  if (e.length != t.tiles.length - 1)
5409
5411
  throw new Error(`removal: ${e} block: ${t}`);
5410
5412
  this.dec(e), this.data.called = [...this.called, t], this.data.tsumo = null;
5411
5413
  }
5412
5414
  kan(t) {
5413
- if (t instanceof F) {
5415
+ if (t instanceof q) {
5414
5416
  let e = t.tiles[0];
5415
- it(e) && (e = new g(e.t, 5)), this.dec([e, e, e, e]), this.data.called = [...this.called, t], this.data.tsumo = null;
5417
+ K(e) && (e = new g(e.t, 5)), this.dec([e, e, e, e]), this.data.called = [...this.called, t], this.data.tsumo = null;
5416
5418
  return;
5417
5419
  }
5418
5420
  if (t instanceof ht) {
@@ -5422,7 +5424,7 @@ class tn {
5422
5424
  );
5423
5425
  if (e == -1) throw new Error(`unable to find ${t.tiles[0]}`);
5424
5426
  let n = t.tiles[0];
5425
- it(n) && (n = new g(n.t, 5)), this.dec([n]), this.data.called = [
5427
+ K(n) && (n = new g(n.t, 5)), this.dec([n]), this.data.called = [
5426
5428
  ...this.called.slice(0, e),
5427
5429
  ...this.called.slice(e + 1),
5428
5430
  t
@@ -5481,8 +5483,8 @@ class en {
5481
5483
  for (let p of [u.patternA, u.patternB])
5482
5484
  for (let y of [f.patternA, f.patternB]) {
5483
5485
  const w = [this.hand.called.length, 0, 0];
5484
- for (let O = 0; O < 3; O++)
5485
- w[O] += m[O] + p[O] + y[O] + i[O] + o[O];
5486
+ for (let I = 0; I < 3; I++)
5487
+ w[I] += m[I] + p[I] + y[I] + i[I] + o[I];
5486
5488
  let A = this.calcCommon(w[0], w[1], w[2], n);
5487
5489
  A < h && (h = A);
5488
5490
  }
@@ -5552,7 +5554,7 @@ class Ua {
5552
5554
  }
5553
5555
  markDrawn(t, e) {
5554
5556
  if (t.length == 0) return [];
5555
- const n = this.hand.drawn != null || e.has(S.TSUMO) ? S.TSUMO : S.RON, i = [];
5557
+ const n = this.hand.drawn != null || e.has(v.TSUMO) ? v.TSUMO : v.RON, i = [];
5556
5558
  for (let o = 0; o < t.length; o++) {
5557
5559
  const a = t[o], c = {};
5558
5560
  for (let h = 0; h < a.length; h++) {
@@ -5584,7 +5586,7 @@ class Ua {
5584
5586
  if (e != d.BACK)
5585
5587
  for (let n = 1; n < this.hand.getArrayLen(e); n++) {
5586
5588
  const i = this.hand.get(e, n);
5587
- if (i == 2) t.push(new X(new g(e, n), new g(e, n)));
5589
+ if (i == 2) t.push(new J(new g(e, n), new g(e, n)));
5588
5590
  else {
5589
5591
  if (i == 0) continue;
5590
5592
  return [];
@@ -5602,7 +5604,7 @@ class Ua {
5602
5604
  if (this.hand.get(n, r) == 1)
5603
5605
  t.push(new Ls(new g(n, r)));
5604
5606
  else if (this.hand.get(n, r) == 2 && e == "")
5605
- t.unshift(new X(new g(n, r), new g(n, r)));
5607
+ t.unshift(new J(new g(n, r), new g(n, r)));
5606
5608
  else return [];
5607
5609
  }
5608
5610
  return [t];
@@ -5622,7 +5624,7 @@ class Ua {
5622
5624
  for (let e of Object.values(d))
5623
5625
  for (let n = 1; n < this.hand.getArrayLen(e); n++)
5624
5626
  if (this.hand.get(e, n) >= 2) {
5625
- const i = this.hand.dec([new g(e, n), new g(e, n)]), r = this.commonAll().filter((o) => o.length == 4).map((o) => (o.unshift(new X(i[0], i[1])), o));
5627
+ const i = this.hand.dec([new g(e, n), new g(e, n)]), r = this.commonAll().filter((o) => o.length == 4).map((o) => (o.unshift(new J(i[0], i[1])), o));
5626
5628
  t = [...t, ...r], this.hand.inc(i);
5627
5629
  }
5628
5630
  return t;
@@ -5704,9 +5706,9 @@ class Ts {
5704
5706
  b(this, "hand");
5705
5707
  b(this, "cfg");
5706
5708
  this.hand = t, this.cfg = {
5707
- doras: e.doraMarkers.map((n) => Is(n)),
5709
+ doras: e.doraMarkers.map((n) => Os(n)),
5708
5710
  // convert to dora
5709
- blindDoras: e.blindDoraMarkers == null ? [] : e.blindDoraMarkers.map((n) => Is(n)),
5711
+ blindDoras: e.blindDoraMarkers == null ? [] : e.blindDoraMarkers.map((n) => Os(n)),
5710
5712
  roundWind: g.from(e.round.substring(0, 2)),
5711
5713
  myWind: g.from(e.myWind),
5712
5714
  reached: e.reached ?? 0,
@@ -5725,7 +5727,7 @@ class Ts {
5725
5727
  let n = [0, 0], i = 0;
5726
5728
  for (let p = 0; p < e.length; p++) {
5727
5729
  const y = e[p], w = y.points.reduce(
5728
- (A, O) => A + O.double,
5730
+ (A, I) => A + I.double,
5729
5731
  0
5730
5732
  );
5731
5733
  (w > n[0] || w == n[0] && y.fu > n[1]) && (i = p, n[0] = w, n[1] = y.fu);
@@ -5758,17 +5760,17 @@ class Ts {
5758
5760
  }
5759
5761
  a > 13 && a < 26 && (c = 8e3);
5760
5762
  const h = e[i].hand.some(
5761
- (p) => p.tiles.some((y) => y.has(S.TSUMO))
5762
- ), l = this.cfg.orig.myWind, u = l == v.E, f = q(0);
5763
+ (p) => p.tiles.some((y) => y.has(v.TSUMO))
5764
+ ), l = this.cfg.orig.myWind, u = l == S.E, f = Z(0);
5763
5765
  if (h) {
5764
5766
  const p = this.cfg.sticks.dead * 100;
5765
5767
  if (u) {
5766
5768
  const y = r(c * 2);
5767
- f["1w"] += y * 3 + p * 3, f["2w"] -= y + p, f["3w"] -= y + p, f["4w"] -= y + p;
5769
+ f[S.E] += y * 3 + p * 3, f[S.S] -= y + p, f[S.W] -= y + p, f[S.N] -= y + p;
5768
5770
  } else
5769
- for (let y of Object.values(v)) {
5771
+ for (let y of Object.values(S)) {
5770
5772
  if (y == l) continue;
5771
- const w = y == v.E ? 2 : 1, A = r(c * w) + p;
5773
+ const w = y == S.E ? 2 : 1, A = r(c * w) + p;
5772
5774
  f[y] -= A, f[l] += A;
5773
5775
  }
5774
5776
  } else {
@@ -5855,12 +5857,12 @@ class Ts {
5855
5857
  return this.cfg.reached == 1 ? [{ name: "立直", double: 1 }] : this.cfg.reached == 2 ? [{ name: "ダブルリーチ", double: 2 }] : [];
5856
5858
  }
5857
5859
  dB1(t) {
5858
- return this.minus() != 0 ? [] : (this.hand.drawn == null, t.some((n) => n.tiles.some((i) => i.has(S.TSUMO))) ? [{ name: "門前清自摸和", double: 1 }] : []);
5860
+ return this.minus() != 0 ? [] : (this.hand.drawn == null, t.some((n) => n.tiles.some((i) => i.has(v.TSUMO))) ? [{ name: "門前清自摸和", double: 1 }] : []);
5859
5861
  }
5860
5862
  dC1(t) {
5861
5863
  if (this.minus() != 0) return [];
5862
5864
  const e = "平和", n = this.calcFu(t);
5863
- return n == 20 ? [{ name: e, double: 1 }] : !t.some((i) => i.tiles.some((r) => r.has(S.TSUMO))) && n == 30 ? [{ name: e, double: 1 }] : [];
5865
+ return n == 20 ? [{ name: e, double: 1 }] : !t.some((i) => i.tiles.some((r) => r.has(v.TSUMO))) && n == 30 ? [{ name: e, double: 1 }] : [];
5864
5866
  }
5865
5867
  dD1(t) {
5866
5868
  return t.some(
@@ -5868,12 +5870,12 @@ class Ts {
5868
5870
  ) ? [] : [{ name: "断么九", double: 1 }];
5869
5871
  }
5870
5872
  dE1(t) {
5871
- return this.minus() != 0 ? [] : Os(t) == 1 ? [{ name: "一盃口", double: 1 }] : [];
5873
+ return this.minus() != 0 ? [] : Is(t) == 1 ? [{ name: "一盃口", double: 1 }] : [];
5872
5874
  }
5873
5875
  dF1(t) {
5874
5876
  const e = [];
5875
5877
  return t.forEach((n) => {
5876
- if (n instanceof X) return;
5878
+ if (n instanceof J) return;
5877
5879
  const i = n.tiles[0];
5878
5880
  i.t == d.Z && (i.equals(this.cfg.myWind) ? e.push({ name: "自風", double: 1 }) : i.equals(this.cfg.roundWind) ? e.push({ name: "場風", double: 1 }) : i.n == 5 ? e.push({ name: "白", double: 1 }) : i.n == 6 ? e.push({ name: "發", double: 1 }) : i.n == 7 && e.push({ name: "中", double: 1 }));
5879
5881
  }), e;
@@ -5899,7 +5901,7 @@ class Ts {
5899
5901
  for (let a of o.tiles) {
5900
5902
  for (let c of this.cfg.doras) a.equals(c, !0) && e++;
5901
5903
  for (let c of this.cfg.blindDoras) a.equals(c, !0) && i++;
5902
- it(a) && n++;
5904
+ K(a) && n++;
5903
5905
  }
5904
5906
  const r = [];
5905
5907
  return e > 0 && r.push({ name: "ドラ", double: e }), n > 0 && r.push({ name: "赤ドラ", double: n }), this.hand.reached && i > 0 && r.push({ name: "裏ドラ", double: i }), r;
@@ -5927,19 +5929,19 @@ class Ts {
5927
5929
  }
5928
5930
  dC2(t) {
5929
5931
  return t.length == 7 ? [] : t.every(
5930
- (n) => n instanceof F || n instanceof ht || n instanceof mt || n instanceof ct || n instanceof gt || n instanceof X
5932
+ (n) => n instanceof q || n instanceof ht || n instanceof mt || n instanceof ct || n instanceof gt || n instanceof J
5931
5933
  ) ? [{ name: "対々和", double: 2 }] : [];
5932
5934
  }
5933
5935
  dD2(t) {
5934
- return this.minus() != 0 ? [] : t.filter((n) => (n instanceof F || n instanceof ct) && !n.tiles.some((i) => i.has(S.RON))).length >= 3 ? [{ name: "三暗刻", double: 2 }] : [];
5936
+ return this.minus() != 0 ? [] : t.filter((n) => (n instanceof q || n instanceof ct) && !n.tiles.some((i) => i.has(v.RON))).length >= 3 ? [{ name: "三暗刻", double: 2 }] : [];
5935
5937
  }
5936
5938
  dE2(t) {
5937
5939
  return t.filter(
5938
- (n) => n instanceof F || n instanceof ht || n instanceof mt
5940
+ (n) => n instanceof q || n instanceof ht || n instanceof mt
5939
5941
  ).length >= 3 ? [{ name: "三槓子", double: 2 }] : [];
5940
5942
  }
5941
5943
  dF2(t) {
5942
- const e = (n) => n instanceof F || n instanceof ht || n instanceof mt || n instanceof ct || n instanceof gt;
5944
+ const e = (n) => n instanceof q || n instanceof ht || n instanceof mt || n instanceof ct || n instanceof gt;
5943
5945
  for (let n of t) {
5944
5946
  if (!e(n)) continue;
5945
5947
  const i = kt(n);
@@ -6000,7 +6002,7 @@ class Ts {
6000
6002
  return t.length == 7 ? [] : t.some((n) => n instanceof Nt || n instanceof lt) ? t.some((n) => n.tiles[0].t == d.Z) ? [] : t.every((n) => n.tiles.some((i) => wt.includes(i.n))) ? [{ name: "純全帯么九色", double: 3 - this.minus() }] : [] : [];
6001
6003
  }
6002
6004
  dC3(t) {
6003
- return this.minus() != 0 ? [] : Os(t) == 2 ? [{ name: "ニ盃口", double: 3 }] : [];
6005
+ return this.minus() != 0 ? [] : Is(t) == 2 ? [{ name: "ニ盃口", double: 3 }] : [];
6004
6006
  }
6005
6007
  dA6(t) {
6006
6008
  if (t.some((e) => e.tiles[0].t == d.Z)) return [];
@@ -6012,7 +6014,7 @@ class Ts {
6012
6014
  }
6013
6015
  dA13(t) {
6014
6016
  return t.length != 13 ? [] : t.some(
6015
- (n) => n instanceof X && n.tiles.some((i) => i.has(S.TSUMO) || i.has(S.RON))
6017
+ (n) => n instanceof J && n.tiles.some((i) => i.has(v.TSUMO) || i.has(v.RON))
6016
6018
  ) ? [{ name: "国士無双13面待ち", double: 26 }] : [{ name: "国士無双", double: 13 }];
6017
6019
  }
6018
6020
  dB13(t) {
@@ -6020,16 +6022,16 @@ class Ts {
6020
6022
  }
6021
6023
  dC13(t) {
6022
6024
  return t.length == 7 ? [] : t.every(
6023
- (i) => i instanceof F || i instanceof ct && !i.tiles.some((r) => r.has(S.RON)) || i instanceof X
6025
+ (i) => i instanceof q || i instanceof ct && !i.tiles.some((r) => r.has(v.RON)) || i instanceof J
6024
6026
  ) ? t.some(
6025
- (i) => i instanceof X && i.tiles.every((r) => r.has(S.TSUMO) || r.has(S.RON))
6027
+ (i) => i instanceof J && i.tiles.every((r) => r.has(v.TSUMO) || r.has(v.RON))
6026
6028
  ) ? [{ name: "四暗刻単騎待ち", double: 26 }] : [{ name: "四暗刻", double: 13 }] : [];
6027
6029
  }
6028
6030
  dD13(t) {
6029
6031
  if (t.length == 13) return [];
6030
6032
  const e = [5, 6, 7];
6031
6033
  return t.filter(
6032
- (i) => !(i instanceof X) && i.tiles.some((r) => r.t == d.Z && e.includes(r.n))
6034
+ (i) => !(i instanceof J) && i.tiles.some((r) => r.t == d.Z && e.includes(r.n))
6033
6035
  ).length == 3 ? [{ name: "大三元", double: 13 }] : [];
6034
6036
  }
6035
6037
  dE13(t) {
@@ -6042,14 +6044,14 @@ class Ts {
6042
6044
  }
6043
6045
  dG13(t) {
6044
6046
  return t.filter(
6045
- (n) => n instanceof F || n instanceof ht || n instanceof mt
6047
+ (n) => n instanceof q || n instanceof ht || n instanceof mt
6046
6048
  ).length == 4 ? [{ name: "四槓子", double: 13 }] : [];
6047
6049
  }
6048
6050
  dH13(t) {
6049
6051
  if (t.length == 13) return [];
6050
6052
  if (t.length == 7) return [];
6051
6053
  const e = [1, 2, 3, 4];
6052
- return t.filter((r) => r.tiles.some((o) => o.t == d.Z && e.includes(o.n))).length == 4 ? t.find((r) => r instanceof X).tiles.some((r) => r.t == d.Z && e.includes(r.n)) ? [{ name: "小四喜", double: 13 }] : [{ name: "大四喜", double: 13 }] : [];
6054
+ return t.filter((r) => r.tiles.some((o) => o.t == d.Z && e.includes(o.n))).length == 4 ? t.find((r) => r instanceof J).tiles.some((r) => r.t == d.Z && e.includes(r.n)) ? [{ name: "小四喜", double: 13 }] : [{ name: "大四喜", double: 13 }] : [];
6053
6055
  }
6054
6056
  dI13(t) {
6055
6057
  const e = (n) => !!(n.equals(new g(d.Z, 6)) || n.t == d.S && [2, 3, 4, 6, 8].includes(n.n));
@@ -6067,15 +6069,15 @@ class Ts {
6067
6069
  const i = this.cfg.myWind.n, r = this.cfg.roundWind.n;
6068
6070
  if (t.length == 7) return 25;
6069
6071
  const o = t.find(
6070
- (p) => p.tiles.some((y) => y.has(S.TSUMO) || y.has(S.RON))
6071
- ), a = this.minus() == 1, c = o.tiles.some((p) => p.has(S.TSUMO)), h = (p, y) => {
6072
+ (p) => p.tiles.some((y) => y.has(v.TSUMO) || y.has(v.RON))
6073
+ ), a = this.minus() == 1, c = o.tiles.some((p) => p.has(v.TSUMO)), h = (p, y) => {
6072
6074
  const w = p.tiles[0];
6073
6075
  return w.t == d.Z && [5, 6, 7].includes(w.n) || w.t == d.Z && [i, r].includes(w.n) || wt.includes(w.n) ? y * 2 : y;
6074
6076
  };
6075
6077
  for (let p of t)
6076
6078
  switch (!0) {
6077
6079
  case p instanceof ct:
6078
- let y = p.tiles.some((w) => w.has(S.RON)) ? 2 : 4;
6080
+ let y = p.tiles.some((w) => w.has(v.RON)) ? 2 : 4;
6079
6081
  n += h(p, y);
6080
6082
  break;
6081
6083
  case p instanceof gt:
@@ -6084,25 +6086,25 @@ class Ts {
6084
6086
  case (p instanceof mt || p instanceof ht):
6085
6087
  n += h(p, 8);
6086
6088
  break;
6087
- case p instanceof F:
6089
+ case p instanceof q:
6088
6090
  n += h(p, 16);
6089
6091
  break;
6090
6092
  }
6091
6093
  n += ((p) => {
6092
6094
  if (p instanceof ct) return 0;
6093
- if (p instanceof X) return 2;
6095
+ if (p instanceof J) return 2;
6094
6096
  const y = p.tiles, w = y.findIndex(
6095
- (A) => A.has(S.TSUMO) || A.has(S.RON)
6097
+ (A) => A.has(v.TSUMO) || A.has(v.RON)
6096
6098
  );
6097
6099
  return w == 1 || w == 0 && y[2].n == 9 || w == 2 && y[0].n == 1 ? 2 : 0;
6098
6100
  })(o);
6099
- let f = t.find((p) => p instanceof X).tiles[0];
6101
+ let f = t.find((p) => p instanceof J).tiles[0];
6100
6102
  f.t == d.Z && ([5, 6, 7].includes(f.n) && (n += 2), f.n == r && (n += 2), f.n == i && (n += 2));
6101
6103
  let m = !1;
6102
6104
  return !a && n == 20 && (m = !0), c && !m && (n += 2), !c && !a && (n += 10), !c && !a && n == 30 && (m = !0), a && n == 20 && (n = 30), n;
6103
6105
  }
6104
6106
  }
6105
- const xi = (s) => s.tiles.reduce((t, e) => `${t}${e.n}${e.t}`, ""), Os = (s) => {
6107
+ const xi = (s) => s.tiles.reduce((t, e) => `${t}${e.n}${e.t}`, ""), Is = (s) => {
6106
6108
  let t = {};
6107
6109
  for (let n of s) {
6108
6110
  if (!(n instanceof Nt)) continue;
@@ -6113,33 +6115,34 @@ const xi = (s) => s.tiles.reduce((t, e) => `${t}${e.n}${e.t}`, ""), Os = (s) =>
6113
6115
  for (let n in t)
6114
6116
  t[n] >= 2 && e++;
6115
6117
  return e;
6116
- }, kt = (s) => [...s.tiles].sort(Re)[0], Is = (s) => {
6117
- let t = it(s) ? 5 : s.n, e = s.t;
6118
+ }, kt = (s) => [...s.tiles].sort(Re)[0], Os = (s) => {
6119
+ let t = K(s) ? 5 : s.n, e = s.t;
6118
6120
  return new g(e, t % 9 + 1);
6119
6121
  };
6120
6122
  class Qt {
6121
- // ツモった後の17枚の手配から、牌効率に従って捨てるべき牌を返す。
6123
+ // ツモった後の14枚の手配から、牌効率に従って捨てるべき牌を返す。
6122
6124
  // choices は、通常なら hand.hand を指定する。ただし、リーチしている場合は捨てる牌が限られているので choices で制限する。
6123
- static calcCandidates(t, e) {
6125
+ static calcCandidates(t, e, n = !1) {
6124
6126
  C(e.length > 0, "choices to discard is zero");
6125
- let n = [];
6126
- for (let i of e) {
6127
- const r = t.dec([i]), o = Qt.candidateTiles(t);
6128
- t.inc(r), n.length == 0 || o.shanten < n[0].shanten ? n = [
6129
- {
6130
- shanten: o.shanten,
6131
- candidates: o.candidates,
6132
- tile: i
6133
- }
6134
- ] : o.shanten == n[0].shanten && n.push({
6135
- candidates: o.candidates,
6136
- shanten: o.shanten,
6137
- tile: i
6127
+ const i = /* @__PURE__ */ new Map();
6128
+ let r = Number.POSITIVE_INFINITY;
6129
+ for (let o of e) {
6130
+ const a = t.dec([o]), c = Qt.candidateTiles(t);
6131
+ t.inc(a);
6132
+ const h = K(o) && n ? new g(o.t, 5).toString() : new g(o.t, o.n).toString();
6133
+ c.shanten < r ? (i.clear(), i.set(h, {
6134
+ shanten: c.shanten,
6135
+ candidates: c.candidates,
6136
+ tile: o
6137
+ }), r = c.shanten) : c.shanten == r && i.set(h, {
6138
+ shanten: c.shanten,
6139
+ candidates: c.candidates,
6140
+ tile: o
6138
6141
  });
6139
6142
  }
6140
- return n;
6143
+ return Array.from(i.values());
6141
6144
  }
6142
- // 積もる前の16枚の手配から、有効牌の一覧を返す
6145
+ // 積もる前の13枚の手配から、有効牌の一覧を返す
6143
6146
  static candidateTiles(t) {
6144
6147
  let e = Number.POSITIVE_INFINITY, n = [];
6145
6148
  const i = new en(t);
@@ -6276,7 +6279,7 @@ class Ue {
6276
6279
  class Fe {
6277
6280
  constructor(t, e) {
6278
6281
  b(this, "pToW", {});
6279
- b(this, "wToP", q(""));
6282
+ b(this, "wToP", Z(""));
6280
6283
  b(this, "round");
6281
6284
  b(this, "sticks");
6282
6285
  this.round = (e == null ? void 0 : e.round) ?? "1w1", this.sticks = (e == null ? void 0 : e.sticks) ?? { reach: 0, dead: 0 }, this.pToW = t;
@@ -6335,12 +6338,12 @@ class Xa {
6335
6338
  [d.P]: [1, 4, 4, 4, 4, 4, 4, 4, 4, 4],
6336
6339
  [d.Z]: [0, 4, 4, 4, 4, 4, 4, 4]
6337
6340
  });
6338
- b(this, "safeMap", q({}, !0));
6341
+ b(this, "safeMap", Z({}, !0));
6339
6342
  this.disable = t;
6340
6343
  }
6341
6344
  // FIXME get red
6342
6345
  get(t) {
6343
- return t.t == d.BACK ? 0 : it(t) ? this.c[t.t][5] : this.c[t.t][t.n];
6346
+ return t.t == d.BACK ? 0 : K(t) ? this.c[t.t][5] : this.c[t.t][t.n];
6344
6347
  }
6345
6348
  dec(...t) {
6346
6349
  if (!this.disable) {
@@ -6348,7 +6351,7 @@ class Xa {
6348
6351
  if (e.t != d.BACK) {
6349
6352
  if (this.get(e) <= 0)
6350
6353
  throw new Error(`cannot decrease ${e.toString()} due to zero`);
6351
- this.c[e.t][e.n] -= 1, it(e) && (this.c[e.t][5] -= 1);
6354
+ this.c[e.t][e.n] -= 1, K(e) && (this.c[e.t][5] -= 1);
6352
6355
  }
6353
6356
  }
6354
6357
  }
@@ -6370,7 +6373,7 @@ class Xa {
6370
6373
  };
6371
6374
  }
6372
6375
  }
6373
- class Oi {
6376
+ class Ii {
6374
6377
  constructor() {
6375
6378
  b(this, "m", []);
6376
6379
  }
@@ -6449,7 +6452,7 @@ class Es {
6449
6452
  this._last = null;
6450
6453
  }
6451
6454
  }
6452
- const Ii = ".", tc = "", Ei = "", ec = "#", nc = "*", Ni = "xstate.init", $n = "xstate.stop";
6455
+ const Oi = ".", tc = "", Ei = "", ec = "#", nc = "*", Ni = "xstate.init", $n = "xstate.stop";
6453
6456
  function sc(s, t) {
6454
6457
  return {
6455
6458
  type: `xstate.after.${s}.${t}`
@@ -6602,12 +6605,12 @@ function lc(s, t) {
6602
6605
  delay: y,
6603
6606
  id: w,
6604
6607
  startedAt: Date.now()
6605
- }, O = Cs(f, w);
6606
- u._snapshot._scheduledEvents[O] = A;
6608
+ }, I = Cs(f, w);
6609
+ u._snapshot._scheduledEvents[I] = A;
6607
6610
  const H = a.setTimeout(() => {
6608
- delete o[O], delete u._snapshot._scheduledEvents[O], u._relay(f, m, p);
6611
+ delete o[I], delete u._snapshot._scheduledEvents[I], u._relay(f, m, p);
6609
6612
  }, y);
6610
- o[O] = H;
6613
+ o[I] = H;
6611
6614
  },
6612
6615
  cancel: (f, m) => {
6613
6616
  const p = Cs(f, m), y = o[p];
@@ -6680,9 +6683,9 @@ function lc(s, t) {
6680
6683
  target: y,
6681
6684
  event: w,
6682
6685
  delay: A,
6683
- id: O
6686
+ id: I
6684
6687
  } = f[m];
6685
- h.schedule(p, y, w, A, O);
6688
+ h.schedule(p, y, w, A, I);
6686
6689
  }
6687
6690
  },
6688
6691
  _clock: a,
@@ -6691,7 +6694,7 @@ function lc(s, t) {
6691
6694
  return u;
6692
6695
  }
6693
6696
  const cs = 1;
6694
- let U = /* @__PURE__ */ function(s) {
6697
+ let F = /* @__PURE__ */ function(s) {
6695
6698
  return s[s.NotStarted = 0] = "NotStarted", s[s.Running = 1] = "Running", s[s.Stopped = 2] = "Stopped", s;
6696
6699
  }({});
6697
6700
  const uc = {
@@ -6711,7 +6714,7 @@ class fc {
6711
6714
  * @param options Actor options
6712
6715
  */
6713
6716
  constructor(t, e) {
6714
- this.logic = t, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new Es(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = U.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
6717
+ this.logic = t, this._snapshot = void 0, this.clock = void 0, this.options = void 0, this.id = void 0, this.mailbox = new Es(this._process.bind(this)), this.observers = /* @__PURE__ */ new Set(), this.eventListeners = /* @__PURE__ */ new Map(), this.logger = void 0, this._processingStatus = F.NotStarted, this._parent = void 0, this._syncSnapshot = void 0, this.ref = void 0, this._actorScope = void 0, this._systemId = void 0, this.sessionId = void 0, this.system = void 0, this._doneEvent = void 0, this.src = void 0, this._deferred = [];
6715
6718
  const n = {
6716
6719
  ...uc,
6717
6720
  ...e
@@ -6871,7 +6874,7 @@ class fc {
6871
6874
  subscribe(t, e, n) {
6872
6875
  var r;
6873
6876
  const i = Bn(t, e, n);
6874
- if (this._processingStatus !== U.Stopped)
6877
+ if (this._processingStatus !== F.Stopped)
6875
6878
  this.observers.add(i);
6876
6879
  else
6877
6880
  switch (this._snapshot.status) {
@@ -6913,7 +6916,7 @@ class fc {
6913
6916
  }
6914
6917
  /** Starts the Actor from the initial state */
6915
6918
  start() {
6916
- if (this._processingStatus === U.Running)
6919
+ if (this._processingStatus === F.Running)
6917
6920
  return this;
6918
6921
  this._syncSnapshot && this.subscribe({
6919
6922
  next: (n) => {
@@ -6924,7 +6927,7 @@ class fc {
6924
6927
  },
6925
6928
  error: () => {
6926
6929
  }
6927
- }), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = U.Running;
6930
+ }), this.system._register(this.sessionId, this), this._systemId && this.system._set(this._systemId, this), this._processingStatus = F.Running;
6928
6931
  const t = Mi(this.options.input);
6929
6932
  switch (this.system._sendInspectionEvent({
6930
6933
  type: "@xstate.event",
@@ -6972,7 +6975,7 @@ class fc {
6972
6975
  this.update(e, t), t.type === $n && (this._stopProcedure(), this._complete());
6973
6976
  }
6974
6977
  _stop() {
6975
- return this._processingStatus === U.Stopped ? this : (this.mailbox.clear(), this._processingStatus === U.NotStarted ? (this._processingStatus = U.Stopped, this) : (this.mailbox.enqueue({
6978
+ return this._processingStatus === F.Stopped ? this : (this.mailbox.clear(), this._processingStatus === F.NotStarted ? (this._processingStatus = F.Stopped, this) : (this.mailbox.enqueue({
6976
6979
  type: $n
6977
6980
  }), this));
6978
6981
  }
@@ -7018,11 +7021,11 @@ class fc {
7018
7021
  // right now, they are being stopped within the machine's transition
7019
7022
  // but that could throw and leave us with "orphaned" active actors
7020
7023
  _stopProcedure() {
7021
- return this._processingStatus !== U.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new Es(this._process.bind(this)), this._processingStatus = U.Stopped, this.system._unregister(this), this);
7024
+ return this._processingStatus !== F.Running ? this : (this.system.scheduler.cancelAll(this), this.mailbox.clear(), this.mailbox = new Es(this._process.bind(this)), this._processingStatus = F.Stopped, this.system._unregister(this), this);
7022
7025
  }
7023
7026
  /** @internal */
7024
7027
  _send(t) {
7025
- this._processingStatus !== U.Stopped && this.mailbox.enqueue(t);
7028
+ this._processingStatus !== F.Stopped && this.mailbox.enqueue(t);
7026
7029
  }
7027
7030
  /**
7028
7031
  * Sends an event to the running Actor to trigger a transition.
@@ -7135,7 +7138,7 @@ function yc(s, {
7135
7138
  actorRef: e
7136
7139
  }) {
7137
7140
  e && s.defer(() => {
7138
- e._processingStatus !== U.Stopped && e.start();
7141
+ e._processingStatus !== F.Stopped && e.start();
7139
7142
  });
7140
7143
  }
7141
7144
  function wc(...[s, {
@@ -7161,7 +7164,7 @@ function _c(s, t, e, n, {
7161
7164
  }
7162
7165
  function bc(s, t) {
7163
7166
  if (t) {
7164
- if (s.system._unregister(t), t._processingStatus !== U.Running) {
7167
+ if (s.system._unregister(t), t._processingStatus !== F.Running) {
7165
7168
  s.stopChild(t);
7166
7169
  return;
7167
7170
  }
@@ -7383,7 +7386,7 @@ function kc(s, t) {
7383
7386
  return e;
7384
7387
  if (nn(e))
7385
7388
  return s.machine.getStateNodeById(e);
7386
- const n = e[0] === Ii;
7389
+ const n = e[0] === Oi;
7387
7390
  if (n && !s.parent)
7388
7391
  return Ze(s, e.slice(1));
7389
7392
  const i = n ? s.key + e : e;
@@ -7473,11 +7476,11 @@ function Tc(s, t, e, n) {
7473
7476
  const r = ne(s, t).next(e, n);
7474
7477
  return !r || !r.length ? s.next(e, n) : r;
7475
7478
  }
7476
- function Oc(s, t, e, n) {
7479
+ function Ic(s, t, e, n) {
7477
7480
  const i = Object.keys(t), r = ne(s, i[0]), o = fs(r, t[i[0]], e, n);
7478
7481
  return !o || !o.length ? s.next(e, n) : o;
7479
7482
  }
7480
- function Ic(s, t, e, n) {
7483
+ function Oc(s, t, e, n) {
7481
7484
  const i = [];
7482
7485
  for (const r of Object.keys(t)) {
7483
7486
  const o = t[r];
@@ -7489,7 +7492,7 @@ function Ic(s, t, e, n) {
7489
7492
  return i.length ? i : s.next(e, n);
7490
7493
  }
7491
7494
  function fs(s, t, e, n) {
7492
- return typeof t == "string" ? Tc(s, t, e, n) : Object.keys(t).length === 1 ? Oc(s, t, e, n) : Ic(s, t, e, n);
7495
+ return typeof t == "string" ? Tc(s, t, e, n) : Object.keys(t).length === 1 ? Ic(s, t, e, n) : Oc(s, t, e, n);
7493
7496
  }
7494
7497
  function Ec(s) {
7495
7498
  return Object.keys(s.states).map((t) => s.states[t]).filter((t) => t.type === "history");
@@ -7747,7 +7750,7 @@ function Fi(s, t, e, n, i, r) {
7747
7750
  event: t
7748
7751
  }) : c.params : void 0;
7749
7752
  if (!("resolve" in l)) {
7750
- e.self._processingStatus === U.Running ? m() : e.defer(() => {
7753
+ e.self._processingStatus === F.Running ? m() : e.defer(() => {
7751
7754
  m();
7752
7755
  });
7753
7756
  continue;
@@ -7761,7 +7764,7 @@ function Fi(s, t, e, n, i, r) {
7761
7764
  // this holds all params
7762
7765
  i
7763
7766
  );
7764
- a = y, "retryResolve" in p && (r == null || r.push([p, w])), "execute" in p && (e.self._processingStatus === U.Running ? p.execute(e, w) : e.defer(p.execute.bind(null, e, w))), A && (a = Fi(a, t, e, A, i, r));
7767
+ a = y, "retryResolve" in p && (r == null || r.push([p, w])), "execute" in p && (e.self._processingStatus === F.Running ? p.execute(e, w) : e.defer(p.execute.bind(null, e, w))), A && (a = Fi(a, t, e, A, i, r));
7765
7768
  }
7766
7769
  return a;
7767
7770
  }
@@ -8039,7 +8042,7 @@ function Yc(s, {
8039
8042
  return (o, a) => {
8040
8043
  const c = r(o, a);
8041
8044
  return i[c.id] = c, s.defer(() => {
8042
- c._processingStatus !== U.Stopped && c.start();
8045
+ c._processingStatus !== F.Stopped && c.start();
8043
8046
  }), c;
8044
8047
  };
8045
8048
  }
@@ -8093,7 +8096,7 @@ const Vc = {}, he = (s) => typeof s == "string" ? {
8093
8096
  } : s;
8094
8097
  class ps {
8095
8098
  constructor(t, e) {
8096
- if (this.config = t, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = e._parent, this.key = e._key, this.machine = e._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(Ii), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Ms(this.config.states, (n, i) => new ps(n, {
8099
+ if (this.config = t, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = e._parent, this.key = e._key, this.machine = e._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(Oi), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Ms(this.config.states, (n, i) => new ps(n, {
8097
8100
  _parent: this,
8098
8101
  _key: i,
8099
8102
  _machine: this.machine
@@ -8431,9 +8434,9 @@ const Ne = (s) => s === !1 ? !1 : s.map((t) => t.serialize()), eh = (s) => s ===
8431
8434
  id: "Untitled",
8432
8435
  initial: "distribute",
8433
8436
  context: {
8434
- currentWind: v.E,
8435
- oneShotMap: q(!1),
8436
- missingMap: q(!1),
8437
+ currentWind: S.E,
8438
+ oneShotMap: Z(!1),
8439
+ missingMap: Z(!1),
8437
8440
  controller: s,
8438
8441
  genEventID: sh()
8439
8442
  },
@@ -8713,8 +8716,8 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8713
8716
  },
8714
8717
  notify_distribution: ({ context: t, event: e }) => {
8715
8718
  const n = t.genEventID(), i = t.controller.initialHands();
8716
- for (let r of Object.values(v)) {
8717
- const o = q("_____________");
8719
+ for (let r of Object.values(S)) {
8720
+ const o = Z("_____________");
8718
8721
  o[r] = i[r].toString();
8719
8722
  const a = {
8720
8723
  id: n,
@@ -8755,8 +8758,8 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8755
8758
  t.controller.emit(a), t.controller.pollReplies(o, [i]);
8756
8759
  },
8757
8760
  notify_choice_after_discarded: ({ context: t, event: e }) => {
8758
- const n = t.genEventID(), i = t.controller.river.lastTile, r = i.t.clone({ add: S.HORIZONTAL });
8759
- for (let o of Object.values(v)) {
8761
+ const n = t.genEventID(), i = t.controller.river.lastTile, r = i.t.clone({ add: v.HORIZONTAL });
8762
+ for (let o of Object.values(S)) {
8760
8763
  const a = {
8761
8764
  id: n,
8762
8765
  type: "CHOICE_AFTER_DISCARDED",
@@ -8786,7 +8789,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8786
8789
  };
8787
8790
  a.choices.RON && (t.missingMap[o] = !0), t.controller.emit(a);
8788
8791
  }
8789
- t.controller.pollReplies(n, Object.values(v));
8792
+ t.controller.pollReplies(n, Object.values(S));
8790
8793
  },
8791
8794
  notify_choice_after_called: ({ context: t, event: e }, n) => {
8792
8795
  const i = t.genEventID(), r = t.currentWind;
@@ -8806,11 +8809,11 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8806
8809
  notify_choice_for_chankan: ({ context: t, event: e }) => {
8807
8810
  if (e.type != "SHO_KAN" && e.type != "AN_KAN")
8808
8811
  throw new Error(`unexpected event ${e.type}`);
8809
- const n = t.genEventID(), i = e.block.tiles[0].clone({ remove: S.HORIZONTAL });
8810
- for (let r of Object.values(v)) {
8812
+ const n = t.genEventID(), i = e.block.tiles[0].clone({ remove: v.HORIZONTAL });
8813
+ for (let r of Object.values(S)) {
8811
8814
  const o = t.controller.doWin(
8812
8815
  r,
8813
- e.block.tiles[0].clone({ remove: S.HORIZONTAL }),
8816
+ e.block.tiles[0].clone({ remove: v.HORIZONTAL }),
8814
8817
  {
8815
8818
  whoDiscarded: e.iam,
8816
8819
  quadWin: !0,
@@ -8828,14 +8831,14 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8828
8831
  };
8829
8832
  a.choices.RON && (t.missingMap[r] = !0), t.controller.emit(a);
8830
8833
  }
8831
- t.controller.pollReplies(n, Object.values(v));
8834
+ t.controller.pollReplies(n, Object.values(S));
8832
8835
  },
8833
8836
  notify_call: ({ context: t, event: e }) => {
8834
8837
  if (!(e.type == "CHI" || e.type == "PON" || e.type == "DAI_KAN" || e.type == "AN_KAN" || e.type == "SHO_KAN"))
8835
8838
  throw new Error(`unexpected event ${e.type}`);
8836
8839
  const n = t.genEventID(), i = e.iam;
8837
8840
  t.currentWind = i;
8838
- for (let r of Object.values(v)) {
8841
+ for (let r of Object.values(S)) {
8839
8842
  const o = {
8840
8843
  id: n,
8841
8844
  type: e.type,
@@ -8851,7 +8854,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8851
8854
  if (e.type != "DISCARD" && e.type != "REACH")
8852
8855
  throw new Error(`unexpected event ${e.type}`);
8853
8856
  const n = t.genEventID(), i = t.currentWind, r = e.tile;
8854
- for (let o of Object.values(v)) {
8857
+ for (let o of Object.values(S)) {
8855
8858
  const a = {
8856
8859
  id: n,
8857
8860
  type: "DISCARD",
@@ -8869,8 +8872,8 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8869
8872
  r == "kan" ? o = t.controller.wall.kan() : o = t.controller.wall.draw();
8870
8873
  const a = t.currentWind;
8871
8874
  t.controller.hand(a).reached || (t.missingMap[a] = !1);
8872
- for (let c of Object.values(v)) {
8873
- let h = new g(d.BACK, 0, [S.TSUMO]);
8875
+ for (let c of Object.values(S)) {
8876
+ let h = new g(d.BACK, 0, [v.TSUMO]);
8874
8877
  c == a && (h = o);
8875
8878
  const l = {
8876
8879
  id: i,
@@ -8888,7 +8891,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8888
8891
  const n = t.genEventID();
8889
8892
  if (e.type == "RON") {
8890
8893
  const i = e.targetInfo.wind, r = t.currentWind, o = i == r && t.oneShotMap[r] == !0, a = e.iam;
8891
- for (let c of Object.values(v)) {
8894
+ for (let c of Object.values(S)) {
8892
8895
  const h = {
8893
8896
  id: n,
8894
8897
  type: e.type,
@@ -8909,7 +8912,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8909
8912
  if (e.type != "TSUMO")
8910
8913
  throw new Error(`unexpected event ${e.type}`);
8911
8914
  const n = t.genEventID(), i = t.currentWind;
8912
- for (let r of Object.values(v)) {
8915
+ for (let r of Object.values(S)) {
8913
8916
  const o = {
8914
8917
  id: n,
8915
8918
  type: e.type,
@@ -8924,9 +8927,9 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8924
8927
  notify_reach: ({ context: t, event: e }) => {
8925
8928
  if (e.type != "REACH")
8926
8929
  throw new Error(`unexpected event ${e.type}`);
8927
- const n = t.genEventID(), i = e.iam, r = e.tile.clone({ add: S.HORIZONTAL });
8930
+ const n = t.genEventID(), i = e.iam, r = e.tile.clone({ add: v.HORIZONTAL });
8928
8931
  t.oneShotMap[i] = !0;
8929
- for (let o of Object.values(v)) {
8932
+ for (let o of Object.values(S)) {
8930
8933
  const a = {
8931
8934
  id: n,
8932
8935
  type: e.type,
@@ -8941,7 +8944,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8941
8944
  const n = t.genEventID();
8942
8945
  if (e.type == "AN_KAN") {
8943
8946
  const i = t.controller.wall.openDoraMarker();
8944
- for (let r of Object.values(v)) {
8947
+ for (let r of Object.values(S)) {
8945
8948
  const o = {
8946
8949
  id: n,
8947
8950
  type: "NEW_DORA",
@@ -8954,16 +8957,16 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8954
8957
  e.type == "SHO_KAN";
8955
8958
  },
8956
8959
  disable_one_shot: ({ context: t, event: e }) => {
8957
- for (let n of Object.values(v)) t.oneShotMap[n] = !1;
8960
+ for (let n of Object.values(S)) t.oneShotMap[n] = !1;
8958
8961
  },
8959
8962
  disable_one_shot_for_me: ({ context: t, event: e }) => {
8960
8963
  t.oneShotMap[t.currentWind] = !1;
8961
8964
  },
8962
8965
  notify_end: ({ context: t, event: e }) => {
8963
- const n = t.genEventID(), i = q("");
8966
+ const n = t.genEventID(), i = Z("");
8964
8967
  if (e.type == "DRAWN_GAME_BY_NINE_TILES") {
8965
8968
  i[e.iam] = t.controller.hand(e.iam).toString();
8966
- for (let r of Object.values(v)) {
8969
+ for (let r of Object.values(S)) {
8967
8970
  const o = {
8968
8971
  id: n,
8969
8972
  type: "END_GAME",
@@ -8972,17 +8975,17 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8972
8975
  shouldContinue: !0,
8973
8976
  sticks: t.controller.placeManager.sticks,
8974
8977
  scores: t.controller.scoreManager.summary,
8975
- deltas: q(0),
8978
+ deltas: Z(0),
8976
8979
  hands: i
8977
8980
  };
8978
8981
  t.controller.emit(o);
8979
8982
  }
8980
8983
  } else if (e.type == "RON" || e.type == "TSUMO") {
8981
- const r = e.iam == v.E, o = t.controller.finalResult(
8984
+ const r = e.iam == S.E, o = t.controller.finalResult(
8982
8985
  e.ret,
8983
8986
  e.iam
8984
8987
  );
8985
- for (let a of Object.values(v)) {
8988
+ for (let a of Object.values(S)) {
8986
8989
  i[e.iam] = t.controller.hand(e.iam).toString();
8987
8990
  const c = {
8988
8991
  id: n,
@@ -8999,7 +9002,7 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
8999
9002
  }
9000
9003
  } else if (!t.controller.wall.canKan || t.controller.river.cannotContinue()) {
9001
9004
  const r = t.controller.wall.canKan ? "FOUR_WIND" : "FOUR_KAN";
9002
- for (let o of Object.values(v)) {
9005
+ for (let o of Object.values(S)) {
9003
9006
  const a = {
9004
9007
  id: n,
9005
9008
  type: "END_GAME",
@@ -9008,8 +9011,8 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
9008
9011
  shouldContinue: !0,
9009
9012
  sticks: t.controller.placeManager.sticks,
9010
9013
  scores: t.controller.scoreManager.summary,
9011
- deltas: q(0),
9012
- hands: q("")
9014
+ deltas: Z(0),
9015
+ hands: Z("")
9013
9016
  };
9014
9017
  t.controller.emit(a);
9015
9018
  }
@@ -9018,15 +9021,15 @@ CHI/PON の場合は鳴ける組み合わせの一覧`
9018
9021
  throw new Error(`unexpected event ${e.type}`);
9019
9022
  {
9020
9023
  const r = [];
9021
- for (let h of Object.values(v)) {
9024
+ for (let h of Object.values(S)) {
9022
9025
  const l = t.controller.hand(h);
9023
9026
  new en(l).calc() == 0 && (r.push(h), i[h] = l.toString());
9024
9027
  }
9025
- const o = r.length == 0 || r.length == 4, a = q(0);
9026
- for (let h of Object.values(v))
9028
+ const o = r.length == 0 || r.length == 4, a = Z(0);
9029
+ for (let h of Object.values(S))
9027
9030
  r.includes(h) ? a[h] += o ? 0 : 3e3 / r.length : a[h] -= o ? 0 : 3e3 / (4 - r.length);
9028
- const c = r.length == 4 || a[v.E] > 0;
9029
- for (let h of Object.values(v)) {
9031
+ const c = r.length == 4 || a[S.E] > 0;
9032
+ for (let h of Object.values(S)) {
9030
9033
  const l = {
9031
9034
  id: n,
9032
9035
  type: "END_GAME",
@@ -9167,10 +9170,10 @@ class sn {
9167
9170
  this.observer.scoreManager = new Ue(i);
9168
9171
  const r = Ti(this.playerIDs.concat());
9169
9172
  this.observer.placeManager = new Fe({
9170
- [r[0]]: v.E,
9171
- [r[1]]: v.S,
9172
- [r[2]]: v.W,
9173
- [r[3]]: v.N
9173
+ [r[0]]: S.E,
9174
+ [r[1]]: S.S,
9175
+ [r[2]]: S.W,
9176
+ [r[3]]: S.N
9174
9177
  });
9175
9178
  }
9176
9179
  boardParams(t) {
@@ -9293,7 +9296,7 @@ class sn {
9293
9296
  const h = o.choices[r.type];
9294
9297
  C(h, `${r.type} choice is none`), this.actor.send({
9295
9298
  type: r.type,
9296
- tile: g.from(h[0]).clone({ remove: S.TSUMO }),
9299
+ tile: g.from(h[0]).clone({ remove: v.TSUMO }),
9297
9300
  iam: a
9298
9301
  });
9299
9302
  break;
@@ -9301,7 +9304,7 @@ class sn {
9301
9304
  const l = o.choices[r.type];
9302
9305
  C(l, `${r.type} choice is none`), this.actor.send({
9303
9306
  type: r.type,
9304
- block: F.from(l[0].tiles),
9307
+ block: q.from(l[0].tiles),
9305
9308
  iam: a
9306
9309
  });
9307
9310
  break;
@@ -9413,17 +9416,17 @@ class sn {
9413
9416
  if (n == null || t == e) return !1;
9414
9417
  const i = this.hand(t);
9415
9418
  if (i.reached || i.hands.length < 3) return !1;
9416
- let r = n.clone({ remove: S.HORIZONTAL });
9417
- if (it(n) && (r = r.clone({ n: 5 })), i.get(n.t, r.n) < 2) return !1;
9419
+ let r = n.clone({ remove: v.HORIZONTAL });
9420
+ if (K(n) && (r = r.clone({ n: 5 })), i.get(n.t, r.n) < 2) return !1;
9418
9421
  const o = [];
9419
9422
  let a = Math.abs(Number(t[0]) - Number(e[0]));
9420
9423
  a == 3 && (a = 0), a == 2 && (a = 1), a == 1 && (a = 2);
9421
9424
  let c = new gt([r, r, r]);
9422
9425
  c = c.clone({
9423
- replace: { idx: a, tile: n.clone({ add: S.HORIZONTAL }) }
9426
+ replace: { idx: a, tile: n.clone({ add: v.HORIZONTAL }) }
9424
9427
  });
9425
9428
  const h = a % 2 + 1, l = c.tiles[h];
9426
- if (tt(n) && i.get(n.t, 0) > 0 && (c = c.clone({ replace: { idx: h, tile: l.clone({ n: 0 }) } })), o.push(c), tt(n) && i.get(n.t, r.n) == 3) {
9429
+ if (et(n) && i.get(n.t, 0) > 0 && (c = c.clone({ replace: { idx: h, tile: l.clone({ n: 0 }) } })), o.push(c), et(n) && i.get(n.t, r.n) == 3) {
9427
9430
  const u = c.clone({ replace: { idx: h, tile: l.clone({ n: 5 }) } });
9428
9431
  o.push(u);
9429
9432
  }
@@ -9434,10 +9437,10 @@ class sn {
9434
9437
  const i = this.hand(t);
9435
9438
  if (i.reached || i.hands.length < 3) return !1;
9436
9439
  let r = n;
9437
- it(r) && (r = n.clone({ n: 5 }));
9440
+ K(r) && (r = n.clone({ n: 5 }));
9438
9441
  const o = [], a = r.n - 2 >= 1 && i.get(n.t, r.n - 2) > 0 && i.get(n.t, r.n - 1) > 0, c = n.clone({
9439
- add: S.HORIZONTAL,
9440
- remove: S.TSUMO
9442
+ add: v.HORIZONTAL,
9443
+ remove: v.TSUMO
9441
9444
  });
9442
9445
  if (a && o.push(
9443
9446
  new lt([
@@ -9459,7 +9462,7 @@ class sn {
9459
9462
  ])
9460
9463
  ), o.length == 0) return !1;
9461
9464
  if (i.hands.length == 4) {
9462
- const m = o[0], p = this.cannotDiscardTile(o[0]), y = i.dec([m.tiles[1], m.tiles[2]]), w = p.reduce((A, O) => A + i.get(O.t, O.n), 0) == 2;
9465
+ const m = o[0], p = this.cannotDiscardTile(o[0]), y = i.dec([m.tiles[1], m.tiles[2]]), w = p.reduce((A, I) => A + i.get(I.t, I.n), 0) == 2;
9463
9466
  if (i.inc(y), w) return !1;
9464
9467
  }
9465
9468
  const u = i.get(n.t, 0) > 0, f = this.redPattern(o, u);
@@ -9467,12 +9470,12 @@ class sn {
9467
9470
  }
9468
9471
  redPattern(t, e) {
9469
9472
  return t.length == 0 ? [] : e ? t.filter(
9470
- (i) => tt(i.tiles[1]) || tt(i.tiles[2])
9473
+ (i) => et(i.tiles[1]) || et(i.tiles[2])
9471
9474
  ).map((i) => {
9472
- if (tt(i.tiles[1])) {
9475
+ if (et(i.tiles[1])) {
9473
9476
  const r = i.tiles[1].clone({ n: 0 });
9474
9477
  return i.clone({ replace: { idx: 1, tile: r } });
9475
- } else if (tt(i.tiles[2])) {
9478
+ } else if (et(i.tiles[2])) {
9476
9479
  const r = i.tiles[2].clone({ n: 0 });
9477
9480
  return i.clone({ replace: { idx: 2, tile: r } });
9478
9481
  }
@@ -9513,12 +9516,12 @@ class sn {
9513
9516
  new g(i, r),
9514
9517
  new g(i, r)
9515
9518
  ];
9516
- i != d.Z && r == 5 && (o[0] = o[0].clone({ n: 0 })), n.push(new F(o));
9519
+ i != d.Z && r == 5 && (o[0] = o[0].clone({ n: 0 })), n.push(new q(o));
9517
9520
  }
9518
9521
  if (n.length == 0) return !1;
9519
9522
  for (let i of n)
9520
9523
  C(
9521
- i.tiles.filter((r) => r.has(S.HORIZONTAL)).length == 0,
9524
+ i.tiles.filter((r) => r.has(v.HORIZONTAL)).length == 0,
9522
9525
  `h op ${i.toString()}`
9523
9526
  );
9524
9527
  return n;
@@ -9534,15 +9537,15 @@ class sn {
9534
9537
  if (e.get(o.t, o.n) == 1) {
9535
9538
  const a = [
9536
9539
  ...r.tiles,
9537
- new g(o.t, o.n, [S.HORIZONTAL])
9540
+ new g(o.t, o.n, [v.HORIZONTAL])
9538
9541
  ];
9539
- tt(o) && e.get(o.t, 0) == 1 && a[3].n == 0, i.push(new ht(a));
9542
+ et(o) && e.get(o.t, 0) == 1 && a[3].n == 0, i.push(new ht(a));
9540
9543
  }
9541
9544
  }
9542
9545
  if (i.length == 0) return !1;
9543
9546
  for (let r of i)
9544
9547
  C(
9545
- r.tiles.filter((o) => o.has(S.HORIZONTAL)).length == 2,
9548
+ r.tiles.filter((o) => o.has(v.HORIZONTAL)).length == 2,
9546
9549
  `h op ${r.toString()}`
9547
9550
  );
9548
9551
  return i;
@@ -9550,19 +9553,19 @@ class sn {
9550
9553
  doDaiKan(t, e, n) {
9551
9554
  const i = this.hand(t);
9552
9555
  if (i.reached || t == e) return !1;
9553
- let r = n.clone({ remove: S.HORIZONTAL });
9554
- if (it(r) && (r = r.clone({ n: 5 })), i.get(r.t, r.n) != 3) return !1;
9556
+ let r = n.clone({ remove: v.HORIZONTAL });
9557
+ if (K(r) && (r = r.clone({ n: 5 })), i.get(r.t, r.n) != 3) return !1;
9555
9558
  let o = new mt([r, r, r, r]), a = Math.abs(Number(t[0]) - Number(e[0]));
9556
9559
  a == 3 && (a = 0), a == 1 && (a = 3);
9557
9560
  let c = o.clone({
9558
- replace: { idx: a, tile: n.clone({ add: S.HORIZONTAL }) }
9561
+ replace: { idx: a, tile: n.clone({ add: v.HORIZONTAL }) }
9559
9562
  });
9560
- if (tt(r) && tt(n)) {
9563
+ if (et(r) && et(n)) {
9561
9564
  const h = a % 3 + 1, l = c.tiles[h].clone({ n: 0 });
9562
9565
  c = c.clone({ replace: { idx: h, tile: l } });
9563
9566
  }
9564
9567
  return C(
9565
- c.tiles.filter((h) => h.has(S.HORIZONTAL)).length == 1,
9568
+ c.tiles.filter((h) => h.has(v.HORIZONTAL)).length == 1,
9566
9569
  `h op ${c.toString()}`
9567
9570
  ), c;
9568
9571
  }
@@ -9574,12 +9577,12 @@ class sn {
9574
9577
  return n >= 9;
9575
9578
  }
9576
9579
  initialHands() {
9577
- const t = q("");
9580
+ const t = Z("");
9578
9581
  for (let e = 0; e < 3; e++)
9579
- for (let n of Object.values(v))
9582
+ for (let n of Object.values(S))
9580
9583
  for (let i = 0; i < 4; i++)
9581
9584
  t[n] += this.wall.draw().toString();
9582
- for (let e of Object.values(v)) t[e] += this.wall.draw().toString();
9585
+ for (let e of Object.values(S)) t[e] += this.wall.draw().toString();
9583
9586
  return t;
9584
9587
  }
9585
9588
  }
@@ -9601,12 +9604,12 @@ class ie extends tn {
9601
9604
  class Zi {
9602
9605
  constructor(t, e) {
9603
9606
  b(this, "id");
9604
- b(this, "river", new Oi());
9607
+ b(this, "river", new Ii());
9605
9608
  b(this, "placeManager", new Fe({}));
9606
9609
  // empty for init
9607
9610
  b(this, "scoreManager", new Ue({}));
9608
9611
  // empty for init
9609
- b(this, "hands", q(new ie("")));
9612
+ b(this, "hands", Z(new ie("")));
9610
9613
  // empty for init
9611
9614
  b(this, "counter", new Xa());
9612
9615
  b(this, "doraMarkers", []);
@@ -9633,7 +9636,7 @@ class Zi {
9633
9636
  round: structuredClone(t.round),
9634
9637
  sticks: structuredClone(t.sticks)
9635
9638
  }), this.scoreManager = new Ue(structuredClone(t.scores)), this.doraMarkers = [e], this.counter.dec(e);
9636
- for (let i of Object.values(v))
9639
+ for (let i of Object.values(S))
9637
9640
  i == t.wind && this.counter.dec(...this.hand(i).hands);
9638
9641
  break;
9639
9642
  case "DRAW": {
@@ -9645,7 +9648,7 @@ class Zi {
9645
9648
  const i = g.from(t.tile);
9646
9649
  if (this.river.discard(i, t.iam), this.hands[t.iam].discard(i), t.iam != t.wind) {
9647
9650
  this.counter.dec(i), this.counter.addTileToSafeMap(i, t.iam);
9648
- for (let r of Object.values(v))
9651
+ for (let r of Object.values(S))
9649
9652
  this.hand(r).reached && this.counter.addTileToSafeMap(i, r);
9650
9653
  }
9651
9654
  break;
@@ -9655,21 +9658,21 @@ class Zi {
9655
9658
  case "DAI_KAN": {
9656
9659
  const i = z.deserialize(t.block);
9657
9660
  this.hands[t.iam].call(i), this.river.markCalled(), t.iam != t.wind && this.counter.dec(
9658
- ...i.tiles.filter((r) => !r.has(S.HORIZONTAL))
9661
+ ...i.tiles.filter((r) => !r.has(v.HORIZONTAL))
9659
9662
  );
9660
9663
  break;
9661
9664
  }
9662
9665
  case "SHO_KAN": {
9663
9666
  const i = ht.from(t.block.tiles);
9664
9667
  this.hands[t.iam].kan(i), t.iam != t.wind && this.counter.dec(
9665
- i.tiles.filter((r) => r.has(S.HORIZONTAL))[0]
9668
+ i.tiles.filter((r) => r.has(v.HORIZONTAL))[0]
9666
9669
  );
9667
9670
  break;
9668
9671
  }
9669
9672
  case "AN_KAN": {
9670
- const i = F.from(t.block.tiles);
9673
+ const i = q.from(t.block.tiles);
9671
9674
  this.hands[t.iam].kan(i), t.iam != t.wind && this.counter.dec(
9672
- ...i.tiles.filter((r) => !r.has(S.HORIZONTAL))
9675
+ ...i.tiles.filter((r) => !r.has(v.HORIZONTAL))
9673
9676
  );
9674
9677
  break;
9675
9678
  }
@@ -9721,7 +9724,7 @@ class ih extends Zi {
9721
9724
  constructor(e) {
9722
9725
  super("observer", e);
9723
9726
  b(this, "applied", {});
9724
- this.counter.disable = !0, this.hands = q(new ie("_____________"));
9727
+ this.counter.disable = !0, this.hands = Z(new ie("_____________"));
9725
9728
  }
9726
9729
  setHands(e) {
9727
9730
  this.hands[e.wind] = new ie(e.hands[e.wind]);
@@ -9730,7 +9733,7 @@ class ih extends Zi {
9730
9733
  switch (super.handleEvent(e), e.type) {
9731
9734
  case "DISTRIBUTE":
9732
9735
  let n = !0;
9733
- for (let i of Object.values(v))
9736
+ for (let i of Object.values(S))
9734
9737
  n && (n = this.hand(i).get(d.BACK, 0) == 0);
9735
9738
  if (!n) break;
9736
9739
  console.debug(
@@ -9740,7 +9743,7 @@ class ih extends Zi {
9740
9743
  `map: ${JSON.stringify(this.placeManager.playerMap, null, 2)}`,
9741
9744
  `sticks: ${JSON.stringify(this.placeManager.sticks, null, 2)}`
9742
9745
  );
9743
- for (let i of Object.values(v))
9746
+ for (let i of Object.values(S))
9744
9747
  console.debug(
9745
9748
  this.placeManager.playerID(i),
9746
9749
  `init hand: ${this.hand(i).toString()}`
@@ -9787,7 +9790,7 @@ class ih extends Zi {
9787
9790
  );
9788
9791
  break;
9789
9792
  case "END_GAME":
9790
- for (let i of Object.values(v))
9793
+ for (let i of Object.values(S))
9791
9794
  console.debug(
9792
9795
  this.placeManager.playerID(i),
9793
9796
  `end hand: ${this.hand(i).toString()}`
@@ -9805,7 +9808,7 @@ class ih extends Zi {
9805
9808
  class Me extends Zi {
9806
9809
  constructor(e, n) {
9807
9810
  super(e, n);
9808
- b(this, "river", new Oi());
9811
+ b(this, "river", new Ii());
9809
9812
  b(this, "doras", []);
9810
9813
  this.eventHandler.on((i) => this.handleEvent(i));
9811
9814
  }
@@ -9813,11 +9816,11 @@ class Me extends Zi {
9813
9816
  return this.placeManager.wind(this.id);
9814
9817
  }
9815
9818
  setHands(e) {
9816
- for (let n of Object.values(v))
9819
+ for (let n of Object.values(S))
9817
9820
  this.hands[n] = new ie(e.hands[n]);
9818
9821
  }
9819
9822
  handleDiscard(e) {
9820
- const n = Object.values(v).filter((l) => l == this.myWind ? !1 : this.hand(l).reached), i = new en(this.hand(this.myWind)).calc();
9823
+ const n = Object.values(S).filter((l) => l == this.myWind ? !1 : this.hand(l).reached), i = new en(this.hand(this.myWind)).calc();
9821
9824
  if (n.length > 0 && i >= 2)
9822
9825
  return fe.selectTile(this.counter, n, e);
9823
9826
  const r = Qt.calcCandidates(this.hand(this.myWind), e), a = Ye.calcPlayerCandidates(this.counter, r).sort((l, u) => u.sum - l.sum), c = a.filter((l) => l.sum == a[0].sum);
@@ -9972,14 +9975,14 @@ export {
9972
9975
  _ as BLOCK,
9973
9976
  Zi as BaseActor,
9974
9977
  z as Block,
9975
- F as BlockAnKan,
9978
+ q as BlockAnKan,
9976
9979
  Ua as BlockCalculator,
9977
9980
  lt as BlockChi,
9978
9981
  mt as BlockDaiKan,
9979
9982
  Un as BlockHand,
9980
9983
  Ls as BlockIsolated,
9981
9984
  Ks as BlockOther,
9982
- X as BlockPair,
9985
+ J as BlockPair,
9983
9986
  gt as BlockPon,
9984
9987
  Nt as BlockRun,
9985
9988
  ht as BlockShoKan,
@@ -9995,9 +9998,9 @@ export {
9995
9998
  ah as MeasureText,
9996
9999
  wt as N19,
9997
10000
  Ke as NZ,
9998
- S as OPERATOR,
10001
+ v as OPERATOR,
9999
10002
  ih as Observer,
10000
- et as Parser,
10003
+ nt as Parser,
10001
10004
  Fe as PlaceManager,
10002
10005
  Me as Player,
10003
10006
  Ye as PlayerEfficiency,
@@ -10005,14 +10008,14 @@ export {
10005
10008
  js as ROUND_MAP,
10006
10009
  ph as Replayer,
10007
10010
  fe as RiskRank,
10008
- Oi as River,
10011
+ Ii as River,
10009
10012
  Ue as ScoreManager,
10010
10013
  en as ShantenCalculator,
10011
10014
  Qi as TABLE_CONTEXT,
10012
10015
  Dt as TILE_CONTEXT,
10013
10016
  d as TYPE,
10014
10017
  g as Tile,
10015
- v as WIND,
10018
+ S as WIND,
10016
10019
  Ln as WIND_MAP,
10017
10020
  Gt as Wall,
10018
10021
  La as convertInput,
@@ -10022,13 +10025,13 @@ export {
10022
10025
  ue as createHand,
10023
10026
  mh as createLocalGame,
10024
10027
  Ta as createTable,
10025
- q as createWindMap,
10028
+ Z as createWindMap,
10026
10029
  mn as deserializeWinResult,
10027
10030
  uh as drawBlocks,
10028
10031
  dh as drawTable,
10029
10032
  sh as incrementalIDGenerator,
10030
- it as isNum0,
10031
- tt as isNum5,
10033
+ K as isNum0,
10034
+ et as isNum5,
10032
10035
  $e as isNum5or0,
10033
10036
  De as nextRound,
10034
10037
  Ct as nextWind,