@pixerate/editor 0.112.0 → 0.114.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.
Files changed (129) hide show
  1. package/THIRD_PARTY_NOTICES.md +11 -0
  2. package/dist/animation-editor/index.cjs +60 -54
  3. package/dist/animation-editor/index.cjs.map +1 -1
  4. package/dist/animation-editor/index.d.cts +3 -3
  5. package/dist/animation-editor/index.d.ts +3 -3
  6. package/dist/animation-editor/index.js +14 -8
  7. package/dist/animation-editor/index.js.map +1 -1
  8. package/dist/builtin-CY97ppKM.d.cts +354 -0
  9. package/dist/builtin-CY97ppKM.d.ts +354 -0
  10. package/dist/canvas/index.cjs +3 -3
  11. package/dist/canvas/index.cjs.map +1 -1
  12. package/dist/canvas/index.js +9 -9
  13. package/dist/chunk-26PGXHY7.cjs +753 -0
  14. package/dist/chunk-26PGXHY7.cjs.map +1 -0
  15. package/dist/chunk-2OJACTPR.cjs +929 -0
  16. package/dist/chunk-2OJACTPR.cjs.map +1 -0
  17. package/dist/chunk-3UFGNHSP.js +929 -0
  18. package/dist/chunk-3UFGNHSP.js.map +1 -0
  19. package/dist/{chunk-YGIMK4NX.cjs → chunk-5OVJHMZQ.cjs} +757 -825
  20. package/dist/chunk-5OVJHMZQ.cjs.map +1 -0
  21. package/dist/chunk-643B2HKC.cjs +534 -0
  22. package/dist/chunk-643B2HKC.cjs.map +1 -0
  23. package/dist/chunk-6FCKOS2B.js +534 -0
  24. package/dist/chunk-6FCKOS2B.js.map +1 -0
  25. package/dist/chunk-BRLYOPLT.js +2574 -0
  26. package/dist/chunk-BRLYOPLT.js.map +1 -0
  27. package/dist/{chunk-LQEEDHOP.js → chunk-C6C5PDKU.js} +759 -761
  28. package/dist/chunk-C6C5PDKU.js.map +1 -0
  29. package/dist/chunk-DFQEX3AM.cjs +781 -0
  30. package/dist/chunk-DFQEX3AM.cjs.map +1 -0
  31. package/dist/{chunk-CZOXTEMN.js → chunk-EUVSQ25B.js} +336 -404
  32. package/dist/chunk-EUVSQ25B.js.map +1 -0
  33. package/dist/chunk-G5NMLUVF.cjs +2574 -0
  34. package/dist/chunk-G5NMLUVF.cjs.map +1 -0
  35. package/dist/chunk-LKCYANMW.js +781 -0
  36. package/dist/chunk-LKCYANMW.js.map +1 -0
  37. package/dist/{chunk-W3GXSUSQ.cjs → chunk-LPLCWZTM.cjs} +5087 -1283
  38. package/dist/chunk-LPLCWZTM.cjs.map +1 -0
  39. package/dist/chunk-MMVHBKMM.js +753 -0
  40. package/dist/chunk-MMVHBKMM.js.map +1 -0
  41. package/dist/{chunk-POGBUYWE.cjs → chunk-ST7E3NEE.cjs} +857 -859
  42. package/dist/chunk-ST7E3NEE.cjs.map +1 -0
  43. package/dist/{chunk-7VOHOPLW.cjs → chunk-TCKIXI46.cjs} +59 -59
  44. package/dist/{chunk-7VOHOPLW.cjs.map → chunk-TCKIXI46.cjs.map} +1 -1
  45. package/dist/{chunk-XIOMMGPD.cjs → chunk-TFOPHZ3U.cjs} +1 -1
  46. package/dist/chunk-TFOPHZ3U.cjs.map +1 -0
  47. package/dist/{chunk-Z4BC6M74.js → chunk-UBIXVXPR.js} +2 -2
  48. package/dist/{chunk-BLWCAQCW.js → chunk-VXR7XWMF.js} +4574 -770
  49. package/dist/chunk-VXR7XWMF.js.map +1 -0
  50. package/dist/{chunk-HNS7UHCM.js → chunk-XK5LZKBD.js} +1 -1
  51. package/dist/chunk-XK5LZKBD.js.map +1 -0
  52. package/dist/cms/index.cjs +146 -0
  53. package/dist/cms/index.cjs.map +1 -0
  54. package/dist/cms/index.d.cts +51 -0
  55. package/dist/cms/index.d.ts +51 -0
  56. package/dist/cms/index.js +146 -0
  57. package/dist/{export-DNu_Jr8p.d.ts → export-_1dUKwpF.d.ts} +326 -195
  58. package/dist/{export-DBba-buV.d.cts → export-b6NjCZ5-.d.cts} +326 -195
  59. package/dist/image-editor/index.cjs +2377 -1291
  60. package/dist/image-editor/index.cjs.map +1 -1
  61. package/dist/image-editor/index.d.cts +149 -97
  62. package/dist/image-editor/index.d.ts +149 -97
  63. package/dist/image-editor/index.js +1343 -257
  64. package/dist/image-editor/index.js.map +1 -1
  65. package/dist/opentype-BZEOSOX3.d.ts +188 -0
  66. package/dist/opentype-Dpe75vL5.d.cts +188 -0
  67. package/dist/paint/index.cjs +63 -4
  68. package/dist/paint/index.cjs.map +1 -1
  69. package/dist/paint/index.d.cts +30 -3
  70. package/dist/paint/index.d.ts +30 -3
  71. package/dist/paint/index.js +62 -3
  72. package/dist/paint-editor/index.cjs +146 -145
  73. package/dist/paint-editor/index.cjs.map +1 -1
  74. package/dist/paint-editor/index.d.cts +9 -8
  75. package/dist/paint-editor/index.d.ts +9 -8
  76. package/dist/paint-editor/index.js +6 -5
  77. package/dist/paint-editor/index.js.map +1 -1
  78. package/dist/raster/index.cjs +53 -3
  79. package/dist/raster/index.cjs.map +1 -1
  80. package/dist/raster/index.d.cts +62 -91
  81. package/dist/raster/index.d.ts +62 -91
  82. package/dist/raster/index.js +59 -9
  83. package/dist/{render-BEriFuqK.d.cts → render-B1K_OoLy.d.cts} +87 -2
  84. package/dist/{render-tjzKaik-.d.ts → render-CrmHOgpo.d.ts} +87 -2
  85. package/dist/{blending-aOE6Y3UE.d.cts → retouch-Bxkuc0KH.d.cts} +219 -2
  86. package/dist/{blending-DXl06NSx.d.ts → retouch-Do6tBs2H.d.ts} +219 -2
  87. package/dist/{surface-C8RRg_Bh.d.ts → surface-Cn30xIV6.d.cts} +6 -1
  88. package/dist/{surface-C8RRg_Bh.d.cts → surface-Cn30xIV6.d.ts} +6 -1
  89. package/dist/{svg-D_cfkhlB.d.cts → svg-BnRj0q8i.d.cts} +16 -4
  90. package/dist/{svg-wIaKLrU0.d.ts → svg-CmmBFfGT.d.ts} +16 -4
  91. package/dist/{types-DtL_qLFz.d.ts → types-1SUQKDAw.d.ts} +273 -4
  92. package/dist/{types-DyQq-WPY.d.cts → types-yINF17Ta.d.cts} +273 -4
  93. package/dist/vector/index.cjs +12170 -7343
  94. package/dist/vector/index.cjs.map +1 -1
  95. package/dist/vector/index.d.cts +1579 -16
  96. package/dist/vector/index.d.ts +1579 -16
  97. package/dist/vector/index.js +6303 -1476
  98. package/dist/vector/index.js.map +1 -1
  99. package/dist/warp-B39VsOtd.d.cts +348 -0
  100. package/dist/warp-DMN30aY6.d.ts +348 -0
  101. package/dist/zlib-dxQdgHyN.d.cts +95 -0
  102. package/dist/zlib-dxQdgHyN.d.ts +95 -0
  103. package/package.json +6 -1
  104. package/skills/pixerate-image-editor/SKILL.md +34 -34
  105. package/skills/pixerate-image-editor/references/color-management.md +37 -0
  106. package/skills/pixerate-image-editor/references/photoshop-files.md +39 -0
  107. package/skills/pixerate-image-editor/references/retouching.md +36 -0
  108. package/skills/pixerate-vector/SKILL.md +154 -5
  109. package/dist/chunk-BLWCAQCW.js.map +0 -1
  110. package/dist/chunk-CZOXTEMN.js.map +0 -1
  111. package/dist/chunk-FTBZPI77.cjs +0 -1
  112. package/dist/chunk-FTBZPI77.cjs.map +0 -1
  113. package/dist/chunk-HNS7UHCM.js.map +0 -1
  114. package/dist/chunk-JLYX4V57.cjs +0 -2001
  115. package/dist/chunk-JLYX4V57.cjs.map +0 -1
  116. package/dist/chunk-KB2YBCVS.js +0 -2001
  117. package/dist/chunk-KB2YBCVS.js.map +0 -1
  118. package/dist/chunk-LQEEDHOP.js.map +0 -1
  119. package/dist/chunk-POGBUYWE.cjs.map +0 -1
  120. package/dist/chunk-VKK5VS2T.js +0 -1
  121. package/dist/chunk-W3GXSUSQ.cjs.map +0 -1
  122. package/dist/chunk-XIOMMGPD.cjs.map +0 -1
  123. package/dist/chunk-YGIMK4NX.cjs.map +0 -1
  124. package/dist/homography-CZ-tFjay.d.cts +0 -50
  125. package/dist/homography-Ctfjoc1b.d.ts +0 -50
  126. package/dist/warp-CWHZzE3x.d.ts +0 -118
  127. package/dist/warp-D5jz_tN7.d.cts +0 -118
  128. /package/dist/{chunk-Z4BC6M74.js.map → chunk-UBIXVXPR.js.map} +0 -0
  129. /package/dist/{chunk-VKK5VS2T.js.map → cms/index.js.map} +0 -0
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkYGIMK4NXcjs = require('../chunk-YGIMK4NX.cjs');
7
+ var _chunk5OVJHMZQcjs = require('../chunk-5OVJHMZQ.cjs');
8
8
 
9
9
 
10
10
 
