@kubohiroya/turbowarp-bubble 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -299,14 +299,14 @@ var w = /* @__PURE__ */ o(((e, t) => {
299
299
  if (o-- > 0) for (s < this.DB && (r = this[o] >> s) > 0 && (i = !0, a = v(r)); o >= 0;) s < t ? (r = (this[o] & (1 << s) - 1) << t - s, r |= this[--o] >> (s += this.DB - t)) : (r = this[o] >> (s -= t) & n, s <= 0 && (s += this.DB, --o)), r > 0 && (i = !0), i && (a += v(r));
300
300
  return i ? a : "0";
301
301
  }
302
- function T() {
302
+ function te() {
303
303
  var e = l();
304
304
  return c.ZERO.subTo(this, e), e;
305
305
  }
306
- function E() {
306
+ function T() {
307
307
  return this.s < 0 ? this.negate() : this;
308
308
  }
309
- function te(e) {
309
+ function ne(e) {
310
310
  var t = this.s - e.s;
311
311
  if (t != 0) return t;
312
312
  var n = this.t;
@@ -314,30 +314,30 @@ var w = /* @__PURE__ */ o(((e, t) => {
314
314
  for (; --n >= 0;) if ((t = this[n] - e[n]) != 0) return t;
315
315
  return 0;
316
316
  }
317
- function D(e) {
317
+ function re(e) {
318
318
  var t = 1, n;
319
319
  return (n = e >>> 16) != 0 && (e = n, t += 16), (n = e >> 8) != 0 && (e = n, t += 8), (n = e >> 4) != 0 && (e = n, t += 4), (n = e >> 2) != 0 && (e = n, t += 2), (n = e >> 1) != 0 && (e = n, t += 1), t;
320
320
  }
321
- function ne() {
322
- return this.t <= 0 ? 0 : this.DB * (this.t - 1) + D(this[this.t - 1] ^ this.s & this.DM);
321
+ function ie() {
322
+ return this.t <= 0 ? 0 : this.DB * (this.t - 1) + re(this[this.t - 1] ^ this.s & this.DM);
323
323
  }
324
- function O(e, t) {
324
+ function ae(e, t) {
325
325
  var n;
326
326
  for (n = this.t - 1; n >= 0; --n) t[n + e] = this[n];
327
327
  for (n = e - 1; n >= 0; --n) t[n] = 0;
328
328
  t.t = this.t + e, t.s = this.s;
329
329
  }
330
- function k(e, t) {
330
+ function E(e, t) {
331
331
  for (var n = e; n < this.t; ++n) t[n - e] = this[n];
332
332
  t.t = Math.max(this.t - e, 0), t.s = this.s;
333
333
  }
334
- function A(e, t) {
334
+ function D(e, t) {
335
335
  var n = e % this.DB, r = this.DB - n, i = (1 << r) - 1, a = Math.floor(e / this.DB), o = this.s << n & this.DM, s;
336
336
  for (s = this.t - 1; s >= 0; --s) t[s + a + 1] = this[s] >> r | o, o = (this[s] & i) << n;
337
337
  for (s = a - 1; s >= 0; --s) t[s] = 0;
338
338
  t[a] = o, t.t = this.t + a + 1, t.s = this.s, t.clamp();
339
339
  }
340
- function re(e, t) {
340
+ function oe(e, t) {
341
341
  t.s = this.s;
342
342
  var n = Math.floor(e / this.DB);
343
343
  if (n >= this.t) {
@@ -349,7 +349,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
349
349
  for (var o = n + 1; o < this.t; ++o) t[o - n - 1] |= (this[o] & a) << i, t[o - n] = this[o] >> r;
350
350
  r > 0 && (t[this.t - n - 1] |= (this.s & a) << i), t.t = this.t - n, t.clamp();
351
351
  }
352
- function j(e, t) {
352
+ function O(e, t) {
353
353
  for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] - e[n], t[n++] = r & this.DM, r >>= this.DB;
354
354
  if (e.t < this.t) {
355
355
  for (r -= e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
@@ -360,13 +360,13 @@ var w = /* @__PURE__ */ o(((e, t) => {
360
360
  }
361
361
  t.s = r < 0 ? -1 : 0, r < -1 ? t[n++] = this.DV + r : r > 0 && (t[n++] = r), t.t = n, t.clamp();
362
362
  }
363
- function M(e, t) {
363
+ function k(e, t) {
364
364
  var n = this.abs(), r = e.abs(), i = n.t;
365
365
  for (t.t = i + r.t; --i >= 0;) t[i] = 0;
366
366
  for (i = 0; i < r.t; ++i) t[i + n.t] = n.am(0, r[i], t, i, 0, n.t);
367
367
  t.s = 0, t.clamp(), this.s != e.s && c.ZERO.subTo(t, t);
368
368
  }
369
- function N(e) {
369
+ function A(e) {
370
370
  for (var t = this.abs(), n = e.t = 2 * t.t; --n >= 0;) e[n] = 0;
371
371
  for (n = 0; n < t.t - 1; ++n) {
372
372
  var r = t.am(n, t[n], e, 2 * n, 0, 1);
@@ -374,7 +374,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
374
374
  }
375
375
  e.t > 0 && (e[e.t - 1] += t.am(n, t[n], e, 2 * n, 0, 1)), e.s = 0, e.clamp();
376
376
  }
377
- function P(e, t, n) {
377
+ function j(e, t, n) {
378
378
  var r = e.abs();
379
379
  if (!(r.t <= 0)) {
380
380
  var i = this.abs();
@@ -383,7 +383,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
383
383
  return;
384
384
  }
385
385
  n ??= l();
386
- var a = l(), o = this.s, s = e.s, u = this.DB - D(r[r.t - 1]);
386
+ var a = l(), o = this.s, s = e.s, u = this.DB - re(r[r.t - 1]);
387
387
  u > 0 ? (r.lShiftTo(u, a), i.lShiftTo(u, n)) : (r.copyTo(a), i.copyTo(n));
388
388
  var d = a.t, f = a[d - 1];
389
389
  if (f != 0) {
@@ -397,48 +397,48 @@ var w = /* @__PURE__ */ o(((e, t) => {
397
397
  }
398
398
  }
399
399
  }
400
- function F(e) {
400
+ function M(e) {
401
401
  var t = l();
402
402
  return this.abs().divRemTo(e, null, t), this.s < 0 && t.compareTo(c.ZERO) > 0 && e.subTo(t, t), t;
403
403
  }
404
- function I(e) {
404
+ function N(e) {
405
405
  this.m = e;
406
406
  }
407
- function L(e) {
407
+ function P(e) {
408
408
  return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e;
409
409
  }
410
- function ie(e) {
410
+ function se(e) {
411
411
  return e;
412
412
  }
413
- function R(e) {
413
+ function F(e) {
414
414
  e.divRemTo(this.m, null, e);
415
415
  }
416
- function z(e, t, n) {
416
+ function ce(e, t, n) {
417
417
  e.multiplyTo(t, n), this.reduce(n);
418
418
  }
419
- function ae(e, t) {
419
+ function le(e, t) {
420
420
  e.squareTo(t), this.reduce(t);
421
421
  }
422
- I.prototype.convert = L, I.prototype.revert = ie, I.prototype.reduce = R, I.prototype.mulTo = z, I.prototype.sqrTo = ae;
423
- function oe() {
422
+ N.prototype.convert = P, N.prototype.revert = se, N.prototype.reduce = F, N.prototype.mulTo = ce, N.prototype.sqrTo = le;
423
+ function ue() {
424
424
  if (this.t < 1) return 0;
425
425
  var e = this[0];
426
426
  if (!(e & 1)) return 0;
427
427
  var t = e & 3;
428
428
  return t = t * (2 - (e & 15) * t) & 15, t = t * (2 - (e & 255) * t) & 255, t = t * (2 - ((e & 65535) * t & 65535)) & 65535, t = t * (2 - e * t % this.DV) % this.DV, t > 0 ? this.DV - t : -t;
429
429
  }
430
- function B(e) {
430
+ function de(e) {
431
431
  this.m = e, this.mp = e.invDigit(), this.mpl = this.mp & 32767, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t;
432
432
  }
433
- function se(e) {
433
+ function fe(e) {
434
434
  var t = l();
435
435
  return e.abs().dlShiftTo(this.m.t, t), t.divRemTo(this.m, null, t), e.s < 0 && t.compareTo(c.ZERO) > 0 && this.m.subTo(t, t), t;
436
436
  }
437
- function ce(e) {
437
+ function pe(e) {
438
438
  var t = l();
439
439
  return e.copyTo(t), this.reduce(t), t;
440
440
  }
441
- function le(e) {
441
+ function me(e) {
442
442
  for (; e.t <= this.mt2;) e[e.t++] = 0;
443
443
  for (var t = 0; t < this.m.t; ++t) {
444
444
  var n = e[t] & 32767, r = n * this.mpl + ((n * this.mph + (e[t] >> 15) * this.mpl & this.um) << 15) & e.DM;
@@ -446,19 +446,19 @@ var w = /* @__PURE__ */ o(((e, t) => {
446
446
  }
447
447
  e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e);
448
448
  }
449
- function ue(e, t) {
449
+ function he(e, t) {
450
450
  e.squareTo(t), this.reduce(t);
451
451
  }
452
- function de(e, t, n) {
452
+ function ge(e, t, n) {
453
453
  e.multiplyTo(t, n), this.reduce(n);
454
454
  }
455
- B.prototype.convert = se, B.prototype.revert = ce, B.prototype.reduce = le, B.prototype.mulTo = de, B.prototype.sqrTo = ue;
456
- function fe() {
455
+ de.prototype.convert = fe, de.prototype.revert = pe, de.prototype.reduce = me, de.prototype.mulTo = ge, de.prototype.sqrTo = he;
456
+ function _e() {
457
457
  return (this.t > 0 ? this[0] & 1 : this.s) == 0;
458
458
  }
459
- function pe(e, t) {
459
+ function ve(e, t) {
460
460
  if (e > 4294967295 || e < 1) return c.ONE;
461
- var n = l(), r = l(), i = t.convert(this), a = D(e) - 1;
461
+ var n = l(), r = l(), i = t.convert(this), a = re(e) - 1;
462
462
  for (i.copyTo(n); --a >= 0;) if (t.sqrTo(n, r), (e & 1 << a) > 0) t.mulTo(r, i, n);
463
463
  else {
464
464
  var o = n;
@@ -466,16 +466,16 @@ var w = /* @__PURE__ */ o(((e, t) => {
466
466
  }
467
467
  return t.revert(n);
468
468
  }
469
- function me(e, t) {
470
- var n = e < 256 || t.isEven() ? new I(t) : new B(t);
469
+ function ye(e, t) {
470
+ var n = e < 256 || t.isEven() ? new N(t) : new de(t);
471
471
  return this.exp(e, n);
472
472
  }
473
- c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = ee, c.prototype.dlShiftTo = O, c.prototype.drShiftTo = k, c.prototype.lShiftTo = A, c.prototype.rShiftTo = re, c.prototype.subTo = j, c.prototype.multiplyTo = M, c.prototype.squareTo = N, c.prototype.divRemTo = P, c.prototype.invDigit = oe, c.prototype.isEven = fe, c.prototype.exp = pe, c.prototype.toString = w, c.prototype.negate = T, c.prototype.abs = E, c.prototype.compareTo = te, c.prototype.bitLength = ne, c.prototype.mod = F, c.prototype.modPowInt = me, c.ZERO = S(0), c.ONE = S(1);
474
- function he() {
473
+ c.prototype.copyTo = b, c.prototype.fromInt = x, c.prototype.fromString = C, c.prototype.clamp = ee, c.prototype.dlShiftTo = ae, c.prototype.drShiftTo = E, c.prototype.lShiftTo = D, c.prototype.rShiftTo = oe, c.prototype.subTo = O, c.prototype.multiplyTo = k, c.prototype.squareTo = A, c.prototype.divRemTo = j, c.prototype.invDigit = ue, c.prototype.isEven = _e, c.prototype.exp = ve, c.prototype.toString = w, c.prototype.negate = te, c.prototype.abs = T, c.prototype.compareTo = ne, c.prototype.bitLength = ie, c.prototype.mod = M, c.prototype.modPowInt = ye, c.ZERO = S(0), c.ONE = S(1);
474
+ function be() {
475
475
  var e = l();
476
476
  return this.copyTo(e), e;
477
477
  }
478
- function ge() {
478
+ function xe() {
479
479
  if (this.s < 0) {
480
480
  if (this.t == 1) return this[0] - this.DV;
481
481
  if (this.t == 0) return -1;
@@ -483,25 +483,25 @@ var w = /* @__PURE__ */ o(((e, t) => {
483
483
  else if (this.t == 0) return 0;
484
484
  return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];
485
485
  }
486
- function V() {
486
+ function I() {
487
487
  return this.t == 0 ? this.s : this[0] << 24 >> 24;
488
488
  }
489
- function H() {
489
+ function Se() {
490
490
  return this.t == 0 ? this.s : this[0] << 16 >> 16;
491
491
  }
492
- function _e(e) {
492
+ function Ce(e) {
493
493
  return Math.floor(Math.LN2 * this.DB / Math.log(e));
494
494
  }
495
- function ve() {
495
+ function we() {
496
496
  return this.s < 0 ? -1 : this.t <= 0 || this.t == 1 && this[0] <= 0 ? 0 : 1;
497
497
  }
498
- function ye(e) {
498
+ function Te(e) {
499
499
  if (e ??= 10, this.signum() == 0 || e < 2 || e > 36) return "0";
500
500
  var t = this.chunkSize(e), n = e ** +t, r = S(n), i = l(), a = l(), o = "";
501
501
  for (this.divRemTo(r, i, a); i.signum() > 0;) o = (n + a.intValue()).toString(e).substr(1) + o, i.divRemTo(r, i, a);
502
502
  return a.intValue().toString(e) + o;
503
503
  }
504
- function be(e, t) {
504
+ function Ee(e, t) {
505
505
  this.fromInt(0), t ??= 10;
506
506
  for (var n = this.chunkSize(t), r = t ** +n, i = !1, a = 0, o = 0, s = 0; s < e.length; ++s) {
507
507
  var l = y(e, s);
@@ -513,32 +513,32 @@ var w = /* @__PURE__ */ o(((e, t) => {
513
513
  }
514
514
  a > 0 && (this.dMultiply(t ** +a), this.dAddOffset(o, 0)), i && c.ZERO.subTo(this, this);
515
515
  }
516
- function xe(e, t, n) {
516
+ function De(e, t, n) {
517
517
  if (typeof t == "number") {
518
518
  if (e < 2) this.fromInt(1);
519
- else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1), W, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(c.ONE.shiftLeft(e - 1), this);
519
+ else for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(c.ONE.shiftLeft(e - 1), R, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(t);) this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(c.ONE.shiftLeft(e - 1), this);
520
520
  } else {
521
521
  var r = [], i = e & 7;
522
522
  r.length = (e >> 3) + 1, t.nextBytes(r), i > 0 ? r[0] &= (1 << i) - 1 : r[0] = 0, this.fromString(r, 256);
523
523
  }
524
524
  }
525
- function Se() {
525
+ function Oe() {
526
526
  var e = this.t, t = [];
527
527
  t[0] = this.s;
528
528
  var n = this.DB - e * this.DB % 8, r, i = 0;
529
529
  if (e-- > 0) for (n < this.DB && (r = this[e] >> n) != (this.s & this.DM) >> n && (t[i++] = r | this.s << this.DB - n); e >= 0;) n < 8 ? (r = (this[e] & (1 << n) - 1) << 8 - n, r |= this[--e] >> (n += this.DB - 8)) : (r = this[e] >> (n -= 8) & 255, n <= 0 && (n += this.DB, --e)), r & 128 && (r |= -256), i == 0 && (this.s & 128) != (r & 128) && ++i, (i > 0 || r != this.s) && (t[i++] = r);
530
530
  return t;
531
531
  }
532
- function Ce(e) {
532
+ function ke(e) {
533
533
  return this.compareTo(e) == 0;
534
534
  }
535
- function we(e) {
535
+ function Ae(e) {
536
536
  return this.compareTo(e) < 0 ? this : e;
537
537
  }
538
- function Te(e) {
538
+ function je(e) {
539
539
  return this.compareTo(e) > 0 ? this : e;
540
540
  }
541
- function Ee(e, t, n) {
541
+ function Me(e, t, n) {
542
542
  var r, i, a = Math.min(e.t, this.t);
543
543
  for (r = 0; r < a; ++r) n[r] = t(this[r], e[r]);
544
544
  if (e.t < this.t) {
@@ -550,81 +550,81 @@ var w = /* @__PURE__ */ o(((e, t) => {
550
550
  }
551
551
  n.s = t(this.s, e.s), n.clamp();
552
552
  }
553
- function De(e, t) {
553
+ function Ne(e, t) {
554
554
  return e & t;
555
555
  }
556
- function U(e) {
556
+ function L(e) {
557
557
  var t = l();
558
- return this.bitwiseTo(e, De, t), t;
558
+ return this.bitwiseTo(e, Ne, t), t;
559
559
  }
560
- function W(e, t) {
560
+ function R(e, t) {
561
561
  return e | t;
562
562
  }
563
- function Oe(e) {
563
+ function Pe(e) {
564
564
  var t = l();
565
- return this.bitwiseTo(e, W, t), t;
565
+ return this.bitwiseTo(e, R, t), t;
566
566
  }
567
- function G(e, t) {
567
+ function Fe(e, t) {
568
568
  return e ^ t;
569
569
  }
570
- function ke(e) {
570
+ function Ie(e) {
571
571
  var t = l();
572
- return this.bitwiseTo(e, G, t), t;
572
+ return this.bitwiseTo(e, Fe, t), t;
573
573
  }
574
- function Ae(e, t) {
574
+ function Le(e, t) {
575
575
  return e & ~t;
576
576
  }
577
- function je(e) {
577
+ function Re(e) {
578
578
  var t = l();
579
- return this.bitwiseTo(e, Ae, t), t;
579
+ return this.bitwiseTo(e, Le, t), t;
580
580
  }
581
- function Me() {
581
+ function ze() {
582
582
  for (var e = l(), t = 0; t < this.t; ++t) e[t] = this.DM & ~this[t];
583
583
  return e.t = this.t, e.s = ~this.s, e;
584
584
  }
585
- function K(e) {
585
+ function z(e) {
586
586
  var t = l();
587
587
  return e < 0 ? this.rShiftTo(-e, t) : this.lShiftTo(e, t), t;
588
588
  }
589
- function Ne(e) {
589
+ function Be(e) {
590
590
  var t = l();
591
591
  return e < 0 ? this.lShiftTo(-e, t) : this.rShiftTo(e, t), t;
592
592
  }
593
- function Pe(e) {
593
+ function Ve(e) {
594
594
  if (e == 0) return -1;
595
595
  var t = 0;
596
596
  return e & 65535 || (e >>= 16, t += 16), e & 255 || (e >>= 8, t += 8), e & 15 || (e >>= 4, t += 4), e & 3 || (e >>= 2, t += 2), e & 1 || ++t, t;
597
597
  }
598
- function Fe() {
599
- for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + Pe(this[e]);
598
+ function He() {
599
+ for (var e = 0; e < this.t; ++e) if (this[e] != 0) return e * this.DB + Ve(this[e]);
600
600
  return this.s < 0 ? this.t * this.DB : -1;
601
601
  }
602
- function Ie(e) {
602
+ function Ue(e) {
603
603
  for (var t = 0; e != 0;) e &= e - 1, ++t;
604
604
  return t;
605
605
  }
606
- function q() {
607
- for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) e += Ie(this[n] ^ t);
606
+ function B() {
607
+ for (var e = 0, t = this.s & this.DM, n = 0; n < this.t; ++n) e += Ue(this[n] ^ t);
608
608
  return e;
609
609
  }
610
- function Le(e) {
610
+ function We(e) {
611
611
  var t = Math.floor(e / this.DB);
612
612
  return t >= this.t ? this.s != 0 : !!(this[t] & 1 << e % this.DB);
613
613
  }
614
- function Re(e, t) {
614
+ function Ge(e, t) {
615
615
  var n = c.ONE.shiftLeft(e);
616
616
  return this.bitwiseTo(n, t, n), n;
617
617
  }
618
- function ze(e) {
619
- return this.changeBit(e, W);
618
+ function Ke(e) {
619
+ return this.changeBit(e, R);
620
620
  }
621
- function Be(e) {
622
- return this.changeBit(e, Ae);
621
+ function qe(e) {
622
+ return this.changeBit(e, Le);
623
623
  }
624
- function Ve(e) {
625
- return this.changeBit(e, G);
624
+ function Je(e) {
625
+ return this.changeBit(e, Fe);
626
626
  }
627
- function He(e, t) {
627
+ function Ye(e, t) {
628
628
  for (var n = 0, r = 0, i = Math.min(e.t, this.t); n < i;) r += this[n] + e[n], t[n++] = r & this.DM, r >>= this.DB;
629
629
  if (e.t < this.t) {
630
630
  for (r += e.s; n < this.t;) r += this[n], t[n++] = r & this.DM, r >>= this.DB;
@@ -635,58 +635,58 @@ var w = /* @__PURE__ */ o(((e, t) => {
635
635
  }
636
636
  t.s = r < 0 ? -1 : 0, r > 0 ? t[n++] = r : r < -1 && (t[n++] = this.DV + r), t.t = n, t.clamp();
637
637
  }
638
- function Ue(e) {
638
+ function Xe(e) {
639
639
  var t = l();
640
640
  return this.addTo(e, t), t;
641
641
  }
642
- function We(e) {
642
+ function Ze(e) {
643
643
  var t = l();
644
644
  return this.subTo(e, t), t;
645
645
  }
646
- function Ge(e) {
646
+ function Qe(e) {
647
647
  var t = l();
648
648
  return this.multiplyTo(e, t), t;
649
649
  }
650
- function Ke() {
650
+ function $e() {
651
651
  var e = l();
652
652
  return this.squareTo(e), e;
653
653
  }
654
- function qe(e) {
654
+ function et(e) {
655
655
  var t = l();
656
656
  return this.divRemTo(e, t, null), t;
657
657
  }
658
- function Je(e) {
658
+ function tt(e) {
659
659
  var t = l();
660
660
  return this.divRemTo(e, null, t), t;
661
661
  }
662
- function Ye(e) {
662
+ function nt(e) {
663
663
  var t = l(), n = l();
664
664
  return this.divRemTo(e, t, n), [t, n];
665
665
  }
666
- function Xe(e) {
666
+ function rt(e) {
667
667
  this[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp();
668
668
  }
669
- function Ze(e, t) {
669
+ function it(e, t) {
670
670
  if (e != 0) {
671
671
  for (; this.t <= t;) this[this.t++] = 0;
672
672
  for (this[t] += e; this[t] >= this.DV;) this[t] -= this.DV, ++t >= this.t && (this[this.t++] = 0), ++this[t];
673
673
  }
674
674
  }
675
- function Qe() {}
676
- function $e(e) {
675
+ function at() {}
676
+ function ot(e) {
677
677
  return e;
678
678
  }
679
- function et(e, t, n) {
679
+ function st(e, t, n) {
680
680
  e.multiplyTo(t, n);
681
681
  }
682
- function tt(e, t) {
682
+ function ct(e, t) {
683
683
  e.squareTo(t);
684
684
  }
685
- Qe.prototype.convert = $e, Qe.prototype.revert = $e, Qe.prototype.mulTo = et, Qe.prototype.sqrTo = tt;
686
- function nt(e) {
687
- return this.exp(e, new Qe());
685
+ at.prototype.convert = ot, at.prototype.revert = ot, at.prototype.mulTo = st, at.prototype.sqrTo = ct;
686
+ function lt(e) {
687
+ return this.exp(e, new at());
688
688
  }
689
- function rt(e, t, n) {
689
+ function ut(e, t, n) {
690
690
  var r = Math.min(this.t + e.t, t);
691
691
  for (n.s = 0, n.t = r; r > 0;) n[--r] = 0;
692
692
  var i;
@@ -694,47 +694,47 @@ var w = /* @__PURE__ */ o(((e, t) => {
694
694
  for (i = Math.min(e.t, t); r < i; ++r) this.am(0, e[r], n, r, 0, t - r);
695
695
  n.clamp();
696
696
  }
697
- function it(e, t, n) {
697
+ function dt(e, t, n) {
698
698
  --t;
699
699
  var r = n.t = this.t + e.t - t;
700
700
  for (n.s = 0; --r >= 0;) n[r] = 0;
701
701
  for (r = Math.max(t - this.t, 0); r < e.t; ++r) n[this.t + r - t] = this.am(t - r, e[r], n, 0, 0, this.t + r - t);
702
702
  n.clamp(), n.drShiftTo(1, n);
703
703
  }
704
- function at(e) {
704
+ function ft(e) {
705
705
  this.r2 = l(), this.q3 = l(), c.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e), this.m = e;
706
706
  }
707
- function ot(e) {
707
+ function pt(e) {
708
708
  if (e.s < 0 || e.t > 2 * this.m.t) return e.mod(this.m);
709
709
  if (e.compareTo(this.m) < 0) return e;
710
710
  var t = l();
711
711
  return e.copyTo(t), this.reduce(t), t;
712
712
  }
713
- function st(e) {
713
+ function mt(e) {
714
714
  return e;
715
715
  }
716
- function ct(e) {
716
+ function ht(e) {
717
717
  for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1, e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0;) e.dAddOffset(1, this.m.t + 1);
718
718
  for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0;) e.subTo(this.m, e);
719
719
  }
720
- function lt(e, t) {
720
+ function gt(e, t) {
721
721
  e.squareTo(t), this.reduce(t);
722
722
  }
723
- function ut(e, t, n) {
723
+ function _t(e, t, n) {
724
724
  e.multiplyTo(t, n), this.reduce(n);
725
725
  }
726
- at.prototype.convert = ot, at.prototype.revert = st, at.prototype.reduce = ct, at.prototype.mulTo = ut, at.prototype.sqrTo = lt;
727
- function dt(e, t) {
726
+ ft.prototype.convert = pt, ft.prototype.revert = mt, ft.prototype.reduce = ht, ft.prototype.mulTo = _t, ft.prototype.sqrTo = gt;
727
+ function vt(e, t) {
728
728
  var n = e.bitLength(), r, i = S(1), a;
729
729
  if (n <= 0) return i;
730
- r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new I(t) : t.isEven() ? new at(t) : new B(t);
730
+ r = n < 18 ? 1 : n < 48 ? 3 : n < 144 ? 4 : n < 768 ? 5 : 6, a = n < 8 ? new N(t) : t.isEven() ? new ft(t) : new de(t);
731
731
  var o = [], s = 3, c = r - 1, u = (1 << r) - 1;
732
732
  if (o[1] = a.convert(this), r > 1) {
733
733
  var d = l();
734
734
  for (a.sqrTo(o[1], d); s <= u;) o[s] = l(), a.mulTo(d, o[s - 2], o[s]), s += 2;
735
735
  }
736
736
  var f = e.t - 1, p, m = !0, h = l(), g;
737
- for (n = D(e[f]) - 1; f >= 0;) {
737
+ for (n = re(e[f]) - 1; f >= 0;) {
738
738
  for (n >= c ? p = e[f] >> n - c & u : (p = (e[f] & (1 << n + 1) - 1) << c - n, f > 0 && (p |= e[f - 1] >> this.DB + n - c)), s = r; !(p & 1);) p >>= 1, --s;
739
739
  if ((n -= s) < 0 && (n += this.DB, --f), m) o[p].copyTo(i), m = !1;
740
740
  else {
@@ -745,7 +745,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
745
745
  }
746
746
  return a.revert(i);
747
747
  }
748
- function ft(e) {
748
+ function V(e) {
749
749
  var t = this.s < 0 ? this.negate() : this.clone(), n = e.s < 0 ? e.negate() : e.clone();
750
750
  if (t.compareTo(n) < 0) {
751
751
  var r = t;
@@ -756,7 +756,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
756
756
  for (i < a && (a = i), a > 0 && (t.rShiftTo(a, t), n.rShiftTo(a, n)); t.signum() > 0;) (i = t.getLowestSetBit()) > 0 && t.rShiftTo(i, t), (i = n.getLowestSetBit()) > 0 && n.rShiftTo(i, n), t.compareTo(n) >= 0 ? (t.subTo(n, t), t.rShiftTo(1, t)) : (n.subTo(t, n), n.rShiftTo(1, n));
757
757
  return a > 0 && n.lShiftTo(a, n), n;
758
758
  }
759
- function pt(e) {
759
+ function yt(e) {
760
760
  if (e <= 0) return 0;
761
761
  var t = this.DV % e, n = this.s < 0 ? e - 1 : 0;
762
762
  if (this.t > 0) {
@@ -765,7 +765,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
765
765
  }
766
766
  return n;
767
767
  }
768
- function mt(e) {
768
+ function bt(e) {
769
769
  var t = e.isEven();
770
770
  if (this.isEven() && t || e.signum() == 0) return c.ZERO;
771
771
  for (var n = e.clone(), r = this.clone(), i = S(1), a = S(0), o = S(0), s = S(1); n.signum() != 0;) {
@@ -779,7 +779,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
779
779
  else return s;
780
780
  return s.signum() < 0 ? s.add(e) : s;
781
781
  }
782
- var J = [
782
+ var H = [
783
783
  2,
784
784
  3,
785
785
  5,
@@ -948,27 +948,27 @@ var w = /* @__PURE__ */ o(((e, t) => {
948
948
  983,
949
949
  991,
950
950
  997
951
- ], ht = (1 << 26) / J[J.length - 1];
952
- function gt(e) {
951
+ ], xt = (1 << 26) / H[H.length - 1];
952
+ function St(e) {
953
953
  var t, n = this.abs();
954
- if (n.t == 1 && n[0] <= J[J.length - 1]) {
955
- for (t = 0; t < J.length; ++t) if (n[0] == J[t]) return !0;
954
+ if (n.t == 1 && n[0] <= H[H.length - 1]) {
955
+ for (t = 0; t < H.length; ++t) if (n[0] == H[t]) return !0;
956
956
  return !1;
957
957
  }
958
958
  if (n.isEven()) return !1;
959
- for (t = 1; t < J.length;) {
960
- for (var r = J[t], i = t + 1; i < J.length && r < ht;) r *= J[i++];
961
- for (r = n.modInt(r); t < i;) if (r % J[t++] == 0) return !1;
959
+ for (t = 1; t < H.length;) {
960
+ for (var r = H[t], i = t + 1; i < H.length && r < xt;) r *= H[i++];
961
+ for (r = n.modInt(r); t < i;) if (r % H[t++] == 0) return !1;
962
962
  }
963
963
  return n.millerRabin(e);
964
964
  }
965
- function _t(e) {
965
+ function Ct(e) {
966
966
  var t = this.subtract(c.ONE), n = t.getLowestSetBit();
967
967
  if (n <= 0) return !1;
968
968
  var r = t.shiftRight(n);
969
- e = e + 1 >> 1, e > J.length && (e = J.length);
969
+ e = e + 1 >> 1, e > H.length && (e = H.length);
970
970
  for (var i = l(), a = 0; a < e; ++a) {
971
- i.fromInt(J[Math.floor(Math.random() * J.length)]);
971
+ i.fromInt(H[Math.floor(Math.random() * H.length)]);
972
972
  var o = i.modPow(r, this);
973
973
  if (o.compareTo(c.ONE) != 0 && o.compareTo(t) != 0) {
974
974
  for (var s = 1; s++ < n && o.compareTo(t) != 0;) if (o = o.modPowInt(2, this), o.compareTo(c.ONE) == 0) return !1;
@@ -977,29 +977,29 @@ var w = /* @__PURE__ */ o(((e, t) => {
977
977
  }
978
978
  return !0;
979
979
  }
980
- c.prototype.chunkSize = _e, c.prototype.toRadix = ye, c.prototype.fromRadix = be, c.prototype.fromNumber = xe, c.prototype.bitwiseTo = Ee, c.prototype.changeBit = Re, c.prototype.addTo = He, c.prototype.dMultiply = Xe, c.prototype.dAddOffset = Ze, c.prototype.multiplyLowerTo = rt, c.prototype.multiplyUpperTo = it, c.prototype.modInt = pt, c.prototype.millerRabin = _t, c.prototype.clone = he, c.prototype.intValue = ge, c.prototype.byteValue = V, c.prototype.shortValue = H, c.prototype.signum = ve, c.prototype.toByteArray = Se, c.prototype.equals = Ce, c.prototype.min = we, c.prototype.max = Te, c.prototype.and = U, c.prototype.or = Oe, c.prototype.xor = ke, c.prototype.andNot = je, c.prototype.not = Me, c.prototype.shiftLeft = K, c.prototype.shiftRight = Ne, c.prototype.getLowestSetBit = Fe, c.prototype.bitCount = q, c.prototype.testBit = Le, c.prototype.setBit = ze, c.prototype.clearBit = Be, c.prototype.flipBit = Ve, c.prototype.add = Ue, c.prototype.subtract = We, c.prototype.multiply = Ge, c.prototype.divide = qe, c.prototype.remainder = Je, c.prototype.divideAndRemainder = Ye, c.prototype.modPow = dt, c.prototype.modInverse = mt, c.prototype.pow = nt, c.prototype.gcd = ft, c.prototype.isProbablePrime = gt, c.prototype.square = Ke;
981
- var Y = c;
982
- if (Y.prototype.IsNegative = function() {
983
- return this.compareTo(Y.ZERO) == -1;
984
- }, Y.op_Equality = function(e, t) {
980
+ c.prototype.chunkSize = Ce, c.prototype.toRadix = Te, c.prototype.fromRadix = Ee, c.prototype.fromNumber = De, c.prototype.bitwiseTo = Me, c.prototype.changeBit = Ge, c.prototype.addTo = Ye, c.prototype.dMultiply = rt, c.prototype.dAddOffset = it, c.prototype.multiplyLowerTo = ut, c.prototype.multiplyUpperTo = dt, c.prototype.modInt = yt, c.prototype.millerRabin = Ct, c.prototype.clone = be, c.prototype.intValue = xe, c.prototype.byteValue = I, c.prototype.shortValue = Se, c.prototype.signum = we, c.prototype.toByteArray = Oe, c.prototype.equals = ke, c.prototype.min = Ae, c.prototype.max = je, c.prototype.and = L, c.prototype.or = Pe, c.prototype.xor = Ie, c.prototype.andNot = Re, c.prototype.not = ze, c.prototype.shiftLeft = z, c.prototype.shiftRight = Be, c.prototype.getLowestSetBit = He, c.prototype.bitCount = B, c.prototype.testBit = We, c.prototype.setBit = Ke, c.prototype.clearBit = qe, c.prototype.flipBit = Je, c.prototype.add = Xe, c.prototype.subtract = Ze, c.prototype.multiply = Qe, c.prototype.divide = et, c.prototype.remainder = tt, c.prototype.divideAndRemainder = nt, c.prototype.modPow = vt, c.prototype.modInverse = bt, c.prototype.pow = lt, c.prototype.gcd = V, c.prototype.isProbablePrime = St, c.prototype.square = $e;
981
+ var U = c;
982
+ if (U.prototype.IsNegative = function() {
983
+ return this.compareTo(U.ZERO) == -1;
984
+ }, U.op_Equality = function(e, t) {
985
985
  return e.compareTo(t) == 0;
986
- }, Y.op_Inequality = function(e, t) {
986
+ }, U.op_Inequality = function(e, t) {
987
987
  return e.compareTo(t) != 0;
988
- }, Y.op_GreaterThan = function(e, t) {
988
+ }, U.op_GreaterThan = function(e, t) {
989
989
  return e.compareTo(t) > 0;
990
- }, Y.op_LessThan = function(e, t) {
990
+ }, U.op_LessThan = function(e, t) {
991
991
  return e.compareTo(t) < 0;
992
- }, Y.op_Addition = function(e, t) {
993
- return new Y(e).add(new Y(t));
994
- }, Y.op_Subtraction = function(e, t) {
995
- return new Y(e).subtract(new Y(t));
996
- }, Y.Int128Mul = function(e, t) {
997
- return new Y(e).multiply(new Y(t));
998
- }, Y.op_Division = function(e, t) {
992
+ }, U.op_Addition = function(e, t) {
993
+ return new U(e).add(new U(t));
994
+ }, U.op_Subtraction = function(e, t) {
995
+ return new U(e).subtract(new U(t));
996
+ }, U.Int128Mul = function(e, t) {
997
+ return new U(e).multiply(new U(t));
998
+ }, U.op_Division = function(e, t) {
999
999
  return e.divide(t);
1000
- }, Y.prototype.ToDouble = function() {
1000
+ }, U.prototype.ToDouble = function() {
1001
1001
  return parseFloat(this.toString());
1002
- }, vt === void 0) var vt = function(e, t) {
1002
+ }, wt === void 0) var wt = function(e, t) {
1003
1003
  var n;
1004
1004
  if (Object.getOwnPropertyNames === void 0) {
1005
1005
  for (n in t.prototype) (e.prototype[n] === void 0 || e.prototype[n] == Object.prototype[n]) && (e.prototype[n] = t.prototype[n]);
@@ -1055,7 +1055,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
1055
1055
  return this.m_Childs.length > 0 ? this.m_Childs[0] : null;
1056
1056
  }, e.PolyTree.prototype.Total = function() {
1057
1057
  return this.m_AllPolys.length;
1058
- }, vt(e.PolyTree, e.PolyNode), e.Math_Abs_Int64 = e.Math_Abs_Int32 = e.Math_Abs_Double = function(e) {
1058
+ }, wt(e.PolyTree, e.PolyNode), e.Math_Abs_Int64 = e.Math_Abs_Int32 = e.Math_Abs_Double = function(e) {
1059
1059
  return Math.abs(e);
1060
1060
  }, e.Math_Max_Int32_Int32 = function(e, t) {
1061
1061
  return Math.max(e, t);
@@ -1168,7 +1168,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
1168
1168
  } while (r != n);
1169
1169
  return !1;
1170
1170
  }, e.ClipperBase.prototype.PointOnLineSegment = function(e, t, n, r) {
1171
- return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && Y.op_Equality(Y.Int128Mul(e.X - t.X, n.Y - t.Y), Y.Int128Mul(n.X - t.X, e.Y - t.Y)) : e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && (e.X - t.X) * (n.Y - t.Y) == (n.X - t.X) * (e.Y - t.Y);
1171
+ return r ? e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && U.op_Equality(U.Int128Mul(e.X - t.X, n.Y - t.Y), U.Int128Mul(n.X - t.X, e.Y - t.Y)) : e.X == t.X && e.Y == t.Y || e.X == n.X && e.Y == n.Y || e.X > t.X == e.X < n.X && e.Y > t.Y == e.Y < n.Y && (e.X - t.X) * (n.Y - t.Y) == (n.X - t.X) * (e.Y - t.Y);
1172
1172
  }, e.ClipperBase.prototype.PointOnPolygon = function(e, t, n) {
1173
1173
  for (var r = t;;) {
1174
1174
  if (this.PointOnLineSegment(e, r.Pt, r.Next.Pt, n)) return !0;
@@ -1177,13 +1177,13 @@ var w = /* @__PURE__ */ o(((e, t) => {
1177
1177
  return !1;
1178
1178
  }, e.ClipperBase.prototype.SlopesEqual = e.ClipperBase.SlopesEqual = function() {
1179
1179
  var t = arguments, n = t.length, r, i, a, o, s, c, l;
1180
- return n == 3 ? (r = t[0], i = t[1], l = t[2], l ? Y.op_Equality(Y.Int128Mul(r.Delta.Y, i.Delta.X), Y.Int128Mul(r.Delta.X, i.Delta.Y)) : e.Cast_Int64(r.Delta.Y * i.Delta.X) == e.Cast_Int64(r.Delta.X * i.Delta.Y)) : n == 4 ? (a = t[0], o = t[1], s = t[2], l = t[3], l ? Y.op_Equality(Y.Int128Mul(a.Y - o.Y, o.X - s.X), Y.Int128Mul(a.X - o.X, o.Y - s.Y)) : e.Cast_Int64((a.Y - o.Y) * (o.X - s.X)) - e.Cast_Int64((a.X - o.X) * (o.Y - s.Y)) === 0) : (a = t[0], o = t[1], s = t[2], c = t[3], l = t[4], l ? Y.op_Equality(Y.Int128Mul(a.Y - o.Y, s.X - c.X), Y.Int128Mul(a.X - o.X, s.Y - c.Y)) : e.Cast_Int64((a.Y - o.Y) * (s.X - c.X)) - e.Cast_Int64((a.X - o.X) * (s.Y - c.Y)) === 0);
1180
+ return n == 3 ? (r = t[0], i = t[1], l = t[2], l ? U.op_Equality(U.Int128Mul(r.Delta.Y, i.Delta.X), U.Int128Mul(r.Delta.X, i.Delta.Y)) : e.Cast_Int64(r.Delta.Y * i.Delta.X) == e.Cast_Int64(r.Delta.X * i.Delta.Y)) : n == 4 ? (a = t[0], o = t[1], s = t[2], l = t[3], l ? U.op_Equality(U.Int128Mul(a.Y - o.Y, o.X - s.X), U.Int128Mul(a.X - o.X, o.Y - s.Y)) : e.Cast_Int64((a.Y - o.Y) * (o.X - s.X)) - e.Cast_Int64((a.X - o.X) * (o.Y - s.Y)) === 0) : (a = t[0], o = t[1], s = t[2], c = t[3], l = t[4], l ? U.op_Equality(U.Int128Mul(a.Y - o.Y, s.X - c.X), U.Int128Mul(a.X - o.X, s.Y - c.Y)) : e.Cast_Int64((a.Y - o.Y) * (s.X - c.X)) - e.Cast_Int64((a.X - o.X) * (s.Y - c.Y)) === 0);
1181
1181
  }, e.ClipperBase.SlopesEqual3 = function(t, n, r) {
1182
- return r ? Y.op_Equality(Y.Int128Mul(t.Delta.Y, n.Delta.X), Y.Int128Mul(t.Delta.X, n.Delta.Y)) : e.Cast_Int64(t.Delta.Y * n.Delta.X) == e.Cast_Int64(t.Delta.X * n.Delta.Y);
1182
+ return r ? U.op_Equality(U.Int128Mul(t.Delta.Y, n.Delta.X), U.Int128Mul(t.Delta.X, n.Delta.Y)) : e.Cast_Int64(t.Delta.Y * n.Delta.X) == e.Cast_Int64(t.Delta.X * n.Delta.Y);
1183
1183
  }, e.ClipperBase.SlopesEqual4 = function(t, n, r, i) {
1184
- return i ? Y.op_Equality(Y.Int128Mul(t.Y - n.Y, n.X - r.X), Y.Int128Mul(t.X - n.X, n.Y - r.Y)) : e.Cast_Int64((t.Y - n.Y) * (n.X - r.X)) - e.Cast_Int64((t.X - n.X) * (n.Y - r.Y)) === 0;
1184
+ return i ? U.op_Equality(U.Int128Mul(t.Y - n.Y, n.X - r.X), U.Int128Mul(t.X - n.X, n.Y - r.Y)) : e.Cast_Int64((t.Y - n.Y) * (n.X - r.X)) - e.Cast_Int64((t.X - n.X) * (n.Y - r.Y)) === 0;
1185
1185
  }, e.ClipperBase.SlopesEqual5 = function(t, n, r, i, a) {
1186
- return a ? Y.op_Equality(Y.Int128Mul(t.Y - n.Y, r.X - i.X), Y.Int128Mul(t.X - n.X, r.Y - i.Y)) : e.Cast_Int64((t.Y - n.Y) * (r.X - i.X)) - e.Cast_Int64((t.X - n.X) * (r.Y - i.Y)) === 0;
1186
+ return a ? U.op_Equality(U.Int128Mul(t.Y - n.Y, r.X - i.X), U.Int128Mul(t.X - n.X, r.Y - i.Y)) : e.Cast_Int64((t.Y - n.Y) * (r.X - i.X)) - e.Cast_Int64((t.X - n.X) * (r.Y - i.Y)) === 0;
1187
1187
  }, e.ClipperBase.prototype.Clear = function() {
1188
1188
  this.DisposeLocalMinimaList();
1189
1189
  for (var t = 0, n = this.m_edges.length; t < n; ++t) {
@@ -1861,16 +1861,16 @@ var w = /* @__PURE__ */ o(((e, t) => {
1861
1861
  }
1862
1862
  this.m_IntersectList.length = 0;
1863
1863
  };
1864
- var yt = function(e) {
1864
+ var Tt = function(e) {
1865
1865
  return e < 0 ? Math.ceil(e - .5) : Math.round(e);
1866
- }, bt = function(e) {
1866
+ }, Et = function(e) {
1867
1867
  return e < 0 ? Math.ceil(e - .5) : Math.floor(e + .5);
1868
- }, xt = function(e) {
1868
+ }, Dt = function(e) {
1869
1869
  return e < 0 ? -Math.round(Math.abs(e)) : Math.round(e);
1870
- }, St = function(e) {
1870
+ }, Ot = function(e) {
1871
1871
  return e < 0 ? (e -= .5, e < -2147483648 ? Math.ceil(e) : e | 0) : (e += .5, e > 2147483647 ? Math.floor(e) : e | 0);
1872
1872
  };
1873
- a.msie ? e.Clipper.Round = yt : a.chromium ? e.Clipper.Round = xt : a.safari ? e.Clipper.Round = St : e.Clipper.Round = bt, e.Clipper.TopX = function(t, n) {
1873
+ a.msie ? e.Clipper.Round = Tt : a.chromium ? e.Clipper.Round = Dt : a.safari ? e.Clipper.Round = Ot : e.Clipper.Round = Et, e.Clipper.TopX = function(t, n) {
1874
1874
  return n == t.Top.Y ? t.Top.X : t.Bot.X + e.Clipper.Round(t.Dx * (n - t.Bot.Y));
1875
1875
  }, e.Clipper.prototype.IntersectPoint = function(t, n, r) {
1876
1876
  r.X = 0, r.Y = 0;
@@ -2248,7 +2248,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
2248
2248
  }, e.Clipper.ClosedPathsFromPolyTree = function(t) {
2249
2249
  var n = new e.Paths();
2250
2250
  return e.Clipper.AddPolyNodeToPaths(t, e.Clipper.NodeType.ntClosed, n), n;
2251
- }, vt(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
2251
+ }, wt(e.Clipper, e.ClipperBase), e.Clipper.NodeType = {
2252
2252
  ntAny: 0,
2253
2253
  ntOpen: 1,
2254
2254
  ntClosed: 2
@@ -2511,7 +2511,7 @@ var w = /* @__PURE__ */ o(((e, t) => {
2511
2511
  return n;
2512
2512
  };
2513
2513
  })();
2514
- })), T = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2514
+ })), te = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
2515
2515
  var n = w(), r = 10 ** 5;
2516
2516
  function i(e) {
2517
2517
  return e.map(function(e) {
@@ -2697,16 +2697,16 @@ var w = /* @__PURE__ */ o(((e, t) => {
2697
2697
  Polygon: _,
2698
2698
  ClipperLib: n
2699
2699
  };
2700
- })))(), 1), E = 18, te = Object.freeze({
2700
+ })))(), 1), T = 18, ne = Object.freeze({
2701
2701
  x: 0,
2702
2702
  y: 0,
2703
2703
  scalePercent: 100
2704
2704
  });
2705
- function D(e) {
2705
+ function re(e) {
2706
2706
  if (typeof e != "number" || !Number.isFinite(e) || e <= 0) throw TypeError("Bubble tail length must be greater than zero.");
2707
2707
  return e;
2708
2708
  }
2709
- function ne(e) {
2709
+ function ie(e) {
2710
2710
  if (e.length !== 2 && e.length !== 3) throw TypeError("Bubble offset must be [x, y] or [x, y, scale].");
2711
2711
  let [t, n, r = 100] = e;
2712
2712
  if (![
@@ -2720,7 +2720,7 @@ function ne(e) {
2720
2720
  scalePercent: r
2721
2721
  });
2722
2722
  }
2723
- var O = Object.freeze([
2723
+ var ae = Object.freeze([
2724
2724
  "NORMAL",
2725
2725
  "THINKING",
2726
2726
  "DREAMING",
@@ -2732,21 +2732,21 @@ var O = Object.freeze([
2732
2732
  "NARRATION",
2733
2733
  "NO_BUBBLE"
2734
2734
  ]);
2735
- function k(e) {
2735
+ function E(e) {
2736
2736
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
2737
2737
  }
2738
- function A(e, t) {
2738
+ function D(e, t) {
2739
2739
  let n = e ?? t;
2740
2740
  if (!Number.isFinite(n) || n <= 0) throw TypeError("Bubble SVG dimensions must be positive and finite.");
2741
2741
  return n;
2742
2742
  }
2743
- function re(e) {
2743
+ function oe(e) {
2744
2744
  if (e === null) return null;
2745
2745
  let t = e ?? 180;
2746
2746
  if (!Number.isFinite(t)) throw TypeError("tailDirection must be finite.");
2747
2747
  return (t % 360 + 360) % 360;
2748
2748
  }
2749
- function j(e, t, n = 18) {
2749
+ function O(e, t, n = 18) {
2750
2750
  let r = e - 24, i = t - 24;
2751
2751
  return [
2752
2752
  {
@@ -2777,24 +2777,24 @@ function j(e, t, n = 18) {
2777
2777
  };
2778
2778
  }));
2779
2779
  }
2780
- function M(e, t) {
2780
+ function k(e, t) {
2781
2781
  return e.x * t.y - e.y * t.x;
2782
2782
  }
2783
- function N(e, t) {
2783
+ function A(e, t) {
2784
2784
  return {
2785
2785
  x: e.x - t.x,
2786
2786
  y: e.y - t.y
2787
2787
  };
2788
2788
  }
2789
- function P(e, t) {
2789
+ function j(e, t) {
2790
2790
  return Math.hypot(e.x - t.x, e.y - t.y);
2791
2791
  }
2792
- function F(e, t, n, r) {
2792
+ function M(e, t, n, r) {
2793
2793
  let i = t, a = r;
2794
2794
  for (; a > 0;) {
2795
2795
  let t = (i + n + e.length) % e.length, r = e[i], o = e[t];
2796
2796
  if (!r || !o) throw Error("Bubble border path is invalid.");
2797
- let s = P(r, o);
2797
+ let s = j(r, o);
2798
2798
  if (a <= s) {
2799
2799
  let e = a / s;
2800
2800
  return {
@@ -2808,14 +2808,14 @@ function F(e, t, n, r) {
2808
2808
  if (!o) throw Error("Bubble border path is empty.");
2809
2809
  return o;
2810
2810
  }
2811
- function I(e, t, n, r, i) {
2811
+ function N(e, t, n, r, i) {
2812
2812
  let a;
2813
2813
  for (let r = 0; r < e.length; r += 1) {
2814
2814
  let i = e[r], o = e[(r + 1) % e.length];
2815
2815
  if (!i || !o) continue;
2816
- let s = N(o, i), c = M(n, s);
2816
+ let s = A(o, i), c = k(n, s);
2817
2817
  if (Math.abs(c) < 1e-9) continue;
2818
- let l = N(i, t), u = M(l, s) / c, d = M(l, n) / c;
2818
+ let l = A(i, t), u = k(l, s) / c, d = k(l, n) / c;
2819
2819
  u < 0 || d < -1e-9 || d > 1 + 1e-9 || a && u >= a.rayScale || (a = {
2820
2820
  edgeIndex: r,
2821
2821
  point: {
@@ -2833,61 +2833,61 @@ function I(e, t, n, r, i) {
2833
2833
  ], s = a.edgeIndex + 1;
2834
2834
  return {
2835
2835
  borderPoint: a.point,
2836
- base: [F(o, s, -1, 9), F(o, s, 1, 9)],
2836
+ base: [M(o, s, -1, 9), M(o, s, 1, 9)],
2837
2837
  tip: {
2838
2838
  x: i?.x ?? t.x + n.x * (a.rayScale + r),
2839
2839
  y: i?.y ?? t.y + n.y * (a.rayScale + r)
2840
2840
  }
2841
2841
  };
2842
2842
  }
2843
- function L(e) {
2843
+ function P(e) {
2844
2844
  let t = e * Math.PI / 180;
2845
2845
  return {
2846
2846
  x: Math.sin(t),
2847
2847
  y: -Math.cos(t)
2848
2848
  };
2849
2849
  }
2850
- function ie(e, t, n, r) {
2850
+ function se(e, t, n, r) {
2851
2851
  return {
2852
2852
  x: n.x + (e.x - t.x) * r,
2853
2853
  y: n.y + (e.y - t.y) * r
2854
2854
  };
2855
2855
  }
2856
- function R(e, t, n, r, i, a) {
2856
+ function F(e, t, n, r, i, a) {
2857
2857
  let o = {
2858
2858
  x: t / 2,
2859
2859
  y: n / 2
2860
- }, s = L(r), c = I(e, o, s, i), l = P(o, c.borderPoint), u = a.scalePercent / 100, d = {
2860
+ }, s = P(r), c = N(e, o, s, i), l = j(o, c.borderPoint), u = a.scalePercent / 100, d = {
2861
2861
  x: o.x - s.x * l * (u - 1) + a.x,
2862
2862
  y: o.y - s.y * l * (u - 1) - a.y
2863
2863
  };
2864
2864
  return {
2865
- body: e.map((e) => ie(e, o, d, u)),
2865
+ body: e.map((e) => se(e, o, d, u)),
2866
2866
  bodyCenter: d,
2867
2867
  tip: c.tip
2868
2868
  };
2869
2869
  }
2870
- function z(e) {
2870
+ function ce(e) {
2871
2871
  let t = e[0];
2872
2872
  if (!t) throw Error("Bubble polygon is empty.");
2873
2873
  return `M ${t.x.toFixed(4)} ${t.y.toFixed(4)} ${e.slice(1).map(({ x: e, y: t }) => `L ${e.toFixed(4)} ${t.toFixed(4)}`).join(" ")} Z`;
2874
2874
  }
2875
- function ae(e) {
2875
+ function le(e) {
2876
2876
  return Math.abs(e.reduce((t, n, r) => {
2877
2877
  let i = e[(r + 1) % e.length];
2878
2878
  return i ? t + n.x * i.y - i.x * n.y : t;
2879
2879
  }, 0) / 2);
2880
2880
  }
2881
- function oe(e, t, n, r = "") {
2882
- return `<path d="${z(e)}" fill="${t}" stroke="${n}" stroke-width="3" stroke-linejoin="round" ${r}/>`;
2881
+ function ue(e, t, n, r = "") {
2882
+ return `<path d="${ce(e)}" fill="${t}" stroke="${n}" stroke-width="3" stroke-linejoin="round" ${r}/>`;
2883
2883
  }
2884
- function B(e, t, n, r, i, a = "") {
2885
- let o = N(n, t), s = Math.hypot(o.x, o.y);
2884
+ function de(e, t, n, r, i, a = "") {
2885
+ let o = A(n, t), s = Math.hypot(o.x, o.y);
2886
2886
  if (!(s > 0)) throw TypeError("Bubble body center and tail tip must differ.");
2887
- let c = I(e, t, {
2887
+ let c = N(e, t, {
2888
2888
  x: o.x / s,
2889
2889
  y: o.y / s
2890
- }, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u = T.default.union([l(e)], [[l([
2890
+ }, 0, n), l = (e) => e.map(({ x: e, y: t }) => [e, t]), u = te.default.union([l(e)], [[l([
2891
2891
  c.base[0],
2892
2892
  c.tip,
2893
2893
  c.base[1]
@@ -2896,11 +2896,11 @@ function B(e, t, n, r, i, a = "") {
2896
2896
  let d = u.map((e) => e.map(([e, t]) => ({
2897
2897
  x: e,
2898
2898
  y: t
2899
- }))).sort((e, t) => ae(t) - ae(e))[0];
2899
+ }))).sort((e, t) => le(t) - le(e))[0];
2900
2900
  if (!d) throw Error("JSClipper returned an empty Bubble outline.");
2901
- return `<path d="${z(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
2901
+ return `<path d="${ce(d)}" fill="${r}" stroke="${i}" stroke-width="3" stroke-linejoin="round" data-boolean-operation="union" data-tail-base-on-border="true" ${a}/>`;
2902
2902
  }
2903
- function se(e, t, n, r) {
2903
+ function fe(e, t, n, r) {
2904
2904
  let i = e - 24, a = t - 24, o = e / 2, s = t / 2;
2905
2905
  return `<path d="M 42 ${s}
2906
2906
  C 22 ${s - 20}, 32 42, 60 44
@@ -2913,8 +2913,8 @@ function se(e, t, n, r) {
2913
2913
  C 31 ${a + 2}, 17 ${s + 20}, 42 ${s} Z"
2914
2914
  fill="${n}" stroke="${r}" stroke-width="3" stroke-linejoin="round"/>`;
2915
2915
  }
2916
- function ce(e, t, n, r, i, a) {
2917
- let o = N(n, t), s = Math.hypot(o.x, o.y), c = I(e, t, {
2916
+ function pe(e, t, n, r, i, a) {
2917
+ let o = A(n, t), s = Math.hypot(o.x, o.y), c = N(e, t, {
2918
2918
  x: o.x / s,
2919
2919
  y: o.y / s
2920
2920
  }, 0, n), l = {
@@ -2942,7 +2942,7 @@ function ce(e, t, n, r, i, a) {
2942
2942
  radius: 3.5
2943
2943
  }]).map(({ ratio: e, radius: t }) => `<circle cx="${l.x + (c.tip.x - l.x) * e}" cy="${l.y + (c.tip.y - l.y) * e}" r="${t}" fill="${r}" stroke="${i}" stroke-width="2"/>`).join("");
2944
2944
  }
2945
- function le(e, t) {
2945
+ function me(e, t) {
2946
2946
  let n = e / 2, r = t / 2;
2947
2947
  return Array.from({ length: 28 }, (i, a) => {
2948
2948
  let o = a * Math.PI * 2 / 28 - Math.PI / 2, s = a % 2 == 0, c = s ? e / 2 - 6 : e / 2 - 22, l = s ? t / 2 - 6 : t / 2 - 22;
@@ -2952,7 +2952,7 @@ function le(e, t) {
2952
2952
  };
2953
2953
  });
2954
2954
  }
2955
- function ue(e, t) {
2955
+ function he(e, t) {
2956
2956
  let n = e - 24, r = t - 24, i = Array.from({ length: 21 }, (e, t) => {
2957
2957
  let n = t / 20;
2958
2958
  return {
@@ -2985,59 +2985,59 @@ function ue(e, t) {
2985
2985
  }))
2986
2986
  ];
2987
2987
  }
2988
- function de(e, t, n) {
2989
- return e === "YELLING" ? le(t, n) : e === "WAVY" ? ue(t, n) : j(t, n);
2988
+ function ge(e, t, n) {
2989
+ return e === "YELLING" ? me(t, n) : e === "WAVY" ? he(t, n) : O(t, n);
2990
2990
  }
2991
- function fe(e) {
2992
- let t = A(e.width, 220), n = A(e.height, 112), r = re(e.tailDirection);
2991
+ function _e(e) {
2992
+ let t = D(e.width, 220), n = D(e.height, 112), r = oe(e.tailDirection);
2993
2993
  if (r === null) throw TypeError("Bubble body center offset requires a tail direction.");
2994
- let i = D(e.tailLength ?? E), a = ne(e.offset), o = {
2994
+ let i = re(e.tailLength ?? T), a = ie(e.offset), o = {
2995
2995
  x: t / 2,
2996
2996
  y: n / 2
2997
- }, s = R(de(e.style, t, n), t, n, r, i, a);
2997
+ }, s = F(ge(e.style, t, n), t, n, r, i, a);
2998
2998
  return Object.freeze({
2999
2999
  x: s.bodyCenter.x - o.x,
3000
3000
  y: s.bodyCenter.y - o.y
3001
3001
  });
3002
3002
  }
3003
- function pe(e, t, n, r, i, a, o, s) {
3004
- let c = j(t, n), l = (e) => r === null ? e : R(e, t, n, r, o, s).body, u = (e, c = "") => {
3005
- if (r === null) return oe(e, i, a, c);
3006
- let l = R(e, t, n, r, o, s);
3007
- return B(l.body, l.bodyCenter, l.tip, i, a, c);
3003
+ function ve(e, t, n, r, i, a, o, s) {
3004
+ let c = O(t, n), l = (e) => r === null ? e : F(e, t, n, r, o, s).body, u = (e, c = "") => {
3005
+ if (r === null) return ue(e, i, a, c);
3006
+ let l = F(e, t, n, r, o, s);
3007
+ return de(l.body, l.bodyCenter, l.tip, i, a, c);
3008
3008
  };
3009
3009
  switch (e) {
3010
3010
  case "NO_BUBBLE": return "";
3011
3011
  case "THINKING":
3012
3012
  case "DREAMING": {
3013
- if (r === null) return se(t, n, i, a);
3014
- let l = R(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
3013
+ if (r === null) return fe(t, n, i, a);
3014
+ let l = F(c, t, n, r, o, s), u = s.scalePercent / 100, d = {
3015
3015
  x: t / 2,
3016
3016
  y: n / 2
3017
3017
  }, f = l.bodyCenter.x - d.x * u, p = l.bodyCenter.y - d.y * u;
3018
- return `${ce(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${se(t, n, i, a)}</g>`;
3018
+ return `${pe(l.body, l.bodyCenter, l.tip, i, a, e === "DREAMING")}<g transform="translate(${f} ${p}) scale(${u})">${fe(t, n, i, a)}</g>`;
3019
3019
  }
3020
- case "YELLING": return u(le(t, n));
3021
- case "WAVY": return u(ue(t, n));
3020
+ case "YELLING": return u(me(t, n));
3021
+ case "WAVY": return u(he(t, n));
3022
3022
  case "WHISPERING": return u(c, "stroke-dasharray=\"5 5\"");
3023
3023
  case "ANNOUNCEMENT": return `${u(c)}<rect x="30" y="30" width="${t - 60}" height="${n - 60}" rx="13" fill="none" stroke="${a}" stroke-width="1.5"/>`;
3024
- case "NARRATION": return oe(l(c), i, a);
3024
+ case "NARRATION": return ue(l(c), i, a);
3025
3025
  case "OFF_PANEL": return u(c);
3026
3026
  case "NORMAL": return u(c);
3027
3027
  }
3028
3028
  }
3029
- function me(e) {
3030
- if (!O.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
3029
+ function ye(e) {
3030
+ if (!ae.includes(e.style)) throw TypeError(`Unsupported Bubble visual style: ${String(e.style)}`);
3031
3031
  if (!Array.isArray(e.lines) || e.lines.some((e) => typeof e != "string")) throw TypeError("lines must be an array of strings.");
3032
- let t = A(e.width, 220), n = A(e.height, 112), r = A(e.fontSize, 15), i = re(e.tailDirection), a = D(e.tailLength ?? E), o = e.offset === void 0 ? te : ne(e.offset), s = e.fillColor ?? "#fff4cc", c = e.borderColor ?? "#6f5b45", l = e.textColor ?? "#25283a", u = e.fontFamily ?? "Noto Sans JP, sans-serif", d = r * 1.35, f = n / 2 - (e.lines.length - 1) * d / 2 + r * .35, p = i === null ? 1 : o.scalePercent / 100, m = i === null ? {
3032
+ let t = D(e.width, 220), n = D(e.height, 112), r = D(e.fontSize, 15), i = oe(e.tailDirection), a = re(e.tailLength ?? T), o = e.offset === void 0 ? ne : ie(e.offset), s = e.fillColor ?? "#fff4cc", c = e.borderColor ?? "#6f5b45", l = e.textColor ?? "#25283a", u = e.fontFamily ?? "Noto Sans JP, sans-serif", d = r * 1.35, f = n / 2 - (e.lines.length - 1) * d / 2 + r * .35, p = i === null ? 1 : o.scalePercent / 100, m = i === null ? {
3033
3033
  x: t / 2,
3034
3034
  y: n / 2
3035
- } : R(j(t, n), t, n, i, a, o).bodyCenter, h = e.lines.map((e, t) => `<text x="${m.x}" y="${m.y + (f + t * d - n / 2) * p}" text-anchor="middle" fill="${k(l)}" font-family="${k(u)}" font-size="${r * p}">${k(e)}</text>`).join(""), g = k(e.title ?? `${e.style} bubble`);
3036
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" viewBox="0 0 ${t} ${n}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}"><title>${g}</title>${pe(e.style, t, n, i, s, c, a, o)}${h}</svg>`;
3035
+ } : F(O(t, n), t, n, i, a, o).bodyCenter, h = e.lines.map((e, t) => `<text x="${m.x}" y="${m.y + (f + t * d - n / 2) * p}" text-anchor="middle" fill="${E(l)}" font-family="${E(u)}" font-size="${r * p}">${E(e)}</text>`).join(""), g = E(e.title ?? `${e.style} bubble`);
3036
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}" viewBox="0 0 ${t} ${n}" role="img" data-bubble-renderer="canonical" data-bubble-style="${e.style}"><title>${g}</title>${ve(e.style, t, n, i, s, c, a, o)}${h}</svg>`;
3037
3037
  }
3038
3038
  //#endregion
3039
3039
  //#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/constants.js
3040
- var he = 2048, ge = 2112, V = Uint8Array, H = Uint16Array, _e = Int32Array, ve = new V([
3040
+ var be = 2048, xe = 2112, I = Uint8Array, Se = Uint16Array, Ce = Int32Array, we = new I([
3041
3041
  0,
3042
3042
  0,
3043
3043
  0,
@@ -3070,7 +3070,7 @@ var he = 2048, ge = 2112, V = Uint8Array, H = Uint16Array, _e = Int32Array, ve =
3070
3070
  0,
3071
3071
  0,
3072
3072
  0
3073
- ]), ye = new V([
3073
+ ]), Te = new I([
3074
3074
  0,
3075
3075
  0,
3076
3076
  0,
@@ -3103,7 +3103,7 @@ var he = 2048, ge = 2112, V = Uint8Array, H = Uint16Array, _e = Int32Array, ve =
3103
3103
  13,
3104
3104
  0,
3105
3105
  0
3106
- ]), be = new V([
3106
+ ]), Ee = new I([
3107
3107
  16,
3108
3108
  17,
3109
3109
  18,
@@ -3123,51 +3123,51 @@ var he = 2048, ge = 2112, V = Uint8Array, H = Uint16Array, _e = Int32Array, ve =
3123
3123
  14,
3124
3124
  1,
3125
3125
  15
3126
- ]), xe = function(e, t) {
3127
- for (var n = new H(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
3128
- for (var i = new _e(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
3126
+ ]), De = function(e, t) {
3127
+ for (var n = new Se(31), r = 0; r < 31; ++r) n[r] = t += 1 << e[r - 1];
3128
+ for (var i = new Ce(n[30]), r = 1; r < 30; ++r) for (var a = n[r]; a < n[r + 1]; ++a) i[a] = a - n[r] << 5 | r;
3129
3129
  return {
3130
3130
  b: n,
3131
3131
  r: i
3132
3132
  };
3133
- }, Se = xe(ve, 2), Ce = Se.b, we = Se.r;
3134
- Ce[28] = 258, we[258] = 28;
3135
- var Te = xe(ye, 0), Ee = Te.b;
3136
- Te.r;
3137
- for (var De = new H(32768), U = 0; U < 32768; ++U) {
3138
- var W = (U & 43690) >> 1 | (U & 21845) << 1;
3139
- W = (W & 52428) >> 2 | (W & 13107) << 2, W = (W & 61680) >> 4 | (W & 3855) << 4, De[U] = ((W & 65280) >> 8 | (W & 255) << 8) >> 1;
3140
- }
3141
- for (var Oe = (function(e, t, n) {
3142
- for (var r = e.length, i = 0, a = new H(t); i < r; ++i) e[i] && ++a[e[i] - 1];
3143
- var o = new H(t);
3133
+ }, Oe = De(we, 2), ke = Oe.b, Ae = Oe.r;
3134
+ ke[28] = 258, Ae[258] = 28;
3135
+ var je = De(Te, 0), Me = je.b;
3136
+ je.r;
3137
+ for (var Ne = new Se(32768), L = 0; L < 32768; ++L) {
3138
+ var R = (L & 43690) >> 1 | (L & 21845) << 1;
3139
+ R = (R & 52428) >> 2 | (R & 13107) << 2, R = (R & 61680) >> 4 | (R & 3855) << 4, Ne[L] = ((R & 65280) >> 8 | (R & 255) << 8) >> 1;
3140
+ }
3141
+ for (var Pe = (function(e, t, n) {
3142
+ for (var r = e.length, i = 0, a = new Se(t); i < r; ++i) e[i] && ++a[e[i] - 1];
3143
+ var o = new Se(t);
3144
3144
  for (i = 1; i < t; ++i) o[i] = o[i - 1] + a[i - 1] << 1;
3145
3145
  var s;
3146
3146
  if (n) {
3147
- s = new H(1 << t);
3147
+ s = new Se(1 << t);
3148
3148
  var c = 15 - t;
3149
- for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[De[d] >> c] = l;
3150
- } else for (s = new H(r), i = 0; i < r; ++i) e[i] && (s[i] = De[o[e[i] - 1]++] >> 15 - e[i]);
3149
+ for (i = 0; i < r; ++i) if (e[i]) for (var l = i << 4 | e[i], u = t - e[i], d = o[e[i] - 1]++ << u, f = d | (1 << u) - 1; d <= f; ++d) s[Ne[d] >> c] = l;
3150
+ } else for (s = new Se(r), i = 0; i < r; ++i) e[i] && (s[i] = Ne[o[e[i] - 1]++] >> 15 - e[i]);
3151
3151
  return s;
3152
- }), G = new V(288), U = 0; U < 144; ++U) G[U] = 8;
3153
- for (var U = 144; U < 256; ++U) G[U] = 9;
3154
- for (var U = 256; U < 280; ++U) G[U] = 7;
3155
- for (var U = 280; U < 288; ++U) G[U] = 8;
3156
- for (var ke = new V(32), U = 0; U < 32; ++U) ke[U] = 5;
3157
- var Ae = /*#__PURE__*/ Oe(G, 9, 1), je = /*#__PURE__*/ Oe(ke, 5, 1), Me = function(e) {
3152
+ }), Fe = new I(288), L = 0; L < 144; ++L) Fe[L] = 8;
3153
+ for (var L = 144; L < 256; ++L) Fe[L] = 9;
3154
+ for (var L = 256; L < 280; ++L) Fe[L] = 7;
3155
+ for (var L = 280; L < 288; ++L) Fe[L] = 8;
3156
+ for (var Ie = new I(32), L = 0; L < 32; ++L) Ie[L] = 5;
3157
+ var Le = /*#__PURE__*/ Pe(Fe, 9, 1), Re = /*#__PURE__*/ Pe(Ie, 5, 1), ze = function(e) {
3158
3158
  for (var t = e[0], n = 1; n < e.length; ++n) e[n] > t && (t = e[n]);
3159
3159
  return t;
3160
- }, K = function(e, t, n) {
3160
+ }, z = function(e, t, n) {
3161
3161
  var r = t / 8 | 0;
3162
3162
  return (e[r] | e[r + 1] << 8) >> (t & 7) & n;
3163
- }, Ne = function(e, t) {
3163
+ }, Be = function(e, t) {
3164
3164
  var n = t / 8 | 0;
3165
3165
  return (e[n] | e[n + 1] << 8 | e[n + 2] << 16) >> (t & 7);
3166
- }, Pe = function(e) {
3166
+ }, Ve = function(e) {
3167
3167
  return (e + 7) / 8 | 0;
3168
- }, Fe = function(e, t, n) {
3169
- return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new V(e.subarray(t, n));
3170
- }, Ie = [
3168
+ }, He = function(e, t, n) {
3169
+ return (t == null || t < 0) && (t = 0), (n == null || n > e.length) && (n = e.length), new I(e.subarray(t, n));
3170
+ }, Ue = [
3171
3171
  "unexpected EOF",
3172
3172
  "invalid block type",
3173
3173
  "invalid length/literal",
@@ -3182,121 +3182,121 @@ var Ae = /*#__PURE__*/ Oe(G, 9, 1), je = /*#__PURE__*/ Oe(ke, 5, 1), Me = functi
3182
3182
  "filename too long",
3183
3183
  "stream finishing",
3184
3184
  "invalid zip data"
3185
- ], q = function(e, t, n) {
3186
- var r = Error(t || Ie[e]);
3187
- if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, q), !n) throw r;
3185
+ ], B = function(e, t, n) {
3186
+ var r = Error(t || Ue[e]);
3187
+ if (r.code = e, Error.captureStackTrace && Error.captureStackTrace(r, B), !n) throw r;
3188
3188
  return r;
3189
- }, Le = function(e, t, n, r) {
3189
+ }, We = function(e, t, n, r) {
3190
3190
  var i = e.length, a = r ? r.length : 0;
3191
- if (!i || t.f && !t.l) return n || new V(0);
3191
+ if (!i || t.f && !t.l) return n || new I(0);
3192
3192
  var o = !n, s = o || t.i != 2, c = t.i;
3193
- o && (n = new V(i * 3));
3193
+ o && (n = new I(i * 3));
3194
3194
  var l = function(e) {
3195
3195
  var t = n.length;
3196
3196
  if (e > t) {
3197
- var r = new V(Math.max(t * 2, e));
3197
+ var r = new I(Math.max(t * 2, e));
3198
3198
  r.set(n), n = r;
3199
3199
  }
3200
3200
  }, u = t.f || 0, d = t.p || 0, f = t.b || 0, p = t.l, m = t.d, h = t.m, g = t.n, _ = i * 8;
3201
3201
  do {
3202
3202
  if (!p) {
3203
- u = K(e, d, 1);
3204
- var v = K(e, d + 1, 3);
3203
+ u = z(e, d, 1);
3204
+ var v = z(e, d + 1, 3);
3205
3205
  if (d += 3, !v) {
3206
- var y = Pe(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
3206
+ var y = Ve(d) + 4, b = e[y - 4] | e[y - 3] << 8, x = y + b;
3207
3207
  if (x > i) {
3208
- c && q(0);
3208
+ c && B(0);
3209
3209
  break;
3210
3210
  }
3211
3211
  s && l(f + b), n.set(e.subarray(y, x), f), t.b = f += b, t.p = d = x * 8, t.f = u;
3212
3212
  continue;
3213
3213
  }
3214
- if (v == 1) p = Ae, m = je, h = 9, g = 5;
3214
+ if (v == 1) p = Le, m = Re, h = 9, g = 5;
3215
3215
  else if (v == 2) {
3216
- var S = K(e, d, 31) + 257, C = K(e, d + 10, 15) + 4, ee = S + K(e, d + 5, 31) + 1;
3216
+ var S = z(e, d, 31) + 257, C = z(e, d + 10, 15) + 4, ee = S + z(e, d + 5, 31) + 1;
3217
3217
  d += 14;
3218
- for (var w = new V(ee), T = new V(19), E = 0; E < C; ++E) T[be[E]] = K(e, d + E * 3, 7);
3218
+ for (var w = new I(ee), te = new I(19), T = 0; T < C; ++T) te[Ee[T]] = z(e, d + T * 3, 7);
3219
3219
  d += C * 3;
3220
- for (var te = Me(T), D = (1 << te) - 1, ne = Oe(T, te, 1), E = 0; E < ee;) {
3221
- var O = ne[K(e, d, D)];
3222
- d += O & 15;
3223
- var y = O >> 4;
3224
- if (y < 16) w[E++] = y;
3220
+ for (var ne = ze(te), re = (1 << ne) - 1, ie = Pe(te, ne, 1), T = 0; T < ee;) {
3221
+ var ae = ie[z(e, d, re)];
3222
+ d += ae & 15;
3223
+ var y = ae >> 4;
3224
+ if (y < 16) w[T++] = y;
3225
3225
  else {
3226
- var k = 0, A = 0;
3227
- for (y == 16 ? (A = 3 + K(e, d, 3), d += 2, k = w[E - 1]) : y == 17 ? (A = 3 + K(e, d, 7), d += 3) : y == 18 && (A = 11 + K(e, d, 127), d += 7); A--;) w[E++] = k;
3226
+ var E = 0, D = 0;
3227
+ for (y == 16 ? (D = 3 + z(e, d, 3), d += 2, E = w[T - 1]) : y == 17 ? (D = 3 + z(e, d, 7), d += 3) : y == 18 && (D = 11 + z(e, d, 127), d += 7); D--;) w[T++] = E;
3228
3228
  }
3229
3229
  }
3230
- var re = w.subarray(0, S), j = w.subarray(S);
3231
- h = Me(re), g = Me(j), p = Oe(re, h, 1), m = Oe(j, g, 1);
3232
- } else q(1);
3230
+ var oe = w.subarray(0, S), O = w.subarray(S);
3231
+ h = ze(oe), g = ze(O), p = Pe(oe, h, 1), m = Pe(O, g, 1);
3232
+ } else B(1);
3233
3233
  if (d > _) {
3234
- c && q(0);
3234
+ c && B(0);
3235
3235
  break;
3236
3236
  }
3237
3237
  }
3238
3238
  s && l(f + 131072);
3239
- for (var M = (1 << h) - 1, N = (1 << g) - 1, P = d;; P = d) {
3240
- var k = p[Ne(e, d) & M], F = k >> 4;
3241
- if (d += k & 15, d > _) {
3242
- c && q(0);
3239
+ for (var k = (1 << h) - 1, A = (1 << g) - 1, j = d;; j = d) {
3240
+ var E = p[Be(e, d) & k], M = E >> 4;
3241
+ if (d += E & 15, d > _) {
3242
+ c && B(0);
3243
3243
  break;
3244
3244
  }
3245
- if (k || q(2), F < 256) n[f++] = F;
3246
- else if (F == 256) {
3247
- P = d, p = null;
3245
+ if (E || B(2), M < 256) n[f++] = M;
3246
+ else if (M == 256) {
3247
+ j = d, p = null;
3248
3248
  break;
3249
3249
  } else {
3250
- var I = F - 254;
3251
- if (F > 264) {
3252
- var E = F - 257, L = ve[E];
3253
- I = K(e, d, (1 << L) - 1) + Ce[E], d += L;
3250
+ var N = M - 254;
3251
+ if (M > 264) {
3252
+ var T = M - 257, P = we[T];
3253
+ N = z(e, d, (1 << P) - 1) + ke[T], d += P;
3254
3254
  }
3255
- var ie = m[Ne(e, d) & N], R = ie >> 4;
3256
- ie || q(3), d += ie & 15;
3257
- var j = Ee[R];
3258
- if (R > 3) {
3259
- var L = ye[R];
3260
- j += Ne(e, d) & (1 << L) - 1, d += L;
3255
+ var se = m[Be(e, d) & A], F = se >> 4;
3256
+ se || B(3), d += se & 15;
3257
+ var O = Me[F];
3258
+ if (F > 3) {
3259
+ var P = Te[F];
3260
+ O += Be(e, d) & (1 << P) - 1, d += P;
3261
3261
  }
3262
3262
  if (d > _) {
3263
- c && q(0);
3263
+ c && B(0);
3264
3264
  break;
3265
3265
  }
3266
3266
  s && l(f + 131072);
3267
- var z = f + I;
3268
- if (f < j) {
3269
- var ae = a - j, oe = Math.min(j, z);
3270
- for (ae + f < 0 && q(3); f < oe; ++f) n[f] = r[ae + f];
3267
+ var ce = f + N;
3268
+ if (f < O) {
3269
+ var le = a - O, ue = Math.min(O, ce);
3270
+ for (le + f < 0 && B(3); f < ue; ++f) n[f] = r[le + f];
3271
3271
  }
3272
- for (; f < z; ++f) n[f] = n[f - j];
3272
+ for (; f < ce; ++f) n[f] = n[f - O];
3273
3273
  }
3274
3274
  }
3275
- t.l = p, t.p = P, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
3275
+ t.l = p, t.p = j, t.b = f, t.f = u, p && (u = 1, t.m = h, t.d = m, t.n = g);
3276
3276
  } while (!u);
3277
- return f != n.length && o ? Fe(n, 0, f) : n.subarray(0, f);
3278
- }, Re = /*#__PURE__*/ new V(0), ze = function(e) {
3279
- (e[0] != 31 || e[1] != 139 || e[2] != 8) && q(6, "invalid gzip data");
3277
+ return f != n.length && o ? He(n, 0, f) : n.subarray(0, f);
3278
+ }, Ge = /*#__PURE__*/ new I(0), Ke = function(e) {
3279
+ (e[0] != 31 || e[1] != 139 || e[2] != 8) && B(6, "invalid gzip data");
3280
3280
  var t = e[3], n = 10;
3281
3281
  t & 4 && (n += (e[10] | e[11] << 8) + 2);
3282
3282
  for (var r = (t >> 3 & 1) + (t >> 4 & 1); r > 0; r -= !e[n++]);
3283
3283
  return n + (t & 2);
3284
- }, Be = function(e) {
3284
+ }, qe = function(e) {
3285
3285
  var t = e.length;
3286
3286
  return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
3287
3287
  };
3288
- function Ve(e, t) {
3289
- var n = ze(e);
3290
- return n + 8 > e.length && q(6, "invalid gzip data"), Le(e.subarray(n, -8), { i: 2 }, t && t.out || new V(Be(e)), t && t.dictionary);
3288
+ function Je(e, t) {
3289
+ var n = Ke(e);
3290
+ return n + 8 > e.length && B(6, "invalid gzip data"), We(e.subarray(n, -8), { i: 2 }, t && t.out || new I(qe(e)), t && t.dictionary);
3291
3291
  }
3292
- var He = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
3292
+ var Ye = typeof TextDecoder < "u" && /*#__PURE__*/ new TextDecoder();
3293
3293
  try {
3294
- He.decode(Re, { stream: !0 });
3294
+ Ye.decode(Ge, { stream: !0 });
3295
3295
  } catch {}
3296
3296
  //#endregion
3297
3297
  //#region node_modules/.pnpm/@cto.af+unicode-trie-runtime@3.2.9/node_modules/@cto.af/unicode-trie-runtime/swap.js
3298
- var Ue = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
3299
- function We(e) {
3298
+ var Xe = new Uint8Array(new Uint32Array([305419896]).buffer)[0] === 18;
3299
+ function Ze(e) {
3300
3300
  let t = e.length;
3301
3301
  for (let n = 0; n < t; n += 4) [e[n], e[n + 1], e[n + 2], e[n + 3]] = [
3302
3302
  e[n + 3],
@@ -3305,15 +3305,15 @@ function We(e) {
3305
3305
  e[n]
3306
3306
  ];
3307
3307
  }
3308
- function Ge(e) {}
3309
- var Ke = Ue ? We : Ge, qe = new TextDecoder(), Je = class e {
3308
+ function Qe(e) {}
3309
+ var $e = Xe ? Ze : Qe, et = new TextDecoder(), tt = class e {
3310
3310
  constructor(e) {
3311
3311
  if (e instanceof Uint8Array) {
3312
3312
  let t = 0, n = new DataView(e.buffer);
3313
3313
  if (this.highStart = n.getUint32(0, !0), this.errorValue = n.getUint32(4, !0), t = n.getUint32(8, !0), t !== 4294967295) throw Error("Trie created with old version of @cto.af/unicode-trie.");
3314
3314
  if (t = n.getUint32(12, !0), 16 + t > e.byteLength) throw RangeError("Invalid input length");
3315
3315
  let r = e.subarray(16 + t);
3316
- this.values = r.length ? JSON.parse(qe.decode(Ve(r))) : [], e = Ve(e.subarray(16, 16 + t)), Ke(e), this.data = new Int32Array(e.buffer);
3316
+ this.values = r.length ? JSON.parse(et.decode(Je(r))) : [], e = Je(e.subarray(16, 16 + t)), $e(e), this.data = new Int32Array(e.buffer);
3317
3317
  } else ({data: this.data, highStart: this.highStart, errorValue: this.errorValue, values: this.values = []} = e);
3318
3318
  }
3319
3319
  static fromBase64(t) {
@@ -3326,10 +3326,10 @@ var Ke = Ue ? We : Ge, qe = new TextDecoder(), Je = class e {
3326
3326
  let n = (this.data[e >> 5] << 2) + (e & 31);
3327
3327
  t = this.data[n];
3328
3328
  } else if (e <= 65535) {
3329
- let n = (this.data[he + (e - 55296 >> 5)] << 2) + (e & 31);
3329
+ let n = (this.data[be + (e - 55296 >> 5)] << 2) + (e & 31);
3330
3330
  t = this.data[n];
3331
3331
  } else if (e < this.highStart) {
3332
- let n = this.data[ge - 32 + (e >> 11)];
3332
+ let n = this.data[xe - 32 + (e >> 11)];
3333
3333
  n = this.data[n + (e >> 5 & 63)], n = (n << 2) + (e & 31), t = this.data[n];
3334
3334
  } else t = this.data[this.data.length - 4];
3335
3335
  return t;
@@ -3338,22 +3338,610 @@ var Ke = Ue ? We : Ge, qe = new TextDecoder(), Je = class e {
3338
3338
  let t = this.get(e);
3339
3339
  return this.values[t] ?? t;
3340
3340
  }
3341
- }, Ye = Je.fromBase64("AAgOAAEAAAD/////nRQAAB+LCAC4xcFoAgPtnQnwlkUdx1+URLxABcUUghTEEK8Cmwp0LJAa\n MRrFbBSPSXHSAUYNdFQoBWMKyQrUCo/EyMIjD3TIAxXJM5NBHBm0RDSPzDOVdAz7/nB/07bt\n s8/e+/zhfef9zD7HPs/e129/u8/yzVutVWANeBl079xq9QJ9wUCwDxjqYQ4DI8BoMBYcBY4D\n 48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M39HGFz7yzRLr\n k1PoMMfcPzeGvDPWPssxw6Rzo8QcXmp3XGSSHX2/Et08k67f5dtmuupKN2FvMpOsKObeDnVx\n k3ofp1h6VrFIVVdV7T2fYm9013l7k/5rbNlKaBuXso7LLV+K1d67uuWiJ19ShhcjvUP97FsO\n Q+V7pdfDpy5rtv2qEPkU7XFY0v3Q+Oc8FpqHdHV9Xf415XFbPTPfPk7qNWsufow9vkqlz6v+\n eA4udH9l3XxtiA5ZyN5XpvxSNzdetRdQlWnKjzbP695Xt9+WTz/bJk5y6tDVlYHUe0Crv9Bv\n vMf+bnzq79DHenfs/ZD3y4TO7b0S7vPM8Z5yL2mTG1XXKcyMLh5093OzvwbVfzr/1hHDby7u\n ufhH5z/Vrm1YZPsheUtn2pQh+RnfMmCqy3PN7aSeN0oRtrp8m6oONOXflHVfrnj0ccdU1lVS\n yYu7Ssjz96ZwxEgz13rX1c3Y+Sp2vJve7eN+zP3nYsojYunAhMq1cs2vM1X9J99+Q2g+d+1z\n 5OznpXJD1zcKcc/U33KN39TzgCnr4lz95Fz1cW79kxT6SDF00UruT5ZDZ8Xl9x83MV0I0CwB\n AB+LCAC4xcFoAgMdjksWhCAMBO/CelYzJ4gMCqiI4t/n/a9hyk29JN3p5DL7bj7GTQrbKypR\n dDVVywyhZCz4xkUhnSIj5EExoFoQisIfbICE2WJOoAESSK7wecCscDJSxRXMbBAlfLCyIbTh\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), Xe = Object.fromEntries(Ye.values.map((e, t) => [e, t])), { values: Ze } = Ye, { AI: Qe, AL: $e, CJ: et, CM: tt, NS: nt, SA: rt, SG: it, SP: at, XX: ot } = Xe, st = Je.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH9TtBvTNwUXK9dyv0frzE3DSxje8mZ0yNjuz8\n zlT+S6T1OnQh7M5oo+f+Bvk67EGY/OfiPeKfTL5+hr6ZuM13k/cT4R/QC86tMfdZbf4a2Un6\n H9L9OXNIGCoo12yDYdR7mzG+tP8yhjoTpt607tuh/6r7b1VG7yv5ya/OP7iZQXEdYyi9UNel\n WKM83YTQE/f8qftudz9y7G/OdWlXLxTPYRm9cu+ZMutMaYuK2tnjyqpb5jnPa8+xH7n3eJFO\n ivRGbTNC6su3PeHYM0V7OxZ/hUtWLP5ZFfzDmMYQSieU8qj78rF3fMsI+axX5fwWYvw+5t9u\n f0VnNR964yh31bdLOce8qfYb11ndVWeUvibHfCj8tZD2LNZvTRyyW/GfQr1/OM8gob/LcPn8\n If3iVmVT23Iu/69KaxHzOYn6XenTNw1551DW/3V5X7v6c9Tfh7jPX9TrFtqOhjgPttqeW28u\n 33192kvqs2vW7w7BeyuJcEoAAB+LCAC1xcFoAgOLVvJT0lGKVIoFANHfAiwJAAAA");
3342
- Object.fromEntries(st.values.map((e, t) => [e, t]));
3343
- var { values: ct } = st, { AK: lt, AL: ut, AP: dt, AS: ft, B2: pt, BA: mt, BB: J, BK: ht, CB: gt, CL: _t, CM: Y, CP: vt, CR: yt, EB: bt, EM: xt, EX: St, GL: Ct, H2: wt, H3: Tt, HH: Et, HL: Dt, HY: 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I4t/n/a9hyk29JN3p5DL7bj7GTQrbKypR\n dDVVywyhZCz4xkUhnSIj5EExoFoQisIfbICE2WJOoAESSK7wecCscDJSxRXMbBAlfLCyIbTh\n T8tr5/YikvVFSYq3dURbKo/gf+Q3zBCELycCXW/uB2mPjCb8AAAA"), rt = Object.fromEntries(nt.values.map((e, t) => [e, t])), { values: it } = nt, { AI: at, AL: ot, CJ: st, CM: ct, NS: lt, SA: ut, SG: dt, SP: ft, XX: pt } = rt;
3342
+ function mt(e) {
3343
+ switch (e) {
3344
+ case null: return null;
3345
+ case -1: return "sot";
3346
+ case -2: return "eot";
3347
+ default: return it[e];
3348
+ }
3349
+ }
3350
+ function ht(e, t) {
3351
+ switch (e) {
3352
+ case at:
3353
+ case dt:
3354
+ case pt: return ot;
3355
+ case ut: return /^[\p{gc=Mn}\p{gc=Mc}]$/u.test(t) ? ct : ot;
3356
+ case st: return lt;
3357
+ }
3358
+ return e;
3359
+ }
3360
+ var gt = class {
3361
+ cp = -Infinity;
3362
+ cls = -1;
3363
+ char = "";
3364
+ len = 0;
3365
+ ignored = !1;
3366
+ constructor(e, t, n, r) {
3367
+ this.cls = e, this.cp = t, this.char = n, this.len = r;
3368
+ }
3369
+ [Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
3370
+ return `${mt(this.cls)}(${this.cp.toString(16).padStart(4, "0")}:${JSON.stringify(this.char)})${this.ignored ? "Ig" : ""}`;
3371
+ }
3372
+ }, _t = class {
3373
+ str = "";
3374
+ len = 0;
3375
+ prevChunk = 0;
3376
+ prev = new gt(-1, -Infinity, "", 0);
3377
+ cur = new gt(-1, -Infinity, "", 0);
3378
+ next = new gt(-1, -Infinity, "", 0);
3379
+ LB8 = !1;
3380
+ spaces = !1;
3381
+ RI = 0;
3382
+ props = void 0;
3383
+ extra = {};
3384
+ constructor(e) {
3385
+ this.str = e, this.len = e.length;
3386
+ }
3387
+ push(e) {
3388
+ this.next.ignored ? this.cur.len = this.next.len : (this.prev = this.cur, this.cur = this.next), this.next = e;
3389
+ }
3390
+ pushEnd() {
3391
+ this.push(new gt(-2, Infinity, "", this.next.len));
3392
+ }
3393
+ *codePoints(e, t = !0) {
3394
+ if (t) for (; e < this.len;) if (e === this.cur.len && this.next.cls >= 0) yield this.next, e += this.next.char.length;
3395
+ else {
3396
+ let t = this.str.codePointAt(e), n = String.fromCodePoint(t), r = nt.get(t);
3397
+ e += n.length, yield new gt(ht(r, n), t, n, e);
3398
+ }
3399
+ else for (; e > 0;) if (e === this.cur.len) yield this.cur, e -= this.cur.char.length;
3400
+ else if (e === this.prev.len) yield this.prev, e -= this.prev.char.length;
3401
+ else {
3402
+ let t = e - 1, n = this.str.charCodeAt(t);
3403
+ n >= 56320 && n <= 57343 && t--;
3404
+ let r = this.str.codePointAt(t), i = String.fromCodePoint(r);
3405
+ yield new gt(ht(nt.get(r), i), r, i, e), e = t;
3406
+ }
3407
+ }
3408
+ classAfterSpaces(e) {
3409
+ for (let { cls: t } of this.codePoints(e)) if (t !== ft) return t;
3410
+ return -2;
3411
+ }
3412
+ afterNext(e = 1) {
3413
+ for (let t of this.codePoints(this.next.len)) if (--e <= 0) return t;
3414
+ return null;
3415
+ }
3416
+ setProp(e, t) {
3417
+ this.props ||= {}, this.props[e] = t;
3418
+ }
3419
+ [Symbol.for("nodejs.util.inspect.custom")](e, t, n) {
3420
+ let r = `${n(this.prev)} => ${n(this.cur)} => ${n(this.next)}`;
3421
+ return this.LB8 && (r += " LB8"), this.spaces && (r += " spaces"), this.RI > 0 && (r += ` RI: ${this.RI}`), this.props && (r += ` ${JSON.stringify(this.props)}`), r;
3422
+ }
3423
+ }, vt = class {
3424
+ string = void 0;
3425
+ props = void 0;
3426
+ constructor(e, t = !1) {
3427
+ this.position = e, this.required = t;
3428
+ }
3429
+ }, V = tt.fromBase64("AAAEAAAAAAD/////wQIAAB+LCAC1xcFoAgPtmj1IHUEQxzd5FiaEkMLSKqQIViEQCEmTjyqk\n SUgR7OySTrHxdVoIYqUg2AgqFhYWFhYidpYqKDaClVZaqJWF2qj/xT1cjjtv772Z3T1uHvzY\n 753d2b252ds3+1SpRbAMVkGSrlMo5LNjIfqoB/uEfR2Ao5yy4zb7PgUX4Brcgo6GUi9AF+gG\n r0EPeAc+AN3mM8KvJu6DH0bWb08yeyEneV77rHia/yjbMvEBxJum7mCqzQjSo1beuBWfRFy3\n 1fHpR2QJgiAIgiAIgiAIQpoZc45c8HhGd2WJYUyy5oIgCP5oRPhuEQQh7vvPVuAe34q5x1lH\n uJFh15J7HRt9Z7MJ9iKwg1fP72kG4osqz3ynUlNPHjhC2i5/9UypX8DOa6bSa0hfAbsf33zE\n /EPLr7NtOYj4zlTfD+v7dG0r8uzhXM39qEPH9TtBvTNwUXK9dyv0frzE3DSxje8mZ0yNjuz8\n zlT+S6T1OnQh7M5oo+f+Bvk67EGY/OfiPeKfTL5+hr6ZuM13k/cT4R/QC86tMfdZbf4a2Un6\n H9L9OXNIGCoo12yDYdR7mzG+tP8yhjoTpt607tuh/6r7b1VG7yv5ya/OP7iZQXEdYyi9UNel\n WKM83YTQE/f8qftudz9y7G/OdWlXLxTPYRm9cu+ZMutMaYuK2tnjyqpb5jnPa8+xH7n3eJFO\n ivRGbTNC6su3PeHYM0V7OxZ/hUtWLP5ZFfzDmMYQSieU8qj78rF3fMsI+axX5fwWYvw+5t9u\n f0VnNR964yh31bdLOce8qfYb11ndVWeUvibHfCj8tZD2LNZvTRyyW/GfQr1/OM8gob/LcPn8\n If3iVmVT23Iu/69KaxHzOYn6XenTNw1551DW/3V5X7v6c9Tfh7jPX9TrFtqOhjgPttqeW28u\n 33192kvqs2vW7w7BeyuJcEoAAB+LCAC1xcFoAgOLVvJT0lGKVIoFANHfAiwJAAAA");
3430
+ Object.fromEntries(V.values.map((e, t) => [e, t]));
3431
+ var { values: yt } = V, { AK: bt, AL: H, AP: xt, AS: St, B2: Ct, BA: U, BB: wt, BK: Tt, CB: Et, CL: Dt, CM: Ot, CP: kt, CR: At, EB: jt, EM: Mt, EX: Nt, GL: Pt, H2: Ft, H3: It, HH: Lt, HL: W, HY: Rt, ID: zt, IN: Bt, IS: Vt, JL: Ht, JT: Ut, JV: Wt, LF: Gt, NU: G, OP: Kt, NL: qt, NS: Jt, PO: Yt, PR: Xt, RI: Zt, SP: K, SY: Qt, QU: q, VF: $t, VI: en, WJ: tn, ZW: nn, ZWJ: rn } = rt, an = /* @__PURE__ */ new Set([
3432
+ H,
3433
+ W,
3434
+ G
3435
+ ]), on = /* @__PURE__ */ new Set([
3436
+ Tt,
3437
+ At,
3438
+ Gt,
3439
+ qt,
3440
+ K,
3441
+ nn
3442
+ ]), sn = /* @__PURE__ */ new Set([
3443
+ zt,
3444
+ jt,
3445
+ Mt
3446
+ ]), cn = /* @__PURE__ */ new Set([
3447
+ Ht,
3448
+ Wt,
3449
+ Ft,
3450
+ It
3451
+ ]), ln = /* @__PURE__ */ new Set([
3452
+ Ht,
3453
+ Wt,
3454
+ Ut,
3455
+ Ft,
3456
+ It
3457
+ ]), un = /* @__PURE__ */ new Set([Wt, Ut]), dn = /* @__PURE__ */ new Set([
3458
+ K,
3459
+ Pt,
3460
+ tn,
3461
+ Dt,
3462
+ q,
3463
+ kt,
3464
+ Nt,
3465
+ Vt,
3466
+ Qt,
3467
+ Tt,
3468
+ At,
3469
+ Gt,
3470
+ qt,
3471
+ nn
3472
+ ]), fn = /* @__PURE__ */ new Set([
3473
+ -1,
3474
+ Tt,
3475
+ At,
3476
+ Gt,
3477
+ qt,
3478
+ Kt,
3479
+ q,
3480
+ Pt,
3481
+ K,
3482
+ nn
3483
+ ]), J = Symbol("PASS"), Y = Symbol("NO_BREAK"), pn = Symbol("MAY_BREAK"), mn = Symbol("MUST_BREAK");
3484
+ function hn(e) {
3485
+ return e.cur.cls === -1 && e.next.cls !== -2 ? Y : J;
3486
+ }
3487
+ function gn(e) {
3488
+ return e.next.cls === -2 && (e.cur.len === 0 || e.cur.len !== e.prevChunk) ? mn : J;
3489
+ }
3490
+ function _n(e) {
3491
+ return e.cur.cls === Tt ? mn : J;
3492
+ }
3493
+ function vn(e) {
3494
+ switch (e.cur.cls) {
3495
+ case At: return e.next.cls === Gt ? Y : mn;
3496
+ case Gt:
3497
+ case qt: return mn;
3498
+ }
3499
+ return J;
3500
+ }
3501
+ function yn(e) {
3502
+ switch (e.next.cls) {
3503
+ case Tt:
3504
+ case At:
3505
+ case Gt:
3506
+ case qt: return Y;
3507
+ }
3508
+ return J;
3509
+ }
3510
+ function bn(e) {
3511
+ return e.cur.cls !== Zt && (e.RI = 0), e.spaces ? (e.next.cls !== K && (e.spaces = !1), Y) : J;
3512
+ }
3513
+ function xn(e) {
3514
+ if (e.next.cls === nn) return Y;
3515
+ if (e.next.cls === K) switch (e.cur.cls) {
3516
+ case nn:
3517
+ case Kt:
3518
+ case q:
3519
+ case Dt:
3520
+ case kt:
3521
+ case Ct: break;
3522
+ default: return Y;
3523
+ }
3524
+ return J;
3525
+ }
3526
+ function Sn(e) {
3527
+ return e.LB8 ? (e.LB8 = !1, pn) : e.cur.cls === nn ? e.next.cls === K ? (e.LB8 = !0, Y) : pn : J;
3528
+ }
3529
+ function Cn(e) {
3530
+ return e.cur.cls === rn ? Y : J;
3531
+ }
3532
+ function wn(e) {
3533
+ return !on.has(e.cur.cls) && (e.next.cls === Ot || e.next.cls === rn) ? (e.next.ignored = !0, Y) : J;
3534
+ }
3535
+ function Tn(e) {
3536
+ return e.cur.cls === Ot && (e.cur.cls = H), e.next.cls === Ot && (e.next.cls = H), J;
3537
+ }
3538
+ function En(e) {
3539
+ return e.next.cls === tn || e.cur.cls === tn ? Y : J;
3540
+ }
3541
+ function Dn(e) {
3542
+ return e.cur.cls === Pt ? Y : J;
3543
+ }
3544
+ function On(e) {
3545
+ if (e.next.cls === Pt) switch (e.cur.cls) {
3546
+ case K:
3547
+ case U:
3548
+ case Rt:
3549
+ case Lt: return J;
3550
+ default: return Y;
3551
+ }
3552
+ return J;
3553
+ }
3554
+ function kn(e) {
3555
+ switch (e.next.cls) {
3556
+ case Dt:
3557
+ case kt:
3558
+ case Nt:
3559
+ case Qt: return Y;
3560
+ }
3561
+ return J;
3562
+ }
3563
+ function An(e) {
3564
+ return e.cur.cls === Kt ? (e.next.cls === K && (e.spaces = !0), Y) : J;
3565
+ }
3566
+ function jn(e) {
3567
+ return fn.has(e.prev.cls) && /^\p{Pi}$/u.test(e.cur.char) && e.cur.cls === q ? (e.spaces = !0, Y) : J;
3568
+ }
3569
+ function Mn(e) {
3570
+ if (/^\p{gc=Pf}$/u.test(e.next.char) && e.next.cls === q) {
3571
+ let t = e.afterNext();
3572
+ if (!t || dn.has(t.cls)) return Y;
3573
+ }
3574
+ return J;
3575
+ }
3576
+ function Nn(e) {
3577
+ return e.cur.cls === K && e.next.cls === Vt && e.afterNext()?.cls === G ? pn : J;
3578
+ }
3579
+ function Pn(e) {
3580
+ return e.next.cls === Vt ? Y : J;
3581
+ }
3582
+ function Fn(e) {
3583
+ if (e.cur.cls === Dt || e.cur.cls === kt) {
3584
+ if (e.classAfterSpaces(e.cur.len) === Jt) return e.next.cls === K && (e.spaces = !0), Y;
3585
+ if (e.next.cls === K) return Y;
3586
+ }
3587
+ return J;
3588
+ }
3589
+ function In(e) {
3590
+ if (e.cur.cls === Ct) {
3591
+ if (e.classAfterSpaces(e.cur.len) === Ct) return e.next.cls === K && (e.spaces = !0), Y;
3592
+ if (e.next.cls === K) return Y;
3593
+ }
3594
+ return J;
3595
+ }
3596
+ function Ln(e) {
3597
+ return e.cur.cls === K ? pn : J;
3598
+ }
3599
+ function Rn(e) {
3600
+ return e.next.cls === q && !/^\p{Pi}$/u.test(e.next.char) || e.cur.cls === q && !/^\p{Pf}$/u.test(e.cur.char) ? Y : J;
3601
+ }
3602
+ function zn(e) {
3603
+ if (!V.get(e.cur.cp) && e.next.cls === q) return Y;
3604
+ if (e.next.cls === q) {
3605
+ let t = e.afterNext();
3606
+ if (!t || !V.get(t.cp)) return Y;
3607
+ }
3608
+ return e.cur.cls === q && !V.get(e.next.cp) || (e.prev.cls === -1 || !V.get(e.prev.cp)) && e.cur.cls === q ? Y : J;
3609
+ }
3610
+ function Bn(e) {
3611
+ return e.cur.cls === Et || e.next.cls === Et ? pn : J;
3612
+ }
3613
+ var Vn = /* @__PURE__ */ new Set([
3614
+ -1,
3615
+ Tt,
3616
+ At,
3617
+ Gt,
3618
+ qt,
3619
+ K,
3620
+ nn,
3621
+ Et,
3622
+ Pt
3623
+ ]);
3624
+ function Hn(e) {
3625
+ return Vn.has(e.prev.cls) && (e.cur.cls === Rt || e.cur.cls === Lt) && (e.next.cls === H || e.next.cls === W) ? Y : J;
3626
+ }
3627
+ function Un(e) {
3628
+ if (e.cur.cls === wt) return Y;
3629
+ switch (e.next.cls) {
3630
+ case U:
3631
+ case Lt:
3632
+ case Rt:
3633
+ case Jt: return Y;
3634
+ }
3635
+ return J;
3636
+ }
3637
+ function Wn(e) {
3638
+ return e.prev.cls === W && (e.cur.cls === Rt || e.cur.cls === Lt) && e.next.cls !== W ? Y : J;
3639
+ }
3640
+ function Gn(e) {
3641
+ return e.cur.cls === Qt && e.next.cls === W ? Y : J;
3642
+ }
3643
+ function Kn(e) {
3644
+ return e.next.cls === Bt ? Y : J;
3645
+ }
3646
+ function qn(e) {
3647
+ switch (e.cur.cls) {
3648
+ case H:
3649
+ case W:
3650
+ if (e.next.cls === G) return Y;
3651
+ break;
3652
+ case G: if (e.next.cls === H || e.next.cls === W) return Y;
3653
+ }
3654
+ return J;
3655
+ }
3656
+ function Jn(e) {
3657
+ return e.cur.cls === Xt && sn.has(e.next.cls) || e.next.cls === Yt && sn.has(e.cur.cls) ? Y : J;
3658
+ }
3659
+ function Yn(e) {
3660
+ return (e.cur.cls === Xt || e.cur.cls === Yt) && (e.next.cls === H || e.next.cls === W) || (e.cur.cls === H || e.cur.cls === W) && (e.next.cls === Xt || e.next.cls === Yt) ? Y : J;
3661
+ }
3662
+ var Xn = /* @__PURE__ */ new Set([Yt, Xt]), Zn = /* @__PURE__ */ new Set([Dt, kt]);
3663
+ function Qn(e) {
3664
+ let t = null;
3665
+ if (Xn.has(e.next.cls) ? t = Zn.has(e.cur.cls) ? e.prev.len : e.cur.len : e.next.cls === G && (t = e.cur.len), t !== null) SyIsLoop: for (let { cls: n } of e.codePoints(t, !1)) switch (n) {
3666
+ case Qt:
3667
+ case Vt: continue;
3668
+ case G: return Y;
3669
+ default: break SyIsLoop;
3670
+ }
3671
+ if (e.cur.cls === Yt || e.cur.cls === Xt) {
3672
+ if (e.next.cls === Kt) {
3673
+ let t = e.afterNext();
3674
+ if (t && (t.cls === G || t.cls === Vt && e.afterNext(2)?.cls === G)) return Y;
3675
+ } else if (e.next.cls === G) return Y;
3676
+ }
3677
+ return e.cur.cls === Rt && e.next.cls === G || e.cur.cls === Vt && e.next.cls === G ? Y : J;
3678
+ }
3679
+ function $n(e) {
3680
+ switch (e.cur.cls) {
3681
+ case Ht:
3682
+ if (cn.has(e.next.cls)) return Y;
3683
+ break;
3684
+ case Wt:
3685
+ case Ft:
3686
+ if (un.has(e.next.cls)) return Y;
3687
+ break;
3688
+ case Ut:
3689
+ case It: if (e.next.cls === Ut) return Y;
3690
+ }
3691
+ return J;
3692
+ }
3693
+ function er(e) {
3694
+ switch (e.cur.cls) {
3695
+ case Ht:
3696
+ case Wt:
3697
+ case Ut:
3698
+ case Ft:
3699
+ case It:
3700
+ if (e.next.cls === Yt) return Y;
3701
+ break;
3702
+ case Xt: if (ln.has(e.next.cls)) return Y;
3703
+ }
3704
+ return J;
3705
+ }
3706
+ function tr(e) {
3707
+ return (e.cur.cls === H || e.cur.cls === W) && (e.next.cls === H || e.next.cls === W) ? Y : J;
3708
+ }
3709
+ function nr(e) {
3710
+ let { prev: t, cur: n, next: r } = e;
3711
+ function i(e) {
3712
+ return e.cls === bt || e.char === "◌" || e.cls === St;
3713
+ }
3714
+ return n.cls === xt && i(r) || i(n) && (r.cls === $t || r.cls === en) || i(t) && n.cls === en && (r.cls === bt || r.char === "◌") || i(n) && i(r) && e.afterNext()?.cls === $t ? Y : J;
3715
+ }
3716
+ function rr(e) {
3717
+ return e.cur.cls === Vt && (e.next.cls === H || e.next.cls === W) ? Y : J;
3718
+ }
3719
+ function ar(e) {
3720
+ switch (e.cur.cls) {
3721
+ case H:
3722
+ case W:
3723
+ case G:
3724
+ if (e.next.cls === Kt && !V.get(e.next.cp)) return Y;
3725
+ break;
3726
+ case kt: if (!V.get(e.cur.cp) && an.has(e.next.cls)) return Y;
3727
+ }
3728
+ return J;
3729
+ }
3730
+ function or(e) {
3731
+ if (e.cur.cls === Zt) {
3732
+ if (e.next.cls === Zt && ++e.RI % 2 != 0) return Y;
3733
+ } else e.RI = 0;
3734
+ return J;
3735
+ }
3736
+ function sr(e) {
3737
+ return e.cur.cls === jt && e.next.cls === Mt || e.next.cls === Mt && /^\p{ExtPict}$/u.test(e.cur.char) && /^\p{gc=Cn}$/u.test(e.cur.char) ? Y : J;
3738
+ }
3739
+ function cr() {
3740
+ return pn;
3741
+ }
3742
+ var lr = [
3743
+ hn,
3744
+ gn,
3745
+ _n,
3746
+ vn,
3747
+ yn,
3748
+ bn,
3749
+ xn,
3750
+ Sn,
3751
+ Cn,
3752
+ wn,
3753
+ Tn,
3754
+ En,
3755
+ Dn,
3756
+ On,
3757
+ kn,
3758
+ An,
3759
+ jn,
3760
+ Mn,
3761
+ Nn,
3762
+ Pn,
3763
+ Fn,
3764
+ In,
3765
+ Ln,
3766
+ Rn,
3767
+ zn,
3768
+ Bn,
3769
+ Hn,
3770
+ Wn,
3771
+ Un,
3772
+ Gn,
3773
+ Kn,
3774
+ qn,
3775
+ Jn,
3776
+ Yn,
3777
+ Qn,
3778
+ $n,
3779
+ er,
3780
+ tr,
3781
+ nr,
3782
+ rr,
3783
+ ar,
3784
+ or,
3785
+ sr,
3786
+ cr
3787
+ ], ur = class {
3788
+ #e;
3789
+ constructor(e = {}) {
3790
+ if (this.#e = {
3791
+ string: !1,
3792
+ example7: !1,
3793
+ verbose: !1,
3794
+ ...e
3795
+ }, this.rules = [...lr], this.#e.example7) throw Error("'example7' flag deprecated");
3796
+ this.#e.verbose && this.rules.unshift((e) => (console.log(e.cur.len, e), J));
3797
+ }
3798
+ removeRule(...e) {
3799
+ let t = [];
3800
+ return this.rules = this.rules.filter((n) => !e.includes(n.name) || (t.push(n), !1)), t;
3801
+ }
3802
+ addRuleAfter(e, ...t) {
3803
+ let n = this.rules.findIndex((t) => t.name === e);
3804
+ if (n === -1) throw Error(`Rule not found: "${e}"`);
3805
+ return this.rules.splice(n + 1, 0, ...t), n + 1;
3806
+ }
3807
+ addRuleBefore(e, ...t) {
3808
+ let n = this.rules.findIndex((t) => t.name === e);
3809
+ if (n === -1) throw Error(`Rule not found: "${e}"`);
3810
+ return this.rules.splice(n, 0, ...t), n;
3811
+ }
3812
+ replaceRule(e, ...t) {
3813
+ let n = this.rules.findIndex((t) => t.name === e);
3814
+ if (n === -1) throw Error(`Rule not found: "${e}"`);
3815
+ return this.rules.splice(n, 1, ...t);
3816
+ }
3817
+ #t(e) {
3818
+ for (let t of this.rules) {
3819
+ let n = t.call(this, e);
3820
+ switch (n) {
3821
+ case J: break;
3822
+ case Y: return this.#e.verbose && console.log(` ${t.name}: NO_BREAK`), null;
3823
+ case pn: return this.#e.verbose && console.log(` ${t.name}: MAY_BREAK`), new vt(e.cur.len);
3824
+ case mn: return this.#e.verbose && console.log(` ${t.name}: MUST_BREAK`), new vt(e.cur.len, !0);
3825
+ default: throw Error(`Invalid state: "${n}"`);
3826
+ }
3827
+ }
3828
+ return null;
3829
+ }
3830
+ *#n(e) {
3831
+ let t = this.#t(e);
3832
+ t && (this.#e.string && (t.string = e.str.slice(e.prevChunk, e.cur.len)), e.props &&= (t.props = e.props, void 0), yield t, e.prevChunk = e.cur.len);
3833
+ }
3834
+ *breaks(e) {
3835
+ let t = new _t(e);
3836
+ for (let e of t.codePoints(0)) t.push(e), yield* this.#n(t);
3837
+ t.pushEnd(), yield* this.#n(t);
3838
+ }
3839
+ };
3840
+ //#endregion
3841
+ //#region src/text-layout.ts
3842
+ function dr(e, t) {
3843
+ let n = new Intl.Segmenter(t, { granularity: "grapheme" }), r = /* @__PURE__ */ new Set([0]);
3844
+ for (let t of n.segment(e)) r.add(t.index + t.segment.length);
3845
+ return r;
3846
+ }
3847
+ var fr = class {
3848
+ #e = new ur();
3849
+ #t;
3850
+ constructor(e = "ja") {
3851
+ this.#t = e;
3852
+ }
3853
+ getBreakOpportunities(e) {
3854
+ let t = dr(e, this.#t), n = /* @__PURE__ */ new Map();
3855
+ for (let r of this.#e.breaks(e)) t.has(r.position) && n.set(r.position, (n.get(r.position) ?? !1) || r.required);
3856
+ return Object.freeze([...n].sort(([e], [t]) => e - t).map(([e, t]) => Object.freeze({
3857
+ position: e,
3858
+ required: t
3859
+ })));
3860
+ }
3861
+ }, pr = /* @__PURE__ */ new Map(), mr = /\r\n|[\n\r\v\f\u0085\u2028\u2029]/gu;
3862
+ function hr(e) {
3863
+ let t = pr.get(e);
3864
+ if (t) return t;
3865
+ let n = new fr(e);
3866
+ return pr.set(e, n), n;
3867
+ }
3868
+ function gr(e, t) {
3869
+ if (!Number.isFinite(e) || e < 0) throw TypeError(`${t} must return a non-negative finite number.`);
3870
+ return e;
3871
+ }
3872
+ function _r(e, t, n) {
3873
+ let r = /* @__PURE__ */ new Map();
3874
+ for (let i of t.getBreakOpportunities(e)) {
3875
+ let { position: t, required: a } = i;
3876
+ !Number.isInteger(t) || t <= 0 || t > e.length || !n.has(t) || r.set(t, (r.get(t) ?? !1) || a);
3877
+ }
3878
+ return r.set(e.length, !0), [...r].sort(([e], [t]) => e - t).map(([e, t]) => ({
3879
+ position: e,
3880
+ required: t
3881
+ }));
3882
+ }
3883
+ function vr(e, t, n, r, i) {
3884
+ if (e.length === 0) return [{
3885
+ text: "",
3886
+ start: t,
3887
+ end: t,
3888
+ width: 0
3889
+ }];
3890
+ let a = dr(e, i), o = [...a].sort((e, t) => e - t), s = _r(e, r, a), c = [], l = 0;
3891
+ for (; l < e.length;) {
3892
+ let r = s.find((e) => e.position > l && e.required)?.position ?? e.length, i, a = 0;
3893
+ for (let t of s) {
3894
+ if (t.position <= l || t.position > r) continue;
3895
+ let o = e.slice(l, t.position), s = gr(n.measureText(o), "measureText");
3896
+ s <= n.maxWidth && (i = t.position, a = s);
3897
+ }
3898
+ if (i === void 0) {
3899
+ let t = o.filter((e) => e > l && e <= r);
3900
+ for (let r of t) {
3901
+ let t = e.slice(l, r), o = gr(n.measureText(t), "measureText");
3902
+ o <= n.maxWidth && (i = r, a = o);
3903
+ }
3904
+ i === void 0 && (i = t[0] ?? r, a = gr(n.measureText(e.slice(l, i)), "measureText"));
3905
+ }
3906
+ c.push({
3907
+ text: e.slice(l, i),
3908
+ start: t + l,
3909
+ end: t + i,
3910
+ width: a
3911
+ }), l = i;
3912
+ }
3913
+ return c;
3914
+ }
3915
+ function yr(e) {
3916
+ if (typeof e.text != "string") throw TypeError("text must be a string.");
3917
+ if (!Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw TypeError("maxWidth must be a positive finite number.");
3918
+ if (typeof e.measureText != "function") throw TypeError("measureText must be a function.");
3919
+ let t = e.locale ?? "ja", n = e.lineBreakProvider ?? hr(t), r = [], i = 0;
3920
+ for (let a of e.text.matchAll(mr)) {
3921
+ let o = a.index;
3922
+ r.push(...vr(e.text.slice(i, o), i, e, n, t)), i = o + a[0].length;
3923
+ }
3924
+ return r.push(...vr(e.text.slice(i), i, e, n, t)), Object.freeze({
3925
+ lines: Object.freeze(r.map((e) => Object.freeze(e))),
3926
+ maxLineWidth: Math.max(0, ...r.map((e) => e.width))
3927
+ });
3928
+ }
3929
+ //#endregion
3930
+ //#region src/composition.ts
3931
+ var X = class extends Error {
3344
3932
  code;
3345
3933
  constructor(e, t) {
3346
3934
  super(t), this.name = "BubbleCompositionError", this.code = e;
3347
3935
  }
3348
- }, Zt = /* @__PURE__ */ new Set(["say", "think"]), Qt = /* @__PURE__ */ new Set([
3936
+ }, br = /* @__PURE__ */ new Set(["say", "think"]), xr = /* @__PURE__ */ new Set([
3349
3937
  "idle",
3350
3938
  "talking",
3351
- "awaiting-advance"
3939
+ "awaiting-continue"
3352
3940
  ]);
3353
3941
  function Z(e) {
3354
3942
  return typeof e == "object" && !!e && !Array.isArray(e);
3355
3943
  }
3356
- function $t(e, t, n, r) {
3944
+ function Sr(e, t, n, r) {
3357
3945
  let i = /* @__PURE__ */ new Set([...t, ...n]), a = t.filter((t) => !Object.prototype.hasOwnProperty.call(e, t)), o = Object.keys(e).filter((e) => !i.has(e));
3358
3946
  if (a.length > 0 || o.length > 0) throw new X("BUBBLE-COMPOSITION-001", `${r} has missing or unknown properties.`);
3359
3947
  }
@@ -3361,9 +3949,9 @@ function Q(e, t) {
3361
3949
  if (typeof e != "string" || e.trim().length === 0) throw new X("BUBBLE-COMPOSITION-001", `${t} must be a non-empty string.`);
3362
3950
  return e.trim();
3363
3951
  }
3364
- function en(e, t, n) {
3952
+ function Cr(e, t, n) {
3365
3953
  if (!Z(e)) throw new X("BUBBLE-COMPOSITION-001", `${t} must be an object.`);
3366
- if ($t(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new X("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
3954
+ if (Sr(e, ["frames", "frameIntervalSeconds"], [], t), !Array.isArray(e.frames) || e.frames.length < n) throw new X("BUBBLE-COMPOSITION-001", `${t}.frames must contain at least ${n} image asset name${n === 1 ? "" : "s"}.`);
3367
3955
  let r = Object.freeze(e.frames.map((e, n) => Q(e, `${t}.frames[${n}]`))), i = e.frameIntervalSeconds;
3368
3956
  if (typeof i != "number" || !Number.isFinite(i) || i <= 0) throw new X("BUBBLE-COMPOSITION-001", `${t}.frameIntervalSeconds must be a positive finite number.`);
3369
3957
  return Object.freeze({
@@ -3371,28 +3959,30 @@ function en(e, t, n) {
3371
3959
  frameIntervalSeconds: i
3372
3960
  });
3373
3961
  }
3374
- function tn(e) {
3962
+ function wr(e) {
3375
3963
  if (!Z(e)) throw new X("BUBBLE-COMPOSITION-001", "Bubble portrait must be an object.");
3376
- $t(e, ["base"], ["blink", "talk"], "Bubble portrait");
3377
- let t = e.blink === void 0 ? void 0 : en(e.blink, "Bubble portrait blink", 1), n = e.talk === void 0 ? void 0 : en(e.talk, "Bubble portrait talk", 1);
3964
+ Sr(e, ["base"], ["blink", "lipSync"], "Bubble portrait");
3965
+ let t = e.blink === void 0 ? void 0 : Cr(e.blink, "Bubble portrait blink", 1), n = e.lipSync === void 0 ? void 0 : Cr(e.lipSync, "Bubble portrait lip-sync", 1);
3378
3966
  return Object.freeze({
3379
3967
  base: Q(e.base, "Bubble portrait base"),
3380
3968
  ...t === void 0 ? {} : { blink: t },
3381
- ...n === void 0 ? {} : { talk: n }
3969
+ ...n === void 0 ? {} : { lipSync: n }
3382
3970
  });
3383
3971
  }
3384
- function nn(e) {
3972
+ function Tr(e) {
3385
3973
  if (!Z(e)) throw new X("BUBBLE-COMPOSITION-001", "Bubble style must be an object.");
3386
- $t(e, ["name", "textStyle"], [
3974
+ Sr(e, ["name", "textStyle"], [
3387
3975
  "placement",
3976
+ "maxWidth",
3977
+ "textLocale",
3388
3978
  "distance",
3389
3979
  "tailLength",
3390
3980
  "offset",
3391
3981
  "visualStyle",
3392
3982
  "portrait",
3393
- "advanceIndicator"
3983
+ "continueIndicator"
3394
3984
  ], "Bubble style");
3395
- let t = e.portrait === void 0 ? void 0 : tn(e.portrait), n = e.advanceIndicator === void 0 ? void 0 : en(e.advanceIndicator, "Bubble advance indicator", 2), r;
3985
+ let t = e.portrait === void 0 ? void 0 : wr(e.portrait), n = e.continueIndicator === void 0 ? void 0 : Cr(e.continueIndicator, "Bubble continue indicator", 2), r;
3396
3986
  try {
3397
3987
  r = _(e.placement ?? "up-right");
3398
3988
  } catch (e) {
@@ -3405,77 +3995,105 @@ function nn(e) {
3405
3995
  throw new X("BUBBLE-COMPOSITION-001", e instanceof Error ? e.message : "Bubble actor-relative transform is invalid.");
3406
3996
  }
3407
3997
  let s = e.visualStyle ?? "NORMAL";
3408
- if (typeof s != "string" || !O.includes(s)) throw new X("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(s)}`);
3998
+ if (typeof s != "string" || !ae.includes(s)) throw new X("BUBBLE-COMPOSITION-001", `Unsupported Bubble visual style: ${String(s)}`);
3999
+ let c;
4000
+ if (e.maxWidth !== void 0) {
4001
+ if (typeof e.maxWidth != "number" || !Number.isFinite(e.maxWidth) || e.maxWidth <= 0) throw new X("BUBBLE-COMPOSITION-001", "Bubble style maxWidth must be a positive finite number.");
4002
+ c = e.maxWidth;
4003
+ }
4004
+ let l = e.textLocale === void 0 ? void 0 : Q(e.textLocale, "Bubble style text locale");
3409
4005
  return Object.freeze({
3410
4006
  name: Q(e.name, "Bubble style name"),
3411
4007
  textStyle: Q(e.textStyle, "Bubble text style name"),
4008
+ ...c === void 0 ? {} : { maxWidth: c },
4009
+ ...l === void 0 ? {} : { textLocale: l },
3412
4010
  placement: r,
3413
4011
  distance: i,
3414
4012
  tailLength: a,
3415
4013
  offset: o,
3416
4014
  visualStyle: s,
3417
4015
  ...t === void 0 ? {} : { portrait: t },
3418
- ...n === void 0 ? {} : { advanceIndicator: n }
4016
+ ...n === void 0 ? {} : { continueIndicator: n }
3419
4017
  });
3420
4018
  }
3421
- function rn(e) {
3422
- if (!Z(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble asset manager must provide applyToTarget, getMimeType, and isRegistered.");
4019
+ function Er(e) {
4020
+ if (e !== void 0) {
4021
+ if (!Z(e) || typeof e.applyToTarget != "function" || typeof e.getMimeType != "function" || typeof e.isRegistered != "function") throw TypeError("Bubble image capability must provide applyToTarget, getMimeType, and isRegistered.");
4022
+ return e;
4023
+ }
4024
+ }
4025
+ function Dr(e) {
4026
+ if (e === void 0) throw new X("BUBBLE-COMPOSITION-006", "Bubble image assets require an image capability. Provide options.imageResolver.");
3423
4027
  return e;
3424
4028
  }
3425
- function an(e) {
4029
+ function Or(e) {
3426
4030
  if (!Z(e) || typeof e.setText != "function" || typeof e.releaseTarget != "function") throw TypeError("Bubble SVG Text composition must provide setText and releaseTarget.");
3427
4031
  return e;
3428
4032
  }
3429
- function on() {
4033
+ function kr() {
3430
4034
  return Object.freeze({
3431
4035
  setTimeout: (e, t) => globalThis.setTimeout(e, t),
3432
4036
  clearTimeout: (e) => globalThis.clearTimeout(e)
3433
4037
  });
3434
4038
  }
3435
- function sn(e) {
4039
+ function Ar(e) {
3436
4040
  if (!Z(e) || typeof e.setTimeout != "function" || typeof e.clearTimeout != "function") throw TypeError("Bubble scheduler must provide setTimeout and clearTimeout.");
3437
4041
  return e;
3438
4042
  }
3439
- function cn(e, t) {
4043
+ function jr(e, t) {
3440
4044
  if (!Z(e) || typeof e.id != "string" || e.id.length === 0 || typeof e.isStage != "boolean") throw new X("BUBBLE-COMPOSITION-004", `${t} must provide id and isStage.`);
3441
4045
  return e;
3442
4046
  }
3443
- function ln(e) {
4047
+ function Mr(e) {
3444
4048
  if (!Z(e) || typeof e.drawableID != "number" || !Number.isInteger(e.drawableID) || e.drawableID < 0) throw new X("BUBBLE-COMPOSITION-004", "Bubble text target must provide a non-negative integer drawableID.");
3445
4049
  return e;
3446
4050
  }
3447
- function un(e, t) {
3448
- if (!Z(e) || !Z(e.targets) || typeof e.setLayerVisible != "function" || typeof e.show != "function" || typeof e.hide != "function" || typeof e.dispose != "function") throw new X("BUBBLE-COMPOSITION-004", "Bubble surface is invalid.");
4051
+ function Nr(e, t) {
4052
+ if (!Z(e) || !Z(e.targets) || typeof e.setLayerVisible != "function" || typeof e.updateStyle != "function" || typeof e.show != "function" || typeof e.hide != "function" || typeof e.dispose != "function") throw new X("BUBBLE-COMPOSITION-004", "Bubble surface is invalid.");
3449
4053
  let n = e.targets;
3450
- ln(n.text);
4054
+ Mr(n.text);
3451
4055
  let r = /* @__PURE__ */ new Set(), i = (e, t) => {
3452
4056
  let i = n[e];
3453
4057
  if (!t && i === void 0) return;
3454
- let a = cn(i, `Bubble surface ${e}`);
4058
+ let a = jr(i, `Bubble surface ${e}`);
3455
4059
  if (r.has(a.id)) throw new X("BUBBLE-COMPOSITION-004", "Bubble image layers must use distinct target IDs.");
3456
4060
  r.add(a.id);
3457
4061
  };
3458
- return i("portraitBase", t.portrait !== void 0), i("portraitBlink", t.portrait?.blink !== void 0), i("portraitTalk", t.portrait?.talk !== void 0), i("advanceIndicator", t.advanceIndicator !== void 0), e;
4062
+ return i("portraitBase", t.portrait !== void 0), i("portraitBlink", t.portrait?.blink !== void 0), i("portraitLipSync", t.portrait?.lipSync !== void 0), i("continueIndicator", t.continueIndicator !== void 0), e;
3459
4063
  }
3460
- function dn(e, t) {
4064
+ function Pr(e, t) {
4065
+ if (e === void 0) throw new X("BUBBLE-COMPOSITION-006", `Bubble image capability is required for: ${t}. Provide options.imageResolver.`);
3461
4066
  if (!e.isRegistered(t)) throw new X("BUBBLE-COMPOSITION-003", `Bubble image asset is not registered: ${t}`);
3462
4067
  if (!e.getMimeType(t).startsWith("image/")) throw new X("BUBBLE-COMPOSITION-003", `Bubble asset is not an image: ${t}`);
3463
4068
  }
3464
- function fn(e) {
4069
+ function Fr(e) {
3465
4070
  return [...e.portrait === void 0 ? [] : [
3466
4071
  e.portrait.base,
3467
4072
  ...e.portrait.blink?.frames ?? [],
3468
- ...e.portrait.talk?.frames ?? []
3469
- ], ...e.advanceIndicator?.frames ?? []];
4073
+ ...e.portrait.lipSync?.frames ?? []
4074
+ ], ...e.continueIndicator?.frames ?? []];
4075
+ }
4076
+ function Ir(e, t, n) {
4077
+ if (t.maxWidth === void 0) return e;
4078
+ if (typeof n.measureText != "function") throw new X("BUBBLE-COMPOSITION-007", "Bubble style maxWidth requires the text capability measureText method.");
4079
+ return yr({
4080
+ text: e,
4081
+ maxWidth: t.maxWidth,
4082
+ ...t.textLocale === void 0 ? {} : { locale: t.textLocale },
4083
+ measureText: (e) => n.measureText?.({
4084
+ styleName: t.textStyle,
4085
+ text: e
4086
+ }) ?? 0
4087
+ }).lines.map(({ text: e }) => e).join("\n");
3470
4088
  }
3471
- function pn(e, t) {
4089
+ function Lr(e, t) {
3472
4090
  if (e.length === 1) throw e[0];
3473
4091
  if (e.length > 1) throw AggregateError(e, t);
3474
4092
  }
3475
- function mn(e) {
4093
+ function Rr(e) {
3476
4094
  let t = !1, n = 0, r = 0, i, a = Promise.resolve(), o = async (t) => {
3477
4095
  let n = e.animation.frames[t];
3478
- n !== void 0 && await e.assetManager.applyToTarget(n, e.target);
4096
+ n !== void 0 && await e.imageResolver.applyToTarget(n, e.target);
3479
4097
  }, s = (t, n) => {
3480
4098
  e.onError?.(t, Object.freeze({
3481
4099
  actorKey: e.actorKey,
@@ -3507,18 +4125,18 @@ function mn(e) {
3507
4125
  }
3508
4126
  });
3509
4127
  }
3510
- function hn(e) {
4128
+ function zr(e) {
3511
4129
  if (!Z(e)) throw new X("BUBBLE-COMPOSITION-001", "Show bubble input must be an object.");
3512
- if ($t(e, [
4130
+ if (Sr(e, [
3513
4131
  "actor",
3514
4132
  "actorKey",
3515
4133
  "kind",
3516
4134
  "text",
3517
4135
  "styleName"
3518
- ], ["animationMode"], "Show bubble input"), !Zt.has(e.kind)) throw new X("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
4136
+ ], ["animationMode"], "Show bubble input"), !br.has(e.kind)) throw new X("BUBBLE-COMPOSITION-001", "Bubble kind must be say or think.");
3519
4137
  if (typeof e.text != "string") throw new X("BUBBLE-COMPOSITION-001", "Bubble text must be a string.");
3520
4138
  let t = e.animationMode ?? "talking";
3521
- if (!Qt.has(t)) throw new X("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
4139
+ if (!xr.has(t)) throw new X("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid.");
3522
4140
  return {
3523
4141
  actor: e.actor,
3524
4142
  actorKey: Q(e.actorKey, "Bubble actor key"),
@@ -3528,12 +4146,12 @@ function hn(e) {
3528
4146
  animationMode: t
3529
4147
  };
3530
4148
  }
3531
- function gn(e) {
4149
+ function Br(e) {
3532
4150
  if (!Z(e)) throw TypeError("Bubble composition options must be an object.");
3533
- let t = rn(e.assetManager), n = an(e.svgText);
4151
+ let t = Er(e.imageResolver), n = Or(e.svgText);
3534
4152
  if (typeof e.createSurface != "function") throw TypeError("Bubble composition createSurface must be a function.");
3535
4153
  if (e.onAnimationError !== void 0 && typeof e.onAnimationError != "function") throw TypeError("Bubble composition onAnimationError must be a function.");
3536
- let r = sn(e.scheduler ?? on()), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = !1, c = () => {
4154
+ let r = Ar(e.scheduler ?? kr()), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = !1, c = () => {
3537
4155
  if (s) throw new X("BUBBLE-COMPOSITION-005", "Bubble composition has been disposed.");
3538
4156
  }, l = async (e, t) => {
3539
4157
  let n = (o.get(e) ?? Promise.resolve()).catch(() => void 0).then(t);
@@ -3547,129 +4165,170 @@ function gn(e) {
3547
4165
  c();
3548
4166
  let s = i.get(o.styleName);
3549
4167
  if (!s) throw new X("BUBBLE-COMPOSITION-002", `Bubble style is not defined: ${o.styleName}`);
3550
- for (let e of new Set(fn(s))) dn(t, e);
3551
- let l = a.get(o.actorKey);
3552
- l && await l.close();
3553
- let u, d = !1, f = !1, p, m, h;
3554
- try {
3555
- u = un(await e.createSurface(Object.freeze({
3556
- actor: o.actor,
3557
- actorKey: o.actorKey,
3558
- kind: o.kind,
3559
- style: s
3560
- })), s), n.setText({
3561
- styleName: s.textStyle,
3562
- target: u.targets.text,
3563
- text: o.text
3564
- }), d = !0;
3565
- let i = [];
3566
- if (s.portrait) {
3567
- i.push(t.applyToTarget(s.portrait.base, u.targets.portraitBase));
3568
- let e = s.portrait.blink?.frames[0];
3569
- e !== void 0 && i.push(t.applyToTarget(e, u.targets.portraitBlink));
3570
- let n = s.portrait.talk?.frames[0];
3571
- n !== void 0 && i.push(t.applyToTarget(n, u.targets.portraitTalk));
3572
- }
3573
- let c = s.advanceIndicator?.frames[0];
3574
- c !== void 0 && i.push(t.applyToTarget(c, u.targets.advanceIndicator)), await Promise.all(i), p = s.portrait?.blink === void 0 ? void 0 : mn({
4168
+ let l = s, u = o.text, d = (e) => {
4169
+ let n = new Set(Fr(e)), r = n.size === 0 ? void 0 : Dr(t);
4170
+ for (let e of n) Pr(r, e);
4171
+ return r;
4172
+ }, f = d(l), p = async (e, t, n) => {
4173
+ let r = Fr(e).length === 0 ? void 0 : Dr(t), i = [];
4174
+ if (e.portrait) {
4175
+ let t = Dr(r);
4176
+ i.push(Promise.resolve(t.applyToTarget(e.portrait.base, n.targets.portraitBase)));
4177
+ let a = e.portrait.blink?.frames[0];
4178
+ a !== void 0 && i.push(Promise.resolve(t.applyToTarget(a, n.targets.portraitBlink)));
4179
+ let o = e.portrait.lipSync?.frames[0];
4180
+ o !== void 0 && i.push(Promise.resolve(t.applyToTarget(o, n.targets.portraitLipSync)));
4181
+ }
4182
+ let a = e.continueIndicator?.frames[0];
4183
+ if (a !== void 0) {
4184
+ let e = Dr(r);
4185
+ i.push(Promise.resolve(e.applyToTarget(a, n.targets.continueIndicator)));
4186
+ }
4187
+ await Promise.all(i);
4188
+ }, m = (t, n, i) => {
4189
+ y = t.portrait?.blink === void 0 ? void 0 : Rr({
3575
4190
  actorKey: o.actorKey,
3576
4191
  layer: "portraitBlink",
3577
- animation: s.portrait.blink,
3578
- target: u.targets.portraitBlink,
3579
- assetManager: t,
4192
+ animation: t.portrait.blink,
4193
+ target: i.targets.portraitBlink,
4194
+ imageResolver: Dr(n),
3580
4195
  scheduler: r,
3581
4196
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
3582
- }), m = s.portrait?.talk === void 0 ? void 0 : mn({
4197
+ }), b = t.portrait?.lipSync === void 0 ? void 0 : Rr({
3583
4198
  actorKey: o.actorKey,
3584
- layer: "portraitTalk",
3585
- animation: s.portrait.talk,
3586
- target: u.targets.portraitTalk,
3587
- assetManager: t,
4199
+ layer: "portraitLipSync",
4200
+ animation: t.portrait.lipSync,
4201
+ target: i.targets.portraitLipSync,
4202
+ imageResolver: Dr(n),
3588
4203
  scheduler: r,
3589
4204
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
3590
- }), h = s.advanceIndicator === void 0 ? void 0 : mn({
4205
+ }), x = t.continueIndicator === void 0 ? void 0 : Rr({
3591
4206
  actorKey: o.actorKey,
3592
- layer: "advanceIndicator",
3593
- animation: s.advanceIndicator,
3594
- target: u.targets.advanceIndicator,
3595
- assetManager: t,
4207
+ layer: "continueIndicator",
4208
+ animation: t.continueIndicator,
4209
+ target: i.targets.continueIndicator,
4210
+ imageResolver: Dr(n),
3596
4211
  scheduler: r,
3597
4212
  ...e.onAnimationError === void 0 ? {} : { onError: e.onAnimationError }
3598
4213
  });
3599
- let l = "idle", g = !1, _ = Promise.resolve(), v = async (e) => {
3600
- e !== l && (e === "talking" ? (await h?.stop(), await u?.setLayerVisible("advanceIndicator", !1), await u?.setLayerVisible("portraitTalk", m !== void 0), await m?.start({ primed: !0 })) : e === "awaiting-advance" ? (await m?.stop({ reset: !0 }), await u?.setLayerVisible("portraitTalk", !1), await u?.setLayerVisible("advanceIndicator", h !== void 0), await h?.start({ primed: !0 })) : (await Promise.all([m?.stop({ reset: !0 }), h?.stop()]), await Promise.all([u?.setLayerVisible("portraitTalk", !1), u?.setLayerVisible("advanceIndicator", !1)])), l = e);
4214
+ }, h = a.get(o.actorKey);
4215
+ h && await h.close();
4216
+ let g, _ = !1, v = !1, y, b, x;
4217
+ try {
4218
+ g = Nr(await e.createSurface(Object.freeze({
4219
+ actor: o.actor,
4220
+ actorKey: o.actorKey,
4221
+ kind: o.kind,
4222
+ style: l
4223
+ })), l), n.setText({
4224
+ styleName: l.textStyle,
4225
+ target: g.targets.text,
4226
+ text: Ir(o.text, l, n)
4227
+ }), _ = !0, await p(l, f, g), m(l, f, g);
4228
+ let t = "idle", r = !1, i = Promise.resolve(), s = async (e) => {
4229
+ e !== t && (e === "talking" ? (await x?.stop(), await g?.setLayerVisible("continueIndicator", !1), await g?.setLayerVisible("portraitLipSync", b !== void 0), await b?.start({ primed: !0 })) : e === "awaiting-continue" ? (await b?.stop({ reset: !0 }), await g?.setLayerVisible("portraitLipSync", !1), await g?.setLayerVisible("continueIndicator", x !== void 0), await x?.start({ primed: !0 })) : (await Promise.all([b?.stop({ reset: !0 }), x?.stop()]), await Promise.all([g?.setLayerVisible("portraitLipSync", !1), g?.setLayerVisible("continueIndicator", !1)])), t = e);
3601
4230
  };
3602
4231
  await Promise.all([
3603
- u.setLayerVisible("portraitBase", s.portrait !== void 0),
3604
- u.setLayerVisible("portraitBlink", s.portrait?.blink !== void 0),
3605
- u.setLayerVisible("portraitTalk", !1),
3606
- u.setLayerVisible("advanceIndicator", !1)
3607
- ]), await u.show(), f = !0, await p?.start({ primed: !0 }), await v(o.animationMode);
3608
- let y = Object.freeze({
4232
+ g.setLayerVisible("portraitBase", l.portrait !== void 0),
4233
+ g.setLayerVisible("portraitBlink", l.portrait?.blink !== void 0),
4234
+ g.setLayerVisible("portraitLipSync", !1),
4235
+ g.setLayerVisible("continueIndicator", !1)
4236
+ ]), await g.show(), v = !0, await y?.start({ primed: !0 }), await s(o.animationMode);
4237
+ let c = Object.freeze({
3609
4238
  actorKey: o.actorKey,
3610
4239
  kind: o.kind,
3611
4240
  get animationMode() {
3612
- return l;
4241
+ return t;
3613
4242
  },
3614
4243
  setText(e) {
3615
- return g ? Promise.reject(new X("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${o.actorKey}`)) : typeof e == "string" ? (_ = _.then(async () => {
3616
- u && (n.setText({
3617
- styleName: s.textStyle,
3618
- target: u.targets.text,
3619
- text: e
3620
- }), await u.show());
3621
- }), _) : Promise.reject(new X("BUBBLE-COMPOSITION-001", "Bubble text must be a string."));
4244
+ return r ? Promise.reject(new X("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${o.actorKey}`)) : typeof e == "string" ? (i = i.then(async () => {
4245
+ g && (n.setText({
4246
+ styleName: l.textStyle,
4247
+ target: g.targets.text,
4248
+ text: Ir(e, l, n)
4249
+ }), u = e, await g.show());
4250
+ }), i) : Promise.reject(new X("BUBBLE-COMPOSITION-001", "Bubble text must be a string."));
4251
+ },
4252
+ updateStyle(e) {
4253
+ if (r) return Promise.reject(new X("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${o.actorKey}`));
4254
+ let a;
4255
+ try {
4256
+ a = Tr(e);
4257
+ } catch (e) {
4258
+ return Promise.reject(e);
4259
+ }
4260
+ return i = i.then(async () => {
4261
+ if (!g) return;
4262
+ Nr(g, a);
4263
+ let e = d(a);
4264
+ await Promise.all([
4265
+ y?.stop(),
4266
+ b?.stop(),
4267
+ x?.stop()
4268
+ ]), await p(a, e, g), await g.updateStyle(a), l = a, n.setText({
4269
+ styleName: a.textStyle,
4270
+ target: g.targets.text,
4271
+ text: Ir(u, a, n)
4272
+ }), m(a, e, g), await Promise.all([
4273
+ g.setLayerVisible("portraitBase", a.portrait !== void 0),
4274
+ g.setLayerVisible("portraitBlink", a.portrait?.blink !== void 0),
4275
+ g.setLayerVisible("portraitLipSync", !1),
4276
+ g.setLayerVisible("continueIndicator", !1)
4277
+ ]);
4278
+ let r = t;
4279
+ t = "idle", await y?.start({ primed: !0 }), await s(r), await g.show();
4280
+ }), i;
3622
4281
  },
3623
4282
  setAnimationMode(e) {
3624
- return g ? Promise.reject(new X("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${o.actorKey}`)) : Qt.has(e) ? (_ = _.then(() => v(e)), _) : Promise.reject(new X("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
4283
+ return r ? Promise.reject(new X("BUBBLE-COMPOSITION-005", `Bubble is already closed: ${o.actorKey}`)) : xr.has(e) ? (i = i.then(() => s(e)), i) : Promise.reject(new X("BUBBLE-COMPOSITION-001", "Bubble animation mode is invalid."));
3625
4284
  },
3626
4285
  async close() {
3627
- if (g) return;
3628
- g = !0;
4286
+ if (r) return;
4287
+ r = !0;
3629
4288
  let e = [];
3630
4289
  try {
3631
- await _;
4290
+ await i;
3632
4291
  } catch (t) {
3633
4292
  e.push(t);
3634
4293
  }
3635
4294
  for (let t of [
3636
- () => p?.stop(),
3637
- () => m?.stop(),
3638
- () => h?.stop(),
4295
+ () => y?.stop(),
4296
+ () => b?.stop(),
4297
+ () => x?.stop(),
3639
4298
  async () => {
3640
- f && await u?.hide();
4299
+ v && await g?.hide();
3641
4300
  },
3642
4301
  async () => {
3643
- d && u && n.releaseTarget(u.targets.text);
4302
+ _ && g && n.releaseTarget(g.targets.text);
3644
4303
  },
3645
- async () => u?.dispose()
4304
+ async () => g?.dispose()
3646
4305
  ]) try {
3647
4306
  await t();
3648
4307
  } catch (t) {
3649
4308
  e.push(t);
3650
4309
  }
3651
- a.get(o.actorKey) === y && a.delete(o.actorKey), pn(e, `Failed to close bubble: ${o.actorKey}`);
4310
+ a.get(o.actorKey) === c && a.delete(o.actorKey), Lr(e, `Failed to close bubble: ${o.actorKey}`);
3652
4311
  }
3653
4312
  });
3654
- return a.set(o.actorKey, y), y;
4313
+ return a.set(o.actorKey, c), c;
3655
4314
  } catch (e) {
3656
4315
  let t = [], r = await Promise.allSettled([
3657
- p?.stop(),
3658
- m?.stop(),
3659
- h?.stop()
4316
+ y?.stop(),
4317
+ b?.stop(),
4318
+ x?.stop()
3660
4319
  ]);
3661
- if (t.push(...r.flatMap((e) => e.status === "rejected" ? [e.reason] : [])), f && u) try {
3662
- await u.hide();
4320
+ if (t.push(...r.flatMap((e) => e.status === "rejected" ? [e.reason] : [])), v && g) try {
4321
+ await g.hide();
3663
4322
  } catch (e) {
3664
4323
  t.push(e);
3665
4324
  }
3666
- if (d && u) try {
3667
- n.releaseTarget(u.targets.text);
4325
+ if (_ && g) try {
4326
+ n.releaseTarget(g.targets.text);
3668
4327
  } catch (e) {
3669
4328
  t.push(e);
3670
4329
  }
3671
- if (u) try {
3672
- await u.dispose();
4330
+ if (g) try {
4331
+ await g.dispose();
3673
4332
  } catch (e) {
3674
4333
  t.push(e);
3675
4334
  }
@@ -3679,7 +4338,7 @@ function gn(e) {
3679
4338
  return Object.freeze({
3680
4339
  defineStyle(e) {
3681
4340
  c();
3682
- let t = nn(e);
4341
+ let t = Tr(e);
3683
4342
  i.set(t.name, t);
3684
4343
  },
3685
4344
  hasActiveBubble(e) {
@@ -3687,7 +4346,7 @@ function gn(e) {
3687
4346
  },
3688
4347
  async show(e) {
3689
4348
  c();
3690
- let t = hn(e);
4349
+ let t = zr(e);
3691
4350
  return l(t.actorKey, () => u(t));
3692
4351
  },
3693
4352
  releaseTarget(e) {
@@ -3698,29 +4357,29 @@ function gn(e) {
3698
4357
  });
3699
4358
  },
3700
4359
  async releaseAll() {
3701
- c(), await Promise.allSettled([...o.values()]), pn((await Promise.allSettled([...a.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
4360
+ c(), await Promise.allSettled([...o.values()]), Lr((await Promise.allSettled([...a.values()].map((e) => e.close()))).flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to release all bubbles");
3702
4361
  },
3703
4362
  async dispose() {
3704
4363
  if (s) return;
3705
4364
  s = !0, await Promise.allSettled([...o.values()]);
3706
4365
  let e = await Promise.allSettled([...a.values()].map((e) => e.close()));
3707
- i.clear(), pn(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
4366
+ i.clear(), Lr(e.flatMap((e) => e.status === "rejected" ? [e.reason] : []), "Failed to dispose bubble composition");
3708
4367
  }
3709
4368
  });
3710
4369
  }
3711
4370
  //#endregion
3712
4371
  //#region src/turbowarp-adapter.ts
3713
- var _n = "sprite", vn = 96, yn = 18, bn = 8, xn = 16, Sn = 0, $ = class extends Error {
4372
+ var Vr = "sprite", Hr = 96, Ur = 18, Wr = 8, Gr = 16, Kr = 0, $ = class extends Error {
3714
4373
  code;
3715
4374
  constructor(e, t) {
3716
4375
  super(t), this.name = "BubbleRuntimeAdapterError", this.code = e;
3717
4376
  }
3718
4377
  };
3719
- function Cn(e) {
4378
+ function qr(e) {
3720
4379
  return typeof e == "object" && !!e && !Array.isArray(e);
3721
4380
  }
3722
- function wn(e) {
3723
- if (!Cn(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp renderer.");
4381
+ function Jr(e) {
4382
+ if (!qr(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp renderer.");
3724
4383
  let t = [
3725
4384
  "createSVGSkin",
3726
4385
  "createDrawable",
@@ -3736,15 +4395,15 @@ function wn(e) {
3736
4395
  if (t.some((t) => typeof e[t] != "function")) throw new $("BUBBLE-RUNTIME-001", `Bubble renderer must provide ${t.join(", ")}.`);
3737
4396
  return e;
3738
4397
  }
3739
- function Tn(e) {
3740
- if (!Cn(e) || typeof e.isLoaded != "function" || typeof e.getAssetMimeType != "function" || typeof e.resolveSkin != "function") throw new $("BUBBLE-RUNTIME-002", "Bubble requires Asset Manager. Load @kubohiroya/turbowarp-asset-manager before using Bubble blocks.");
4398
+ function Yr(e) {
4399
+ if (!qr(e) || typeof e.isLoaded != "function" || typeof e.getAssetMimeType != "function" || typeof e.resolveSkin != "function") throw new $("BUBBLE-RUNTIME-002", "Bubble image assets require an imageResolver capability. Load @kubohiroya/turbowarp-asset-manager or provide options.imageResolver before using image features.");
3741
4400
  return e;
3742
4401
  }
3743
- function En(e) {
3744
- if (!Cn(e) || typeof e.setText != "function" || typeof e.releaseTextActor != "function") throw new $("BUBBLE-RUNTIME-003", "Bubble requires SVG Text. Load @kubohiroya/turbowarp-svg-text before using Bubble blocks.");
4402
+ function Xr(e) {
4403
+ if (!qr(e) || typeof e.setText != "function" || typeof e.releaseTextActor != "function") throw new $("BUBBLE-RUNTIME-003", "Bubble requires SVG Text. Load @kubohiroya/turbowarp-svg-text before using Bubble blocks.");
3745
4404
  return e;
3746
4405
  }
3747
- function Dn(e) {
4406
+ function Zr(e) {
3748
4407
  try {
3749
4408
  let t = e.getBoundsForBubble?.();
3750
4409
  if (t && [
@@ -3762,7 +4421,7 @@ function Dn(e) {
3762
4421
  top: n
3763
4422
  };
3764
4423
  }
3765
- function On(e, t, n) {
4424
+ function Qr(e, t, n) {
3766
4425
  let r = e.getCurrentSkinSize(t.drawableID);
3767
4426
  if (!Array.isArray(r) || r.length < 2) return n;
3768
4427
  let i = Number(r[0]), a = Number(r[1]);
@@ -3771,8 +4430,8 @@ function On(e, t, n) {
3771
4430
  height: a
3772
4431
  };
3773
4432
  }
3774
- function kn(e, t, n, r = 1) {
3775
- let i = On(e, t, {
4433
+ function $r(e, t, n, r = 1) {
4434
+ let i = Qr(e, t, {
3776
4435
  width: n,
3777
4436
  height: n
3778
4437
  }), a = Math.min(n / i.width, n / i.height) * r;
@@ -3781,179 +4440,191 @@ function kn(e, t, n, r = 1) {
3781
4440
  height: i.height * a
3782
4441
  };
3783
4442
  }
3784
- function An(e, t, n) {
4443
+ function ei(e, t, n) {
3785
4444
  return n < t ? (t + n) / 2 : Math.min(n, Math.max(t, e));
3786
4445
  }
3787
- function jn(e, t, n, r, i) {
4446
+ function ti(e, t, n, r, i) {
3788
4447
  let a = t + r * 2, o = n + i * 2;
3789
4448
  return e.replace(/<svg\b[^>]*>/u, (e) => e.replace(/\bwidth="[^"]*"/u, `width="${a}"`).replace(/\bheight="[^"]*"/u, `height="${o}"`).replace(/\bviewBox="[^"]*"/u, `viewBox="${-r} ${-i} ${a} ${o}"`));
3790
4449
  }
3791
- function Mn(e) {
4450
+ function ni(e) {
3792
4451
  let t = v(e);
3793
4452
  return (Math.atan2(-t.x, -t.y) * 180 / Math.PI % 360 + 360) % 360;
3794
4453
  }
3795
- function Nn(e, t, n, r) {
3796
- let i = e.renderer, a = Sn;
3797
- Sn += 1;
4454
+ function ri(e, t, n, r) {
4455
+ let i = e.renderer, a = Kr;
4456
+ Kr += 1;
3798
4457
  let o = [], s, c = (e) => {
3799
- let t = i.createDrawable(_n);
4458
+ let t = i.createDrawable(Vr);
3800
4459
  if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", `TurboWarp did not create the Bubble ${e} drawable.`);
3801
4460
  let r = Object.freeze({
3802
4461
  id: `bubble:${n}:${a}:${e}`,
3803
4462
  isStage: !1,
3804
4463
  drawableID: t
3805
4464
  });
3806
- return o.push(r), i.updateDrawableVisible(t, !1), i.setDrawableOrder?.(t, Infinity, _n), r;
4465
+ return o.push(r), i.updateDrawableVisible(t, !1), i.setDrawableOrder?.(t, Infinity, Vr), r;
3807
4466
  };
3808
4467
  try {
3809
- let n = c("body"), a = r.portrait ? c("portrait-base") : void 0, l = r.portrait?.blink ? c("portrait-blink") : void 0, u = r.portrait?.talk ? c("portrait-talk") : void 0, d = c("text"), f = r.advanceIndicator ? c("advance-indicator") : void 0, p = Object.freeze({
4468
+ let n = c("body"), a = r.portrait ? c("portrait-base") : void 0, l = r.portrait?.blink ? c("portrait-blink") : void 0, u = r.portrait?.lipSync ? c("portrait-lip-sync") : void 0, d = c("text"), f = r.continueIndicator ? c("continue-indicator") : void 0, p = Object.freeze({
3810
4469
  text: d,
3811
4470
  ...a ? { portraitBase: a } : {},
3812
4471
  ...l ? { portraitBlink: l } : {},
3813
- ...u ? { portraitTalk: u } : {},
3814
- ...f ? { advanceIndicator: f } : {}
4472
+ ...u ? { portraitLipSync: u } : {},
4473
+ ...f ? { continueIndicator: f } : {}
3815
4474
  }), m = /* @__PURE__ */ new Map();
3816
- a && m.set("portraitBase", a), l && m.set("portraitBlink", l), u && m.set("portraitTalk", u), f && m.set("advanceIndicator", f);
3817
- let h = /* @__PURE__ */ new Map(), g = !1, _ = !1, v = "", y = () => {
3818
- let a = r.placement.basis === "background" || t.visible !== !1;
3819
- i.updateDrawableVisible(n.drawableID, g && a && r.visualStyle !== "NO_BUBBLE"), i.updateDrawableVisible(d.drawableID, g && a);
3820
- for (let [e, t] of m) i.updateDrawableVisible(t.drawableID, g && a && (h.get(e) ?? !1));
4475
+ a && m.set("portraitBase", a), l && m.set("portraitBlink", l), u && m.set("portraitLipSync", u), f && m.set("continueIndicator", f);
4476
+ let h = /* @__PURE__ */ new Map(), g = !1, _ = !1, v = "", y = r, b = () => {
4477
+ let r = y.placement.basis === "background" || t.visible !== !1;
4478
+ i.updateDrawableVisible(n.drawableID, g && r && y.visualStyle !== "NO_BUBBLE"), i.updateDrawableVisible(d.drawableID, g && r);
4479
+ for (let [e, t] of m) i.updateDrawableVisible(t.drawableID, g && r && (h.get(e) ?? !1));
3821
4480
  e.requestRedraw?.();
3822
- }, b = () => {
4481
+ }, x = () => {
3823
4482
  if (_) return;
3824
- let e = r.placement.basis === "actor" ? r.offset.scalePercent / 100 : 1, o = On(i, d, {
4483
+ let e = y.placement.basis === "actor" ? y.offset.scalePercent / 100 : 1, r = Qr(i, d, {
3825
4484
  width: 180,
3826
4485
  height: 48
3827
4486
  });
3828
4487
  i.updateDrawableScale(d.drawableID, [e * 100, e * 100]);
3829
- let c = {
3830
- width: o.width * e,
3831
- height: o.height * e
3832
- }, p = a ? kn(i, a, vn, e) : {
4488
+ let o = {
4489
+ width: r.width * e,
4490
+ height: r.height * e
4491
+ }, c = a ? $r(i, a, Hr, e) : {
3833
4492
  width: 0,
3834
4493
  height: 0
3835
4494
  };
3836
- for (let t of [l, u]) t && kn(i, t, vn, e);
3837
- let m = f ? kn(i, f, yn, e) : {
4495
+ for (let t of [l, u]) t && $r(i, t, Hr, e);
4496
+ let p = f ? $r(i, f, Ur, e) : {
3838
4497
  width: 0,
3839
4498
  height: 0
3840
- }, h = p.width + (a ? bn * e : 0) + c.width, g = Math.max(p.height, c.height), b = h / e + 48, x = g / e + 48, S = h, C = g, w = i.getNativeSize(), T = Array.isArray(w) && Number(w[0]) > 0 ? Number(w[0]) : 480, E = Array.isArray(w) && Number(w[1]) > 0 ? Number(w[1]) : 360, te = -T / 2, D = T / 2, ne = E / 2, O = -E / 2, k = te + S / 2, A = D - S / 2, re = O + C / 2, j = ne - C / 2, M, N;
3841
- if (r.placement.basis === "background") M = 0, N = r.placement.region === "HEADER_LIKE" ? ne - xn - C / 2 : r.placement.region === "FOOTER_LIKE" ? O + xn + C / 2 : 0;
4499
+ }, m = c.width + (a ? Wr * e : 0) + o.width, h = Math.max(c.height, o.height), g = m / e + 48, x = h / e + 48, S = m, C = h, w = i.getNativeSize(), te = Array.isArray(w) && Number(w[0]) > 0 ? Number(w[0]) : 480, T = Array.isArray(w) && Number(w[1]) > 0 ? Number(w[1]) : 360, ne = -te / 2, re = te / 2, ie = T / 2, ae = -T / 2, E = ne + S / 2, D = re - S / 2, oe = ae + C / 2, O = ie - C / 2, k, A;
4500
+ if (y.placement.basis === "background") k = 0, A = y.placement.region === "HEADER_LIKE" ? ie - Gr - C / 2 : y.placement.region === "FOOTER_LIKE" ? ae + Gr + C / 2 : 0;
3842
4501
  else {
3843
4502
  let e = ee({
3844
- bounds: Dn(t),
4503
+ bounds: Zr(t),
3845
4504
  bubbleWidth: S,
3846
4505
  bubbleHeight: C,
3847
- direction: r.placement.direction,
3848
- distance: r.distance,
3849
- tailLength: r.tailLength,
3850
- offset: r.offset
4506
+ direction: y.placement.direction,
4507
+ distance: y.distance,
4508
+ tailLength: y.tailLength,
4509
+ offset: y.offset
3851
4510
  });
3852
- M = e.x, N = e.y;
4511
+ k = e.x, A = e.y;
3853
4512
  }
3854
- M = An(M, k, A), N = An(N, re, j);
3855
- let P = r.placement.basis === "actor" ? Mn(r.placement.direction) : null, F = r.placement.basis === "actor" ? [
3856
- r.offset.x,
3857
- r.offset.y,
3858
- r.offset.scalePercent
4513
+ k = ei(k, E, D), A = ei(A, oe, O);
4514
+ let j = y.placement.basis === "actor" ? ni(y.placement.direction) : null, M = y.placement.basis === "actor" ? [
4515
+ y.offset.x,
4516
+ y.offset.y,
4517
+ y.offset.scalePercent
3859
4518
  ] : [
3860
4519
  0,
3861
4520
  0,
3862
4521
  100
3863
- ], I = P === null ? {
4522
+ ], N = j === null ? {
3864
4523
  x: 0,
3865
4524
  y: 0
3866
- } : fe({
3867
- style: r.visualStyle,
3868
- width: b,
4525
+ } : _e({
4526
+ style: y.visualStyle,
4527
+ width: g,
3869
4528
  height: x,
3870
- tailDirection: P,
3871
- tailLength: r.tailLength,
3872
- offset: F
3873
- }), L = Math.abs(F[0]) + b * Math.abs(e - 1) + Math.max(0, r.tailLength - 18) + 8, ie = Math.abs(F[1]) + x * Math.abs(e - 1) + Math.max(0, r.tailLength - 18) + 8, R = JSON.stringify({
4529
+ tailDirection: j,
4530
+ tailLength: y.tailLength,
4531
+ offset: M
4532
+ }), P = Math.abs(M[0]) + g * Math.abs(e - 1) + Math.max(0, y.tailLength - 18) + 8, se = Math.abs(M[1]) + x * Math.abs(e - 1) + Math.max(0, y.tailLength - 18) + 8, F = JSON.stringify({
3874
4533
  baseBubbleHeight: x,
3875
- baseBubbleWidth: b,
3876
- bodyOffset: F,
3877
- tailDirection: P,
3878
- tailLength: r.tailLength,
3879
- viewportExtraX: L,
3880
- viewportExtraY: ie,
3881
- visualStyle: r.visualStyle
4534
+ baseBubbleWidth: g,
4535
+ bodyOffset: M,
4536
+ tailDirection: j,
4537
+ tailLength: y.tailLength,
4538
+ viewportExtraX: P,
4539
+ viewportExtraY: se,
4540
+ visualStyle: y.visualStyle
3882
4541
  });
3883
- if (R !== v) {
3884
- let e = jn(me({
3885
- style: r.visualStyle,
4542
+ if (F !== v) {
4543
+ let e = ti(ye({
4544
+ style: y.visualStyle,
3886
4545
  lines: [],
3887
- width: b,
4546
+ width: g,
3888
4547
  height: x,
3889
- tailDirection: P,
3890
- tailLength: r.tailLength,
3891
- offset: F,
3892
- title: `${r.name} Bubble body`
3893
- }), b, x, L, ie), t = i.createSVGSkin(e);
4548
+ tailDirection: j,
4549
+ tailLength: y.tailLength,
4550
+ offset: M,
4551
+ title: `${y.name} Bubble body`
4552
+ }), g, x, P, se), t = i.createSVGSkin(e);
3894
4553
  if (!Number.isInteger(t) || t < 0) throw new $("BUBBLE-RUNTIME-001", "TurboWarp did not create the Bubble body SVG skin.");
3895
4554
  try {
3896
4555
  i.updateDrawableSkinId(n.drawableID, t);
3897
4556
  } catch (e) {
3898
4557
  throw i.destroySkin(t), e;
3899
4558
  }
3900
- let a = s;
3901
- s = t, v = R, a !== void 0 && i.destroySkin(a);
4559
+ let r = s;
4560
+ s = t, v = F, r !== void 0 && i.destroySkin(r);
3902
4561
  }
3903
- i.updateDrawableScale(n.drawableID, [100, 100]), i.updateDrawablePosition(n.drawableID, [M - I.x, N + I.y]);
3904
- let z = M - h / 2, ae = z + p.width / 2, oe = z + p.width + (a ? bn * e : 0) + c.width / 2;
4562
+ i.updateDrawableScale(n.drawableID, [100, 100]), i.updateDrawablePosition(n.drawableID, [k - N.x, A + N.y]);
4563
+ let ce = k - m / 2, le = ce + c.width / 2, ue = ce + c.width + (a ? Wr * e : 0) + o.width / 2;
3905
4564
  for (let e of [
3906
4565
  a,
3907
4566
  l,
3908
4567
  u
3909
- ]) e && i.updateDrawablePosition(e.drawableID, [ae, N]);
3910
- i.updateDrawablePosition(d.drawableID, [oe, N]), f && i.updateDrawablePosition(f.drawableID, [oe + c.width / 2 - m.width / 2 - bn * e, N - c.height / 2 + m.height / 2 + bn * e]), y();
3911
- }, x = t.onTargetVisualChange, S = (e) => {
3912
- x?.(e), b();
4568
+ ]) e && i.updateDrawablePosition(e.drawableID, [le, A]);
4569
+ i.updateDrawablePosition(d.drawableID, [ue, A]), f && i.updateDrawablePosition(f.drawableID, [ue + o.width / 2 - p.width / 2 - Wr * e, A - o.height / 2 + p.height / 2 + Wr * e]), b();
4570
+ }, S = t.onTargetVisualChange, C = (e) => {
4571
+ S?.(e), x();
3913
4572
  };
3914
- return r.placement.basis === "actor" && (t.onTargetVisualChange = S), Object.freeze({
4573
+ return y.placement.basis === "actor" && (t.onTargetVisualChange = C), Object.freeze({
3915
4574
  targets: p,
3916
4575
  setLayerVisible(e, t) {
3917
- _ || (h.set(e, t), y());
4576
+ _ || (h.set(e, t), b());
4577
+ },
4578
+ updateStyle(e) {
4579
+ if (_) return;
4580
+ let n = y.placement.basis === "actor";
4581
+ y = e;
4582
+ let r = y.placement.basis === "actor";
4583
+ n && !r ? t.onTargetVisualChange === C && (t.onTargetVisualChange = S ?? null) : !n && r && (t.onTargetVisualChange = C), x();
3918
4584
  },
3919
4585
  show() {
3920
- _ || (g = !0, b());
4586
+ _ || (g = !0, x());
3921
4587
  },
3922
4588
  hide() {
3923
- _ || (g = !1, y());
4589
+ _ || (g = !1, b());
3924
4590
  },
3925
4591
  dispose() {
3926
4592
  if (!_) {
3927
- _ = !0, r.placement.basis === "actor" && t.onTargetVisualChange === S && (t.onTargetVisualChange = x ?? null);
3928
- for (let e of [...o].reverse()) i.destroyDrawable(e.drawableID, _n);
4593
+ _ = !0, y.placement.basis === "actor" && t.onTargetVisualChange === C && (t.onTargetVisualChange = S ?? null);
4594
+ for (let e of [...o].reverse()) i.destroyDrawable(e.drawableID, Vr);
3929
4595
  s !== void 0 && (i.destroySkin(s), s = void 0), e.requestRedraw?.();
3930
4596
  }
3931
4597
  }
3932
4598
  });
3933
4599
  } catch (e) {
3934
- for (let e of [...o].reverse()) i.destroyDrawable(e.drawableID, _n);
4600
+ for (let e of [...o].reverse()) i.destroyDrawable(e.drawableID, Vr);
3935
4601
  throw s !== void 0 && i.destroySkin(s), e;
3936
4602
  }
3937
4603
  }
3938
- function Pn(e, t = {}) {
3939
- if (!Cn(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp runtime.");
3940
- let n = e, r = wn(n.renderer), i = t.assetManager ? null : Tn(n.ext_kubohiroyaassetmanager), a = t.svgText ? null : En(n.ext_kubohiroyasvgtext);
3941
- return gn({
3942
- assetManager: t.assetManager ?? {
4604
+ function ii(e, t = {}) {
4605
+ if (!qr(e)) throw new $("BUBBLE-RUNTIME-001", "Bubble requires the TurboWarp runtime.");
4606
+ let n = e, r = Jr(n.renderer), i = () => Yr(n.ext_kubohiroyaassetmanager), a = t.svgText ? null : Xr(n.ext_kubohiroyasvgtext);
4607
+ return Br({
4608
+ imageResolver: t.imageResolver ?? {
3943
4609
  isRegistered(e) {
3944
- return i?.isLoaded({ NAME: e }) ?? !1;
4610
+ return i().isLoaded({ NAME: e });
3945
4611
  },
3946
4612
  getMimeType(e) {
3947
- return i?.getAssetMimeType({ NAME: e }) ?? "";
4613
+ return i().getAssetMimeType({ NAME: e });
3948
4614
  },
3949
4615
  async applyToTarget(e, t) {
3950
4616
  let a = t.drawableID;
3951
4617
  if (!Number.isInteger(a) || a < 0) throw new $("BUBBLE-RUNTIME-001", "Bubble image target drawable is invalid.");
3952
- let o = await i?.resolveSkin(e);
3953
- if (!Cn(o) || !Number.isInteger(o.skinId) || o.skinId < 0) throw new $("BUBBLE-RUNTIME-002", `Asset Manager did not resolve an image skin: ${String(e)}`);
4618
+ let o = await i().resolveSkin(e);
4619
+ if (!qr(o) || !Number.isInteger(o.skinId) || o.skinId < 0) throw new $("BUBBLE-RUNTIME-002", `Asset Manager did not resolve an image skin: ${String(e)}`);
3954
4620
  r.updateDrawableSkinId(a, o.skinId), n.requestRedraw?.();
3955
4621
  }
3956
4622
  },
4623
+ audio: t.audio ?? { async playSound(e, t = {}) {
4624
+ let n = i(), r = t.untilDone ? n?.playSoundUntilDone : n?.playSound;
4625
+ if (typeof r != "function") throw new $("BUBBLE-RUNTIME-002", "TurboWarp Asset Manager does not provide audio playback.");
4626
+ await r.call(n, { NAME: e });
4627
+ } },
3957
4628
  svgText: t.svgText ?? {
3958
4629
  setText({ styleName: e, target: t, text: n }) {
3959
4630
  a?.setText({
@@ -3963,15 +4634,20 @@ function Pn(e, t = {}) {
3963
4634
  },
3964
4635
  releaseTarget(e) {
3965
4636
  a?.releaseTextActor(e);
4637
+ },
4638
+ measureText({ styleName: e, text: t }) {
4639
+ let n = a?.measureText;
4640
+ if (typeof n != "function") throw new $("BUBBLE-RUNTIME-003", "SVG Text does not provide text measurement.");
4641
+ return n.call(a, e, t);
3966
4642
  }
3967
4643
  },
3968
4644
  createSurface({ actor: e, actorKey: t, style: r }) {
3969
- if (!Cn(e) || typeof e.id != "string") throw new $("BUBBLE-RUNTIME-001", "Bubble actor target is invalid.");
3970
- return Nn(n, e, t, r);
4645
+ if (!qr(e) || typeof e.id != "string") throw new $("BUBBLE-RUNTIME-001", "Bubble actor target is invalid.");
4646
+ return ri(n, e, t, r);
3971
4647
  },
3972
4648
  ...t.scheduler === void 0 ? {} : { scheduler: t.scheduler },
3973
4649
  ...t.onAnimationError === void 0 ? {} : { onAnimationError: t.onAnimationError }
3974
4650
  });
3975
4651
  }
3976
4652
  //#endregion
3977
- export { $ as BubbleRuntimeAdapterError, Pn as createTurboWarpBubbleComposition };
4653
+ export { $ as BubbleRuntimeAdapterError, ii as createTurboWarpBubbleComposition };