@pixerate/editor 0.105.0 → 0.107.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 (49) hide show
  1. package/dist/{chunk-DS7KDKPX.js → chunk-3PHA3UKI.js} +2 -2
  2. package/dist/{chunk-ZID226ZG.cjs → chunk-FRD3FUXI.cjs} +172 -172
  3. package/dist/{chunk-ZID226ZG.cjs.map → chunk-FRD3FUXI.cjs.map} +1 -1
  4. package/dist/{chunk-67FRIOPZ.js → chunk-G4BIYE6R.js} +2 -2
  5. package/dist/{chunk-PV42JITT.cjs → chunk-HUFQD4CB.cjs} +44 -44
  6. package/dist/{chunk-PV42JITT.cjs.map → chunk-HUFQD4CB.cjs.map} +1 -1
  7. package/dist/{chunk-4X5MIVCE.js → chunk-SOROZ2BF.js} +3 -3
  8. package/dist/{chunk-CRMAXIUV.cjs → chunk-SZ6KMZNM.cjs} +157 -8
  9. package/dist/chunk-SZ6KMZNM.cjs.map +1 -0
  10. package/dist/{chunk-WSTEXEKD.cjs → chunk-T3QZ6S47.cjs} +92 -92
  11. package/dist/{chunk-WSTEXEKD.cjs.map → chunk-T3QZ6S47.cjs.map} +1 -1
  12. package/dist/{chunk-HEW6KDNI.js → chunk-WMBIJCHA.js} +155 -6
  13. package/dist/chunk-WMBIJCHA.js.map +1 -0
  14. package/dist/{compositor-Bc3PNP3C.d.cts → compositor-D92URMlm.d.cts} +1 -1
  15. package/dist/{compositor-BsYYllvR.d.ts → compositor-Kt_M4ruo.d.ts} +1 -1
  16. package/dist/{export-_m3Es4ru.d.cts → export-JGWQEPJn.d.cts} +3 -3
  17. package/dist/{export-iMrop3Jm.d.ts → export-a9bnF7Cl.d.ts} +3 -3
  18. package/dist/image-editor/index.cjs +831 -632
  19. package/dist/image-editor/index.cjs.map +1 -1
  20. package/dist/image-editor/index.d.cts +42 -9
  21. package/dist/image-editor/index.d.ts +42 -9
  22. package/dist/image-editor/index.js +203 -4
  23. package/dist/image-editor/index.js.map +1 -1
  24. package/dist/{mixer-C1M1Nua_.d.cts → mixer-5ziHU8OS.d.cts} +1 -1
  25. package/dist/{mixer-Cu5a9Bzd.d.ts → mixer-DNqiYXYQ.d.ts} +1 -1
  26. package/dist/paint/index.cjs +3 -3
  27. package/dist/paint/index.d.cts +2 -2
  28. package/dist/paint/index.d.ts +2 -2
  29. package/dist/paint/index.js +2 -2
  30. package/dist/paint-editor/index.cjs +175 -127
  31. package/dist/paint-editor/index.cjs.map +1 -1
  32. package/dist/paint-editor/index.d.cts +18 -7
  33. package/dist/paint-editor/index.d.ts +18 -7
  34. package/dist/paint-editor/index.js +59 -11
  35. package/dist/paint-editor/index.js.map +1 -1
  36. package/dist/raster/index.cjs +11 -3
  37. package/dist/raster/index.cjs.map +1 -1
  38. package/dist/raster/index.d.cts +4 -4
  39. package/dist/raster/index.d.ts +4 -4
  40. package/dist/raster/index.js +10 -2
  41. package/dist/{surface-BBJN9wxg.d.ts → surface-CkKOHGPm.d.cts} +20 -2
  42. package/dist/{surface-BBJN9wxg.d.cts → surface-CkKOHGPm.d.ts} +20 -2
  43. package/package.json +1 -1
  44. package/skills/pixerate-paint-editor/SKILL.md +21 -1
  45. package/dist/chunk-CRMAXIUV.cjs.map +0 -1
  46. package/dist/chunk-HEW6KDNI.js.map +0 -1
  47. /package/dist/{chunk-DS7KDKPX.js.map → chunk-3PHA3UKI.js.map} +0 -0
  48. /package/dist/{chunk-67FRIOPZ.js.map → chunk-G4BIYE6R.js.map} +0 -0
  49. /package/dist/{chunk-4X5MIVCE.js.map → chunk-SOROZ2BF.js.map} +0 -0
@@ -37,7 +37,7 @@
37
37
 
38
38
 
39
39
 
40
- var _chunkWSTEXEKDcjs = require('./chunk-WSTEXEKD.cjs');
40
+ var _chunkT3QZ6S47cjs = require('./chunk-T3QZ6S47.cjs');
41
41
 
42
42
 
43
43
 
@@ -59,7 +59,7 @@ var _chunkMUUXNRU4cjs = require('./chunk-MUUXNRU4.cjs');
59
59
 
60
60
 
61
61
 
62
- var _chunkCRMAXIUVcjs = require('./chunk-CRMAXIUV.cjs');
62
+ var _chunkSZ6KMZNMcjs = require('./chunk-SZ6KMZNM.cjs');
63
63
 
64
64
 
65
65
 
@@ -1086,7 +1086,7 @@ function smoothCoverage(m, w, h, r) {
1086
1086
  return src;
1087
1087
  }
1088
1088
  function featherCoverage(m, w, h, radius) {
1089
- const out = _chunkWSTEXEKDcjs.gaussianBlur.call(void 0, m, w, h, Number.isFinite(radius) ? Math.max(0, radius) : 0, "zero");
1089
+ const out = _chunkT3QZ6S47cjs.gaussianBlur.call(void 0, m, w, h, Number.isFinite(radius) ? Math.max(0, radius) : 0, "zero");
1090
1090
  for (let i = 0; i < out.length; i++) if (Math.abs(out[i]) < 1e-7) out[i] = 0;
1091
1091
  return out;
1092
1092
  }
@@ -1234,7 +1234,7 @@ function layerMaskCoverage(mask) {
1234
1234
  let v = new Float32Array(sel.data.length);
1235
1235
  for (let i = 0; i < v.length; i++) v[i] = sel.data[i] / 255;
1236
1236
  const feather = _nullishCoalesce(mask.feather, () => ( 0));
1237
- if (feather > 0) v = _chunkWSTEXEKDcjs.gaussianBlur.call(void 0, v, mask.width, mask.height, feather, "clamp");
1237
+ if (feather > 0) v = _chunkT3QZ6S47cjs.gaussianBlur.call(void 0, v, mask.width, mask.height, feather, "clamp");
1238
1238
  const density = _nullishCoalesce(mask.density, () => ( 1));
1239
1239
  if (density !== 1) for (let i = 0; i < v.length; i++) v[i] = 1 - density * (1 - v[i]);
1240
1240
  return v;
@@ -1455,7 +1455,7 @@ function normalizeAdjustmentLayer(raw) {
1455
1455
  kind: r.kind,
1456
1456
  enabled: r.enabled !== false,
1457
1457
  opacity: clampTo(r.opacity, 0, 1, 1),
1458
- blend: _chunkCRMAXIUVcjs.normalizeBlendMode.call(void 0, r.blend),
1458
+ blend: _chunkSZ6KMZNMcjs.normalizeBlendMode.call(void 0, r.blend),
1459
1459
  params: normParams(r.kind, r.params)
1460
1460
  };
1461
1461
  if (typeof r.name === "string" && r.name) layer.name = r.name;
@@ -1477,7 +1477,7 @@ function normalizeAdjustmentLayers(raw) {
1477
1477
  return out;
1478
1478
  }
1479
1479
  function curveLutFromLevels(points) {
1480
- return _chunkWSTEXEKDcjs.curveLut.call(void 0, points.map((p) => ({ input: p.input / 255, output: p.output / 255 })));
1480
+ return _chunkT3QZ6S47cjs.curveLut.call(void 0, points.map((p) => ({ input: p.input / 255, output: p.output / 255 })));
1481
1481
  }
1482
1482
  var toUnitLevels = (c) => ({
1483
1483
  inBlack: c.inBlack / 255,
@@ -1800,7 +1800,7 @@ function compileAdjustmentLayer(layer) {
1800
1800
  return (c) => {
1801
1801
  const g = blackWhiteGray(c, weights);
1802
1802
  if (tint) {
1803
- const t = _chunkCRMAXIUVcjs.setLum.call(void 0, tint, g);
1803
+ const t = _chunkSZ6KMZNMcjs.setLum.call(void 0, tint, g);
1804
1804
  c[0] = clamp01(t[0]);
1805
1805
  c[1] = clamp01(t[1]);
1806
1806
  c[2] = clamp01(t[2]);
@@ -1819,7 +1819,7 @@ function compileAdjustmentLayer(layer) {
1819
1819
  let f = [0, 1, 2].map((r) => linearToSrgb(Math.max(0, m[r][0] * l[0] + m[r][1] * l[1] + m[r][2] * l[2])));
1820
1820
  if (preserve) {
1821
1821
  const target = 0.3 * c[0] + 0.59 * c[1] + 0.11 * c[2];
1822
- f = _chunkCRMAXIUVcjs.setLum.call(void 0, f, target);
1822
+ f = _chunkSZ6KMZNMcjs.setLum.call(void 0, f, target);
1823
1823
  }
1824
1824
  c[0] = clamp01(f[0]);
1825
1825
  c[1] = clamp01(f[1]);
@@ -1886,10 +1886,10 @@ function applyLayer(c, layer, op, coverage = 1) {
1886
1886
  const cb0 = c[0], cb1 = c[1], cb2 = c[2];
1887
1887
  op(c);
1888
1888
  if (blend === "pigment") {
1889
- _chunkCRMAXIUVcjs.mixPigmentRgb.call(void 0, [clamp01(cb0), clamp01(cb1), clamp01(cb2)], [clamp01(c[0]), clamp01(c[1]), clamp01(c[2])], alpha, c);
1889
+ _chunkSZ6KMZNMcjs.mixPigmentRgb.call(void 0, [clamp01(cb0), clamp01(cb1), clamp01(cb2)], [clamp01(c[0]), clamp01(c[1]), clamp01(c[2])], alpha, c);
1890
1890
  return;
1891
1891
  }
1892
- const b = blend === "normal" ? c : _chunkCRMAXIUVcjs.blendRgb.call(void 0, blend, [cb0, cb1, cb2], c);
1892
+ const b = blend === "normal" ? c : _chunkSZ6KMZNMcjs.blendRgb.call(void 0, blend, [cb0, cb1, cb2], c);
1893
1893
  c[0] = (1 - alpha) * cb0 + alpha * b[0];
1894
1894
  c[1] = (1 - alpha) * cb1 + alpha * b[1];
1895
1895
  c[2] = (1 - alpha) * cb2 + alpha * b[2];
@@ -2202,7 +2202,7 @@ function newLayerId(prefix = "layer") {
2202
2202
  return `${prefix}_${Date.now().toString(36)}_${(++idCounter).toString(36)}`;
2203
2203
  }
2204
2204
  function pixelLayers(layers) {
2205
- return _chunkWSTEXEKDcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "pixel");
2205
+ return _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "pixel");
2206
2206
  }
2207
2207
  function developFilter(layer) {
2208
2208
  return _optionalChain([layer, 'access', _8 => _8.filters, 'optionalAccess', _9 => _9.find, 'call', _10 => _10((f) => f.kind === "develop")]);
@@ -2230,7 +2230,7 @@ function hasSurface(layer) {
2230
2230
  return layer.type === "pixel" || layer.type === "smart";
2231
2231
  }
2232
2232
  function smartObjectLayers(layers) {
2233
- return _chunkWSTEXEKDcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart");
2233
+ return _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart");
2234
2234
  }
2235
2235
 
2236
2236
  // src/image-editor/layers/compositor.ts
@@ -2333,7 +2333,7 @@ var PHOTO_PROFILE = {
2333
2333
  return v;
2334
2334
  }
2335
2335
  };
2336
- var LayerCompositor = class extends _chunkWSTEXEKDcjs.RasterCompositor {
2336
+ var LayerCompositor = class extends _chunkT3QZ6S47cjs.RasterCompositor {
2337
2337
  constructor(options = {}) {
2338
2338
  super(PHOTO_PROFILE, options);
2339
2339
  }
@@ -2508,47 +2508,47 @@ var fail = (message) => {
2508
2508
  throw new LayerOperationError(message);
2509
2509
  };
2510
2510
  function requireLayer(layers, id) {
2511
- const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, layers, id);
2511
+ const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, layers, id);
2512
2512
  if (!loc) {
2513
- const ids = _chunkWSTEXEKDcjs.flattenLayers.call(void 0, layers).map((l) => l.id);
2513
+ const ids = _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).map((l) => l.id);
2514
2514
  fail(`Unknown layer "${id}". ${ids.length ? `Layers: ${ids.join(", ")}.` : "The document has no layers."} Call list_layers for ids.`);
2515
2515
  }
2516
2516
  return loc;
2517
2517
  }
2518
2518
  function requireUnlocked(layer, what, action) {
2519
- if (_chunkWSTEXEKDcjs.isLayerLocked.call(void 0, layer, "all")) fail(`Layer "${layer.name || layer.id}" is locked (all); unlock it before you ${action}.`);
2520
- if (what !== "all" && _chunkWSTEXEKDcjs.isLayerLocked.call(void 0, layer, what)) fail(`Layer "${layer.name || layer.id}" has its ${what} locked; unlock it before you ${action}.`);
2519
+ if (_chunkT3QZ6S47cjs.isLayerLocked.call(void 0, layer, "all")) fail(`Layer "${layer.name || layer.id}" is locked (all); unlock it before you ${action}.`);
2520
+ if (what !== "all" && _chunkT3QZ6S47cjs.isLayerLocked.call(void 0, layer, what)) fail(`Layer "${layer.name || layer.id}" has its ${what} locked; unlock it before you ${action}.`);
2521
2521
  }
2522
2522
  function placeLayer(layers, layer, placement = {}, defaultIndex) {
2523
2523
  const given = [placement.aboveId, placement.belowId, placement.parentId].filter((v) => v !== void 0).length;
2524
2524
  if (given > 1) fail("Give only one of aboveId, belowId and parentId.");
2525
2525
  if (placement.aboveId || placement.belowId) {
2526
2526
  const ref = requireLayer(layers, _nullishCoalesce(placement.aboveId, () => ( placement.belowId)));
2527
- return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access', _19 => _19.parent, 'optionalAccess', _20 => _20.id]), () => ( null)), ref.index + (placement.aboveId ? 1 : 0));
2527
+ return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access', _19 => _19.parent, 'optionalAccess', _20 => _20.id]), () => ( null)), ref.index + (placement.aboveId ? 1 : 0));
2528
2528
  }
2529
2529
  if (placement.parentId) {
2530
2530
  const ref = requireLayer(layers, placement.parentId);
2531
2531
  if (ref.layer.type !== "group") fail(`Layer "${placement.parentId}" is not a group; parentId must be a group id.`);
2532
- return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, layer, ref.layer.id, placement.index);
2532
+ return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, layer, ref.layer.id, placement.index);
2533
2533
  }
2534
- return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, layer, null, _nullishCoalesce(placement.index, () => ( defaultIndex)));
2534
+ return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, layer, null, _nullishCoalesce(placement.index, () => ( defaultIndex)));
2535
2535
  }
2536
2536
  function removeLayer(layers, id) {
2537
2537
  const loc = requireLayer(layers, id);
2538
2538
  requireUnlocked(loc.layer, "all", "delete it");
2539
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => null);
2539
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => null);
2540
2540
  }