@@ -19,7 +19,7 @@ var _chunkYGIMK4NXcjs = require('../chunk-YGIMK4NX.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunkPOGBUYWEcjs = require('../chunk-POGBUYWE.cjs');
22
+ var _chunkST7E3NEEcjs = require('../chunk-ST7E3NEE.cjs');
23
23
  require('../chunk-MUUXNRU4.cjs');
24
24
 
25
25
 
@@ -47,7 +47,7 @@ require('../chunk-MUUXNRU4.cjs');
47
47
 
48
48
 
49
49
 
50
- var _chunk7VOHOPLWcjs = require('../chunk-7VOHOPLW.cjs');
50
+ var _chunkTCKIXI46cjs = require('../chunk-TCKIXI46.cjs');
51
51
 
52
52
 
53
53
 
@@ -68,14 +68,15 @@ var _chunk7VOHOPLWcjs = require('../chunk-7VOHOPLW.cjs');
68
68
 
69
69
 
70
70
 
71
- var _chunkXIOMMGPDcjs = require('../chunk-XIOMMGPD.cjs');
71
+ var _chunkTFOPHZ3Ucjs = require('../chunk-TFOPHZ3U.cjs');
72
+ require('../chunk-643B2HKC.cjs');
72
73
 
73
74
 
74
75
 
75
76
 
76
77
 
77
78
  var _chunkEGFUVXKKcjs = require('../chunk-EGFUVXKK.cjs');
78
- require('../chunk-W3GXSUSQ.cjs');
79
+ require('../chunk-LPLCWZTM.cjs');
79
80
  require('../chunk-XGD3FSNC.cjs');
80
81
  require('../chunk-MR3Z4OQI.cjs');
81
82
  require('../chunk-A6PHCAGX.cjs');
@@ -427,7 +428,7 @@ function newPaintLayerId() {
427
428
  return `pl${Date.now().toString(36)}${(nextId++).toString(36)}`;
428
429
  }
429
430
  function createPaintLayer(name, id = newPaintLayerId()) {
430
- return { type: "pixel", id, name, visible: true, opacity: 1, blend: "normal", surface: _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
431
+ return { type: "pixel", id, name, visible: true, opacity: 1, blend: "normal", surface: _chunkTFOPHZ3Ucjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
431
432
  }
432
433
  var PaintDocumentError = class extends Error {
433
434
  constructor(message) {
@@ -528,7 +529,7 @@ function normalizePaintBrush(raw = {}, base) {
528
529
  if (rb.dirty !== void 0) mixerIn.cleanEachStroke = !rb.dirty;
529
530
  if (rb.mixing !== void 0) mixerIn.mixing = rb.mixing;
530
531
  }
531
- const mixer = _chunk7VOHOPLWcjs.normalizeMixer.call(void 0, mixerIn);
532
+ const mixer = _chunkTCKIXI46cjs.normalizeMixer.call(void 0, mixerIn);
532
533
  let behavior = normalizeBehavior(rb, b.behavior);
533
534
  if (engine === "mixer") behavior = { ...behavior, pickup: mixer.wet, mix: mixer.mix, dirty: !mixer.cleanEachStroke, mixing: mixer.mixing };
534
535
  return {
@@ -536,7 +537,7 @@ function normalizePaintBrush(raw = {}, base) {
536
537
  name: typeof raw.name === "string" && raw.name.trim() ? raw.name.trim().slice(0, 80) : b.name,
537
538
  category: PAINT_BRUSH_CATEGORIES.includes(raw.category) ? raw.category : b.category,
538
539
  engine,
539
- tip: _chunk7VOHOPLWcjs.normalizeBrush.call(void 0, { ...b.tip, ..._nullishCoalesce(raw.tip, () => ( {})) }),
540
+ tip: _chunkTCKIXI46cjs.normalizeBrush.call(void 0, { ...b.tip, ..._nullishCoalesce(raw.tip, () => ( {})) }),
540
541
  grain: unit2(raw.grain, b.grain),
541
542
  pressureSmoothing: range(raw.pressureSmoothing, 0, 0.95, b.pressureSmoothing),
542
543
  rotation: BRUSH_ROTATIONS.includes(raw.rotation) ? raw.rotation : b.rotation,
@@ -544,8 +545,8 @@ function normalizePaintBrush(raw = {}, base) {
544
545
  mixer,
545
546
  loadsColor: typeof raw.loadsColor === "boolean" ? raw.loadsColor : b.loadsColor,
546
547
  behavior,
547
- blender: _chunk7VOHOPLWcjs.normalizeBlender.call(void 0, _nullishCoalesce(raw.blender, () => ( {})), b.blender),
548
- smudge: _chunk7VOHOPLWcjs.normalizeSmudge.call(void 0, _nullishCoalesce(raw.smudge, () => ( {})), b.smudge),
548
+ blender: _chunkTCKIXI46cjs.normalizeBlender.call(void 0, _nullishCoalesce(raw.blender, () => ( {})), b.blender),
549
+ smudge: _chunkTCKIXI46cjs.normalizeSmudge.call(void 0, _nullishCoalesce(raw.smudge, () => ( {})), b.smudge),
549
550
  ...raw.builtin ? { builtin: true } : {}
550
551
  };
551
552
  }
@@ -554,16 +555,16 @@ var BASE_BRUSH = {
554
555
  name: "Round",
555
556
  category: "custom",
556
557
  engine: "dab",
557
- tip: { ..._chunk7VOHOPLWcjs.DEFAULT_BRUSH },
558
+ tip: { ..._chunkTCKIXI46cjs.DEFAULT_BRUSH },
558
559
  grain: 0,
559
560
  pressureSmoothing: 0,
560
561
  rotation: "fixed",
561
562
  dynamics: { ...DEFAULT_DYNAMICS },
562
- mixer: { ..._chunk7VOHOPLWcjs.DEFAULT_MIXER },
563
+ mixer: { ..._chunkTCKIXI46cjs.DEFAULT_MIXER },
563
564
  loadsColor: true,
564
565
  behavior: { ...DEFAULT_BEHAVIOR, multicolor: { ...DEFAULT_MULTI_COLOR, colors: [] } },
565
- blender: { ..._chunk7VOHOPLWcjs.DEFAULT_BLENDER },
566
- smudge: { ..._chunk7VOHOPLWcjs.DEFAULT_SMUDGE }
566
+ blender: { ..._chunkTCKIXI46cjs.DEFAULT_BLENDER },
567
+ smudge: { ..._chunkTCKIXI46cjs.DEFAULT_SMUDGE }
567
568
  };
568
569
  var builtin = (init) => ({ ...normalizePaintBrush(init), builtin: true });
569
570
  var BUILTIN_BRUSHES = [
@@ -976,7 +977,7 @@ var DryStroke = (_class5 = class {
976
977
  }
977
978
 
978
979
 
979
- __init12() {this.coverage = new (0, _chunk7VOHOPLWcjs.CoverageMap)()}
980
+ __init12() {this.coverage = new (0, _chunkTCKIXI46cjs.CoverageMap)()}
980
981
  __init13() {this.dabCount = 0}
981
982
 
982
983
 
@@ -1010,11 +1011,11 @@ var DryStroke = (_class5 = class {
1010
1011
  const hardness = this.brush.tip.hardness;
1011
1012
  const grain = this.options.grain;
1012
1013
  for (const d of dabs) {
1013
- const rect = _chunk7VOHOPLWcjs.dabRect.call(void 0, d, hardness);
1014
+ const rect = _chunkTCKIXI46cjs.dabRect.call(void 0, d, hardness);
1014
1015
  const n = rect.width * rect.height;
1015
1016
  if (this.buf.length < n) this.buf = new Float32Array(n);
1016
1017
  const vals = this.buf.subarray(0, n);
1017
- _chunk7VOHOPLWcjs.rasterizeDab.call(void 0, d, hardness, rect, vals);
1018
+ _chunkTCKIXI46cjs.rasterizeDab.call(void 0, d, hardness, rect, vals);
1018
1019
  if (this.depth > 0 && grain) {
1019
1020
  for (let yy = 0, k = 0; yy < rect.height; yy++) {
1020
1021
  const y = rect.y + yy + 0.5;
@@ -1059,7 +1060,7 @@ function mixRgb(a, b, t, mixing) {
1059
1060
  if (mixing === "pigment") {
1060
1061
  const o = [0, 0, 0];
1061
1062
  const q = (v) => Math.round(Math.min(1, Math.max(0, v)) * 255);
1062
- _chunkXIOMMGPDcjs.mixPigment8.call(void 0, q(a[0]), q(a[1]), q(a[2]), q(b[0]), q(b[1]), q(b[2]), t, o);
1063
+ _chunkTFOPHZ3Ucjs.mixPigment8.call(void 0, q(a[0]), q(a[1]), q(a[2]), q(b[0]), q(b[1]), q(b[2]), t, o);
1063
1064
  return [o[0], o[1], o[2]];
1064
1065
  }
1065
1066
  return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
@@ -1091,20 +1092,20 @@ var PaintDabStroke = (_class6 = class {
1091
1092
  this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
1092
1093
  this.copies = _optionalChain([options, 'access', _4 => _4.copies, 'optionalAccess', _5 => _5.length]) ? options.copies : [IDENTITY_COPY];
1093
1094
  const exchanging = brush.engine === "mixer" || brush.engine === "dab";
1094
- const rates = brush.engine === "mixer" ? _chunk7VOHOPLWcjs.mixerRates.call(void 0, brush.mixer) : _chunk7VOHOPLWcjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, 1, brush.behavior.mixing);
1095
+ const rates = brush.engine === "mixer" ? _chunkTCKIXI46cjs.mixerRates.call(void 0, brush.mixer) : _chunkTCKIXI46cjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, 1, brush.behavior.mixing);
1095
1096
  this.mixing = brush.engine === "mixer" ? brush.mixer.mixing : brush.behavior.mixing;
1096
1097
  this.states = this.copies.map((c, i) => ({
1097
1098
  walker: new PenDabWalker(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear),
1098
- exchange: exchanging ? new (0, _chunk7VOHOPLWcjs.PaintExchange)(rates, options.load) : null,
1099
- smudge: brush.engine === "smudge" ? new (0, _chunk7VOHOPLWcjs.SmudgeTip)(brush.smudge, brush.tip.size * (1 + brush.dynamics.tiltSize * 1.5)) : null
1099
+ exchange: exchanging ? new (0, _chunkTCKIXI46cjs.PaintExchange)(rates, options.load) : null,
1100
+ smudge: brush.engine === "smudge" ? new (0, _chunkTCKIXI46cjs.SmudgeTip)(brush.smudge, brush.tip.size * (1 + brush.dynamics.tiltSize * 1.5)) : null
1100
1101
  }));
1101
- this.medium = new (0, _chunk7VOHOPLWcjs.TileMedium)(options.target, brush.engine === "dab" ? { blend: brush.tip.blend } : {});
1102
+ this.medium = new (0, _chunkTCKIXI46cjs.TileMedium)(options.target, brush.engine === "dab" ? { blend: brush.tip.blend } : {});
1102
1103
  this.depth = options.grain && !options.grain.flat ? Math.min(1, Math.max(0, options.paperDepth * brush.grain)) : 0;
1103
- this.coverage = brush.engine === "dab" ? new (0, _chunk7VOHOPLWcjs.CoverageMap)() : null;
1104
+ this.coverage = brush.engine === "dab" ? new (0, _chunkTCKIXI46cjs.CoverageMap)() : null;
1104
1105
  const mc = brush.behavior.multicolor;
1105
1106
  this.palette = exchanging && mc.mode !== "off" ? multiColorPalette(mc, options.color, options.secondary) : null;
1106
1107
  this.gradient = this.palette && mc.mode === "tip" ? multiColorGradient(this.palette, mc.softness, this.mixing) : null;
1107
- this.scratch = brush.engine === "blender" ? _chunk7VOHOPLWcjs.createBlenderScratch.call(void 0, ) : null;
1108
+ this.scratch = brush.engine === "blender" ? _chunkTCKIXI46cjs.createBlenderScratch.call(void 0, ) : null;
1108
1109
  }
1109
1110
 
1110
1111
 
@@ -1159,7 +1160,7 @@ var PaintDabStroke = (_class6 = class {
1159
1160
  }
1160
1161
  paintDabs(copy, dabs, rects) {
1161
1162
  for (const d of dabs) {
1162
- const rect = _chunk7VOHOPLWcjs.dabRect.call(void 0, d, this.brush.tip.hardness);
1163
+ const rect = _chunkTCKIXI46cjs.dabRect.call(void 0, d, this.brush.tip.hardness);
1163
1164
  if (rect.width <= 0 || rect.height <= 0) continue;
1164
1165
  this.dab(copy, d, rect);
1165
1166
  rects.push(rect);
@@ -1175,7 +1176,7 @@ var PaintDabStroke = (_class6 = class {
1175
1176
  }
1176
1177
  const tip = this.tip.subarray(0, n);
1177
1178
  tip.fill(0);
1178
- _chunk7VOHOPLWcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
1179
+ _chunkTCKIXI46cjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
1179
1180
  if (!(this.depth > 0 && this.options.grain)) return { tip, cov: tip };
1180
1181
  const cov = this.cov.subarray(0, n);
1181
1182
  const grain = this.options.grain;
@@ -1190,7 +1191,7 @@ var PaintDabStroke = (_class6 = class {
1190
1191
  const { tip, cov } = this.rasterize(d, rect);
1191
1192
  const st = this.states[copy];
1192
1193
  if (brush.engine === "blender") {
1193
- _chunk7VOHOPLWcjs.blenderDab.call(void 0, this.medium, rect, cov, d.opacity * d.alpha * brush.tip.opacity, d.radius, brush.blender, this.scratch);
1194
+ _chunkTCKIXI46cjs.blenderDab.call(void 0, this.medium, rect, cov, d.opacity * d.alpha * brush.tip.opacity, d.radius, brush.blender, this.scratch);
1194
1195
  return;
1195
1196
  }
1196
1197
  if (brush.engine === "smudge") {
@@ -1281,7 +1282,7 @@ var PaintDabStroke = (_class6 = class {
1281
1282
 
1282
1283
  // src/paint-editor/stroke.ts
1283
1284
  function defaultTile(surface) {
1284
- const data = new Uint8ClampedArray(_chunkXIOMMGPDcjs.TILE * _chunkXIOMMGPDcjs.TILE * surface.channels);
1285
+ const data = new Uint8ClampedArray(_chunkTFOPHZ3Ucjs.TILE * _chunkTFOPHZ3Ucjs.TILE * surface.channels);
1285
1286
  if (surface.defaultValue) data.fill(surface.defaultValue);
1286
1287
  return data;
1287
1288
  }
@@ -1355,9 +1356,9 @@ var PaintStrokeSession = (_class7 = class {
1355
1356
  offset: this.init.offset,
1356
1357
  lockTransparency: this.init.lockTransparency,
1357
1358
  selection: null,
1358
- readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _10 => _10.live, 'access', _11 => _11.get, 'call', _12 => _12(_chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _13 => _13.data]), () => ( null)),
1359
+ readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _10 => _10.live, 'access', _11 => _11.get, 'call', _12 => _12(_chunkTFOPHZ3Ucjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _13 => _13.data]), () => ( null)),
1359
1360
  writeTile: (tx, ty) => {
1360
- const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty);
1361
+ const key = _chunkTFOPHZ3Ucjs.tileKey.call(void 0, tx, ty);
1361
1362
  if (!this.touched.has(key)) {
1362
1363
  const src = _nullishCoalesce(_optionalChain([this, 'access', _14 => _14.base, 'access', _15 => _15.tiles, 'access', _16 => _16.get, 'call', _17 => _17(key), 'optionalAccess', _18 => _18.data]), () => ( defaultTile(this.base)));
1363
1364
  this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
@@ -1387,14 +1388,14 @@ var PaintStrokeSession = (_class7 = class {
1387
1388
  if (!this.dry) {
1388
1389
  for (const key of this.fresh) this.live.set(key, { data: this.live.get(key).data, uniform: null });
1389
1390
  this.fresh.clear();
1390
- this.host.update(this.layerId, new (0, _chunkXIOMMGPDcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
1391
+ this.host.update(this.layerId, new (0, _chunkTFOPHZ3Ucjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
1391
1392
  return;
1392
1393
  }
1393
1394
  const off = this.init.offset;
1394
1395
  const regions = /* @__PURE__ */ new Map();
1395
1396
  for (const r of rects) {
1396
- for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, { x: r.x - off.x, y: r.y - off.y, width: r.width, height: r.height })) {
1397
- const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, t.tx, t.ty);
1397
+ for (const t of _chunkTFOPHZ3Ucjs.tilesInRect.call(void 0, { x: r.x - off.x, y: r.y - off.y, width: r.width, height: r.height })) {
1398
+ const key = _chunkTFOPHZ3Ucjs.tileKey.call(void 0, t.tx, t.ty);
1398
1399
  const cur = regions.get(key);
1399
1400
  regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? union(cur.r, r) : r });
1400
1401
  }
@@ -1403,10 +1404,10 @@ var PaintStrokeSession = (_class7 = class {
1403
1404
  const src = _nullishCoalesce(_optionalChain([this, 'access', _19 => _19.base, 'access', _20 => _20.tiles, 'access', _21 => _21.get, 'call', _22 => _22(key), 'optionalAccess', _23 => _23.data]), () => ( defaultTile(this.base)));
1404
1405
  const prev = this.touched.has(key) ? _optionalChain([this, 'access', _24 => _24.live, 'access', _25 => _25.get, 'call', _26 => _26(key), 'optionalAccess', _27 => _27.data]) : void 0;
1405
1406
  this.touched.add(key);
1406
- const data = _chunk7VOHOPLWcjs.applyStrokeToTile.call(void 0, this.dry.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
1407
+ const data = _chunkTCKIXI46cjs.applyStrokeToTile.call(void 0, this.dry.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
1407
1408
  this.live.set(key, { data, uniform: null });
1408
1409
  }
1409
- this.host.update(this.layerId, new (0, _chunkXIOMMGPDcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
1410
+ this.host.update(this.layerId, new (0, _chunkTFOPHZ3Ucjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
1410
1411
  }
1411
1412
  /** Ends the stroke (one undo step) and returns what changed. */
1412
1413
  end() {
@@ -1417,17 +1418,17 @@ var PaintStrokeSession = (_class7 = class {
1417
1418
  const tiles = new Map(this.base.tiles);
1418
1419
  let changed = false;
1419
1420
  for (const key of this.touched) {
1420
- const tile = _chunkXIOMMGPDcjs.finishTile.call(void 0, this.live.get(key).data, ch, this.base.defaultValue);
1421
+ const tile = _chunkTFOPHZ3Ucjs.finishTile.call(void 0, this.live.get(key).data, ch, this.base.defaultValue);
1421
1422
  const prev = this.base.tiles.get(key);
1422
1423
  if (tile) tiles.set(key, tile);
1423
1424
  else tiles.delete(key);
1424
1425
  if (!sameTile(prev, tile)) changed = true;
1425
1426
  }
1426
- const surface = changed ? new (0, _chunkXIOMMGPDcjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
1427
+ const surface = changed ? new (0, _chunkTFOPHZ3Ucjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
1427
1428
  const dabs = this.dry ? this.dry.dabCount : this.wet.dabCount;
1428
1429
  this.result = { layerId: this.layerId, bounds: changed ? this.bounds : null, dabs, strokeId: null };
1429
1430
  const carried = _optionalChain([this, 'access', _28 => _28.wet, 'optionalAccess', _29 => _29.load]);
1430
- if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried : _chunk7VOHOPLWcjs.cleanMixer.call(void 0, carried);
1431
+ if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried : _chunkTCKIXI46cjs.cleanMixer.call(void 0, carried);
1431
1432
  this.host.commit(this, surface, false);
1432
1433
  return this.result;
1433
1434
  }
@@ -1440,13 +1441,13 @@ var PaintStrokeSession = (_class7 = class {
1440
1441
  }, _class7);
1441
1442
  function mixerLoadForStroke(brush, current, color) {
1442
1443
  if (!brush.loadsColor) return { reservoir: null, amount: 0, pickup: brush.mixer.cleanEachStroke ? null : current.pickup };
1443
- if (brush.mixer.loadEachStroke || !current.reservoir) return _chunk7VOHOPLWcjs.loadMixer.call(void 0, current, color);
1444
+ if (brush.mixer.loadEachStroke || !current.reservoir) return _chunkTCKIXI46cjs.loadMixer.call(void 0, current, color);
1444
1445
  return current;
1445
1446
  }
1446
1447
  function brushLoadForStroke(brush, current, color) {
1447
1448
  if (brush.engine === "mixer") return mixerLoadForStroke(brush, current, color);
1448
1449
  if (usesPaintExchange(brush)) return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
1449
- return _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD;
1450
+ return _chunkTCKIXI46cjs.EMPTY_MIXER_LOAD;
1450
1451
  }
1451
1452
 
1452
1453
  // src/paint-editor/strokes.ts
@@ -1625,7 +1626,7 @@ var PROFILE = {
1625
1626
  }
1626
1627
  };
1627
1628
  function createPaintCompositor() {
1628
- return new (0, _chunkPOGBUYWEcjs.RasterCompositor)(PROFILE);
1629
+ return new (0, _chunkST7E3NEEcjs.RasterCompositor)(PROFILE);
1629
1630
  }
1630
1631
  function downsampleRgba(data, width, height, tw, th) {
1631
1632
  tw = Math.max(1, Math.round(tw));
@@ -1697,11 +1698,11 @@ function header(state, options) {
1697
1698
  return out;
1698
1699
  }
1699
1700
  function serializePaintDocument(state, options = {}) {
1700
- const { layers, assets } = _chunkYGIMK4NXcjs.serializeLayers.call(void 0, state.layers);
1701
+ const { layers, assets } = _chunk5OVJHMZQcjs.serializeLayers.call(void 0, state.layers);
1701
1702
  return { ...header(state, options), layers, assets };
1702
1703
  }
1703
1704
  async function serializePaintDocumentExternal(state, store, options = {}) {
1704
- const { layers, assets } = await _chunkYGIMK4NXcjs.serializeLayersExternal.call(void 0, state.layers, store);
1705
+ const { layers, assets } = await _chunk5OVJHMZQcjs.serializeLayersExternal.call(void 0, state.layers, store);
1705
1706
  return { ...header(state, options), layers, assets };
1706
1707
  }
1707
1708
  function paintLayersOnly(layers, problems) {
@@ -1738,16 +1739,16 @@ function deserializePaintDocument(raw) {
1738
1739
  const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
1739
1740
  const paper = normalizePaper(_nullishCoalesce(r.paper, () => ( {})));
1740
1741
  const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
1741
- const layers = paintLayersOnly(_chunkYGIMK4NXcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1742
+ const layers = paintLayersOnly(_chunk5OVJHMZQcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
1742
1743
  const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
1743
- const activeLayerId = wanted && _chunkPOGBUYWEcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers), 'access', _33 => _33.filter, 'call', _34 => _34((l) => l.type === "pixel"), 'access', _35 => _35.pop, 'call', _36 => _36(), 'optionalAccess', _37 => _37.id]), () => ( null));
1744
+ const activeLayerId = wanted && _chunkST7E3NEEcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkST7E3NEEcjs.flattenLayers.call(void 0, layers), 'access', _33 => _33.filter, 'call', _34 => _34((l) => l.type === "pixel"), 'access', _35 => _35.pop, 'call', _36 => _36(), 'optionalAccess', _37 => _37.id]), () => ( null));
1744
1745
  return { state: { canvas, paper, layers, activeLayerId, strokes: readStrokes(r.strokes, problems) }, extensions: documentExtensions(r), guides: r.guides, swatches: r.swatches, mixingPad: r.mixingPad, problems };
1745
1746
  }
1746
1747
  async function deserializePaintDocumentAsync(raw, store) {
1747
1748
  if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
1748
1749
  const r = raw;
1749
1750
  const problems = [];
1750
- const assets = await _chunkYGIMK4NXcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1751
+ const assets = await _chunk5OVJHMZQcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
1751
1752
  const loaded = deserializePaintDocument({ ...r, assets });
1752
1753
  return { ...loaded, problems: [...problems, ...loaded.problems] };
1753
1754
  }
@@ -1926,7 +1927,7 @@ function paintTestStroke(surface, brush, paper, color, width, height) {
1926
1927
  colorHex: color,
1927
1928
  affineCopies: [],
1928
1929
  copies: [IDENTITY_COPY],
1929
- mixerLoad: brushLoadForStroke(brush, _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255])
1930
+ mixerLoad: brushLoadForStroke(brush, _chunkTCKIXI46cjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255])
1930
1931
  }
1931
1932
  );
1932
1933
  session.push(thumbnailStroke(width, height));
@@ -1939,13 +1940,13 @@ function renderBrushThumbnail(brush, options) {
1939
1940
  const maxSize = height * 0.42;
1940
1941
  const b = brush.tip.size > maxSize ? normalizePaintBrush({ tip: { ...brush.tip, size: maxSize } }, brush) : brush;
1941
1942
  const rgba = [...hexToRgb8(options.color), 255];
1942
- let surface = _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4);
1943
+ let surface = _chunkTFOPHZ3Ucjs.emptySurface.call(void 0, 4);
1943
1944
  if (b.engine === "eraser") {
1944
- surface = _chunkXIOMMGPDcjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height }, rgba);
1945
+ surface = _chunkTFOPHZ3Ucjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height }, rgba);
1945
1946
  } else if (b.engine === "blender" || b.engine === "smudge" || b.engine === "mixer" && !b.loadsColor || b.behavior.pickup > 0) {
1946
1947
  const half = Math.ceil(height / 2);
1947
- surface = _chunkXIOMMGPDcjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height: half }, rgba);
1948
- surface = _chunkXIOMMGPDcjs.fillRect.call(void 0, surface, { x: 0, y: half, width, height: height - half }, [232, 196, 64, 255]);
1948
+ surface = _chunkTFOPHZ3Ucjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height: half }, rgba);
1949
+ surface = _chunkTFOPHZ3Ucjs.fillRect.call(void 0, surface, { x: 0, y: half, width, height: height - half }, [232, 196, 64, 255]);
1949
1950
  }
1950
1951
  surface = paintTestStroke(surface, b, options.paper, options.color, width, height);
1951
1952
  const layer = { type: "pixel", id: "thumbnail", name: "thumbnail", visible: true, opacity: 1, blend: "normal", surface, offset: { x: 0, y: 0 } };
@@ -2281,7 +2282,7 @@ var PAD_BLOB = normalizePaintBrush({
2281
2282
  var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.call(this);_class9.prototype.__init37.call(this);_class9.prototype.__init38.call(this);_class9.prototype.__init39.call(this); }
2282
2283
  __init36() {this.width = MIXING_PAD_WIDTH}
2283
2284
  __init37() {this.height = MIXING_PAD_HEIGHT}
2284
- __init38() {this.surface = _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4)}
2285
+ __init38() {this.surface = _chunkTFOPHZ3Ucjs.emptySurface.call(void 0, 4)}
2285
2286
  /** Increments on every change (for redrawing). */
2286
2287
  __init39() {this.version = 0}
2287
2288
  /** Paints (`paint`, with `color`) or smears (`knife`) through `points` in pad pixels. */
@@ -2317,7 +2318,7 @@ var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.cal
2317
2318
  colorHex: color,
2318
2319
  affineCopies: [],
2319
2320
  copies: [IDENTITY_COPY],
2320
- mixerLoad: brushLoadForStroke(brush, _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255])
2321
+ mixerLoad: brushLoadForStroke(brush, _chunkTCKIXI46cjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255])
2321
2322
  }
2322
2323
  );
2323
2324
  session.push(points);
@@ -2336,7 +2337,7 @@ var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.cal
2336
2337
  const y0 = Math.max(0, Math.floor(y) - r);
2337
2338
  const x1 = Math.min(this.width, Math.floor(x) + r + 1);
2338
2339
  const y1 = Math.min(this.height, Math.floor(y) + r + 1);
2339
- const px = _chunkXIOMMGPDcjs.readRegion.call(void 0, this.surface, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 });
2340
+ const px = _chunkTFOPHZ3Ucjs.readRegion.call(void 0, this.surface, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 });
2340
2341
  let R = 0;
2341
2342
  let G = 0;
2342
2343
  let B = 0;
@@ -2353,7 +2354,7 @@ var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.cal
2353
2354
  return `#${hex(R)}${hex(G)}${hex(B)}`;
2354
2355
  }
2355
2356
  clear() {
2356
- this.surface = _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4);
2357
+ this.surface = _chunkTFOPHZ3Ucjs.emptySurface.call(void 0, 4);
2357
2358
  this.version++;
2358
2359
  }
2359
2360
  /**
@@ -2383,7 +2384,7 @@ var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.cal
2383
2384
  throw new Error(`A pile of radius ${R} at (${cx}, ${cy}) does not fit on the ${this.width}\xD7${this.height} pad; move it at least ${R} px from every edge or use a smaller radius.`);
2384
2385
  }
2385
2386
  const bounds = { x: Math.floor(cx - R), y: Math.floor(cy - R), width: Math.ceil(2 * R), height: Math.ceil(2 * R) };
2386
- if (options.clear !== false) this.surface = _chunkXIOMMGPDcjs.writeRegion.call(void 0, this.surface, bounds, new Uint8ClampedArray(bounds.width * bounds.height * 4));
2387
+ if (options.clear !== false) this.surface = _chunkTFOPHZ3Ucjs.writeRegion.call(void 0, this.surface, bounds, new Uint8ClampedArray(bounds.width * bounds.height * 4));
2387
2388
  const used = paints.filter((p) => p.parts > 0);
2388
2389
  const area = Math.PI * (0.7 * R) ** 2;
2389
2390
  used.forEach((p, i) => {
@@ -2406,7 +2407,7 @@ var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.cal
2406
2407
  }
2407
2408
  this.run(knife, stir, "#000000");
2408
2409
  }
2409
- const mixed = _chunkXIOMMGPDcjs.mixPigments.call(void 0,
2410
+ const mixed = _chunkTFOPHZ3Ucjs.mixPigments.call(void 0,
2410
2411
  paints.map((p) => hexToRgb8(p.color).map((v) => v / 255)),
2411
2412
  paints.map((p) => p.parts)
2412
2413
  );
@@ -2417,15 +2418,15 @@ var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.cal
2417
2418
  }
2418
2419
  /** The pad's pixels as a PNG data URL (with alpha), for saving. */
2419
2420
  toPng() {
2420
- return _chunkPOGBUYWEcjs.pngDataUrl.call(void 0, this.width, this.height, _chunkXIOMMGPDcjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height }));
2421
+ return _chunkST7E3NEEcjs.pngDataUrl.call(void 0, this.width, this.height, _chunkTFOPHZ3Ucjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height }));
2421
2422
  }
2422
2423
  /** Replaces the pad with a PNG (data URL or base64) of the pad's size, as `toPng` writes. */
2423
2424
  fromPng(png) {
2424
- const bytes = png.startsWith("data:") ? _optionalChain([_chunkPOGBUYWEcjs.parseDataUrl.call(void 0, png), 'optionalAccess', _40 => _40.bytes]) : _chunkPOGBUYWEcjs.base64ToBytes.call(void 0, png);
2425
- if (!bytes || !_chunkPOGBUYWEcjs.isPng.call(void 0, bytes)) throw new Error("The pad image is not a PNG data URL or base64 PNG.");
2426
- const img = _chunkPOGBUYWEcjs.decodePng.call(void 0, bytes);
2425
+ const bytes = png.startsWith("data:") ? _optionalChain([_chunkST7E3NEEcjs.parseDataUrl.call(void 0, png), 'optionalAccess', _40 => _40.bytes]) : _chunkST7E3NEEcjs.base64ToBytes.call(void 0, png);
2426
+ if (!bytes || !_chunkST7E3NEEcjs.isPng.call(void 0, bytes)) throw new Error("The pad image is not a PNG data URL or base64 PNG.");
2427
+ const img = _chunkST7E3NEEcjs.decodePng.call(void 0, bytes);
2427
2428
  if (img.width !== this.width || img.height !== this.height) throw new Error(`The pad image is ${img.width}\xD7${img.height}; a mixing pad is ${this.width}\xD7${this.height}.`);
2428
- this.surface = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: img.width, height: img.height, data: img.data }, 4);
2429
+ this.surface = _chunkTFOPHZ3Ucjs.surfaceFromPixels.call(void 0, { width: img.width, height: img.height, data: img.data }, 4);
2429
2430
  this.version++;
2430
2431
  }
2431
2432
  /** Whether nothing is on the pad. */
@@ -2434,7 +2435,7 @@ var MixingPad = (_class9 = class {constructor() { _class9.prototype.__init36.cal
2434
2435
  }
2435
2436
  /** The pad over white, `width × height` RGBA. */
2436
2437
  pixels() {
2437
- const px = _chunkXIOMMGPDcjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height });
2438
+ const px = _chunkTFOPHZ3Ucjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height });
2438
2439
  for (let i = 0; i < px.length; i += 4) {
2439
2440
  const a = px[i + 3] / 255;
2440
2441
  px[i] = Math.round(px[i] * a + 255 * (1 - a));
@@ -2485,7 +2486,7 @@ var PaintEditorController = (_class10 = class {
2485
2486
  __init43() {this.library = null}
2486
2487
 
2487
2488
  __init44() {this.secondaryColor = "#ffffff"}
2488
- __init45() {this.mixerLoad = _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD}
2489
+ __init45() {this.mixerLoad = _chunkTCKIXI46cjs.EMPTY_MIXER_LOAD}
2489
2490
  __init46() {this.view = { ...DEFAULT_VIEW, pan: { ...DEFAULT_VIEW.pan } }}
2490
2491
 
2491
2492
 
@@ -2658,7 +2659,7 @@ var PaintEditorController = (_class10 = class {
2658
2659
  }
2659
2660
  // --- Layers --------------------------------------------------------------------
2660
2661
  getLayer(id) {
2661
- return _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _44 => _44.layer]);
2662
+ return _optionalChain([_chunkST7E3NEEcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _44 => _44.layer]);
2662
2663
  }
2663
2664
  /** The active pixel layer (or `undefined`). */
2664
2665
  getActiveLayer() {
@@ -2677,12 +2678,12 @@ var PaintEditorController = (_class10 = class {
2677
2678
  walk(this.doc.layers, null, 0);
2678
2679
  return out;
2679
2680
  }
2680
- describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _45 => _45.parent, 'optionalAccess', _46 => _46.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _47 => _47.path, 'access', _48 => _48.length]), () => ( 0))) {
2681
+ describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkST7E3NEEcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _45 => _45.parent, 'optionalAccess', _46 => _46.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkST7E3NEEcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _47 => _47.path, 'access', _48 => _48.length]), () => ( 0))) {
2681
2682
  let bounds = null;
2682
2683
  if (l.type === "pixel") {
2683
- const b = _chunkXIOMMGPDcjs.contentBounds.call(void 0, l.surface);
2684
+ const b = _chunkTFOPHZ3Ucjs.contentBounds.call(void 0, l.surface);
2684
2685
  bounds = b ? { ...b, x: b.x + l.offset.x, y: b.y + l.offset.y } : null;
2685
- } else for (const c of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, l.children)) if (c.type === "pixel") bounds = unionRect(bounds, this.describeLayer(c, l.id, depth + 1).bounds);
2686
+ } else for (const c of _chunkST7E3NEEcjs.flattenLayers.call(void 0, l.children)) if (c.type === "pixel") bounds = unionRect(bounds, this.describeLayer(c, l.id, depth + 1).bounds);
2686
2687
  return {
2687
2688
  id: l.id,
2688
2689
  name: l.name,
@@ -2709,7 +2710,7 @@ var PaintEditorController = (_class10 = class {
2709
2710
  if (!id) throw new PaintEditorError(`There is no active layer to ${what}; add one with add_layer.`);
2710
2711
  const l = this.requireLayer(id);
2711
2712
  if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; ${what} a pixel layer inside it.`);
2712
- if (_chunkPOGBUYWEcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) before you ${what} it.`);
2713
+ if (_chunkST7E3NEEcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) before you ${what} it.`);
2713
2714
  if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) before you ${what} it.`);
2714
2715
  return l;
2715
2716
  }
@@ -2722,7 +2723,7 @@ var PaintEditorController = (_class10 = class {
2722
2723
  /** Adds an empty pixel layer or group above `aboveId` (default: the active layer) and makes it active. */
2723
2724
  addLayer(options = {}) {
2724
2725
  this.requireIdle("adding a layer");
2725
- const count = _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.doc.layers).length;
2726
+ const count = _chunkST7E3NEEcjs.flattenLayers.call(void 0, this.doc.layers).length;
2726
2727
  const type = _nullishCoalesce(options.type, () => ( "pixel"));
2727
2728
  const name = _optionalChain([options, 'access', _49 => _49.name, 'optionalAccess', _50 => _50.trim, 'call', _51 => _51()]) || (type === "group" ? `Group ${count + 1}` : `Layer ${count + 1}`);
2728
2729
  const layer = type === "group" ? { type: "group", id: newPaintLayerId(), name, visible: true, opacity: 1, blend: "pass-through", children: [] } : createPaintLayer(name);
@@ -2734,21 +2735,21 @@ var PaintEditorController = (_class10 = class {
2734
2735
  if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
2735
2736
  parentId = g.id;
2736
2737
  } else if (above) {
2737
- const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.doc.layers, above);
2738
+ const loc = _chunkST7E3NEEcjs.findLayer.call(void 0, this.doc.layers, above);
2738
2739
  if (!loc) throw new PaintEditorError(`Unknown layer "${above}". Call list_layers for the ids.`);
2739
2740
  parentId = _nullishCoalesce(_optionalChain([loc, 'access', _52 => _52.parent, 'optionalAccess', _53 => _53.id]), () => ( null));
2740
2741
  index = loc.index + 1;
2741
2742
  }
2742
- const layers = _chunkPOGBUYWEcjs.insertLayer.call(void 0, this.doc.layers, layer, parentId, index);
2743
+ const layers = _chunkST7E3NEEcjs.insertLayer.call(void 0, this.doc.layers, layer, parentId, index);
2743
2744
  this.commit(type === "group" ? "Add group" : "Add layer", { ...this.doc, layers, activeLayerId: layer.id });
2744
2745
  return this.describeLayer(layer);
2745
2746
  }
2746
2747
  updateLayer(id, update) {
2747
2748
  this.requireIdle("changing a layer");
2748
2749
  const l = this.requireLayer(id);
2749
- if (_chunkPOGBUYWEcjs.isLayerLocked.call(void 0, l, "all") && Object.keys(update).some((k) => k !== "locks")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it first (locks {all: false}).`);
2750
+ if (_chunkST7E3NEEcjs.isLayerLocked.call(void 0, l, "all") && Object.keys(update).some((k) => k !== "locks")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it first (locks {all: false}).`);
2750
2751
  if (update.opacity !== void 0 && !(update.opacity >= 0 && update.opacity <= 1)) throw new PaintEditorError(`opacity ${update.opacity} is out of range; use 0..1.`);
2751
- if (update.blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, update.blend) && !(l.type === "group" && update.blend === "pass-through")) {
2752
+ if (update.blend !== void 0 && !_chunkTFOPHZ3Ucjs.isBlendMode.call(void 0, update.blend) && !(l.type === "group" && update.blend === "pass-through")) {
2752
2753
  throw new PaintEditorError(`Unknown blend mode "${update.blend}". Call get_canvas_info for the blend modes.`);
2753
2754
  }
2754
2755
  if (update.name !== void 0 && !update.name.trim()) throw new PaintEditorError("name is empty; give the layer a name.");
@@ -2762,66 +2763,66 @@ var PaintEditorController = (_class10 = class {
2762
2763
  const locks = { ..._nullishCoalesce(l.locks, () => ( {})), ...update.locks };
2763
2764
  next.locks = Object.values(locks).some(Boolean) ? locks : void 0;
2764
2765
  }
2765
- this.commit("Layer properties", { ...this.doc, layers: _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, id, () => next) });
2766
+ this.commit("Layer properties", { ...this.doc, layers: _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, id, () => next) });
2766
2767
  return this.describeLayer(next);
2767
2768
  }