2541
2541
  function moveLayer(layers, id, placement) {
2542
2542
  const loc = requireLayer(layers, id);
2543
2543
  requireUnlocked(loc.layer, "all", "move it");
2544
2544
  const target = _nullishCoalesce(_nullishCoalesce(placement.aboveId, () => ( placement.belowId)), () => ( placement.parentId));
2545
2545
  if (target === id) fail("A layer cannot be placed relative to itself.");
2546
- if (target && loc.layer.type === "group" && _chunkWSTEXEKDcjs.flattenLayers.call(void 0, loc.layer.children).some((l) => l.id === target)) {
2546
+ if (target && loc.layer.type === "group" && _chunkT3QZ6S47cjs.flattenLayers.call(void 0, loc.layer.children).some((l) => l.id === target)) {
2547
2547
  fail(`Group "${id}" cannot be moved into its own child "${target}".`);
2548
2548
  }
2549
2549
  if (target) requireLayer(layers, target);
2550
2550
  if (!target && placement.index === void 0) fail("Give aboveId, belowId, parentId or index.");
2551
- const without = _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => null);
2551
+ const without = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => null);
2552
2552
  return placeLayer(without, loc.layer, placement);
2553
2553
  }
2554
2554
  function withNewIds(layer) {
@@ -2566,7 +2566,7 @@ function duplicateLayer(layers, id, name) {
2566
2566
  const copy = withNewIds(loc.layer);
2567
2567
  copy.name = _nullishCoalesce(name, () => ( `${loc.layer.name || "Layer"} copy`));
2568
2568
  delete copy.locks;
2569
- return { layers: _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _23 => _23.parent, 'optionalAccess', _24 => _24.id]), () => ( null)), loc.index + 1), id: copy.id };
2569
+ return { layers: _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _23 => _23.parent, 'optionalAccess', _24 => _24.id]), () => ( null)), loc.index + 1), id: copy.id };
2570
2570
  }
2571
2571
  function setLayerProperties(layers, id, props) {
2572
2572
  const loc = requireLayer(layers, id);
@@ -2593,7 +2593,7 @@ function setLayerProperties(layers, id, props) {
2593
2593
  if (props.blend !== void 0) {
2594
2594
  if (props.blend === "pass-through") {
2595
2595
  if (layer.type !== "group") fail("pass-through is only for groups.");
2596
- } else if (!_chunkCRMAXIUVcjs.isBlendMode.call(void 0, props.blend)) fail(`Unknown blend mode "${props.blend}".`);
2596
+ } else if (!_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, props.blend)) fail(`Unknown blend mode "${props.blend}".`);
2597
2597
  next.blend = props.blend;
2598
2598
  }
2599
2599
  if (props.clipped !== void 0) {
@@ -2613,7 +2613,7 @@ function setLayerProperties(layers, id, props) {
2613
2613
  if (props.collapsed) g.collapsed = true;
2614
2614
  else delete g.collapsed;
2615
2615
  }
2616
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next);
2616
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next);
2617
2617
  }
2618
2618
  function groupLayers(layers, ids, name = "Group") {
2619
2619
  if (!ids.length) fail("Give at least one layer id to group.");
@@ -2642,17 +2642,17 @@ function groupLayers(layers, ids, name = "Group") {
2642
2642
  group.children[0] = c;
2643
2643
  }
2644
2644
  let out = layers;
2645
- for (const l of ordered) out = _chunkWSTEXEKDcjs.mapLayer.call(void 0, out, l.layer.id, () => null);
2646
- return { layers: _chunkWSTEXEKDcjs.insertLayer.call(void 0, out, group, parent, top - below), id: group.id };
2645
+ for (const l of ordered) out = _chunkT3QZ6S47cjs.mapLayer.call(void 0, out, l.layer.id, () => null);
2646
+ return { layers: _chunkT3QZ6S47cjs.insertLayer.call(void 0, out, group, parent, top - below), id: group.id };
2647
2647
  }
2648
2648
  function ungroupLayer(layers, id) {
2649
2649
  const loc = requireLayer(layers, id);
2650
2650
  if (loc.layer.type !== "group") fail(`Layer "${id}" is not a group.`);
2651
2651
  requireUnlocked(loc.layer, "all", "ungroup it");
2652
2652
  const group = loc.layer;
2653
- let out = _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => null);
2653
+ let out = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => null);
2654
2654
  group.children.forEach((c, i) => {
2655
- out = _chunkWSTEXEKDcjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access', _33 => _33.parent, 'optionalAccess', _34 => _34.id]), () => ( null)), loc.index + i);
2655
+ out = _chunkT3QZ6S47cjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access', _33 => _33.parent, 'optionalAccess', _34 => _34.id]), () => ( null)), loc.index + i);
2656
2656
  });
2657
2657
  return { layers: out, ids: group.children.map((c) => c.id) };
2658
2658
  }
@@ -2665,14 +2665,14 @@ function offsetLayer(layers, id, offset) {
2665
2665
  const next = { ...layer, offset: { x: Math.round(offset.x), y: Math.round(offset.y) } };
2666
2666
  const mask = layer.mask;
2667
2667
  if (mask && mask.linked === false && !mask.source) {
2668
- next.mask = { ...mask, surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, mask.surface, layer.offset.x - next.offset.x, layer.offset.y - next.offset.y) };
2668
+ next.mask = { ...mask, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, mask.surface, layer.offset.x - next.offset.x, layer.offset.y - next.offset.y) };
2669
2669
  }
2670
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next);
2670
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next);
2671
2671
  }
2672
2672
  function setLayerMask(layers, id, mask) {
2673
2673
  const loc = requireLayer(layers, id);
2674
2674
  requireUnlocked(loc.layer, "all", "change its mask");
2675
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, (l) => {
2675
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, (l) => {
2676
2676
  const next = { ...l };
2677
2677
  if (mask) next.mask = mask;
2678
2678
  else delete next.mask;
@@ -2711,7 +2711,7 @@ function requirePixelLayer(layers, id) {
2711
2711
  function addLayerFilter(layers, id, filter) {
2712
2712
  const layer = requirePixelLayer(layers, id);
2713
2713
  if (_optionalChain([layer, 'access', _35 => _35.filters, 'optionalAccess', _36 => _36.some, 'call', _37 => _37((f) => f.kind === filter.kind)])) fail(`Layer "${id}" already has a ${filter.kind} filter; change it with update_layer_filter.`);
2714
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters: [..._nullishCoalesce(layer.filters, () => ( [])), filter] }));
2714
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters: [..._nullishCoalesce(layer.filters, () => ( [])), filter] }));
2715
2715
  }
2716
2716
  function updateLayerFilter(layers, id, filterId, changes) {
2717
2717
  const layer = requirePixelLayer(layers, id);
@@ -2722,7 +2722,7 @@ function updateLayerFilter(layers, id, filterId, changes) {
2722
2722
  const merged = normalizeFilter({ ...current, ...changes, kind: current.kind }, current.id);
2723
2723
  const filters = [...layer.filters];
2724
2724
  filters[i] = merged;
2725
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters }));
2725
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters }));
2726
2726
  }
2727
2727
  function removeLayerFilter(layers, id, filterId) {
2728
2728
  const layer = requirePixelLayer(layers, id);
@@ -2731,7 +2731,7 @@ function removeLayerFilter(layers, id, filterId) {
2731
2731
  const next = { ...layer };
2732
2732
  if (filters.length) next.filters = filters;
2733
2733
  else delete next.filters;
2734
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next);
2734
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next);
2735
2735
  }
2736
2736
  function requireEffectLayer(layers, id, action) {
2737
2737
  const layer = requireLayer(layers, id).layer;
@@ -2746,7 +2746,7 @@ function guard(fn) {
2746
2746
  try {
2747
2747
  return fn();
2748
2748
  } catch (e) {
2749
- if (e instanceof _chunkWSTEXEKDcjs.LayerEffectError) fail(e.message);
2749
+ if (e instanceof _chunkT3QZ6S47cjs.LayerEffectError) fail(e.message);
2750
2750
  throw e;
2751
2751
  }
2752
2752
  }
@@ -2754,20 +2754,20 @@ function setLayerEffects(layers, id, effects) {
2754
2754
  const layer = requireEffectLayer(layers, id, "change its effects");
2755
2755
  const next = { ...layer };
2756
2756
  if (effects && (effects.items.length || effects.psd || effects.scale !== void 0 || !effects.enabled)) {
2757
- guard(() => _chunkWSTEXEKDcjs.validateLayerEffects.call(void 0, effects));
2757
+ guard(() => _chunkT3QZ6S47cjs.validateLayerEffects.call(void 0, effects));
2758
2758
  next.effects = effects;
2759
2759
  } else delete next.effects;
2760
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next);
2760
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next);
2761
2761
  }