2768
2769
  removeLayer(id) {
2769
2770
  this.requireIdle("removing a layer");
2770
2771
  const l = this.requireLayer(id);
2771
- if (_chunkPOGBUYWEcjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it before removing it.`);
2772
- const layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
2772
+ if (_chunkST7E3NEEcjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it before removing it.`);
2773
+ const layers = _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
2773
2774
  let active = this.doc.activeLayerId;
2774
- if (active && !_chunkPOGBUYWEcjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers), 'access', _54 => _54.filter, 'call', _55 => _55((x) => x.type === "pixel"), 'access', _56 => _56.pop, 'call', _57 => _57(), 'optionalAccess', _58 => _58.id]), () => ( null));
2775
+ if (active && !_chunkST7E3NEEcjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkST7E3NEEcjs.flattenLayers.call(void 0, layers), 'access', _54 => _54.filter, 'call', _55 => _55((x) => x.type === "pixel"), 'access', _56 => _56.pop, 'call', _57 => _57(), 'optionalAccess', _58 => _58.id]), () => ( null));
2775
2776
  this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active });
2776
2777
  return { removed: id, activeLayerId: active };
2777
2778
  }
2778
2779
  duplicateLayer(id) {
2779
2780
  this.requireIdle("duplicating a layer");
2780
- const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.doc.layers, id);
2781
+ const loc = _chunkST7E3NEEcjs.findLayer.call(void 0, this.doc.layers, id);
2781
2782
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
2782
2783
  const copy = (l) => l.type === "group" ? { ...l, id: newPaintLayerId(), children: l.children.map(copy) } : { ...l, id: newPaintLayerId() };
2783
2784
  const dup = { ...copy(loc.layer), name: `${loc.layer.name} copy` };
2784
- const layers = _chunkPOGBUYWEcjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _59 => _59.parent, 'optionalAccess', _60 => _60.id]), () => ( null)), loc.index + 1);
2785
+ const layers = _chunkST7E3NEEcjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _59 => _59.parent, 'optionalAccess', _60 => _60.id]), () => ( null)), loc.index + 1);
2785
2786
  this.commit("Duplicate layer", { ...this.doc, layers, activeLayerId: dup.id });
2786
2787
  return this.describeLayer(dup);
2787
2788
  }
2788
2789
  /** Moves a layer to `index` (0 = bottom) within `parentId` (default its own parent; `null` = top level). */
2789
2790
  moveLayer(id, index, parentId) {
2790
2791
  this.requireIdle("moving a layer");
2791
- const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.doc.layers, id);
2792
+ const loc = _chunkST7E3NEEcjs.findLayer.call(void 0, this.doc.layers, id);
2792
2793
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
2793
2794
  const target = parentId === void 0 ? _nullishCoalesce(_optionalChain([loc, 'access', _61 => _61.parent, 'optionalAccess', _62 => _62.id]), () => ( null)) : parentId;
2794
2795
  if (target) {
2795
2796
  const g = this.requireLayer(target);
2796
2797
  if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
2797
- if (target === id || loc.layer.type === "group" && _chunkPOGBUYWEcjs.findLayer.call(void 0, loc.layer.children, target)) throw new PaintEditorError("A group cannot move into itself.");
2798
+ if (target === id || loc.layer.type === "group" && _chunkST7E3NEEcjs.findLayer.call(void 0, loc.layer.children, target)) throw new PaintEditorError("A group cannot move into itself.");
2798
2799
  }
2799
- const without = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
2800
- const siblings = target ? _chunkPOGBUYWEcjs.findLayer.call(void 0, without, target).layer.children : without;
2800
+ const without = _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
2801
+ const siblings = target ? _chunkST7E3NEEcjs.findLayer.call(void 0, without, target).layer.children : without;
2801
2802
  if (!Number.isInteger(index) || index < 0 || index > siblings.length) throw new PaintEditorError(`index ${index} is out of range; use 0..${siblings.length} (0 is the bottom).`);
2802
- const layers = _chunkPOGBUYWEcjs.insertLayer.call(void 0, without, loc.layer, target, index);
2803
+ const layers = _chunkST7E3NEEcjs.insertLayer.call(void 0, without, loc.layer, target, index);
2803
2804
  this.commit("Move layer", { ...this.doc, layers });
2804
2805
  return this.describeLayer(loc.layer);
2805
2806
  }
2806
2807
  /** Merges a pixel layer into the pixel layer below it (keeping the lower one's settings). */
2807
2808
  mergeDown(id) {
2808
2809
  this.requireIdle("merging");
2809
- const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.doc.layers, id);
2810
+ const loc = _chunkST7E3NEEcjs.findLayer.call(void 0, this.doc.layers, id);
2810
2811
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
2811
2812
  const siblings = loc.parent ? loc.parent.children : this.doc.layers;
2812
2813
  const below = siblings[loc.index - 1];
2813
2814
  const upper = loc.layer;
2814
2815
  if (!isPixelLayer(upper) || !isPixelLayer(below)) throw new PaintEditorError("Merge down needs a pixel layer directly above another pixel layer in the same group.");
2815
- if (_chunkPOGBUYWEcjs.isLayerLocked.call(void 0, below, "pixels")) throw new PaintEditorError(`Layer "${below.name}" has its pixels locked; unlock it to merge into it.`);
2816
+ if (_chunkST7E3NEEcjs.isLayerLocked.call(void 0, below, "pixels")) throw new PaintEditorError(`Layer "${below.name}" has its pixels locked; unlock it to merge into it.`);
2816
2817
  const rect = unionRect(this.describeLayer(below).bounds, this.describeLayer(upper).bounds);
2817
- let surface = _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4);
2818
+ let surface = _chunkTFOPHZ3Ucjs.emptySurface.call(void 0, 4);
2818
2819
  if (rect) {
2819
2820
  const base = { ...below, opacity: 1, blend: "normal", visible: true, clipped: void 0, mask: void 0 };
2820
2821
  const px = createPaintCompositor().composite([base, upper.visible ? upper : { ...upper, opacity: 0 }], rect, this.sources());
2821
- surface = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data: px }, 4, rect.x, rect.y);
2822
+ surface = _chunkTFOPHZ3Ucjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data: px }, 4, rect.x, rect.y);
2822
2823
  }
2823
2824
  const merged = { ...below, surface, offset: { x: 0, y: 0 } };
2824
- const layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, upper.id, () => null), below.id, () => merged);
2825
+ const layers = _chunkST7E3NEEcjs.mapLayer.call(void 0, _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, upper.id, () => null), below.id, () => merged);
2825
2826
  this.commit("Merge down", { ...this.doc, layers, activeLayerId: below.id });
2826
2827
  return this.describeLayer(merged);
2827
2828
  }
@@ -2830,7 +2831,7 @@ var PaintEditorController = (_class10 = class {
2830
2831
  this.requireIdle("clearing");
2831
2832
  const l = this.paintTarget(layerId, "clear");
2832
2833
  const bounds = this.describeLayer(l).bounds;
2833
- this.commit("Clear layer", { ...this.doc, layers: _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface: _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4) })) });
2834
+ this.commit("Clear layer", { ...this.doc, layers: _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface: _chunkTFOPHZ3Ucjs.emptySurface.call(void 0, 4) })) });
2834
2835
  return { layerId: l.id, bounds };
2835
2836
  }