2762
2762
  function addLayerEffect(layers, id, kind, params = {}, index) {
2763
- if (!_chunkWSTEXEKDcjs.isLayerEffectKind.call(void 0, kind)) fail(`Unknown effect kind "${String(kind)}". Kinds: ${_chunkWSTEXEKDcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
2763
+ if (!_chunkT3QZ6S47cjs.isLayerEffectKind.call(void 0, kind)) fail(`Unknown effect kind "${String(kind)}". Kinds: ${_chunkT3QZ6S47cjs.LAYER_EFFECT_KINDS.join(", ")}.`);
2764
2764
  const layer = requireEffectLayer(layers, id, "add effects");
2765
2765
  const current = layerEffectsOf(layer);
2766
2766
  const ids = new Set(current.items.map((e) => e.id));
2767
- let effectId = _chunkWSTEXEKDcjs.newEffectId.call(void 0, );
2768
- while (ids.has(effectId)) effectId = _chunkWSTEXEKDcjs.newEffectId.call(void 0, );
2767
+ let effectId = _chunkT3QZ6S47cjs.newEffectId.call(void 0, );
2768
+ while (ids.has(effectId)) effectId = _chunkT3QZ6S47cjs.newEffectId.call(void 0, );
2769
2769
  const { id: _ignored, kind: _kind, ...rest } = params;
2770
- const effect = guard(() => _chunkWSTEXEKDcjs.mergeLayerEffect.call(void 0, _chunkWSTEXEKDcjs.defaultLayerEffect.call(void 0, kind, effectId), rest));
2770
+ const effect = guard(() => _chunkT3QZ6S47cjs.mergeLayerEffect.call(void 0, _chunkT3QZ6S47cjs.defaultLayerEffect.call(void 0, kind, effectId), rest));
2771
2771
  const items = [...current.items];
2772
2772
  const at = index === void 0 ? items.length : Math.max(0, Math.min(items.length, Math.floor(index)));
2773
2773
  items.splice(at, 0, effect);
@@ -2784,7 +2784,7 @@ function updateLayerEffect(layers, id, effectId, changes) {
2784
2784
  const i = requireEffect(layer, effectId);
2785
2785
  const current = layer.effects;
2786
2786
  const items = [...current.items];
2787
- items[i] = guard(() => _chunkWSTEXEKDcjs.mergeLayerEffect.call(void 0, items[i], changes));
2787
+ items[i] = guard(() => _chunkT3QZ6S47cjs.mergeLayerEffect.call(void 0, items[i], changes));
2788
2788
  return setLayerEffects(layers, id, { ...current, items });
2789
2789
  }
2790
2790
  function removeLayerEffect(layers, id, effectId) {
@@ -2807,7 +2807,7 @@ function setLayerEffectsEnabled(layers, id, enabled, scale) {
2807
2807
  function parseBlend(value, allowPassThrough = false) {
2808
2808
  if (value === void 0) return void 0;
2809
2809
  if (value === "pass-through" && allowPassThrough) return value;
2810
- if (!_chunkCRMAXIUVcjs.isBlendMode.call(void 0, value)) fail(`Unknown blend mode "${String(value)}".`);
2810
+ if (!_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, value)) fail(`Unknown blend mode "${String(value)}".`);
2811
2811
  return value;
2812
2812
  }
2813
2813
  function unionRect(a, b) {
@@ -2822,7 +2822,7 @@ function unionRect(a, b) {
2822
2822
  var fail2 = (message) => {
2823
2823
  throw new LayerOperationError(message);
2824
2824
  };
2825
- var SMART_RENDER_MARGIN = _chunkWSTEXEKDcjs.MAX_EFFECT_REACH;
2825
+ var SMART_RENDER_MARGIN = _chunkT3QZ6S47cjs.MAX_EFFECT_REACH;
2826
2826
  function newContentsId() {
2827
2827
  return newLayerId("so");
2828
2828
  }
@@ -2855,10 +2855,10 @@ function contentsSurface(contents) {
2855
2855
  let s = contentsPixels.get(contents);
2856
2856
  if (s) return s;
2857
2857
  if (contents.kind === "raster") {
2858
- s = _nullishCoalesce(contents.raster, () => ( _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4)));
2858
+ s = _nullishCoalesce(contents.raster, () => ( _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4)));
2859
2859
  } else {
2860
2860
  const doc = contents.document;
2861
- if (!doc) return _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4);
2861
+ if (!doc) return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
2862
2862
  const W = contents.width;
2863
2863
  const H = contents.height;
2864
2864
  const data = new LayerCompositor().composite(doc.layers, { x: 0, y: 0, width: W, height: H }, {
@@ -2867,14 +2867,14 @@ function contentsSurface(contents) {
2867
2867
  globalLight: doc.globalLight,
2868
2868
  pattern: (id) => _nullishCoalesce(_optionalChain([doc, 'access', _43 => _43.patterns, 'optionalAccess', _44 => _44.find, 'call', _45 => _45((p) => p.id === id)]), () => ( null))
2869
2869
  });
2870
- s = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width: W, height: H, data }, 4, 0, 0);
2870
+ s = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: W, height: H, data }, 4, 0, 0);
2871
2871
  }
2872
2872
  contentsPixels.set(contents, s);
2873
2873
  return s;
2874
2874
  }
2875
2875
  function rasterContents(pixels, name, id = newContentsId()) {
2876
2876
  if (!(pixels.width > 0 && pixels.height > 0) || pixels.data.length < pixels.width * pixels.height * 4) fail2("Contents pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
2877
- return { id, name, width: pixels.width, height: pixels.height, kind: "raster", raster: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, pixels, 4, 0, 0) };
2877
+ return { id, name, width: pixels.width, height: pixels.height, kind: "raster", raster: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, pixels, 4, 0, 0) };
2878
2878
  }
2879
2879
  function documentContents(document, width, height, name, id = newContentsId()) {
2880
2880
  if (!(Number.isInteger(width) && Number.isInteger(height) && width > 0 && height > 0)) fail2("Contents width and height must be positive whole numbers.");
@@ -2918,7 +2918,7 @@ function placeContents(layer, canvas, options = {}) {
2918
2918
  let out;
2919
2919
  const move = integerMove(layer);
2920
2920
  if (move && !options.clip) {
2921
- out = _chunkCRMAXIUVcjs.translateSurface.call(void 0, src, move.x, move.y);
2921
+ out = _chunkSZ6KMZNMcjs.translateSurface.call(void 0, src, move.x, move.y);
2922
2922
  } else {
2923
2923
  const g = placementGeometry(layer);
2924
2924
  const interpolation = preview ? placement.interpolation === "nearest" ? "nearest" : "bilinear" : _nullishCoalesce(placement.interpolation, () => ( "bicubic"));
@@ -2929,7 +2929,7 @@ function placeContents(layer, canvas, options = {}) {
2929
2929
  k = step;
2930
2930
  let r = _optionalChain([options, 'access', _50 => _50.reduced, 'optionalAccess', _51 => _51.get, 'call', _52 => _52(k)]);
2931
2931
  if (!r) {
2932
- r = _chunkWSTEXEKDcjs.reduceSurface.call(void 0, src, k);
2932
+ r = _chunkT3QZ6S47cjs.reduceSurface.call(void 0, src, k);
2933
2933
  _optionalChain([options, 'access', _53 => _53.reduced, 'optionalAccess', _54 => _54.set, 'call', _55 => _55(k, r)]);
2934
2934
  }
2935
2935
  source = r;
@@ -2939,15 +2939,15 @@ function placeContents(layer, canvas, options = {}) {
2939
2939
  if (hasWarp(g)) {
2940
2940
  const f = transformMap(g);
2941
2941
  if (!f) fail2("The placement folds the contents over itself or through the horizon; keep the corners a convex quad.");
2942
- out = _chunkWSTEXEKDcjs.warpSurface.call(void 0, source, (p) => f({ x: p.x * k, y: p.y * k }), { interpolation, source: box, clip, step: step > 1 ? step : void 0 });
2942
+ out = _chunkT3QZ6S47cjs.warpSurface.call(void 0, source, (p) => f({ x: p.x * k, y: p.y * k }), { interpolation, source: box, clip, step: step > 1 ? step : void 0 });
2943
2943
  } else {
2944
2944
  const h = transformHomography(g);
2945
2945
  if (!h) fail2("The placement folds the contents over itself or through the horizon; keep the corners a convex quad.");
2946
2946
  const hk = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, [k, 0, 0, 0, k, 0, 0, 0, 1], h);
2947
- out = _chunkWSTEXEKDcjs.transformSurface.call(void 0, source, hk, { interpolation, source: box, clip, step: step > 1 ? step : void 0 });
2947
+ out = _chunkT3QZ6S47cjs.transformSurface.call(void 0, source, hk, { interpolation, source: box, clip, step: step > 1 ? step : void 0 });
2948
2948
  }
2949
2949
  } catch (e) {
2950
- if (e instanceof _chunkWSTEXEKDcjs.TransformTooLargeError) fail2(e.message);
2950
+ if (e instanceof _chunkT3QZ6S47cjs.TransformTooLargeError) fail2(e.message);
2951
2951
  throw e;
2952
2952
  }
2953
2953
  }
@@ -2970,7 +2970,7 @@ function filterMaskCoverage(mask, canvas) {
2970
2970
  if (!mask || mask.enabled === false || mask.source) return null;
2971
2971
  const W = canvas.width;
2972
2972
  const H = canvas.height;
2973
- const bytes = _chunkCRMAXIUVcjs.readRegion.call(void 0, mask.surface, { x: 0, y: 0, width: W, height: H });
2973
+ const bytes = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask.surface, { x: 0, y: 0, width: W, height: H });
2974
2974
  let v = new Float32Array(W * H);
2975
2975
  let all = true;
2976
2976
  for (let i = 0; i < v.length; i++) {
@@ -2979,7 +2979,7 @@ function filterMaskCoverage(mask, canvas) {
2979
2979
  }
2980
2980
  const feather = _nullishCoalesce(mask.feather, () => ( 0));
2981
2981
  if (all && !(feather > 0)) return null;
2982
- if (feather > 0) v = _chunkWSTEXEKDcjs.gaussianBlur.call(void 0, v, W, H, feather, "clamp");
2982
+ if (feather > 0) v = _chunkT3QZ6S47cjs.gaussianBlur.call(void 0, v, W, H, feather, "clamp");
2983
2983
  const density = _nullishCoalesce(mask.density, () => ( 1));
2984
2984
  if (density !== 1) for (let i = 0; i < v.length; i++) v[i] = 1 - density * (1 - v[i]);
2985
2985
  return v;
@@ -2992,7 +2992,7 @@ function applySmartFilters(placed, stack, canvas) {
2992
2992
  const key = JSON.stringify([W, H, active.map((f) => ({ ...f, id: void 0 }))]);
2993
2993
  let entry = filteredCache.get(placed);
2994
2994
  if (!entry || entry.key !== key) {
2995
- const base = _chunkCRMAXIUVcjs.readRegion.call(void 0, placed, { x: 0, y: 0, width: W, height: H });
2995
+ const base = _chunkSZ6KMZNMcjs.readRegion.call(void 0, placed, { x: 0, y: 0, width: W, height: H });
2996
2996
  let acc = new Uint8ClampedArray(base);
2997
2997
  for (const f of active) {
2998
2998
  const out = new Uint8ClampedArray(acc);
@@ -3001,7 +3001,7 @@ function applySmartFilters(placed, stack, canvas) {
3001
3001
  if (f.opacity >= 1) acc = out;
3002
3002
  else lerpInto(acc, out, f.opacity, null);
3003
3003
  } else {
3004
- _chunkWSTEXEKDcjs.blendTile.call(void 0, acc, out, f.blend, f.opacity, null);
3004
+ _chunkT3QZ6S47cjs.blendTile.call(void 0, acc, out, f.blend, f.opacity, null);
3005
3005
  }
3006
3006
  }
3007
3007
  entry = { key, base, filtered: acc };
@@ -3013,7 +3013,7 @@ function applySmartFilters(placed, stack, canvas) {
3013
3013
  result = new Uint8ClampedArray(entry.base);
3014
3014
  lerpInto(result, entry.filtered, 1, cov);
3015
3015
  }
3016
- return _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width: W, height: H, data: result }, 4, 0, 0);
3016
+ return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: W, height: H, data: result }, 4, 0, 0);
3017
3017
  }
3018
3018
  function lerpInto(dst, src, k, coverage) {
3019
3019
  for (let i = 0, p = 0; i < dst.length; i += 4, p++) {
@@ -3048,7 +3048,7 @@ function normalizePlacement(raw, contents) {
3048
3048
  out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
3049
3049
  }
3050
3050
  if (raw.interpolation !== void 0) {
3051
- if (!_chunkWSTEXEKDcjs.isInterpolation.call(void 0, raw.interpolation)) fail2(`Unknown interpolation "${String(raw.interpolation)}"; use nearest, bilinear or bicubic.`);
3051
+ if (!_chunkT3QZ6S47cjs.isInterpolation.call(void 0, raw.interpolation)) fail2(`Unknown interpolation "${String(raw.interpolation)}"; use nearest, bilinear or bicubic.`);
3052
3052
  if (raw.interpolation !== "bicubic") out.interpolation = raw.interpolation;
3053
3053
  }
3054
3054
  const g = { box: { x: 0, y: 0, width: contents.width, height: contents.height }, corners: out.corners, warp: _nullishCoalesce(out.warp, () => ( null)) };
@@ -3068,7 +3068,7 @@ function followMask(mask, before, after) {
3068
3068
  const inv = _chunkMUUXNRU4cjs.invertHomography.call(void 0, h0);
3069
3069
  if (!inv) return mask;
3070
3070
  const delta = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, inv, h1);
3071
- const surface = _chunkWSTEXEKDcjs.transformSurface.call(void 0, mask.surface, delta, { interpolation: "bilinear" });
3071
+ const surface = _chunkT3QZ6S47cjs.transformSurface.call(void 0, mask.surface, delta, { interpolation: "bilinear" });
3072
3072
  return { ...mask, surface };
3073
3073
  }
3074
3074
  function setSmartPlacement(layers, id, placement, canvas) {
@@ -3089,7 +3089,7 @@ function setSmartPlacement(layers, id, placement, canvas) {
3089
3089
  next.smartFilters = { ...next.smartFilters, mask: m };
3090
3090
  }
3091
3091
  next = rerender(next, canvas, "be transformed");
3092
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, masksMoved };
3092
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next), layer: next, masksMoved };
3093
3093
  }
3094
3094
  function offsetSmartObject(layers, id, dx, dy, canvas) {
3095
3095
  const layer = requireSmartObject(layers, id);
@@ -3099,26 +3099,26 @@ function offsetSmartObject(layers, id, dx, dy, canvas) {
3099
3099
  if (!mx && !my) return layers;
3100
3100
  const corners = layer.placement.corners.map((p) => ({ x: p.x + mx, y: p.y + my }));
3101
3101
  let next = { ...layer, placement: { ...layer.placement, corners } };
3102
- const moveMask = (m2) => m2 && m2.linked !== false && !m2.source ? { ...m2, surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, m2.surface, mx, my) } : m2;
3102
+ const moveMask = (m2) => m2 && m2.linked !== false && !m2.source ? { ...m2, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, m2.surface, mx, my) } : m2;
3103
3103
  if (layer.mask) next.mask = moveMask(layer.mask);
3104
3104
  if (_optionalChain([layer, 'access', _60 => _60.smartFilters, 'optionalAccess', _61 => _61.mask])) next.smartFilters = { ...layer.smartFilters, mask: moveMask(layer.smartFilters.mask) };
3105
3105
  const spatial = activeSmartFilters(layer.smartFilters).some((f) => f.kind === "blur");
3106
- const b = _chunkCRMAXIUVcjs.contentBounds.call(void 0, layer.surface);
3106
+ const b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, layer.surface);
3107
3107
  const m = SMART_RENDER_MARGIN;
3108
3108
  const cut = b && (b.x <= -m || b.y <= -m || b.x + b.width >= canvas.width + m || b.y + b.height >= canvas.height + m);
3109
3109
  if (!spatial && !cut && !(_optionalChain([next, 'access', _62 => _62.smartFilters, 'optionalAccess', _63 => _63.mask]) && activeSmartFilters(next.smartFilters).length && next.smartFilters.mask.linked === false)) {
3110
- next = { ...next, surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, layer.surface, mx, my) };
3110
+ next = { ...next, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, layer.surface, mx, my) };
3111
3111
  } else {
3112
3112
  next = rerender(next, canvas, "move");
3113
3113
  }
3114
- return _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next);
3114
+ return _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next);
3115
3115
  }
3116
3116
  function translateLayer(layer, dx, dy) {
3117
3117
  if (!dx && !dy) return layer;
3118
3118
  const moveMask = (m) => {
3119
3119
  if (!m) return m;
3120
3120
  if (m.source) fail2(`Layer "${layer.name || layer.id}" has a depth mask, which cannot move into a smart object; bake or remove it first.`);
3121
- return { ...m, surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, m.surface, dx, dy) };
3121
+ return { ...m, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, m.surface, dx, dy) };
3122
3122
  };
3123
3123
  switch (layer.type) {
3124
3124
  case "pixel":
@@ -3127,7 +3127,7 @@ function translateLayer(layer, dx, dy) {
3127
3127
  const next = {
3128
3128
  ...layer,
3129
3129
  placement: { ...layer.placement, corners: layer.placement.corners.map((p) => ({ x: p.x + dx, y: p.y + dy })) },
3130
- surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, layer.surface, dx, dy),
3130
+ surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, layer.surface, dx, dy),
3131
3131
  mask: moveMask(layer.mask)
3132
3132
  };
3133
3133
  if (!next.mask) delete next.mask;
@@ -3155,7 +3155,7 @@ function layerExtent(layer, surfaceOf, canvas) {
3155
3155
  const s = layer.type === "pixel" ? surfaceOf(layer) : layer.surface;
3156
3156
  if (s.defaultValue !== 0) b = full;
3157
3157
  else {
3158
- const c = _chunkCRMAXIUVcjs.contentBounds.call(void 0, s);
3158
+ const c = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, s);
3159
3159
  b = c ? { x: c.x + layer.offset.x, y: c.y + layer.offset.y, width: c.width, height: c.height } : null;
3160
3160
  }
3161
3161
  } else if (layer.type === "group") {
@@ -3163,7 +3163,7 @@ function layerExtent(layer, surfaceOf, canvas) {
3163
3163
  } else {
3164
3164
  b = full;
3165
3165
  }
3166
- const m = _chunkWSTEXEKDcjs.effectsMargin.call(void 0, layer.effects);
3166
+ const m = _chunkT3QZ6S47cjs.effectsMargin.call(void 0, layer.effects);
3167
3167
  if (b && m > 0) b = { x: b.x - Math.ceil(m), y: b.y - Math.ceil(m), width: b.width + 2 * Math.ceil(m), height: b.height + 2 * Math.ceil(m) };
3168
3168
  return b;
3169
3169
  }
@@ -3191,7 +3191,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
3191
3191
  if (single && single.type === "pixel") {
3192
3192
  const surface = options.surfaceOf(single);
3193
3193
  if (surface.defaultValue !== 0) fail2(`Layer "${single.name || single.id}" has no transparent area to crop to; it cannot be converted.`);
3194
- const b = _chunkCRMAXIUVcjs.contentBounds.call(void 0, surface);
3194
+ const b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, surface);
3195
3195
  if (!b) fail2(`Layer "${single.name || single.id}" has no pixels to convert; paint something first.`);
3196
3196
  const contents = {
3197
3197
  id: newContentsId(),
@@ -3199,7 +3199,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
3199
3199
  width: b.width,
3200
3200
  height: b.height,
3201
3201
  kind: "raster",
3202
- raster: _chunkCRMAXIUVcjs.translateSurface.call(void 0, surface, -b.x, -b.y)
3202
+ raster: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, surface, -b.x, -b.y)
3203
3203
  };
3204
3204
  smart = {
3205
3205
  type: "smart",
@@ -3210,14 +3210,14 @@ function convertToSmartObject(layers, ids, canvas, options) {
3210
3210
  blend: single.blend,
3211
3211
  contents,
3212
3212
  placement: placementAt(contents, b.x + single.offset.x, b.y + single.offset.y),
3213
- surface: _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4),
3213
+ surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4),
3214
3214
  offset: { x: 0, y: 0 }
3215
3215
  };
3216
3216
  if (single.clipped) smart.clipped = true;
3217
3217
  if (single.fillOpacity !== void 0) smart.fillOpacity = single.fillOpacity;
3218
3218
  if (single.effects) smart.effects = single.effects;
3219
3219
  if (single.mask) {
3220
- smart.mask = single.mask.source ? single.mask : { ...single.mask, surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, single.mask.surface, single.offset.x, single.offset.y) };
3220
+ smart.mask = single.mask.source ? single.mask : { ...single.mask, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, single.mask.surface, single.offset.x, single.offset.y) };
3221
3221
  }
3222
3222
  const filters = asSmartFilters(single.filters);
3223
3223
  if (filters) smart.smartFilters = filters;
@@ -3232,7 +3232,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
3232
3232
  delete resolved.source;
3233
3233
  layer = resolved;
3234
3234
  }
3235
- if (_chunkWSTEXEKDcjs.flattenLayers.call(void 0, [layer]).some((x) => x.type === "pixel" && x.source === "document")) fail2(`Layer "${layer.name || layer.id}" holds the document image inside a group; convert the Background on its own.`);
3235
+ if (_chunkT3QZ6S47cjs.flattenLayers.call(void 0, [layer]).some((x) => x.type === "pixel" && x.source === "document")) fail2(`Layer "${layer.name || layer.id}" holds the document image inside a group; convert the Background on its own.`);
3236
3236
  return translateLayer(layer, -b.x, -b.y);
3237
3237
  });
3238
3238
  if (nested[0].clipped) {
@@ -3251,7 +3251,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
3251
3251
  blend: "normal",
3252
3252
  contents,
3253
3253
  placement: placementAt(contents, b.x, b.y),
3254
- surface: _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4),
3254
+ surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4),
3255
3255
  offset: { x: 0, y: 0 }
3256
3256
  };
3257
3257
  }
@@ -3259,8 +3259,8 @@ function convertToSmartObject(layers, ids, canvas, options) {
3259
3259
  smart = { ...smart, surface: renderSmartObject(smart, canvas) };
3260
3260
  const below = ordered.filter((l) => l.index < top.index).length;
3261
3261
  let out = layers;
3262
- for (const l of ordered) out = _chunkWSTEXEKDcjs.mapLayer.call(void 0, out, l.layer.id, () => null);
3263
- return { layers: _chunkWSTEXEKDcjs.insertLayer.call(void 0, out, smart, parent, top.index - below), layer: smart };
3262
+ for (const l of ordered) out = _chunkT3QZ6S47cjs.mapLayer.call(void 0, out, l.layer.id, () => null);
3263
+ return { layers: _chunkT3QZ6S47cjs.insertLayer.call(void 0, out, smart, parent, top.index - below), layer: smart };
3264
3264
  }
3265
3265
  function rasterizeSmartObject(layers, id) {
3266
3266
  const layer = requireSmartObject(layers, id);
@@ -3280,7 +3280,7 @@ function rasterizeSmartObject(layers, id) {
3280
3280
  if (layer.locks) out.locks = layer.locks;
3281
3281
  if (layer.effects) out.effects = layer.effects;
3282
3282
  if (layer.fillOpacity !== void 0) out.fillOpacity = layer.fillOpacity;
3283
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => out), layer: out };
3283
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => out), layer: out };
3284
3284
  }
3285
3285
  function copySmartObject(layers, id, linked, name) {
3286
3286
  const loc = requireLayer(layers, id);
@@ -3290,19 +3290,19 @@ function copySmartObject(layers, id, linked, name) {
3290
3290
  delete copy.psd;
3291
3291
  if (!linked) copy.contents = { ...layer.contents, id: newContentsId() };
3292
3292
  if (copy.smartFilters) copy.smartFilters = { ...copy.smartFilters, filters: copy.smartFilters.filters.map((f) => ({ ...f, id: newLayerId("flt") })) };
3293
- return { layers: _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _80 => _80.parent, 'optionalAccess', _81 => _81.id]), () => ( null)), loc.index + 1), layer: copy };
3293
+ return { layers: _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _80 => _80.parent, 'optionalAccess', _81 => _81.id]), () => ( null)), loc.index + 1), layer: copy };
3294
3294
  }
3295
3295
  function instancesOf(layers, contentsId) {
3296
- return _chunkWSTEXEKDcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart" && l.contents.id === contentsId).map((l) => l.id);
3296
+ return _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart" && l.contents.id === contentsId).map((l) => l.id);
3297
3297
  }
3298
3298
  function replaceContents(layers, contentsId, contents, canvas) {
3299
3299
  const ids = instancesOf(layers, contentsId);
3300
3300
  if (!ids.length) fail2(`No smart object uses contents "${contentsId}".`);
3301
- for (const id of ids) requireUnlocked(_chunkWSTEXEKDcjs.findLayer.call(void 0, layers, id).layer, "all", "replace its contents");
3301
+ for (const id of ids) requireUnlocked(_chunkT3QZ6S47cjs.findLayer.call(void 0, layers, id).layer, "all", "replace its contents");
3302
3302
  const next = { ...contents, id: contentsId };
3303
3303
  let out = layers;
3304
3304
  for (const id of ids) {
3305
- out = _chunkWSTEXEKDcjs.mapLayer.call(void 0, out, id, (l) => {
3305
+ out = _chunkT3QZ6S47cjs.mapLayer.call(void 0, out, id, (l) => {
3306
3306
  const layer = l;
3307
3307
  return rerender({ ...layer, contents: next, placement: refitPlacement(layer, next) }, canvas, "take the new contents");
3308
3308
  });
@@ -3333,7 +3333,7 @@ function normalizeSmartFilter(raw, id = newLayerId("flt")) {
3333
3333
  if (raw.kind === "psd") fail2("Photoshop filters can only come from a PSD; add develop or blur.");
3334
3334
  const base = normalizeFilter(raw, id);
3335
3335
  const blend = _nullishCoalesce(raw.blend, () => ( "normal"));
3336
- if (!_chunkCRMAXIUVcjs.isBlendMode.call(void 0, blend) || blend === "pigment") fail2(`Unknown blend mode "${String(blend)}" for a smart filter.`);
3336
+ if (!_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, blend) || blend === "pigment") fail2(`Unknown blend mode "${String(blend)}" for a smart filter.`);
3337
3337
  const opacity = _nullishCoalesce(raw.opacity, () => ( 1));
3338
3338
  if (!(typeof opacity === "number" && opacity >= 0 && opacity <= 1)) fail2("opacity must be a number from 0 to 1.");
3339
3339
  return { ...base, blend, opacity };
@@ -3365,7 +3365,7 @@ function addSmartFilter(layers, id, filter, canvas, index) {
3365
3365
  const at = index === void 0 ? filters.length : Math.max(0, Math.min(filters.length, Math.floor(index)));
3366
3366
  filters.splice(at, 0, filter);
3367
3367
  const next = withStack(layer, { ...stack, filters }, canvas);
3368
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter };
3368
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter };
3369
3369
  }
3370
3370
  function updateSmartFilter(layers, id, filterId, changes, canvas) {
3371
3371
  const layer = editableSmart(layers, id);
@@ -3377,7 +3377,7 @@ function updateSmartFilter(layers, id, filterId, changes, canvas) {
3377
3377
  const extra = Object.keys(changes).filter((k) => !["enabled", "blend", "opacity", "kind"].includes(k));
3378
3378
  if (extra.length) fail2(`"${current.name}" is a Photoshop filter we keep but do not model; only enabled, blend and opacity change. Unknown: ${extra.join(", ")}.`);
3379
3379
  const blend = _nullishCoalesce(changes.blend, () => ( current.blend));
3380
- if (!_chunkCRMAXIUVcjs.isBlendMode.call(void 0, blend) || blend === "pigment") fail2(`Unknown blend mode "${String(blend)}" for a smart filter.`);
3380
+ if (!_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, blend) || blend === "pigment") fail2(`Unknown blend mode "${String(blend)}" for a smart filter.`);
3381
3381
  const opacity = _nullishCoalesce(changes.opacity, () => ( current.opacity));
3382
3382
  if (!(typeof opacity === "number" && opacity >= 0 && opacity <= 1)) fail2("opacity must be a number from 0 to 1.");
3383
3383
  merged = { ...current, enabled: changes.enabled === void 0 ? current.enabled : Boolean(changes.enabled), blend, opacity };
@@ -3387,7 +3387,7 @@ function updateSmartFilter(layers, id, filterId, changes, canvas) {
3387
3387
  const filters = [...layer.smartFilters.filters];
3388
3388
  filters[i] = merged;
3389
3389
  const next = withStack(layer, { ...layer.smartFilters, filters }, canvas);
3390
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter: merged };
3390
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter: merged };
3391
3391
  }
3392
3392
  function removeSmartFilter(layers, id, filterId, canvas) {
3393
3393
  const layer = editableSmart(layers, id);
@@ -3395,7 +3395,7 @@ function removeSmartFilter(layers, id, filterId, canvas) {
3395
3395
  const stack = layer.smartFilters;
3396
3396
  const filters = stack.filters.filter((f) => f.id !== filterId);
3397
3397
  const next = withStack(layer, filters.length ? { ...stack, filters } : stack.enabled ? void 0 : { enabled: false, filters }, canvas);
3398
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3398
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3399
3399
  }
3400
3400
  function moveSmartFilter(layers, id, filterId, index, canvas) {
3401
3401
  const layer = editableSmart(layers, id);
@@ -3406,12 +3406,12 @@ function moveSmartFilter(layers, id, filterId, index, canvas) {
3406
3406
  const [f] = filters.splice(i, 1);
3407
3407
  filters.splice(index, 0, f);
3408
3408
  const next = withStack(layer, { ...layer.smartFilters, filters }, canvas);
3409
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3409
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3410
3410
  }
3411
3411
  function setSmartFiltersEnabled(layers, id, enabled, canvas) {
3412
3412
  const layer = editableSmart(layers, id);
3413
3413
  const next = withStack(layer, { ...stackOf(layer), enabled: Boolean(enabled) }, canvas);
3414
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3414
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3415
3415
  }
3416
3416
  function setSmartFilterMask(layers, id, mask, canvas) {
3417
3417
  const layer = editableSmart(layers, id);
@@ -3420,7 +3420,7 @@ function setSmartFilterMask(layers, id, mask, canvas) {
3420
3420
  if (mask) stack.mask = mask;
3421
3421
  else delete stack.mask;
3422
3422
  const next = withStack(layer, stack, canvas);
3423
- return { layers: _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3423
+ return { layers: _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
3424
3424
  }
3425
3425
  function withFilterMaskSurface(layer, surface, canvas) {
3426
3426
  const stack = stackOf(layer);
@@ -3460,7 +3460,7 @@ var DEFAULT_DEPTH_MASK_VALUES = {
3460
3460
  // src/image-editor/layers/serialize.ts
3461
3461
  var LAYERED_SCHEMA_VERSION = 3;
3462
3462
  function serializePatterns(patterns) {
3463
- return patterns.map((p) => ({ id: p.id, name: p.name, png: _chunkWSTEXEKDcjs.pngDataUrl.call(void 0, p.width, p.height, p.data) }));
3463
+ return patterns.map((p) => ({ id: p.id, name: p.name, png: _chunkT3QZ6S47cjs.pngDataUrl.call(void 0, p.width, p.height, p.data) }));
3464
3464
  }
3465
3465
  function deserializePatterns(raw, problems = []) {
3466
3466
  if (!Array.isArray(raw)) return [];
@@ -3479,11 +3479,11 @@ function deserializePatterns(raw, problems = []) {
3479
3479
  var encodedCache = /* @__PURE__ */ new WeakMap();
3480
3480
  function encodeSurface(surface) {
3481
3481
  if (encodedCache.has(surface)) return encodedCache.get(surface);
3482
- const b = _chunkCRMAXIUVcjs.contentBounds.call(void 0, surface);
3482
+ const b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, surface);
3483
3483
  let out = null;
3484
3484
  if (b) {
3485
- const data = _chunkCRMAXIUVcjs.readRegion.call(void 0, surface, b);
3486
- out = { url: _chunkWSTEXEKDcjs.pngDataUrl.call(void 0, b.width, b.height, data, surface.channels), x: b.x, y: b.y };
3485
+ const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, b);
3486
+ out = { url: _chunkT3QZ6S47cjs.pngDataUrl.call(void 0, b.width, b.height, data, surface.channels), x: b.x, y: b.y };
3487
3487
  }
3488
3488
  encodedCache.set(surface, out);
3489
3489
  return out;
@@ -3505,7 +3505,7 @@ function baseFields(layer, ctx) {
3505
3505
  function serializeEffects(effects) {
3506
3506
  const out = { enabled: effects.enabled, items: JSON.parse(JSON.stringify(effects.items)) };
3507
3507
  if (effects.scale !== void 0 && effects.scale !== 1) out.scale = effects.scale;
3508
- if (effects.psd) out.psd = { key: effects.psd.key, data: _chunkWSTEXEKDcjs.bytesToBase64.call(void 0, effects.psd.data) };
3508
+ if (effects.psd) out.psd = { key: effects.psd.key, data: _chunkT3QZ6S47cjs.bytesToBase64.call(void 0, effects.psd.data) };
3509
3509
  return out;
3510
3510
  }
3511
3511
  function deserializeEffects(raw) {
@@ -3515,12 +3515,12 @@ function deserializeEffects(raw) {
3515
3515
  const p = r.psd;
3516
3516
  if (p && typeof p.key === "string" && typeof p.data === "string") {
3517
3517
  try {
3518
- psd = { key: p.key, data: _chunkWSTEXEKDcjs.base64ToBytes.call(void 0, p.data) };
3518
+ psd = { key: p.key, data: _chunkT3QZ6S47cjs.base64ToBytes.call(void 0, p.data) };
3519
3519
  } catch (e3) {
3520
3520
  psd = void 0;
3521
3521
  }
3522
3522
  }
3523
- return _chunkWSTEXEKDcjs.normalizeLayerEffects.call(void 0, { ...r, psd });
3523
+ return _chunkT3QZ6S47cjs.normalizeLayerEffects.call(void 0, { ...r, psd });
3524
3524
  }
3525
3525
  function serializeMask(mask, hint, ctx) {
3526
3526
  const out = { defaultValue: mask.defaultValue };
@@ -3574,7 +3574,7 @@ function serializeLayer(layer, ctx) {
3574
3574
  function serializeSmartFilters(stack, layerId, ctx) {
3575
3575
  const out = {
3576
3576
  enabled: stack.enabled,
3577
- filters: stack.filters.map((f) => f.kind === "psd" ? { ...f, data: _chunkWSTEXEKDcjs.bytesToBase64.call(void 0, f.data) } : JSON.parse(JSON.stringify(f)))
3577
+ filters: stack.filters.map((f) => f.kind === "psd" ? { ...f, data: _chunkT3QZ6S47cjs.bytesToBase64.call(void 0, f.data) } : JSON.parse(JSON.stringify(f)))
3578
3578
  };
3579
3579
  if (stack.mask) out.mask = serializeMask(stack.mask, `${layerId}-filter-mask`, ctx);
3580
3580
  return out;
@@ -3600,7 +3600,7 @@ function serializeSmartObject(layer, base, ctx) {
3600
3600
  }
3601
3601
  if (layer.fillOpacity !== void 0 && layer.fillOpacity !== 1) out.fillOpacity = layer.fillOpacity;
3602
3602
  if (layer.psd) {
3603
- out.psd = { key: layer.psd.key, data: _chunkWSTEXEKDcjs.bytesToBase64.call(void 0, layer.psd.data) };
3603
+ out.psd = { key: layer.psd.key, data: _chunkT3QZ6S47cjs.bytesToBase64.call(void 0, layer.psd.data) };
3604
3604
  if (layer.psd.placed) out.psd.placed = layer.psd.placed;
3605
3605
  }
3606
3606
  return out;
@@ -3611,8 +3611,8 @@ function serializeContents(c, ctx) {
3611
3611
  const enc = encodeSurface(c.raster);
3612
3612
  if (enc) {
3613
3613
  if (enc.x !== 0 || enc.y !== 0) {
3614
- const data = _chunkCRMAXIUVcjs.readRegion.call(void 0, c.raster, { x: 0, y: 0, width: c.width, height: c.height });
3615
- out.asset = ctx.addAsset(_chunkWSTEXEKDcjs.pngDataUrl.call(void 0, c.width, c.height, data, 4), `contents-${c.id}`);
3614
+ const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, c.raster, { x: 0, y: 0, width: c.width, height: c.height });
3615
+ out.asset = ctx.addAsset(_chunkT3QZ6S47cjs.pngDataUrl.call(void 0, c.width, c.height, data, 4), `contents-${c.id}`);
3616
3616
  } else out.asset = ctx.addAsset(enc.url, `contents-${c.id}`);
3617
3617
  }
3618
3618
  }
@@ -3621,7 +3621,7 @@ function serializeContents(c, ctx) {
3621
3621
  if (c.document.globalLight) out.globalLight = { ...c.document.globalLight };
3622
3622
  if (_optionalChain([c, 'access', _87 => _87.document, 'access', _88 => _88.patterns, 'optionalAccess', _89 => _89.length])) out.patterns = serializePatterns(c.document.patterns);
3623
3623
  }
3624
- if (c.file) out.file = { type: c.file.type, data: _chunkWSTEXEKDcjs.bytesToBase64.call(void 0, c.file.bytes) };
3624
+ if (c.file) out.file = { type: c.file.type, data: _chunkT3QZ6S47cjs.bytesToBase64.call(void 0, c.file.bytes) };
3625
3625
  if (c.linked) out.linked = { path: c.linked.path };
3626
3626
  return out;
3627
3627
  }
@@ -3657,7 +3657,7 @@ async function serializeLayersExternal(layers, store) {
3657
3657
  for (const [id, url] of Object.entries(inline.assets)) {
3658
3658
  let ref = refs.get(url);
3659
3659
  if (!ref) {
3660
- const parsed = _chunkWSTEXEKDcjs.parseDataUrl.call(void 0, url);
3660
+ const parsed = _chunkT3QZ6S47cjs.parseDataUrl.call(void 0, url);
3661
3661
  const png = decodePngHeader(parsed.bytes);
3662
3662
  ref = await store.put(new Blob([parsed.bytes], { type: "image/png" }), { id, width: png.width, height: png.height });
3663
3663
  if (typeof ref !== "string" || !ref) throw new Error(`The asset store returned no reference for "${id}".`);
@@ -3685,7 +3685,7 @@ async function resolveExternalAssets(assets, store, problems) {
3685
3685
  try {
3686
3686
  const blob = await store.get(ref);
3687
3687
  const bytes = new Uint8Array(await blob.arrayBuffer());
3688
- out[id] = `data:image/png;base64,${_chunkWSTEXEKDcjs.bytesToBase64.call(void 0, bytes)}`;
3688
+ out[id] = `data:image/png;base64,${_chunkT3QZ6S47cjs.bytesToBase64.call(void 0, bytes)}`;
3689
3689
  } catch (err) {
3690
3690
  problems.push(`Asset "${id}" (${ref}) could not be fetched: ${err.message}`);
3691
3691
  }
@@ -3693,9 +3693,9 @@ async function resolveExternalAssets(assets, store, problems) {
3693
3693
  return out;
3694
3694
  }
3695
3695
  function decodePngDataUrl(url, channels) {
3696
- const parsed = _chunkWSTEXEKDcjs.parseDataUrl.call(void 0, url);
3696
+ const parsed = _chunkT3QZ6S47cjs.parseDataUrl.call(void 0, url);
3697
3697
  if (!parsed) throw new Error("Asset is not a data URL.");
3698
- const png = _chunkWSTEXEKDcjs.decodePng.call(void 0, parsed.bytes, { keepGray: channels === 1 });
3698
+ const png = _chunkT3QZ6S47cjs.decodePng.call(void 0, parsed.bytes, { keepGray: channels === 1 });
3699
3699
  if (png.channels === channels) return png;
3700
3700
  if (channels === 1) {
3701
3701
  const out2 = new Uint8ClampedArray(png.width * png.height);
@@ -3713,18 +3713,18 @@ function decodePngDataUrl(url, channels) {
3713
3713
  }
3714
3714
  var num = (v, lo, hi, fallback) => typeof v === "number" && Number.isFinite(v) ? Math.min(hi, Math.max(lo, v)) : fallback;
3715
3715
  function readSurface(ref, x, y, channels, defaultValue, ctx, what) {
3716
- if (typeof ref !== "string" || !ref) return _chunkCRMAXIUVcjs.emptySurface.call(void 0, channels, defaultValue);
3716
+ if (typeof ref !== "string" || !ref) return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, channels, defaultValue);
3717
3717
  const url = ctx.assets[ref];
3718
3718
  if (typeof url !== "string") {
3719
3719
  ctx.problems.push(`${what}: asset "${ref}" is missing`);
3720
- return _chunkCRMAXIUVcjs.emptySurface.call(void 0, channels, defaultValue);
3720
+ return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, channels, defaultValue);
3721
3721
  }
3722
3722
  try {
3723
3723
  const px = (_nullishCoalesce(ctx.decodeAsset, () => ( decodePngDataUrl)))(url, channels);
3724
- return _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, px, channels, Math.round(num(x, -1e7, 1e7, 0)), Math.round(num(y, -1e7, 1e7, 0)), defaultValue);
3724
+ return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, px, channels, Math.round(num(x, -1e7, 1e7, 0)), Math.round(num(y, -1e7, 1e7, 0)), defaultValue);
3725
3725
  } catch (err) {
3726
3726
  ctx.problems.push(`${what}: asset "${ref}" could not be decoded (${err.message})`);
3727
- return _chunkCRMAXIUVcjs.emptySurface.call(void 0, channels, defaultValue);
3727
+ return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, channels, defaultValue);
3728
3728
  }
3729
3729
  }
3730
3730
  function readMask(raw, ctx, what) {
@@ -3732,7 +3732,7 @@ function readMask(raw, ctx, what) {
3732
3732
  const r = raw;
3733
3733
  const defaultValue = r.defaultValue === 255 ? 255 : 0;
3734
3734
  const mask = {
3735
- surface: r.source ? _chunkCRMAXIUVcjs.emptySurface.call(void 0, 1, 255) : readSurface(r.asset, r.x, r.y, 1, defaultValue, ctx, `${what} mask`),
3735
+ surface: r.source ? _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 1, 255) : readSurface(r.asset, r.x, r.y, 1, defaultValue, ctx, `${what} mask`),
3736
3736
  defaultValue: r.source ? 255 : defaultValue
3737
3737
  };
3738
3738
  if (typeof r.density === "number" && r.density !== 1) mask.density = num(r.density, 0, 1, 1);
@@ -3780,7 +3780,7 @@ function deserializeLayer(raw, ctx) {
3780
3780
  name: typeof r.name === "string" ? r.name : "",
3781
3781
  visible: r.visible !== false,
3782
3782
  opacity: num(r.opacity, 0, 1, 1),
3783
- blend: _chunkCRMAXIUVcjs.normalizeBlendMode.call(void 0, r.blend)
3783
+ blend: _chunkSZ6KMZNMcjs.normalizeBlendMode.call(void 0, r.blend)
3784
3784
  };
3785
3785
  if (r.clipped === true) base.clipped = true;
3786
3786
  const mask = readMask(r.mask, ctx, `Layer "${base.name || id}"`);
@@ -3797,7 +3797,7 @@ function deserializeLayer(raw, ctx) {
3797
3797
  const layer = {
3798
3798
  ...base,
3799
3799
  type: "pixel",
3800
- surface: r.source === "document" ? _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4) : readSurface(r.asset, r.x, r.y, 4, 0, ctx, `Layer "${base.name || id}"`),
3800
+ surface: r.source === "document" ? _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4) : readSurface(r.asset, r.x, r.y, 4, 0, ctx, `Layer "${base.name || id}"`),
3801
3801
  offset: { x: Math.round(num(_optionalChain([r, 'access', _90 => _90.offset, 'optionalAccess', _91 => _91.x]), -1e7, 1e7, 0)), y: Math.round(num(_optionalChain([r, 'access', _92 => _92.offset, 'optionalAccess', _93 => _93.y]), -1e7, 1e7, 0)) }
3802
3802
  };
3803
3803
  if (r.source === "document") layer.source = "document";
@@ -3816,7 +3816,7 @@ function deserializeLayer(raw, ctx) {
3816
3816
  }
3817
3817
  case "group": {
3818
3818
  const children = Array.isArray(r.children) ? r.children.map((c) => deserializeLayer(c, ctx)).filter(Boolean) : [];
3819
- const blend = r.blend === "pass-through" ? "pass-through" : _chunkCRMAXIUVcjs.isBlendMode.call(void 0, r.blend) ? r.blend : "pass-through";
3819
+ const blend = r.blend === "pass-through" ? "pass-through" : _chunkSZ6KMZNMcjs.isBlendMode.call(void 0, r.blend) ? r.blend : "pass-through";
3820
3820
  const group = { ...base, type: "group", blend, children };
3821
3821
  if (r.collapsed === true) group.collapsed = true;
3822
3822
  return group;
@@ -3858,7 +3858,7 @@ function readContents(id, ctx) {
3858
3858
  const c = { id, name: typeof raw.name === "string" ? raw.name : "Contents", width, height, kind: raw.kind === "document" ? "document" : "raster" };
3859
3859
  if (raw.file && typeof raw.file.type === "string" && typeof raw.file.data === "string") {
3860
3860
  try {
3861
- c.file = { type: raw.file.type, bytes: _chunkWSTEXEKDcjs.base64ToBytes.call(void 0, raw.file.data) };
3861
+ c.file = { type: raw.file.type, bytes: _chunkT3QZ6S47cjs.base64ToBytes.call(void 0, raw.file.data) };
3862
3862
  } catch (e4) {
3863
3863
  ctx.problems.push(`Smart object contents "${c.name}": the embedded file could not be read`);
3864
3864
  }
@@ -3866,7 +3866,7 @@ function readContents(id, ctx) {
3866
3866
  if (raw.linked && typeof raw.linked.path === "string") c.linked = { path: raw.linked.path };
3867
3867
  if (c.kind === "raster") {
3868
3868
  if (typeof raw.asset === "string") c.raster = readSurface(raw.asset, 0, 0, 4, 0, ctx, `Smart object contents "${c.name}"`);
3869
- else if (!c.file) c.raster = _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4);
3869
+ else if (!c.file) c.raster = _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
3870
3870
  } else {
3871
3871
  const outer = ctx.canvas;
3872
3872
  ctx.canvas = { width, height };
@@ -3889,11 +3889,11 @@ function readSmartFilters(raw, ctx, what) {
3889
3889
  let k = 0;
3890
3890
  for (const f of list2) {
3891
3891
  if (!f || typeof f !== "object") continue;
3892
- const blend = _chunkCRMAXIUVcjs.isBlendMode.call(void 0, f.blend) && f.blend !== "pigment" ? f.blend : "normal";
3892
+ const blend = _chunkSZ6KMZNMcjs.isBlendMode.call(void 0, f.blend) && f.blend !== "pigment" ? f.blend : "normal";
3893
3893
  const opacity = num(f.opacity, 0, 1, 1);
3894
3894
  if (f.kind === "psd") {
3895
3895
  try {
3896
- filters.push({ id: typeof f.id === "string" ? f.id : newLayerId("flt"), kind: "psd", enabled: f.enabled !== false, name: typeof f.name === "string" ? f.name : "Filter", data: _chunkWSTEXEKDcjs.base64ToBytes.call(void 0, String(_nullishCoalesce(f.data, () => ( "")))), blend, opacity });
3896
+ filters.push({ id: typeof f.id === "string" ? f.id : newLayerId("flt"), kind: "psd", enabled: f.enabled !== false, name: typeof f.name === "string" ? f.name : "Filter", data: _chunkT3QZ6S47cjs.base64ToBytes.call(void 0, String(_nullishCoalesce(f.data, () => ( "")))), blend, opacity });
3897
3897
  } catch (e5) {
3898
3898
  ctx.problems.push(`${what}: a Photoshop smart filter could not be read`);
3899
3899
  }
@@ -3919,19 +3919,19 @@ function readSmartObject(r, base, ctx) {
3919
3919
  try {
3920
3920
  const raw = { corners: p.corners };
3921
3921
  if (p.warp && _chunkDWGZUSEScjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
3922
- if (_chunkWSTEXEKDcjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
3922
+ if (_chunkT3QZ6S47cjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
3923
3923
  placement = normalizePlacement(raw, contents);
3924
3924
  } catch (e) {
3925
3925
  ctx.problems.push(`${what}: its placement is invalid (${e instanceof Error ? e.message : String(e)}); it was placed at the top left`);
3926
3926
  placement = { corners: [{ x: 0, y: 0 }, { x: contents.width, y: 0 }, { x: contents.width, y: contents.height }, { x: 0, y: contents.height }] };
3927
3927
  }
3928
- const layer = { ...base, type: "smart", contents, placement, surface: _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
3928
+ const layer = { ...base, type: "smart", contents, placement, surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
3929
3929
  const filters = readSmartFilters(r.smartFilters, ctx, what);
3930
3930
  if (filters) layer.smartFilters = filters;
3931
3931
  if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) layer.fillOpacity = num(r.fillOpacity, 0, 1, 1);
3932
3932
  if (r.psd && typeof r.psd.key === "string" && typeof r.psd.data === "string") {
3933
3933
  try {
3934
- layer.psd = { key: r.psd.key, data: _chunkWSTEXEKDcjs.base64ToBytes.call(void 0, r.psd.data) };
3934
+ layer.psd = { key: r.psd.key, data: _chunkT3QZ6S47cjs.base64ToBytes.call(void 0, r.psd.data) };
3935
3935
  if (typeof r.psd.placed === "string") layer.psd.placed = r.psd.placed;
3936
3936
  } catch (e6) {
3937
3937
  }
@@ -4255,9 +4255,9 @@ function packbitsDecodeInto(src, expected, out, at) {
4255
4255
  function inflateChecked(data, expected) {
4256
4256
  let out;
4257
4257
  try {
4258
- out = _chunkWSTEXEKDcjs.inflate.call(void 0, data, { maxOutput: expected + (1 << 20), sizeHint: expected, verify: false });
4258
+ out = _chunkT3QZ6S47cjs.inflate.call(void 0, data, { maxOutput: expected + (1 << 20), sizeHint: expected, verify: false });
4259
4259
  } catch (e) {
4260
- throw new PsdError(`ZIP channel data: ${e instanceof _chunkWSTEXEKDcjs.ZlibError || e instanceof Error ? e.message : String(e)}`);
4260
+ throw new PsdError(`ZIP channel data: ${e instanceof _chunkT3QZ6S47cjs.ZlibError || e instanceof Error ? e.message : String(e)}`);
4261
4261
  }
4262
4262
  if (out.length < expected) throw new PsdError(`ZIP stream produced ${out.length} of ${expected} bytes.`);
4263
4263
  return out.length === expected ? out : out.subarray(0, expected);
@@ -5151,11 +5151,11 @@ function filterMaskFromItem(item) {
5151
5151
  const height = rect.bottom - rect.top;
5152
5152
  if (!(width > 0 && height > 0) || width * height > 1 << 28) return null;
5153
5153
  const bytes = decodePlanes(plane.compression, plane.data, { planes: 1, width, height, depth: 8, psb: true });
5154
- const surface = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data: bytes }, 1, rect.left, rect.top, 255);
5154
+ const surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: bytes }, 1, rect.left, rect.top, 255);
5155
5155
  return { surface, defaultValue: 255 };
5156
5156
  }
5157
5157
  function filterMaskItem(placed, mask, area) {
5158
- const painted = _chunkCRMAXIUVcjs.contentBounds.call(void 0, mask.surface);
5158
+ const painted = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface);
5159
5159
  let b = _nullishCoalesce(painted, () => ( { x: 0, y: 0, width: 1, height: 1 }));
5160
5160
  if (mask.defaultValue !== 255 && area) {
5161
5161
  const x0 = Math.min(area.x, _nullishCoalesce(_optionalChain([painted, 'optionalAccess', _102 => _102.x]), () => ( area.x)));
@@ -5165,7 +5165,7 @@ function filterMaskItem(placed, mask, area) {
5165
5165
  b = { x: x0, y: y0, width: x1 - x0, height: y1 - y0 };
5166
5166
  }
5167
5167
  const rect = { top: b.y, left: b.x, bottom: b.y + b.height, right: b.x + b.width };
5168
- const values = _chunkCRMAXIUVcjs.readRegion.call(void 0, mask.surface, b);
5168
+ const values = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask.surface, b);
5169
5169
  const plane = new Uint8Array(values.buffer, values.byteOffset, values.length);
5170
5170
  return {
5171
5171
  id: placed,
@@ -6297,11 +6297,11 @@ function safeSize(ctx, rect, name) {
6297
6297
  }
6298
6298
  function recordPixels(ctx, rec, name) {
6299
6299
  const { width, height } = safeSize(ctx, rec.rect, name);
6300
- if (!width || !height || ctx.skipPixels) return _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4);
6300
+ if (!width || !height || ctx.skipPixels) return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
6301
6301
  const ids = [...Array.from({ length: ctx.colorCount }, (_, i) => i), CHANNEL_ALPHA];
6302
6302
  const planes = ids.map((id) => rec.channels.some((c) => c.id === id) ? _nullishCoalesce(decodeOr(ctx, rec, id, name), () => ( null)) : void 0);
6303
- if (planes.some((p) => p === null)) return _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4);
6304
- if (planes.every((p) => p === void 0)) return _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4);
6303
+ if (planes.some((p) => p === null)) return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
6304
+ if (planes.every((p) => p === void 0)) return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
6305
6305
  const data = toRgba8({
6306
6306
  width,
6307
6307
  height,
@@ -6311,7 +6311,7 @@ function recordPixels(ctx, rec, name) {
6311
6311
  alpha: planes[ctx.colorCount],
6312
6312
  palette: ctx.palette
6313
6313
  });
6314
- return _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, rec.rect.left, rec.rect.top);
6314
+ return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, rec.rect.left, rec.rect.top);
6315
6315
  }
6316
6316
  function recordMask(ctx, rec, name) {
6317
6317
  const m = rec.mask;
@@ -6322,11 +6322,11 @@ function recordMask(ctx, rec, name) {
6322
6322
  const rect = useReal ? m.real.rect : m.rect;
6323
6323
  const def = (useReal ? m.real.background : m.defaultColor) >= 128 ? 255 : 0;
6324
6324
  const flags = useReal ? m.real.flags : m.flags;
6325
- let surface = _chunkCRMAXIUVcjs.emptySurface.call(void 0, 1, def);
6325
+ let surface = _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 1, def);
6326
6326
  const { width, height } = safeSize(ctx, rect, name);
6327
6327
  if (width && height && !ctx.skipPixels) {
6328
6328
  const plane = decodeOr(ctx, rec, id, name);
6329
- if (plane) surface = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data: toMask8(plane, width, height, ctx.file.header.depth) }, 1, rect.left, rect.top, def);
6329
+ if (plane) surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: toMask8(plane, width, height, ctx.file.header.depth) }, 1, rect.left, rect.top, def);
6330
6330
  }
6331
6331
  const mask = { surface, defaultValue: def };
6332
6332
  if (m.userDensity !== void 0 && m.userDensity < 255) mask.density = percent(m.userDensity);
@@ -6386,7 +6386,7 @@ function recordEffects(ctx, rec, name, notes, group) {
6386
6386
  }
6387
6387
  for (const e of parsed.effects.items) {
6388
6388
  for (const id of patternIds(e)) {
6389
- if (ctx.patterns.has(id) || _chunkWSTEXEKDcjs.builtinPattern.call(void 0, id)) continue;
6389
+ if (ctx.patterns.has(id) || _chunkT3QZ6S47cjs.builtinPattern.call(void 0, id)) continue;
6390
6390
  ctx.warn.add("A pattern effect uses a pattern the file does not contain, and paints nothing", name);
6391
6391
  notes.push(`pattern "${id}" is not in the file`);
6392
6392
  }
@@ -6465,7 +6465,7 @@ function importNode(ctx, node, depth) {
6465
6465
  if (!file || file.kind !== "liFD") notes.push("linked contents come in as the stored pixels");
6466
6466
  entry.type = "smart";
6467
6467
  entry.status = notes.length ? "approximated" : "mapped";
6468
- return { type: "pixel", id: ctx.newId(name), ...props, surface: _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
6468
+ return { type: "pixel", id: ctx.newId(name), ...props, surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
6469
6469
  }
6470
6470
  }
6471
6471
  if (kind === "smart-object" && !ctx.skipPixels) {
@@ -6515,8 +6515,8 @@ function contentsFor(ctx, placed, name, notes) {
6515
6515
  document: { layers: nested.layers, globalLight: nested.globalLight, patterns: nested.patterns.length ? nested.patterns : void 0 }
6516
6516
  };
6517
6517
  } else if (t.ext === "png") {
6518
- const png = _chunkWSTEXEKDcjs.decodePng.call(void 0, file.bytes);
6519
- out = { ...base, kind: "raster", width: png.width, height: png.height, raster: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, png, 4, 0, 0) };
6518
+ const png = _chunkT3QZ6S47cjs.decodePng.call(void 0, file.bytes);
6519
+ out = { ...base, kind: "raster", width: png.width, height: png.height, raster: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, png, 4, 0, 0) };
6520
6520
  } else {
6521
6521
  const size = _nullishCoalesce(placed.size, () => ( { width: 0, height: 0 }));
6522
6522
  if (!(size.width > 0 && size.height > 0)) throw new PsdError("the contents have no stored size");
@@ -6571,7 +6571,7 @@ function importSmart(ctx, rec, name, notes, props) {
6571
6571
  width,
6572
6572
  height,
6573
6573
  kind: "raster",
6574
- raster: _chunkCRMAXIUVcjs.translateSurface.call(void 0, surface, -rec.rect.left, -rec.rect.top)
6574
+ raster: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, surface, -rec.rect.left, -rec.rect.top)
6575
6575
  };
6576
6576
  if (file && file.kind !== "liFD") {
6577
6577
  contents.linked = { path: _nullishCoalesce(file.path, () => ( file.name)) };
@@ -6645,7 +6645,7 @@ function mergedLayer(ctx) {
6645
6645
  visible: true,
6646
6646
  opacity: 1,
6647
6647
  blend: "normal",
6648
- surface: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4),
6648
+ surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4),
6649
6649
  offset: { x: 0, y: 0 }
6650
6650
  };
6651
6651
  }
@@ -6822,34 +6822,34 @@ function blendOf(d, key, fallback, notes) {
6822
6822
  function colorOf(d, fallback = "#000000") {
6823
6823
  if (!d) return fallback;
6824
6824
  const g = (k) => descNumber(d, k);
6825
- if (g("redFloat") !== void 0) return _chunkWSTEXEKDcjs.effectColorHex.call(void 0, [g("redFloat"), _nullishCoalesce(g("greenFloat"), () => ( 0)), _nullishCoalesce(g("blueFloat"), () => ( 0))]);
6825
+ if (g("redFloat") !== void 0) return _chunkT3QZ6S47cjs.effectColorHex.call(void 0, [g("redFloat"), _nullishCoalesce(g("greenFloat"), () => ( 0)), _nullishCoalesce(g("blueFloat"), () => ( 0))]);
6826
6826
  switch (d.classId) {
6827
6827
  case "HSBC": {
6828
6828
  const rgb = decodePsdColor(1, [(_nullishCoalesce(g("H "), () => ( 0))) / 360 * 65535, (_nullishCoalesce(g("Strt"), () => ( 0))) / 100 * 65535, (_nullishCoalesce(g("Brgh"), () => ( 0))) / 100 * 65535]);
6829
- return rgb ? _chunkWSTEXEKDcjs.effectColorHex.call(void 0, rgb) : fallback;
6829
+ return rgb ? _chunkT3QZ6S47cjs.effectColorHex.call(void 0, rgb) : fallback;
6830
6830
  }
6831
6831
  case "CMYC": {
6832
6832
  const inv = (k) => (1 - (_nullishCoalesce(g(k), () => ( 0))) / 100) * 65535;
6833
6833
  const rgb = decodePsdColor(2, [inv("Cyn "), inv("Mgnt"), inv("Ylw "), inv("Blck")]);
6834
- return rgb ? _chunkWSTEXEKDcjs.effectColorHex.call(void 0, rgb) : fallback;
6834
+ return rgb ? _chunkT3QZ6S47cjs.effectColorHex.call(void 0, rgb) : fallback;
6835
6835
  }
6836
6836
  case "LbCl": {
6837
6837
  const rgb = decodePsdColor(7, [(_nullishCoalesce(g("Lmnc"), () => ( 0))) * 100, Math.round((_nullishCoalesce(g("A "), () => ( 0))) * 100) & 65535, Math.round((_nullishCoalesce(g("B "), () => ( 0))) * 100) & 65535]);
6838
- return rgb ? _chunkWSTEXEKDcjs.effectColorHex.call(void 0, rgb) : fallback;
6838
+ return rgb ? _chunkT3QZ6S47cjs.effectColorHex.call(void 0, rgb) : fallback;
6839
6839
  }
6840
6840
  case "Grsc": {
6841
6841
  const v = 1 - (_nullishCoalesce(g("Gry "), () => ( 0))) / 100;
6842
- return _chunkWSTEXEKDcjs.effectColorHex.call(void 0, [v, v, v]);
6842
+ return _chunkT3QZ6S47cjs.effectColorHex.call(void 0, [v, v, v]);
6843
6843
  }
6844
6844
  }
6845
6845
  const r = g("Rd ");
6846
6846
  const gr = g("Grn ");
6847
6847
  const b = g("Bl ");
6848
6848
  if (r === void 0 || gr === void 0 || b === void 0) return fallback;
6849
- return _chunkWSTEXEKDcjs.effectColorHex.call(void 0, [r / 255, gr / 255, b / 255]);
6849
+ return _chunkT3QZ6S47cjs.effectColorHex.call(void 0, [r / 255, gr / 255, b / 255]);
6850
6850
  }
6851
6851
  function colorDesc(hex) {
6852
- const [r, g, b] = _nullishCoalesce(_chunkWSTEXEKDcjs.parseEffectColor.call(void 0, hex), () => ( [0, 0, 0]));
6852
+ const [r, g, b] = _nullishCoalesce(_chunkT3QZ6S47cjs.parseEffectColor.call(void 0, hex), () => ( [0, 0, 0]));
6853
6853
  return descriptor("RGBC", [
6854
6854
  ["Rd ", dbl2(r * 255)],
6855
6855
  ["Grn ", dbl2(g * 255)],
@@ -6932,9 +6932,9 @@ function gradientOf(d, notes) {
6932
6932
  raw.forEach((s, i) => {
6933
6933
  if (i > 0 && Math.abs(s.mid - 0.5) > 1e-3) {
6934
6934
  const a = raw[i - 1];
6935
- const ca = _chunkWSTEXEKDcjs.parseEffectColor.call(void 0, a.color);
6936
- const cb = _chunkWSTEXEKDcjs.parseEffectColor.call(void 0, s.color);
6937
- stops.push({ position: a.position + (s.position - a.position) * s.mid, color: _chunkWSTEXEKDcjs.effectColorHex.call(void 0, ca.map((v, k) => (v + cb[k]) / 2)) });
6935
+ const ca = _chunkT3QZ6S47cjs.parseEffectColor.call(void 0, a.color);
6936
+ const cb = _chunkT3QZ6S47cjs.parseEffectColor.call(void 0, s.color);
6937
+ stops.push({ position: a.position + (s.position - a.position) * s.mid, color: _chunkT3QZ6S47cjs.effectColorHex.call(void 0, ca.map((v, k) => (v + cb[k]) / 2)) });
6938
6938
  notes.add("gradient midpoints are drawn as straight segments");
6939
6939
  }
6940
6940
  stops.push({ position: s.position, color: s.color });
@@ -7046,8 +7046,8 @@ var KINDS = [
7046
7046
  ["FrFX", "frameFXMulti", "stroke"]
7047
7047
  ];
7048
7048
  function common(d, kind, notes) {
7049
- const def = _chunkWSTEXEKDcjs.defaultLayerEffect.call(void 0, kind, "x");
7050
- return { id: _chunkWSTEXEKDcjs.newEffectId.call(void 0, ), enabled: descBool(d, "enab") !== false, blend: blendOf(d, "Md ", def.blend, notes), opacity: clamp3(pct(d, "Opct", def.opacity), 0, 1) };
7049
+ const def = _chunkT3QZ6S47cjs.defaultLayerEffect.call(void 0, kind, "x");
7050
+ return { id: _chunkT3QZ6S47cjs.newEffectId.call(void 0, ), enabled: descBool(d, "enab") !== false, blend: blendOf(d, "Md ", def.blend, notes), opacity: clamp3(pct(d, "Opct", def.opacity), 0, 1) };
7051
7051
  }
7052
7052
  function readOne(kind, d, notes) {
7053
7053
  const size = (key, fallback) => clamp3(num2(d, key, fallback), 0, 250);
@@ -7090,7 +7090,7 @@ function readOne(kind, d, notes) {
7090
7090
  case "bevel-emboss": {
7091
7091
  const styles = { OtrB: "outer-bevel", InrB: "inner-bevel", Embs: "emboss", PlEb: "pillow-emboss", strokeEmboss: "stroke-emboss" };
7092
7092
  const out = {
7093
- id: _chunkWSTEXEKDcjs.newEffectId.call(void 0, ),
7093
+ id: _chunkT3QZ6S47cjs.newEffectId.call(void 0, ),
7094
7094
  enabled: descBool(d, "enab") !== false,
7095
7095
  kind,
7096
7096
  style: _nullishCoalesce(styles[_nullishCoalesce(enumOf2(d, "bvlS"), () => ( ""))], () => ( "inner-bevel")),
@@ -7301,10 +7301,10 @@ function writeLfx2(effects) {
7301
7301
  ["Scl ", unit2("#Prc", 100)],
7302
7302
  ["masterFXSwitch", boolV2(effects.enabled)]
7303
7303
  ];
7304
- const scale = _chunkWSTEXEKDcjs.effectsScale.call(void 0, effects);
7304
+ const scale = _chunkT3QZ6S47cjs.effectsScale.call(void 0, effects);
7305
7305
  let dropped = 0;
7306
7306
  for (const [single, multi, kind] of KINDS) {
7307
- const of = effects.items.filter((e) => e.kind === kind).map((e) => writeOne(_chunkWSTEXEKDcjs.scaleLayerEffect.call(void 0, e, scale)));
7307
+ const of = effects.items.filter((e) => e.kind === kind).map((e) => writeOne(_chunkT3QZ6S47cjs.scaleLayerEffect.call(void 0, e, scale)));
7308
7308
  if (!of.length) continue;
7309
7309
  if (of.length === 1) items.push([single, obj2(of[0])]);
7310
7310
  else if (multi) items.push([multi, { type: "VlLs", items: of.map(obj2) }]);
@@ -7336,7 +7336,7 @@ function parseLrfx(data) {
7336
7336
  const colorAt = (rd) => {
7337
7337
  rd.u16();
7338
7338
  const c = [rd.u16(), rd.u16(), rd.u16(), rd.u16()];
7339
- return _chunkWSTEXEKDcjs.effectColorHex.call(void 0, [c[0] >> 8, c[1] >> 8, c[2] >> 8].map((v) => v / 255));
7339
+ return _chunkT3QZ6S47cjs.effectColorHex.call(void 0, [c[0] >> 8, c[1] >> 8, c[2] >> 8].map((v) => v / 255));
7340
7340
  };
7341
7341
  const blendAt = (rd) => {
7342
7342
  rd.skip(4);
@@ -7355,7 +7355,7 @@ function parseLrfx(data) {
7355
7355
  const enabled = b.u8() !== 0;
7356
7356
  const useGlobalLight = b.u8() !== 0;
7357
7357
  const opacity = b.u8() / 255;
7358
- const base = { id: _chunkWSTEXEKDcjs.newEffectId.call(void 0, ), enabled, blend, opacity, color, angle, useGlobalLight, distance: clamp3(distance, 0, 3e4), size: clamp3(blur, 0, 250), antiAlias: false, noise: 0 };
7358
+ const base = { id: _chunkT3QZ6S47cjs.newEffectId.call(void 0, ), enabled, blend, opacity, color, angle, useGlobalLight, distance: clamp3(distance, 0, 3e4), size: clamp3(blur, 0, 250), antiAlias: false, noise: 0 };
7359
7359
  items.push(key === "dsdw" ? { ...base, kind: "drop-shadow", spread: 0, knocksOut: true } : { ...base, kind: "inner-shadow", choke: 0 });
7360
7360
  } else if (key === "oglw" || key === "iglw") {
7361
7361
  b.u32();
@@ -7365,7 +7365,7 @@ function parseLrfx(data) {
7365
7365
  const blend = blendAt(b);
7366
7366
  const enabled = b.u8() !== 0;
7367
7367
  const opacity = b.u8() / 255;
7368
- const base = { id: _chunkWSTEXEKDcjs.newEffectId.call(void 0, ), enabled, blend, opacity, fill: { type: "color", color }, technique: "softer", size: clamp3(blur, 0, 250), antiAlias: false, range: 0.5, jitter: 0, noise: 0 };
7368
+ const base = { id: _chunkT3QZ6S47cjs.newEffectId.call(void 0, ), enabled, blend, opacity, fill: { type: "color", color }, technique: "softer", size: clamp3(blur, 0, 250), antiAlias: false, range: 0.5, jitter: 0, noise: 0 };
7369
7369
  items.push(key === "oglw" ? { ...base, kind: "outer-glow", spread: 0 } : { ...base, kind: "inner-glow", choke: 0, source: "edge" });
7370
7370
  } else if (key === "sofi") {
7371
7371
  b.u32();
@@ -7373,7 +7373,7 @@ function parseLrfx(data) {
7373
7373
  const color = colorAt(b);
7374
7374
  const opacity = b.u8() / 255;
7375
7375
  const enabled = b.u8() !== 0;
7376
- items.push({ id: _chunkWSTEXEKDcjs.newEffectId.call(void 0, ), kind: "color-overlay", enabled, blend, opacity, color });
7376
+ items.push({ id: _chunkT3QZ6S47cjs.newEffectId.call(void 0, ), kind: "color-overlay", enabled, blend, opacity, color });
7377
7377
  } else if (key === "bevl") notes.add("legacy bevels are not read");
7378
7378
  }
7379
7379
  return { effects: { enabled: true, items }, notes: [...notes] };
@@ -7423,14 +7423,14 @@ function rleChannel(id, plane, width, height, psb) {
7423
7423
  var emptyChannel = (id) => ({ id, compression: 0, data: new Uint8Array(0) });
7424
7424
  function maskChannel(mask, ox, oy, psb) {
7425
7425
  if (mask.source) throw new PsdError("A parametric mask must be baked before export.");
7426
- const bounds = _chunkCRMAXIUVcjs.contentBounds.call(void 0, mask.surface);
7426
+ const bounds = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface);
7427
7427
  const def = mask.defaultValue;
7428
7428
  const flags = (mask.enabled === false ? MASK_FLAG_DISABLED : 0) | (mask.linked === false ? MASK_FLAG_UNLINKED : 0);
7429
7429
  const m = { rect: EMPTY_RECT, defaultColor: def, flags };
7430
7430
  if ((_nullishCoalesce(mask.density, () => ( 1))) < 1) m.userDensity = Math.round(Math.max(0, _nullishCoalesce(mask.density, () => ( 1))) * 255);
7431
7431
  if ((_nullishCoalesce(mask.feather, () => ( 0))) > 0) m.userFeather = mask.feather;
7432
7432
  if (!bounds) return { channel: emptyChannel(CHANNEL_USER_MASK), mask: m };
7433
- const plane = _chunkCRMAXIUVcjs.readRegion.call(void 0, mask.surface, bounds);
7433
+ const plane = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask.surface, bounds);
7434
7434
  m.rect = toRect({ ...bounds, x: bounds.x + ox, y: bounds.y + oy });
7435
7435
  return { channel: rleChannel(CHANNEL_USER_MASK, new Uint8Array(plane.buffer, plane.byteOffset, plane.length), bounds.width, bounds.height, psb), mask: m };
7436
7436
  }
@@ -7457,7 +7457,7 @@ function prepareNestedLayers(layers) {
7457
7457
  delete plain.effects;
7458
7458
  delete plain.fillOpacity;
7459
7459
  const data = new LayerCompositor().composite([plain], r, { width: r.x + r.width, height: r.y + r.height });
7460
- p.surface = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width: r.width, height: r.height, data }, 4, r.x - l.offset.x, r.y - l.offset.y);
7460
+ p.surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: r.width, height: r.height, data }, 4, r.x - l.offset.x, r.y - l.offset.y);
7461
7461
  }
7462
7462
  }
7463
7463
  delete p.filters;
@@ -7476,11 +7476,11 @@ function smartContentsFile(c) {
7476
7476
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
7477
7477
  if (c.file) return { name: c.name, bytes: c.file.bytes };
7478
7478
  if (c.kind === "raster") {
7479
- const data = _chunkCRMAXIUVcjs.readRegion.call(void 0, contentsSurface(c), { x: 0, y: 0, width: c.width, height: c.height });
7480
- return { name: `${base}.png`, bytes: _chunkWSTEXEKDcjs.encodePng.call(void 0, c.width, c.height, data) };
7479
+ const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, contentsSurface(c), { x: 0, y: 0, width: c.width, height: c.height });
7480
+ return { name: `${base}.png`, bytes: _chunkT3QZ6S47cjs.encodePng.call(void 0, c.width, c.height, data) };
7481
7481
  }
7482
7482
  const doc = c.document;
7483
- const merged = _chunkCRMAXIUVcjs.readRegion.call(void 0, contentsSurface(c), { x: 0, y: 0, width: c.width, height: c.height });
7483
+ const merged = _chunkSZ6KMZNMcjs.readRegion.call(void 0, contentsSurface(c), { x: 0, y: 0, width: c.width, height: c.height });
7484
7484
  const res = exportPsd({ width: c.width, height: c.height, layers: prepareNestedLayers(doc.layers), merged, patterns: doc.patterns, globalLight: doc.globalLight });
7485
7485
  return { name: `${base}.${res.psb ? "psb" : "psd"}`, bytes: res.bytes };
7486
7486
  }
@@ -7528,7 +7528,7 @@ function exportPsd(input) {
7528
7528
  const key = layer.type === "group" ? "lfxs" : "lfx2";
7529
7529
  if (fx.psd) {
7530
7530
  const original = parseLfx2(fx.psd.data);
7531
- if (original ? _chunkWSTEXEKDcjs.effectsFingerprint.call(void 0, original.effects) === _chunkWSTEXEKDcjs.effectsFingerprint.call(void 0, fx) : !fx.items.length) return { key, data: padEven(fx.psd.data) };
7531
+ if (original ? _chunkT3QZ6S47cjs.effectsFingerprint.call(void 0, original.effects) === _chunkT3QZ6S47cjs.effectsFingerprint.call(void 0, fx) : !fx.items.length) return { key, data: padEven(fx.psd.data) };
7532
7532
  }
7533
7533
  if (!fx.items.length && fx.enabled && (_nullishCoalesce(fx.scale, () => ( 1))) === 1) return null;
7534
7534
  const { data, dropped } = writeLfx2(fx);
@@ -7608,10 +7608,10 @@ function exportPsd(input) {
7608
7608
  extra.push({ key: "iOpa", data: Uint8Array.from([Math.round(Math.max(0, layer.fillOpacity) * 255), 0, 0, 0]) });
7609
7609
  }
7610
7610
  const rec = { ...common2(layer, extra), rect: EMPTY_RECT, channels: [], blendKey: _nullishCoalesce(BLEND_TO_PSD[layer.blend], () => ( "norm")) };
7611
- const bounds = _chunkCRMAXIUVcjs.contentBounds.call(void 0, layer.surface);
7611
+ const bounds = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, layer.surface);
7612
7612
  if (bounds) {
7613
7613
  const n2 = bounds.width * bounds.height;
7614
- const [r2, g2, b2, a2] = rgbaToPlanes(_chunkCRMAXIUVcjs.readRegion.call(void 0, layer.surface, bounds), n2);
7614
+ const [r2, g2, b2, a2] = rgbaToPlanes(_chunkSZ6KMZNMcjs.readRegion.call(void 0, layer.surface, bounds), n2);
7615
7615
  rec.rect = toRect({ ...bounds, x: bounds.x + layer.offset.x, y: bounds.y + layer.offset.y });
7616
7616
  rec.channels = [
7617
7617
  rleChannel(CHANNEL_ALPHA, a2, bounds.width, bounds.height, psb),
@@ -7659,10 +7659,10 @@ function exportPsd(input) {
7659
7659
  const fm = _optionalChain([layer, 'access', _152 => _152.smartFilters, 'optionalAccess', _153 => _153.mask]);
7660
7660
  if (fm && !fm.source) filterItems.push(filterMaskItem(placedId, fm, { x: 0, y: 0, width, height }));
7661
7661
  const rec = { ...common2(layer, extra), rect: EMPTY_RECT, channels: [], blendKey: _nullishCoalesce(BLEND_TO_PSD[layer.blend], () => ( "norm")) };
7662
- const bounds = _chunkCRMAXIUVcjs.contentBounds.call(void 0, layer.surface);
7662
+ const bounds = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, layer.surface);
7663
7663
  if (bounds) {
7664
7664
  const n2 = bounds.width * bounds.height;
7665
- const [r2, g2, b2, a2] = rgbaToPlanes(_chunkCRMAXIUVcjs.readRegion.call(void 0, layer.surface, bounds), n2);
7665
+ const [r2, g2, b2, a2] = rgbaToPlanes(_chunkSZ6KMZNMcjs.readRegion.call(void 0, layer.surface, bounds), n2);
7666
7666
  rec.rect = toRect(bounds);
7667
7667
  rec.channels = [
7668
7668
  rleChannel(CHANNEL_ALPHA, a2, bounds.width, bounds.height, psb),
@@ -7724,7 +7724,7 @@ function exportPsd(input) {
7724
7724
  const byId = new Map((_nullishCoalesce(input.patterns, () => ( []))).map((p) => [p.id, p]));
7725
7725
  const embed = [];
7726
7726
  for (const id of patternIds2) {
7727
- const p = _nullishCoalesce(byId.get(id), () => ( _chunkWSTEXEKDcjs.builtinPattern.call(void 0, id)));
7727
+ const p = _nullishCoalesce(byId.get(id), () => ( _chunkT3QZ6S47cjs.builtinPattern.call(void 0, id)));
7728
7728
  if (p) embed.push(p);
7729
7729
  else note(`Pattern "${id}" is not in the document and was not embedded`, id);
7730
7730
  }
@@ -8033,4 +8033,4 @@ function exportPsd(input) {
8033
8033
 
8034
8034
 
8035
8035
  exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.normalizeProcessVersion = normalizeProcessVersion; exports.srgbToLinear = srgbToLinear; exports.linearToSrgb = linearToSrgb; exports.LUMA_709 = LUMA_709; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.mulMatrix3 = mulMatrix3; exports.applyMatrix3 = applyMatrix3; exports.invertMatrix3 = invertMatrix3; exports.D65 = D65; exports.bradfordAdaptation = bradfordAdaptation; exports.wbMatrix = wbMatrix; exports.linearSrgbToXy = linearSrgbToXy; exports.TINT_SCALE = TINT_SCALE; exports.MIN_KELVIN = MIN_KELVIN; exports.MAX_KELVIN = MAX_KELVIN; exports.xyToUv = xyToUv; exports.uvToXy = uvToXy; exports.tempTintToXy = tempTintToXy; exports.xyToTempTint = xyToTempTint; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.temperatureToKelvin = temperatureToKelvin; exports.kelvinToTemperature = kelvinToTemperature; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.toneCurve = toneCurve; exports.buildToneLut = buildToneLut; exports.sampleToneLut = sampleToneLut; exports.normalizeAngle = normalizeAngle; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.getRotatedSize = getRotatedSize; exports.projectImagePoint = projectImagePoint; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.projectImageRect = projectImageRect; exports.clampCropToImage = clampCropToImage; exports.getViewportProjection = getViewportProjection; exports.getViewportMetrics = getViewportMetrics; exports.canvasToImagePoint = canvasToImagePoint; exports.imageToCanvasPoint = imageToCanvasPoint; exports.mapCropHandle = mapCropHandle; exports.hitTestCrop = hitTestCrop; exports.getCropCursor = getCropCursor; exports.calculateCropDrag = calculateCropDrag; exports.getAnnotationBounds = getAnnotationBounds; exports.hitTestAnnotation = hitTestAnnotation; exports.SELECTION_MODES = SELECTION_MODES; exports.isSelectionMode = isSelectionMode; exports.parseSelectionMode = parseSelectionMode; exports.computeSelectionBounds = computeSelectionBounds; exports.createSelectionMask = createSelectionMask; exports.fullSelection = fullSelection; exports.isSelectionEmpty = isSelectionEmpty; exports.selectionValueAt = selectionValueAt; exports.coverageToByte = coverageToByte; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionToCoverage = selectionToCoverage; exports.selectionArea = selectionArea; exports.combineSelections = combineSelections; exports.invertSelection = invertSelection; exports.resizeSelection = resizeSelection; exports.selectionFromPixels = selectionFromPixels; exports.selectionToPixels = selectionToPixels; exports.encodeSelectionRle = encodeSelectionRle; exports.decodeSelectionRle = decodeSelectionRle; exports.serializeSelection = serializeSelection; exports.deserializeSelection = deserializeSelection; exports.hashMaskContent = hashMaskContent; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.distanceTransform = distanceTransform; exports.expandCoverage = expandCoverage; exports.contractCoverage = contractCoverage; exports.borderCoverage = borderCoverage; exports.smoothCoverage = smoothCoverage; exports.featherCoverage = featherCoverage; exports.greyMorphology = greyMorphology; exports.shiftCoverage = shiftCoverage; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.modifySelection = modifySelection; exports.normalizeLayerMask = normalizeLayerMask; exports.layerMaskFromSelection = layerMaskFromSelection; exports.updateLayerMaskProps = updateLayerMaskProps; exports.decodeLayerMask = decodeLayerMask; exports.layerMaskKey = layerMaskKey; exports.layerMaskCoverage = layerMaskCoverage; exports.projectMaskCoverage = projectMaskCoverage; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.sampleLut = sampleLut; exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.isAdjustmentKind = isAdjustmentKind; exports.adjustmentKindLabel = adjustmentKindLabel; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.neutralHueRange = neutralHueRange; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.createAdjustmentLayer = createAdjustmentLayer; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.curveLutFromLevels = curveLutFromLevels; exports.levelsValue = levelsValue; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.hueRangeWeight = hueRangeWeight; exports.hueRangeTables = hueRangeTables; exports.hueSaturation = hueSaturation; exports.rangeLightness = rangeLightness; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.colorBalanceChannel = colorBalanceChannel; exports.blackWhiteGray = blackWhiteGray; exports.D50 = D50; exports.XYZ_D50_TO_SRGB = XYZ_D50_TO_SRGB; exports.photoFilterMatrix = photoFilterMatrix; exports.posterizeValue = posterizeValue; exports.rgbToGray = rgbToGray; exports.hexToRgb = hexToRgb; exports.toneLuts = toneLuts; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustments = applyAdjustments; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.removeAlpha = removeAlpha; exports.newLayerId = newLayerId; exports.pixelLayers = pixelLayers; exports.developFilter = developFilter; exports.blurFilter = blurFilter; exports.isActiveFilter = isActiveFilter; exports.isSpatialFilter = isSpatialFilter; exports.pixelLayerBounds = pixelLayerBounds; exports.layerTypeLabel = layerTypeLabel; exports.hasSurface = hasSurface; exports.smartObjectLayers = smartObjectLayers; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.depthMaskAlpha = depthMaskAlpha; exports.runLayerFilters = runLayerFilters; exports.LayerCompositor = LayerCompositor; exports.DEFAULT_ADJUSTMENTS_VALUES = DEFAULT_ADJUSTMENTS_VALUES; exports.DEFAULT_TRANSFORM_VALUES = DEFAULT_TRANSFORM_VALUES; exports.DEFAULT_DEPTH_MASK_VALUES = DEFAULT_DEPTH_MASK_VALUES; exports.FREE_TRANSFORM_MODES = FREE_TRANSFORM_MODES; exports.TRANSFORM_ANCHORS = TRANSFORM_ANCHORS; exports.isTransformAnchor = isTransformAnchor; exports.identityTransform = identityTransform; exports.cornersFromMatrix = cornersFromMatrix; exports.matrixFromCorners = matrixFromCorners; exports.transformHomography = transformHomography; exports.hasWarp = hasWarp; exports.isIdentityTransform = isIdentityTransform; exports.transformMap = transformMap; exports.transformedPoint = transformedPoint; exports.anchorPoint = anchorPoint; exports.transformedBox = transformedBox; exports.referencePoint = referencePoint; exports.matrixFromParams = matrixFromParams; exports.describeTransform = describeTransform; exports.applyParams = applyParams; exports.flipCorners = flipCorners; exports.boxPointOf = boxPointOf; exports.presetWarp = presetWarp; exports.isValidWarp = isValidWarp; exports.geometryHomography = geometryHomography; exports.LayerOperationError = LayerOperationError; exports.requireLayer = requireLayer; exports.requireUnlocked = requireUnlocked; exports.placeLayer = placeLayer; exports.removeLayer = removeLayer; exports.moveLayer = moveLayer; exports.withNewIds = withNewIds; exports.duplicateLayer = duplicateLayer; exports.setLayerProperties = setLayerProperties; exports.groupLayers = groupLayers; exports.ungroupLayer = ungroupLayer; exports.offsetLayer = offsetLayer; exports.setLayerMask = setLayerMask; exports.normalizeFilter = normalizeFilter; exports.addLayerFilter = addLayerFilter; exports.updateLayerFilter = updateLayerFilter; exports.removeLayerFilter = removeLayerFilter; exports.layerEffectsOf = layerEffectsOf; exports.setLayerEffects = setLayerEffects; exports.addLayerEffect = addLayerEffect; exports.updateLayerEffect = updateLayerEffect; exports.removeLayerEffect = removeLayerEffect; exports.setLayerEffectsEnabled = setLayerEffectsEnabled; exports.parseBlend = parseBlend; exports.unionRect = unionRect; exports.SMART_RENDER_MARGIN = SMART_RENDER_MARGIN; exports.newContentsId = newContentsId; exports.contentsBox = contentsBox; exports.placementGeometry = placementGeometry; exports.placementAt = placementAt; exports.isContentsDecoded = isContentsDecoded; exports.requireSmartObject = requireSmartObject; exports.contentsSurface = contentsSurface; exports.rasterContents = rasterContents; exports.documentContents = documentContents; exports.placeContents = placeContents; exports.activeSmartFilters = activeSmartFilters; exports.filterMaskCoverage = filterMaskCoverage; exports.applySmartFilters = applySmartFilters; exports.renderSmartObject = renderSmartObject; exports.rerender = rerender; exports.normalizePlacement = normalizePlacement; exports.setSmartPlacement = setSmartPlacement; exports.offsetSmartObject = offsetSmartObject; exports.convertToSmartObject = convertToSmartObject; exports.rasterizeSmartObject = rasterizeSmartObject; exports.copySmartObject = copySmartObject; exports.instancesOf = instancesOf; exports.replaceContents = replaceContents; exports.normalizeSmartFilter = normalizeSmartFilter; exports.addSmartFilter = addSmartFilter; exports.updateSmartFilter = updateSmartFilter; exports.removeSmartFilter = removeSmartFilter; exports.moveSmartFilter = moveSmartFilter; exports.setSmartFiltersEnabled = setSmartFiltersEnabled; exports.setSmartFilterMask = setSmartFilterMask; exports.withFilterMaskSurface = withFilterMaskSurface; exports.placementBounds = placementBounds; exports.LAYERED_SCHEMA_VERSION = LAYERED_SCHEMA_VERSION; exports.serializePatterns = serializePatterns; exports.deserializePatterns = deserializePatterns; exports.encodeSurface = encodeSurface; exports.serializeEffects = serializeEffects; exports.deserializeEffects = deserializeEffects; exports.serializeLayer = serializeLayer; exports.serializeContents = serializeContents; exports.serializeLayers = serializeLayers; exports.serializeLayersExternal = serializeLayersExternal; exports.resolveExternalAssets = resolveExternalAssets; exports.decodePngDataUrl = decodePngDataUrl; exports.deserializeLayer = deserializeLayer; exports.deserializeLayers = deserializeLayers; exports.PsdError = PsdError; exports.decodePlanes = decodePlanes; exports.encodeRle = encodeRle; exports.parseVersionedDescriptor = parseVersionedDescriptor; exports.versionedDescriptorBytes = versionedDescriptorBytes; exports.ADJUSTMENT_KEYS = ADJUSTMENT_KEYS; exports.SUPPORTED_ADJUSTMENT_KEYS = SUPPORTED_ADJUSTMENT_KEYS; exports.parseAdjustmentBlock = parseAdjustmentBlock; exports.writeAdjustmentBlock = writeAdjustmentBlock; exports.parseLfx2 = parseLfx2; exports.writeLfx2 = writeLfx2; exports.parseLrfx = parseLrfx; exports.BROWSER_IMAGE_TYPES = BROWSER_IMAGE_TYPES; exports.readPsd = readPsd; exports.layerName = layerName; exports.layerTree = layerTree; exports.decodeLayerChannel = decodeLayerChannel; exports.decodeMergedImage = decodeMergedImage; exports.writePsd = writePsd; exports.PATTERN_BLOCK_KEYS = PATTERN_BLOCK_KEYS; exports.parsePatternBlock = parsePatternBlock; exports.psdPatternToEffectPattern = psdPatternToEffectPattern; exports.writePatternBlock = writePatternBlock; exports.PSD_BLEND_KEYS = PSD_BLEND_KEYS; exports.psdToLayers = psdToLayers; exports.importPsd = importPsd; exports.smartContentsFile = smartContentsFile; exports.exportPsd = exportPsd;
8036
- //# sourceMappingURL=chunk-ZID226ZG.cjs.map
8036
+ //# sourceMappingURL=chunk-FRD3FUXI.cjs.map