2836
2837
  /**
@@ -2847,14 +2848,14 @@ var PaintEditorController = (_class10 = class {
2847
2848
  if (!(grainAmount >= 0 && grainAmount <= 1)) throw new PaintEditorError(`grain ${grainAmount} is out of range; use 0..1.`);
2848
2849
  const pressure = _nullishCoalesce(options.pressure, () => ( 0.5));
2849
2850
  const blend = _nullishCoalesce(options.blend, () => ( "normal"));
2850
- if (!_chunkXIOMMGPDcjs.isBlendMode.call(void 0, blend)) throw new PaintEditorError(`Unknown blend mode "${blend}".`);
2851
+ if (!_chunkTFOPHZ3Ucjs.isBlendMode.call(void 0, blend)) throw new PaintEditorError(`Unknown blend mode "${blend}".`);
2851
2852
  const { width, height } = this.doc.canvas;
2852
2853
  const rect = { x: 0, y: 0, width, height };
2853
- const coverage = new (0, _chunk7VOHOPLWcjs.CoverageMap)();
2854
+ const coverage = new (0, _chunkTCKIXI46cjs.CoverageMap)();
2854
2855
  const depth = grainAmount * this.doc.paper.depth;
2855
2856
  const grain = depth > 0 ? paperGrain(this.doc.paper) : null;
2856
- for (const { tx, ty } of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, rect)) {
2857
- const r = { x: tx * _chunkXIOMMGPDcjs.TILE, y: ty * _chunkXIOMMGPDcjs.TILE, width: Math.min(_chunkXIOMMGPDcjs.TILE, width - tx * _chunkXIOMMGPDcjs.TILE), height: Math.min(_chunkXIOMMGPDcjs.TILE, height - ty * _chunkXIOMMGPDcjs.TILE) };
2857
+ for (const { tx, ty } of _chunkTFOPHZ3Ucjs.tilesInRect.call(void 0, rect)) {
2858
+ const r = { x: tx * _chunkTFOPHZ3Ucjs.TILE, y: ty * _chunkTFOPHZ3Ucjs.TILE, width: Math.min(_chunkTFOPHZ3Ucjs.TILE, width - tx * _chunkTFOPHZ3Ucjs.TILE), height: Math.min(_chunkTFOPHZ3Ucjs.TILE, height - ty * _chunkTFOPHZ3Ucjs.TILE) };
2858
2859
  const vals = new Float32Array(r.width * r.height);
2859
2860
  for (let y = 0, k = 0; y < r.height; y++) for (let x = 0; x < r.width; x++, k++) vals[k] = grain ? grainCatch(grain.at(r.x + x + 0.5, r.y + y + 0.5), depth, pressure) : 1;
2860
2861
  coverage.accumulate(r, vals, 1);
@@ -2865,25 +2866,25 @@ var PaintEditorController = (_class10 = class {
2865
2866
  background: rgbaOf(this.doc.paper.color),
2866
2867
  opacity,
2867
2868
  blend,
2868
- lockTransparency: _chunkPOGBUYWEcjs.isLayerLocked.call(void 0, l, "transparency"),
2869
+ lockTransparency: _chunkST7E3NEEcjs.isLayerLocked.call(void 0, l, "transparency"),
2869
2870
  selection: null,
2870
2871
  offset: l.offset
2871
2872
  };
2872
2873
  const surface = this.applyCoverage(l, coverage, rect, apply);
2873
- this.commit("Fill layer", { ...this.doc, layers: _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })) });
2874
+ this.commit("Fill layer", { ...this.doc, layers: _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })) });
2874
2875
  return { layerId: l.id, bounds: rect };
2875
2876
  }
2876
2877
  applyCoverage(l, coverage, rect, apply) {
2877
2878
  const base = l.surface;
2878
2879
  const tiles = new Map(base.tiles);
2879
- for (const { tx, ty } of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, { x: rect.x - l.offset.x, y: rect.y - l.offset.y, width: rect.width, height: rect.height })) {
2880
- const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty);
2881
- const src = _nullishCoalesce(_optionalChain([base, 'access', _63 => _63.tiles, 'access', _64 => _64.get, 'call', _65 => _65(key), 'optionalAccess', _66 => _66.data]), () => ( new Uint8ClampedArray(_chunkXIOMMGPDcjs.TILE * _chunkXIOMMGPDcjs.TILE * 4)));
2882
- const tile = _chunkXIOMMGPDcjs.finishTile.call(void 0, _chunk7VOHOPLWcjs.applyStrokeToTile.call(void 0, coverage, src, 4, tx, ty, apply), 4, 0);
2880
+ for (const { tx, ty } of _chunkTFOPHZ3Ucjs.tilesInRect.call(void 0, { x: rect.x - l.offset.x, y: rect.y - l.offset.y, width: rect.width, height: rect.height })) {
2881
+ const key = _chunkTFOPHZ3Ucjs.tileKey.call(void 0, tx, ty);
2882
+ const src = _nullishCoalesce(_optionalChain([base, 'access', _63 => _63.tiles, 'access', _64 => _64.get, 'call', _65 => _65(key), 'optionalAccess', _66 => _66.data]), () => ( new Uint8ClampedArray(_chunkTFOPHZ3Ucjs.TILE * _chunkTFOPHZ3Ucjs.TILE * 4)));
2883
+ const tile = _chunkTFOPHZ3Ucjs.finishTile.call(void 0, _chunkTCKIXI46cjs.applyStrokeToTile.call(void 0, coverage, src, 4, tx, ty, apply), 4, 0);
2883
2884
  if (tile) tiles.set(key, tile);
2884
2885
  else tiles.delete(key);
2885
2886
  }
2886
- return new (0, _chunkXIOMMGPDcjs.TiledSurface)(4, tiles, 0);
2887
+ return new (0, _chunkTFOPHZ3Ucjs.TiledSurface)(4, tiles, 0);
2887
2888
  }
2888
2889
  // --- Brushes -------------------------------------------------------------------
2889
2890
  findBrush(id) {
@@ -3008,7 +3009,7 @@ var PaintEditorController = (_class10 = class {
3008
3009
  if (options.layerId !== void 0) {
3009
3010
  const l = this.requireLayer(options.layerId);
3010
3011
  if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; pick from a pixel layer or the composite.`);
3011
- const [r, g, b, a] = _chunkXIOMMGPDcjs.readPixel.call(void 0, l.surface, px - l.offset.x, py - l.offset.y);
3012
+ const [r, g, b, a] = _chunkTFOPHZ3Ucjs.readPixel.call(void 0, l.surface, px - l.offset.x, py - l.offset.y);
3012
3013
  return { color: rgbToHex(r, g, b), alpha: Math.round(a / 255 * 1e3) / 1e3 };
3013
3014
  }
3014
3015
  const d = this.exportCompositor.composite(this.renderLayers({}), { x: px, y: py, width: 1, height: 1 }, this.sources());
@@ -3018,13 +3019,13 @@ var PaintEditorController = (_class10 = class {
3018
3019
  /** Fills the Mixer Brush reservoir with a colour (default the editor colour). */
3019
3020
  loadMixerBrush(color) {
3020
3021
  const [r, g, b] = hexToRgb8(color === void 0 ? this.color : parseColor(color));
3021
- this.mixerLoad = _chunk7VOHOPLWcjs.loadMixer.call(void 0, this.mixerLoad, [r / 255, g / 255, b / 255]);
3022
+ this.mixerLoad = _chunkTCKIXI46cjs.loadMixer.call(void 0, this.mixerLoad, [r / 255, g / 255, b / 255]);
3022
3023
  this.emit([]);
3023
3024
  return this.mixerLoad;
3024
3025
  }
3025
3026
  /** Empties the pickup well (and with `emptyReservoir` the loaded paint too). */
3026
3027
  cleanMixerBrush(emptyReservoir = false) {
3027
- this.mixerLoad = emptyReservoir ? _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD : _chunk7VOHOPLWcjs.cleanMixer.call(void 0, this.mixerLoad);
3028
+ this.mixerLoad = emptyReservoir ? _chunkTCKIXI46cjs.EMPTY_MIXER_LOAD : _chunkTCKIXI46cjs.cleanMixer.call(void 0, this.mixerLoad);
3028
3029
  this.emit([]);
3029
3030
  return this.mixerLoad;
3030
3031
  }
@@ -3066,11 +3067,11 @@ var PaintEditorController = (_class10 = class {
3066
3067
  const layer = (() => {
3067
3068
  const id = _nullishCoalesce(init.layerId, () => ( doc.activeLayerId));
3068
3069
  if (!id) throw new PaintEditorError("There is no active layer to paint on; add one with add_layer.");
3069
- const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, doc.layers, id);
3070
+ const loc = _chunkST7E3NEEcjs.findLayer.call(void 0, doc.layers, id);
3070
3071
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
3071
3072
  const l = loc.layer;
3072
3073
  if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; paint on a pixel layer inside it.`);
3073
- if (_chunkPOGBUYWEcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) to paint on it.`);
3074
+ if (_chunkST7E3NEEcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) to paint on it.`);
3074
3075
  if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) to paint on it.`);
3075
3076
  return l;
3076
3077
  })();
@@ -3087,7 +3088,7 @@ var PaintEditorController = (_class10 = class {
3087
3088
  layerId: layer.id,
3088
3089
  surface: layer.surface,
3089
3090
  offset: layer.offset,
3090
- lockTransparency: _chunkPOGBUYWEcjs.isLayerLocked.call(void 0, layer, "transparency"),
3091
+ lockTransparency: _chunkST7E3NEEcjs.isLayerLocked.call(void 0, layer, "transparency"),
3091
3092
  brush,
3092
3093
  color: rgba,
3093
3094
  background: rgbaOf(doc.paper.color),
@@ -3141,7 +3142,7 @@ var PaintEditorController = (_class10 = class {
3141
3142
  const stroke = this.record(s);
3142
3143
  s.result.strokeId = stroke.id;
3143
3144
  const l = this.getLayer(s.layerId);
3144
- this.commit(`${brush.name} stroke`, { ...this.doc, layers: _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), strokes: [...this.doc.strokes, stroke] });
3145
+ this.commit(`${brush.name} stroke`, { ...this.doc, layers: _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), strokes: [...this.doc.strokes, stroke] });
3145
3146
  }
3146
3147
  };
3147
3148
  const session = this.sessionFor(this.doc, { snapToPerspective: true, ...init }, host);
@@ -3163,8 +3164,8 @@ var PaintEditorController = (_class10 = class {
3163
3164
  if (cancelled || !surface) return;
3164
3165
  const stroke = this.record(s);
3165
3166
  s.result.strokeId = stroke.id;
3166
- const l = _chunkPOGBUYWEcjs.findLayer.call(void 0, out.layers, s.layerId).layer;
3167
- out = { ...out, layers: _chunkPOGBUYWEcjs.mapLayer.call(void 0, out.layers, l.id, () => ({ ...l, surface })), strokes: [...out.strokes, stroke] };
3167
+ const l = _chunkST7E3NEEcjs.findLayer.call(void 0, out.layers, s.layerId).layer;
3168
+ out = { ...out, layers: _chunkST7E3NEEcjs.mapLayer.call(void 0, out.layers, l.id, () => ({ ...l, surface })), strokes: [...out.strokes, stroke] };
3168
3169
  }
3169
3170
  };
3170
3171
  const session = this.sessionFor(doc, init, host);
@@ -3236,7 +3237,7 @@ var PaintEditorController = (_class10 = class {
3236
3237
  brush = normalizePaintBrush({ tip: { ...b.tip, size: b.tip.size * (v.brush.tip.size / s.brush.tip.size) } }, b);
3237
3238
  }
3238
3239
  const layerId = _nullishCoalesce(options.layerId, () => ( s.layerId));
3239
- if (!_chunkPOGBUYWEcjs.findLayer.call(void 0, doc.layers, layerId)) throw new PaintEditorError(`Stroke "${s.id}" was painted on layer "${layerId}", which no longer exists; pass layerId to replay it elsewhere.`);
3240
+ if (!_chunkST7E3NEEcjs.findLayer.call(void 0, doc.layers, layerId)) throw new PaintEditorError(`Stroke "${s.id}" was painted on layer "${layerId}", which no longer exists; pass layerId to replay it elsewhere.`);
3240
3241
  let load = s.load;
3241
3242
  if (load && options.color !== void 0 && load.reservoir) {
3242
3243
  const [r, g, b] = hexToRgb8(options.color);
@@ -3261,7 +3262,7 @@ var PaintEditorController = (_class10 = class {
3261
3262
  const live = this.live;
3262
3263
  if (!live) return this.doc.layers;
3263
3264
  if (_optionalChain([this, 'access', _72 => _72.liveLayers, 'optionalAccess', _73 => _73.key]) === live.surface) return this.liveLayers.layers;
3264
- const layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.doc.layers, live.layerId, (l) => ({ ...l, surface: live.surface }));
3265
+ const layers = _chunkST7E3NEEcjs.mapLayer.call(void 0, this.doc.layers, live.layerId, (l) => ({ ...l, surface: live.surface }));
3265
3266
  this.liveLayers = { key: live.surface, layers };
3266
3267
  return layers;
3267
3268
  }
@@ -3366,7 +3367,7 @@ var PaintEditorController = (_class10 = class {
3366
3367
  /** The canvas as PNG bytes (paper included by default; `scale` below 1 shrinks it). */
3367
3368
  exportPng(options = {}) {
3368
3369
  const img = this.scaled(options);
3369
- return _chunkPOGBUYWEcjs.encodePng.call(void 0, img.width, img.height, img.data);
3370
+ return _chunkST7E3NEEcjs.encodePng.call(void 0, img.width, img.height, img.data);
3370
3371
  }
3371
3372
  scaled(options) {
3372
3373
  const full = this.compositePixels(options);
@@ -3408,22 +3409,22 @@ var PaintEditorController = (_class10 = class {
3408
3409
  opacity: 1,
3409
3410
  blend: "normal",
3410
3411
  locks: { all: true },
3411
- surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, paperPixels, 4),
3412
+ surface: _chunkTFOPHZ3Ucjs.surfaceFromPixels.call(void 0, paperPixels, 4),
3412
3413
  offset: { x: 0, y: 0 }
3413
3414
  };
3414
3415
  const merged = this.compositePixels({ paper: true }).data;
3415
3416
  const changed = /* @__PURE__ */ new Map();
3416
3417
  const toStandard = (layers2) => layers2.map((l) => {
3417
- const blend = l.blend === "pass-through" ? l.blend : _chunkXIOMMGPDcjs.standardBlendMode.call(void 0, l.blend);
3418
+ const blend = l.blend === "pass-through" ? l.blend : _chunkTFOPHZ3Ucjs.standardBlendMode.call(void 0, l.blend);
3418
3419
  if (blend !== l.blend) changed.set(l.blend, [..._nullishCoalesce(changed.get(l.blend), () => ( [])), l.name]);
3419
3420
  const next = blend === l.blend ? l : { ...l, blend };
3420
3421
  return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
3421
3422
  });
3422
3423
  const layers = toStandard(this.doc.layers);
3423
- const result = _chunkYGIMK4NXcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
3424
+ const result = _chunk5OVJHMZQcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
3424
3425
  for (const [mode, names] of changed) {
3425
- const label = _nullishCoalesce(_optionalChain([_chunkXIOMMGPDcjs.BLEND_MODES, 'access', _81 => _81.find, 'call', _82 => _82((m) => m.id === mode), 'optionalAccess', _83 => _83.label]), () => ( mode));
3426
- const std = _nullishCoalesce(_optionalChain([_chunkXIOMMGPDcjs.BLEND_MODES, 'access', _84 => _84.find, 'call', _85 => _85((m) => m.id === _chunkXIOMMGPDcjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _86 => _86.label]), () => ( _chunkXIOMMGPDcjs.standardBlendMode.call(void 0, mode)));
3426
+ const label = _nullishCoalesce(_optionalChain([_chunkTFOPHZ3Ucjs.BLEND_MODES, 'access', _81 => _81.find, 'call', _82 => _82((m) => m.id === mode), 'optionalAccess', _83 => _83.label]), () => ( mode));
3427
+ const std = _nullishCoalesce(_optionalChain([_chunkTFOPHZ3Ucjs.BLEND_MODES, 'access', _84 => _84.find, 'call', _85 => _85((m) => m.id === _chunkTFOPHZ3Ucjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _86 => _86.label]), () => ( _chunkTFOPHZ3Ucjs.standardBlendMode.call(void 0, mode)));
3427
3428
  const list = names.map((n) => `"${n}"`).join(", ");
3428
3429
  const one = names.length === 1;
3429
3430
  result.warnings.push(`${label} blending has no PSD equivalent; ${list} ${one ? "was" : "were"} written as ${std}, the nearest Photoshop mode, so ${one ? "it looks" : "they look"} different in Photoshop (the merged image is exact).`);
@@ -3433,7 +3434,7 @@ var PaintEditorController = (_class10 = class {
3433
3434
  /** `render_preview` as a base64 PNG. */
3434
3435
  previewPngBase64(options = {}) {
3435
3436
  const img = this.renderPreview(options);
3436
- return { data: _chunkPOGBUYWEcjs.bytesToBase64.call(void 0, _chunkPOGBUYWEcjs.encodePng.call(void 0, img.width, img.height, img.data)), width: img.width, height: img.height };
3437
+ return { data: _chunkST7E3NEEcjs.bytesToBase64.call(void 0, _chunkST7E3NEEcjs.encodePng.call(void 0, img.width, img.height, img.data)), width: img.width, height: img.height };
3437
3438
  }
3438
3439
  // --- Guides --------------------------------------------------------------------
3439
3440
  setGuides(next) {
@@ -3471,17 +3472,17 @@ var PaintEditorController = (_class10 = class {
3471
3472
  pixels = this.decodeImage(input.png.trim().startsWith("data:") ? input.png.trim() : `data:image/png;base64,${input.png.trim()}`, what);
3472
3473
  } else throw new PaintEditorError(`${what}: pass png (a PNG as base64 or a data URL) or pixels.`);
3473
3474
  if (pixels.width > MAX_IMAGE_SIDE || pixels.height > MAX_IMAGE_SIDE) throw new PaintEditorError(`${what} is ${pixels.width}\xD7${pixels.height}; the limit is ${MAX_IMAGE_SIDE} px per side.`);
3474
- const src = _chunkPOGBUYWEcjs.pngDataUrl.call(void 0, pixels.width, pixels.height, pixels.data);
3475
+ const src = _chunkST7E3NEEcjs.pngDataUrl.call(void 0, pixels.width, pixels.height, pixels.data);
3475
3476
  this.imagePixels.set(src, pixels);
3476
3477
  return { src, pixels };
3477
3478
  }
3478
3479
  decodeImage(src, what = "Image") {
3479
3480
  const cached = this.imagePixels.get(src);
3480
3481
  if (cached) return cached;
3481
- const parsed = _chunkPOGBUYWEcjs.parseDataUrl.call(void 0, src);
3482
+ const parsed = _chunkST7E3NEEcjs.parseDataUrl.call(void 0, src);
3482
3483
  if (!parsed) throw new PaintEditorError(`${what} is not a data URL or base64 PNG.`);
3483
3484
  try {
3484
- const png = _chunkPOGBUYWEcjs.decodePng.call(void 0, parsed.bytes);
3485
+ const png = _chunkST7E3NEEcjs.decodePng.call(void 0, parsed.bytes);
3485
3486
  const px = { width: png.width, height: png.height, data: png.data };
3486
3487
  this.imagePixels.set(src, px);
3487
3488
  return px;
@@ -3779,7 +3780,7 @@ var PaintEditorController = (_class10 = class {
3779
3780
  }
3780
3781
  /** A layer's tile surface (live while stroking), for thumbnails. */
3781
3782
  layerSurface(id) {
3782
- const l = _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _97 => _97.layer]);
3783
+ const l = _optionalChain([_chunkST7E3NEEcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _97 => _97.layer]);
3783
3784
  return isPixelLayer(l) ? l.surface : null;
3784
3785
  }
3785
3786
  }, _class10);
@@ -4366,7 +4367,7 @@ function createPaintGuideTools(c) {
4366
4367
  const pad = c.mixingPad;
4367
4368
  return {
4368
4369
  content: [
4369
- { type: "image", data: _chunkPOGBUYWEcjs.bytesToBase64.call(void 0, _chunkPOGBUYWEcjs.encodePng.call(void 0, pad.width, pad.height, pad.pixels())), mimeType: "image/png" },
4370
+ { type: "image", data: _chunkST7E3NEEcjs.bytesToBase64.call(void 0, _chunkST7E3NEEcjs.encodePng.call(void 0, pad.width, pad.height, pad.pixels())), mimeType: "image/png" },
4370
4371
  { type: "text", text: `Mixing pad ${pad.width}\xD7${pad.height}` }
4371
4372
  ]
4372
4373
  };
@@ -4387,7 +4388,7 @@ var TIP = {
4387
4388
  type: "object",
4388
4389
  description: "The tip (the shared brush engine). Missing fields keep their current values.",
4389
4390
  properties: {
4390
- size: { type: "number", minimum: 1, maximum: _chunk7VOHOPLWcjs.MAX_BRUSH_SIZE, description: "Diameter in document pixels." },
4391
+ size: { type: "number", minimum: 1, maximum: _chunkTCKIXI46cjs.MAX_BRUSH_SIZE, description: "Diameter in document pixels." },
4391
4392
  hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness, 0 (soft) .. 1 (hard)." },
4392
4393
  spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (0.05 is smooth, 1 is dotted)." },
4393
4394
  angle: { type: "number", minimum: -360, maximum: 360, description: "Tip angle in degrees, counter-clockwise; with rotation stroke or barrel it is added to the stroke direction or pen rotation." },
@@ -4399,7 +4400,7 @@ var TIP = {
4399
4400
  pressureOpacity: { type: "boolean", description: "Pressure scales the opacity." },
4400
4401
  blend: {
4401
4402
  type: "string",
4402
- enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id),
4403
+ enum: _chunkTFOPHZ3Ucjs.BLEND_MODES.map((m) => m.id),
4403
4404
  description: "How paint combines with the layer. pigment mixes it in like real paint (blue into yellow gives green); multiply darkens like marker ink; watercolor glazes like a transparent wash; tint, highlight and shadow recolour, light and shade (see list_blend_modes)."
4404
4405
  }
4405
4406
  },
@@ -4432,11 +4433,11 @@ var MIXER = {
4432
4433
  mix: { type: "number", minimum: 0, maximum: 1, description: "Mix ratio: how far each dab's paint moves from the reservoir towards the picked-up colour." },
4433
4434
  loadEachStroke: { type: "boolean", description: "Refill the reservoir with the colour before each stroke." },
4434
4435
  cleanEachStroke: { type: "boolean", description: "Empty the pickup well after each stroke." },
4435
- mixing: { type: "string", enum: [..._chunk7VOHOPLWcjs.MIXING_MODELS], description: "rgb: RGB averages. pigment: mixes like paint (Kubelka-Munk)." }
4436
+ mixing: { type: "string", enum: [..._chunkTCKIXI46cjs.MIXING_MODELS], description: "rgb: RGB averages. pigment: mixes like paint (Kubelka-Munk)." }
4436
4437
  },
4437
4438
  additionalProperties: false
4438
4439
  };
4439
- var MIXING = { type: "string", enum: [..._chunk7VOHOPLWcjs.MIXING_MODELS], description: "pigment: mixes like paint (Kubelka-Munk, blue and yellow make green); rgb: straight RGB averages." };
4440
+ var MIXING = { type: "string", enum: [..._chunkTCKIXI46cjs.MIXING_MODELS], description: "pigment: mixes like paint (Kubelka-Munk, blue and yellow make green); rgb: straight RGB averages." };
4440
4441
  var BEHAVIOR = {
4441
4442
  type: "object",
4442
4443
  description: "How the brush handles paint on the canvas (dab and mixer engines; on a mixer brush pickup, mix, dirty and mixing are its mixer wet, mix, !cleanEachStroke and mixing). Missing fields keep their current values.",
@@ -4575,7 +4576,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
4575
4576
  strokes: d.strokes.length,
4576
4577
  undo: s.undoLabel,
4577
4578
  redo: s.redoLabel,
4578
- blendModes: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id)
4579
+ blendModes: _chunkTFOPHZ3Ucjs.BLEND_MODES.map((m) => m.id)
4579
4580
  };
4580
4581
  }
4581
4582
  });
@@ -4708,7 +4709,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
4708
4709
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0..1." },
4709
4710
  blend: {
4710
4711
  type: "string",
4711
- enum: [..._chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), "pass-through"],
4712
+ enum: [..._chunkTFOPHZ3Ucjs.BLEND_MODES.map((m) => m.id), "pass-through"],
4712
4713
  description: "Blend mode (pass-through for groups only). Painterly modes: watercolor (the layer glazes like a transparent wash), tint (recolours keeping lightness), highlight (adds soft coloured light), shadow (shades with ambient fill); see list_blend_modes."
4713
4714
  },
4714
4715
  clipped: { type: "boolean", description: "Clip to the layer below (paint only shows where it has paint)." },
@@ -4737,12 +4738,12 @@ function createPaintEditorToolProvider(controller, options = {}) {
4737
4738
  inputSchema: EMPTY2,
4738
4739
  annotations: { title: "List blend modes", ...READ2 },
4739
4740
  handler: () => ({
4740
- modes: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => ({
4741
+ modes: _chunkTFOPHZ3Ucjs.BLEND_MODES.map((m) => ({
4741
4742
  id: m.id,
4742
4743
  label: m.label,
4743
4744
  group: m.painterly ? "painterly" : m.id === "pigment" ? "pigment" : "standard",
4744
4745
  ...m.description ? { description: m.description } : {},
4745
- psd: _chunkXIOMMGPDcjs.standardBlendMode.call(void 0, m.id)
4746
+ psd: _chunkTFOPHZ3Ucjs.standardBlendMode.call(void 0, m.id)
4746
4747
  }))
4747
4748
  })
4748
4749
  });
@@ -4810,7 +4811,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
4810
4811
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Opacity 0..1 (default 1)." },
4811
4812
  grain: { type: "number", minimum: 0, maximum: 1, description: "Paper grain response 0..1 (default 0: flat)." },
4812
4813
  pressure: { type: "number", minimum: 0, maximum: 1, description: "With grain: how far into the valleys, 0..1 (default 0.5)." },
4813
- blend: { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal; pigment mixes like paint, watercolor glazes; see list_blend_modes)." }
4814
+ blend: { type: "string", enum: _chunkTFOPHZ3Ucjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal; pigment mixes like paint, watercolor glazes; see list_blend_modes)." }
4814
4815
  },
4815
4816
  additionalProperties: false
4816
4817
  },
@@ -4931,7 +4932,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
4931
4932
  const t = c.brushThumbnail(_nullishCoalesce(id, () => ( c.getState().brush.id)), { width, height, color });
4932
4933
  return {
4933
4934
  content: [
4934
- { type: "image", data: _chunkPOGBUYWEcjs.bytesToBase64.call(void 0, _chunkPOGBUYWEcjs.encodePng.call(void 0, t.width, t.height, t.data)), mimeType: "image/png" },
4935
+ { type: "image", data: _chunkST7E3NEEcjs.bytesToBase64.call(void 0, _chunkST7E3NEEcjs.encodePng.call(void 0, t.width, t.height, t.data)), mimeType: "image/png" },
4935
4936
  { type: "text", text: `Brush ${_nullishCoalesce(id, () => ( c.getState().brush.id))} ${t.width}\xD7${t.height}` }
4936
4937
  ]
4937
4938
  };
@@ -5186,7 +5187,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
5186
5187
  annotations: { title: "Export the painting", ...READ2 },
5187
5188
  handler: async ({ format, quality, scale, paper }) => {
5188
5189
  const bytes = await c.exportImage({ format, quality, scale, paper });
5189
- return { mimeType: _nullishCoalesce(format, () => ( "image/png")), bytes: bytes.length, data: _chunkPOGBUYWEcjs.bytesToBase64.call(void 0, bytes) };
5190
+ return { mimeType: _nullishCoalesce(format, () => ( "image/png")), bytes: bytes.length, data: _chunkST7E3NEEcjs.bytesToBase64.call(void 0, bytes) };
5190
5191
  }
5191
5192
  });
5192
5193
  add({
@@ -5197,7 +5198,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
5197
5198
  annotations: { title: "Export as PSD", ...READ2 },
5198
5199
  handler: () => {
5199
5200
  const r = c.exportPsd();
5200
- return { data: _chunkPOGBUYWEcjs.bytesToBase64.call(void 0, r.bytes), bytes: r.bytes.length, psb: r.psb, warnings: r.warnings };
5201
+ return { data: _chunkST7E3NEEcjs.bytesToBase64.call(void 0, r.bytes), bytes: r.bytes.length, psb: r.psb, warnings: r.warnings };
5201
5202
  }
5202
5203
  });
5203
5204
  add({
@@ -5221,7 +5222,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
5221
5222
  }
5222
5223
  });
5223
5224
  tools.push(...createPaintGuideTools(c));
5224
- tools.push(..._chunk7VOHOPLWcjs.createPigmentTools.call(void 0, ));
5225
+ tools.push(..._chunkTCKIXI46cjs.createPigmentTools.call(void 0, ));
5225
5226
  return { id: _nullishCoalesce(options.id, () => ( "paint-editor")), namespace: options.namespace, tools };
5226
5227
  }
5227
5228
 
@@ -5416,11 +5417,11 @@ var PaintCanvasPresenter = (_class12 = class {
5416
5417
  const key = `${tx},${ty}`;
5417
5418
  if (this.uploaded.get(key) === data) return;
5418
5419
  this.uploaded.set(key, data);
5419
- if (!this.scratch) this.scratch = ctx.createImageData(_chunkXIOMMGPDcjs.TILE, _chunkXIOMMGPDcjs.TILE);
5420
+ if (!this.scratch) this.scratch = ctx.createImageData(_chunkTFOPHZ3Ucjs.TILE, _chunkTFOPHZ3Ucjs.TILE);
5420
5421
  this.scratch.data.set(data);
5421
- const ox = tx * _chunkXIOMMGPDcjs.TILE;
5422
- const oy = ty * _chunkXIOMMGPDcjs.TILE;
5423
- ctx.putImageData(this.scratch, ox, oy, 0, 0, Math.min(_chunkXIOMMGPDcjs.TILE, width - ox), Math.min(_chunkXIOMMGPDcjs.TILE, height - oy));
5422
+ const ox = tx * _chunkTFOPHZ3Ucjs.TILE;
5423
+ const oy = ty * _chunkTFOPHZ3Ucjs.TILE;
5424
+ ctx.putImageData(this.scratch, ox, oy, 0, 0, Math.min(_chunkTFOPHZ3Ucjs.TILE, width - ox), Math.min(_chunkTFOPHZ3Ucjs.TILE, height - oy));
5424
5425
  drawn++;
5425
5426
  }, { dirty });
5426
5427
  return drawn;
@@ -5502,8 +5503,8 @@ function wheelPick(dx, dy, wheel, color) {
5502
5503
  return rgbToHexColor(nr, ng, nb);
5503
5504
  }
5504
5505
  var BLEND_MENU_GROUPS = [
5505
- { label: "Standard", modes: _chunkXIOMMGPDcjs.BLEND_MODES.filter((m) => !m.painterly && m.id !== "pigment") },
5506
- { label: "Paint", modes: _chunkXIOMMGPDcjs.BLEND_MODES.filter((m) => m.painterly || m.id === "pigment") }
5506
+ { label: "Standard", modes: _chunkTFOPHZ3Ucjs.BLEND_MODES.filter((m) => !m.painterly && m.id !== "pigment") },
5507
+ { label: "Paint", modes: _chunkTFOPHZ3Ucjs.BLEND_MODES.filter((m) => m.painterly || m.id === "pigment") }
5507
5508
  ];
5508
5509
  var PICKUP_SLIDERS = [
5509
5510
  { path: "behavior.pickup", label: "Pick-up", min: 0, max: 1, step: 0.01 },
@@ -5731,5 +5732,5 @@ function padSampleRadius(size) {
5731
5732
 
5732
5733
 
5733
5734
 
5734
- exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkXIOMMGPDcjs.BLEND_MODES; exports.BRUSH_ID = BRUSH_ID; exports.BRUSH_ROTATIONS = BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = BUILTIN_BRUSHES; exports.DEFAULT_BEHAVIOR = DEFAULT_BEHAVIOR; exports.DEFAULT_BRUSH_ID = DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = DEFAULT_DYNAMICS; exports.DEFAULT_MULTI_COLOR = DEFAULT_MULTI_COLOR; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DryStroke = DryStroke; exports.GRAIN_PATTERNS = GRAIN_PATTERNS; exports.GRAIN_TILE = GRAIN_TILE; exports.HARMONY_KINDS = HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.MAX_BRUSH_SIZE = _chunk7VOHOPLWcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkXIOMMGPDcjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = PAINT_BRUSH_ENGINES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintGesture = PaintGesture; exports.PaintPresence = PaintPresence; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = PaperGrain; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.TileableNoise = TileableNoise; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushToJSON = brushToJSON; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony; exports.composeAffine = composeAffine; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintLayer = createPaintLayer; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.fitZoom = fitZoom; exports.grainCatch = grainCatch; exports.grainHeights = grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = hash2; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkXIOMMGPDcjs.isBlendMode; exports.isPainterlyBlendMode = _chunkXIOMMGPDcjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetCapable = isWetCapable; exports.mapPenPoint = mapPenPoint; exports.mix32 = mix32; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.newPaintLayerId = newPaintLayerId; exports.normalizeBehavior = normalizeBehavior; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = normalizeDynamics; exports.normalizeMultiColor = normalizeMultiColor; exports.normalizePaintBrush = normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.padSampleRadius = padSampleRadius; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.pointerToPenPoint = pointerToPenPoint; exports.rand01 = rand01; exports.randSigned = randSigned; exports.readPath = readPath; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.screenToDocument = screenToDocument; exports.seedFromString = seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.standardBlendMode = _chunkXIOMMGPDcjs.standardBlendMode; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = tiltToOrientation; exports.toStrokePoint = toStrokePoint; exports.usesPaintExchange = usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = wheelToHue;
5735
+ exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkTFOPHZ3Ucjs.BLEND_MODES; exports.BRUSH_ID = BRUSH_ID; exports.BRUSH_ROTATIONS = BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = BUILTIN_BRUSHES; exports.DEFAULT_BEHAVIOR = DEFAULT_BEHAVIOR; exports.DEFAULT_BRUSH_ID = DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = DEFAULT_DYNAMICS; exports.DEFAULT_MULTI_COLOR = DEFAULT_MULTI_COLOR; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DryStroke = DryStroke; exports.GRAIN_PATTERNS = GRAIN_PATTERNS; exports.GRAIN_TILE = GRAIN_TILE; exports.HARMONY_KINDS = HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.MAX_BRUSH_SIZE = _chunkTCKIXI46cjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkTFOPHZ3Ucjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = PAINT_BRUSH_ENGINES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintGesture = PaintGesture; exports.PaintPresence = PaintPresence; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = PaperGrain; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.TileableNoise = TileableNoise; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushToJSON = brushToJSON; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony; exports.composeAffine = composeAffine; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintLayer = createPaintLayer; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.fitZoom = fitZoom; exports.grainCatch = grainCatch; exports.grainHeights = grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = hash2; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkTFOPHZ3Ucjs.isBlendMode; exports.isPainterlyBlendMode = _chunkTFOPHZ3Ucjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetCapable = isWetCapable; exports.mapPenPoint = mapPenPoint; exports.mix32 = mix32; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.newPaintLayerId = newPaintLayerId; exports.normalizeBehavior = normalizeBehavior; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = normalizeDynamics; exports.normalizeMultiColor = normalizeMultiColor; exports.normalizePaintBrush = normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.padSampleRadius = padSampleRadius; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.pointerToPenPoint = pointerToPenPoint; exports.rand01 = rand01; exports.randSigned = randSigned; exports.readPath = readPath; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.screenToDocument = screenToDocument; exports.seedFromString = seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.standardBlendMode = _chunkTFOPHZ3Ucjs.standardBlendMode; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = tiltToOrientation; exports.toStrokePoint = toStrokePoint; exports.usesPaintExchange = usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = wheelToHue;
5735
5736
  //# sourceMappingURL=index.cjs.map