@pixerate/editor 0.120.0 → 0.121.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 (48) hide show
  1. package/dist/{chunk-UMVW2Q66.js → chunk-4I54JSJ6.js} +2 -2
  2. package/dist/{chunk-N3467VD6.js → chunk-7QN76ESJ.js} +1 -179
  3. package/dist/chunk-7QN76ESJ.js.map +1 -0
  4. package/dist/{chunk-EJVDBITD.cjs → chunk-DCLJNVZS.cjs} +2 -180
  5. package/dist/chunk-DCLJNVZS.cjs.map +1 -0
  6. package/dist/{chunk-BOWUU4LJ.js → chunk-E6N5KLMA.js} +11 -9
  7. package/dist/{chunk-BOWUU4LJ.js.map → chunk-E6N5KLMA.js.map} +1 -1
  8. package/dist/{chunk-HTAFDTNR.cjs → chunk-GLOOH65Y.cjs} +156 -154
  9. package/dist/chunk-GLOOH65Y.cjs.map +1 -0
  10. package/dist/chunk-GX332W2C.js +181 -0
  11. package/dist/chunk-GX332W2C.js.map +1 -0
  12. package/dist/{chunk-TS5IEUW6.cjs → chunk-K7V27T72.cjs} +178 -3
  13. package/dist/chunk-K7V27T72.cjs.map +1 -0
  14. package/dist/{chunk-WMRIG4XQ.cjs → chunk-LL3RAN55.cjs} +17 -17
  15. package/dist/{chunk-WMRIG4XQ.cjs.map → chunk-LL3RAN55.cjs.map} +1 -1
  16. package/dist/chunk-MUUXNRU4.cjs +181 -0
  17. package/dist/chunk-MUUXNRU4.cjs.map +1 -0
  18. package/dist/{chunk-YHW26LS2.js → chunk-ZZPGTNXJ.js} +177 -2
  19. package/dist/chunk-ZZPGTNXJ.js.map +1 -0
  20. package/dist/image-editor/index.cjs +754 -734
  21. package/dist/image-editor/index.cjs.map +1 -1
  22. package/dist/image-editor/index.d.cts +1 -1
  23. package/dist/image-editor/index.d.ts +1 -1
  24. package/dist/image-editor/index.js +31 -11
  25. package/dist/image-editor/index.js.map +1 -1
  26. package/dist/paint/index.cjs +22 -2
  27. package/dist/paint/index.cjs.map +1 -1
  28. package/dist/paint/index.d.cts +159 -1
  29. package/dist/paint/index.d.ts +159 -1
  30. package/dist/paint/index.js +21 -1
  31. package/dist/paint-editor/index.cjs +95 -94
  32. package/dist/paint-editor/index.cjs.map +1 -1
  33. package/dist/paint-editor/index.js +12 -11
  34. package/dist/paint-editor/index.js.map +1 -1
  35. package/dist/raster/index.cjs +5 -4
  36. package/dist/raster/index.cjs.map +1 -1
  37. package/dist/raster/index.js +11 -10
  38. package/dist/vector/index.cjs +14 -12
  39. package/dist/vector/index.cjs.map +1 -1
  40. package/dist/vector/index.js +7 -5
  41. package/dist/vector/index.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunk-EJVDBITD.cjs.map +0 -1
  44. package/dist/chunk-HTAFDTNR.cjs.map +0 -1
  45. package/dist/chunk-N3467VD6.js.map +0 -1
  46. package/dist/chunk-TS5IEUW6.cjs.map +0 -1
  47. package/dist/chunk-YHW26LS2.js.map +0 -1
  48. /package/dist/{chunk-UMVW2Q66.js.map → chunk-4I54JSJ6.js.map} +0 -0
@@ -34,7 +34,7 @@
34
34
 
35
35
 
36
36
 
37
- var _chunkWMRIG4XQcjs = require('./chunk-WMRIG4XQ.cjs');
37
+ var _chunkLL3RAN55cjs = require('./chunk-LL3RAN55.cjs');
38
38
 
39
39
 
40
40
 
@@ -44,13 +44,13 @@ var _chunkWMRIG4XQcjs = require('./chunk-WMRIG4XQ.cjs');
44
44
 
45
45
 
46
46
 
47
+ var _chunkMUUXNRU4cjs = require('./chunk-MUUXNRU4.cjs');
47
48
 
48
49
 
49
50
 
50
51
 
51
52
 
52
53
 
53
- var _chunkEJVDBITDcjs = require('./chunk-EJVDBITD.cjs');
54
54
 
55
55
 
56
56
 
@@ -65,13 +65,15 @@ var _chunkEJVDBITDcjs = require('./chunk-EJVDBITD.cjs');
65
65
 
66
66
 
67
67
 
68
+ var _chunk7ISPWEJAcjs = require('./chunk-7ISPWEJA.cjs');
68
69
 
69
70
 
70
71
 
71
72
 
72
73
 
73
74
 
74
- var _chunk7ISPWEJAcjs = require('./chunk-7ISPWEJA.cjs');
75
+
76
+ var _chunkDCLJNVZScjs = require('./chunk-DCLJNVZS.cjs');
75
77
 
76
78
 
77
79
 
@@ -1137,7 +1139,7 @@ function smoothCoverage(m, w, h, r) {
1137
1139
  return src;
1138
1140
  }
1139
1141
  function featherCoverage(m, w, h, radius) {
1140
- const out = _chunkWMRIG4XQcjs.gaussianBlur.call(void 0, m, w, h, Number.isFinite(radius) ? Math.max(0, radius) : 0, "zero");
1142
+ const out = _chunkLL3RAN55cjs.gaussianBlur.call(void 0, m, w, h, Number.isFinite(radius) ? Math.max(0, radius) : 0, "zero");
1141
1143
  for (let i = 0; i < out.length; i++) if (Math.abs(out[i]) < 1e-7) out[i] = 0;
1142
1144
  return out;
1143
1145
  }
@@ -1285,7 +1287,7 @@ function layerMaskCoverage(mask) {
1285
1287
  let v = new Float32Array(sel.data.length);
1286
1288
  for (let i = 0; i < v.length; i++) v[i] = sel.data[i] / 255;
1287
1289
  const feather = _nullishCoalesce(mask.feather, () => ( 0));
1288
- if (feather > 0) v = _chunkWMRIG4XQcjs.gaussianBlur.call(void 0, v, mask.width, mask.height, feather, "clamp");
1290
+ if (feather > 0) v = _chunkLL3RAN55cjs.gaussianBlur.call(void 0, v, mask.width, mask.height, feather, "clamp");
1289
1291
  const density = _nullishCoalesce(mask.density, () => ( 1));
1290
1292
  if (density !== 1) for (let i = 0; i < v.length; i++) v[i] = 1 - density * (1 - v[i]);
1291
1293
  return v;
@@ -1528,7 +1530,7 @@ function normalizeAdjustmentLayers(raw) {
1528
1530
  return out;
1529
1531
  }
1530
1532
  function curveLutFromLevels(points) {
1531
- return _chunkWMRIG4XQcjs.curveLut.call(void 0, points.map((p) => ({ input: p.input / 255, output: p.output / 255 })));
1533
+ return _chunkLL3RAN55cjs.curveLut.call(void 0, points.map((p) => ({ input: p.input / 255, output: p.output / 255 })));
1532
1534
  }
1533
1535
  var toUnitLevels = (c) => ({
1534
1536
  inBlack: c.inBlack / 255,
@@ -2282,7 +2284,7 @@ function newLayerId(prefix = "layer") {
2282
2284
  return `${prefix}_${Date.now().toString(36)}_${(++idCounter).toString(36)}`;
2283
2285
  }
2284
2286
  function pixelLayers(layers) {
2285
- return _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "pixel");
2287
+ return _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "pixel");
2286
2288
  }
2287
2289
  function developFilter(layer) {
2288
2290
  return _optionalChain([layer, 'access', _10 => _10.filters, 'optionalAccess', _11 => _11.find, 'call', _12 => _12((f) => f.kind === "develop")]);
@@ -2313,10 +2315,10 @@ function isRenderedLayer(layer) {
2313
2315
  return layer.type === "smart" || layer.type === "shape" || layer.type === "type";
2314
2316
  }
2315
2317
  function shapeLayers(layers) {
2316
- return _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "shape");
2318
+ return _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "shape");
2317
2319
  }
2318
2320
  function smartObjectLayers(layers) {
2319
- return _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart");
2321
+ return _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart");
2320
2322
  }
2321
2323
 
2322
2324
  // src/image-editor/layers/compositor.ts
@@ -2422,13 +2424,13 @@ var PHOTO_PROFILE = {
2422
2424
  return v;
2423
2425
  }
2424
2426
  };
2425
- var LayerCompositor = class extends _chunkWMRIG4XQcjs.RasterCompositor {
2427
+ var LayerCompositor = class extends _chunkLL3RAN55cjs.RasterCompositor {
2426
2428
  constructor(options = {}) {
2427
2429
  super(PHOTO_PROFILE, options);
2428
2430
  }
2429
2431
  };
2430
2432
  function compositeDeep(layers, rect, sources, depth) {
2431
- const deep = new (0, _chunkWMRIG4XQcjs.DeepCompositor)(new LayerCompositor(), PHOTO_PROFILE, {
2433
+ const deep = new (0, _chunkLL3RAN55cjs.DeepCompositor)(new LayerCompositor(), PHOTO_PROFILE, {
2432
2434
  applyFilterRunDeep: (run, acc, _r, masks) => applyAdjustmentLayersFloat(acc, run.map(adjustmentNodeAsLayer), masks)
2433
2435
  }, depth);
2434
2436
  return deep.composite(layers, rect, sources);
@@ -2974,47 +2976,47 @@ var fail = (message) => {
2974
2976
  throw new LayerOperationError(message);
2975
2977
  };
2976
2978
  function requireLayer(layers, id) {
2977
- const loc = _chunkWMRIG4XQcjs.findLayer.call(void 0, layers, id);
2979
+ const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, layers, id);
2978
2980
  if (!loc) {
2979
- const ids = _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers).map((l) => l.id);
2981
+ const ids = _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).map((l) => l.id);
2980
2982
  fail(`Unknown layer "${id}". ${ids.length ? `Layers: ${ids.join(", ")}.` : "The document has no layers."} Call list_layers for ids.`);
2981
2983
  }
2982
2984
  return loc;
2983
2985
  }
2984
2986
  function requireUnlocked(layer, what, action) {
2985
- if (_chunkWMRIG4XQcjs.isLayerLocked.call(void 0, layer, "all")) fail(`Layer "${layer.name || layer.id}" is locked (all); unlock it before you ${action}.`);
2986
- if (what !== "all" && _chunkWMRIG4XQcjs.isLayerLocked.call(void 0, layer, what)) fail(`Layer "${layer.name || layer.id}" has its ${what} locked; unlock it before you ${action}.`);
2987
+ if (_chunkLL3RAN55cjs.isLayerLocked.call(void 0, layer, "all")) fail(`Layer "${layer.name || layer.id}" is locked (all); unlock it before you ${action}.`);
2988
+ if (what !== "all" && _chunkLL3RAN55cjs.isLayerLocked.call(void 0, layer, what)) fail(`Layer "${layer.name || layer.id}" has its ${what} locked; unlock it before you ${action}.`);
2987
2989
  }
2988
2990
  function placeLayer(layers, layer, placement = {}, defaultIndex) {
2989
2991
  const given = [placement.aboveId, placement.belowId, placement.parentId].filter((v) => v !== void 0).length;
2990
2992
  if (given > 1) fail("Give only one of aboveId, belowId and parentId.");
2991
2993
  if (placement.aboveId || placement.belowId) {
2992
2994
  const ref = requireLayer(layers, _nullishCoalesce(placement.aboveId, () => ( placement.belowId)));
2993
- return _chunkWMRIG4XQcjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access', _21 => _21.parent, 'optionalAccess', _22 => _22.id]), () => ( null)), ref.index + (placement.aboveId ? 1 : 0));
2995
+ return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access', _21 => _21.parent, 'optionalAccess', _22 => _22.id]), () => ( null)), ref.index + (placement.aboveId ? 1 : 0));
2994
2996
  }
2995
2997
  if (placement.parentId) {
2996
2998
  const ref = requireLayer(layers, placement.parentId);
2997
2999
  if (ref.layer.type !== "group") fail(`Layer "${placement.parentId}" is not a group; parentId must be a group id.`);
2998
- return _chunkWMRIG4XQcjs.insertLayer.call(void 0, layers, layer, ref.layer.id, placement.index);
3000
+ return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, layer, ref.layer.id, placement.index);
2999
3001
  }
3000
- return _chunkWMRIG4XQcjs.insertLayer.call(void 0, layers, layer, null, _nullishCoalesce(placement.index, () => ( defaultIndex)));
3002
+ return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, layer, null, _nullishCoalesce(placement.index, () => ( defaultIndex)));
3001
3003
  }
3002
3004
  function removeLayer(layers, id) {
3003
3005
  const loc = requireLayer(layers, id);
3004
3006
  requireUnlocked(loc.layer, "all", "delete it");
3005
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => null);
3007
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => null);
3006
3008
  }
3007
3009
  function moveLayer(layers, id, placement) {
3008
3010
  const loc = requireLayer(layers, id);
3009
3011
  requireUnlocked(loc.layer, "all", "move it");
3010
3012
  const target = _nullishCoalesce(_nullishCoalesce(placement.aboveId, () => ( placement.belowId)), () => ( placement.parentId));
3011
3013
  if (target === id) fail("A layer cannot be placed relative to itself.");
3012
- if (target && loc.layer.type === "group" && _chunkWMRIG4XQcjs.flattenLayers.call(void 0, loc.layer.children).some((l) => l.id === target)) {
3014
+ if (target && loc.layer.type === "group" && _chunkLL3RAN55cjs.flattenLayers.call(void 0, loc.layer.children).some((l) => l.id === target)) {
3013
3015
  fail(`Group "${id}" cannot be moved into its own child "${target}".`);
3014
3016
  }
3015
3017
  if (target) requireLayer(layers, target);
3016
3018
  if (!target && placement.index === void 0) fail("Give aboveId, belowId, parentId or index.");
3017
- const without = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => null);
3019
+ const without = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => null);
3018
3020
  return placeLayer(without, loc.layer, placement);
3019
3021
  }
3020
3022
  function withNewIds(layer) {
@@ -3033,7 +3035,7 @@ function duplicateLayer(layers, id, name) {
3033
3035
  const copy = withNewIds(loc.layer);
3034
3036
  copy.name = _nullishCoalesce(name, () => ( `${loc.layer.name || "Layer"} copy`));
3035
3037
  delete copy.locks;
3036
- return { layers: _chunkWMRIG4XQcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _25 => _25.parent, 'optionalAccess', _26 => _26.id]), () => ( null)), loc.index + 1), id: copy.id };
3038
+ return { layers: _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _25 => _25.parent, 'optionalAccess', _26 => _26.id]), () => ( null)), loc.index + 1), id: copy.id };
3037
3039
  }
3038
3040
  function setLayerProperties(layers, id, props) {
3039
3041
  const loc = requireLayer(layers, id);
@@ -3080,7 +3082,7 @@ function setLayerProperties(layers, id, props) {
3080
3082
  if (props.collapsed) g.collapsed = true;
3081
3083
  else delete g.collapsed;
3082
3084
  }
3083
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next);
3085
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next);
3084
3086
  }
3085
3087
  function groupLayers(layers, ids, name = "Group") {
3086
3088
  if (!ids.length) fail("Give at least one layer id to group.");
@@ -3109,17 +3111,17 @@ function groupLayers(layers, ids, name = "Group") {
3109
3111
  group.children[0] = c;
3110
3112
  }
3111
3113
  let out = layers;
3112
- for (const l of ordered) out = _chunkWMRIG4XQcjs.mapLayer.call(void 0, out, l.layer.id, () => null);
3113
- return { layers: _chunkWMRIG4XQcjs.insertLayer.call(void 0, out, group, parent, top - below), id: group.id };
3114
+ for (const l of ordered) out = _chunkLL3RAN55cjs.mapLayer.call(void 0, out, l.layer.id, () => null);
3115
+ return { layers: _chunkLL3RAN55cjs.insertLayer.call(void 0, out, group, parent, top - below), id: group.id };
3114
3116
  }
3115
3117
  function ungroupLayer(layers, id) {
3116
3118
  const loc = requireLayer(layers, id);
3117
3119
  if (loc.layer.type !== "group") fail(`Layer "${id}" is not a group.`);
3118
3120
  requireUnlocked(loc.layer, "all", "ungroup it");
3119
3121
  const group = loc.layer;
3120
- let out = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => null);
3122
+ let out = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => null);
3121
3123
  group.children.forEach((c, i) => {
3122
- out = _chunkWMRIG4XQcjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access', _35 => _35.parent, 'optionalAccess', _36 => _36.id]), () => ( null)), loc.index + i);
3124
+ out = _chunkLL3RAN55cjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access', _35 => _35.parent, 'optionalAccess', _36 => _36.id]), () => ( null)), loc.index + i);
3123
3125
  });
3124
3126
  return { layers: out, ids: group.children.map((c) => c.id) };
3125
3127
  }
@@ -3134,12 +3136,12 @@ function offsetLayer(layers, id, offset) {
3134
3136
  if (mask && mask.linked === false && !mask.source) {
3135
3137
  next.mask = { ...mask, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, mask.surface, layer.offset.x - next.offset.x, layer.offset.y - next.offset.y) };
3136
3138
  }
3137
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next);
3139
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next);
3138
3140
  }
3139
3141
  function setLayerMask(layers, id, mask) {
3140
3142
  const loc = requireLayer(layers, id);
3141
3143
  requireUnlocked(loc.layer, "all", "change its mask");
3142
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, (l) => {
3144
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, (l) => {
3143
3145
  const next = { ...l };
3144
3146
  if (mask) next.mask = mask;
3145
3147
  else delete next.mask;
@@ -3178,7 +3180,7 @@ function requirePixelLayer(layers, id) {
3178
3180
  function addLayerFilter(layers, id, filter) {
3179
3181
  const layer = requirePixelLayer(layers, id);
3180
3182
  if (_optionalChain([layer, 'access', _37 => _37.filters, 'optionalAccess', _38 => _38.some, 'call', _39 => _39((f) => f.kind === filter.kind)])) fail(`Layer "${id}" already has a ${filter.kind} filter; change it with update_layer_filter.`);
3181
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters: [..._nullishCoalesce(layer.filters, () => ( [])), filter] }));
3183
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters: [..._nullishCoalesce(layer.filters, () => ( [])), filter] }));
3182
3184
  }
3183
3185
  function updateLayerFilter(layers, id, filterId, changes) {
3184
3186
  const layer = requirePixelLayer(layers, id);
@@ -3189,7 +3191,7 @@ function updateLayerFilter(layers, id, filterId, changes) {
3189
3191
  const merged2 = normalizeFilter({ ...current, ...changes, kind: current.kind }, current.id);
3190
3192
  const filters = [...layer.filters];
3191
3193
  filters[i] = merged2;
3192
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters }));
3194
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters }));
3193
3195
  }
3194
3196
  function removeLayerFilter(layers, id, filterId) {
3195
3197
  const layer = requirePixelLayer(layers, id);
@@ -3198,7 +3200,7 @@ function removeLayerFilter(layers, id, filterId) {
3198
3200
  const next = { ...layer };
3199
3201
  if (filters.length) next.filters = filters;
3200
3202
  else delete next.filters;
3201
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next);
3203
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next);
3202
3204
  }
3203
3205
  function requireEffectLayer(layers, id, action) {
3204
3206
  const layer = requireLayer(layers, id).layer;
@@ -3213,7 +3215,7 @@ function guard(fn) {
3213
3215
  try {
3214
3216
  return fn();
3215
3217
  } catch (e) {
3216
- if (e instanceof _chunkWMRIG4XQcjs.LayerEffectError) fail(e.message);
3218
+ if (e instanceof _chunkLL3RAN55cjs.LayerEffectError) fail(e.message);
3217
3219
  throw e;
3218
3220
  }
3219
3221
  }
@@ -3221,20 +3223,20 @@ function setLayerEffects(layers, id, effects) {
3221
3223
  const layer = requireEffectLayer(layers, id, "change its effects");
3222
3224
  const next = { ...layer };
3223
3225
  if (effects && (effects.items.length || effects.psd || effects.scale !== void 0 || !effects.enabled)) {
3224
- guard(() => _chunkWMRIG4XQcjs.validateLayerEffects.call(void 0, effects));
3226
+ guard(() => _chunkLL3RAN55cjs.validateLayerEffects.call(void 0, effects));
3225
3227
  next.effects = effects;
3226
3228
  } else delete next.effects;
3227
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next);
3229
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next);
3228
3230
  }
3229
3231
  function addLayerEffect(layers, id, kind, params = {}, index) {
3230
- if (!_chunkWMRIG4XQcjs.isLayerEffectKind.call(void 0, kind)) fail(`Unknown effect kind "${String(kind)}". Kinds: ${_chunkWMRIG4XQcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
3232
+ if (!_chunkLL3RAN55cjs.isLayerEffectKind.call(void 0, kind)) fail(`Unknown effect kind "${String(kind)}". Kinds: ${_chunkLL3RAN55cjs.LAYER_EFFECT_KINDS.join(", ")}.`);
3231
3233
  const layer = requireEffectLayer(layers, id, "add effects");
3232
3234
  const current = layerEffectsOf(layer);
3233
3235
  const ids = new Set(current.items.map((e) => e.id));
3234
- let effectId = _chunkWMRIG4XQcjs.newEffectId.call(void 0, );
3235
- while (ids.has(effectId)) effectId = _chunkWMRIG4XQcjs.newEffectId.call(void 0, );
3236
+ let effectId = _chunkLL3RAN55cjs.newEffectId.call(void 0, );
3237
+ while (ids.has(effectId)) effectId = _chunkLL3RAN55cjs.newEffectId.call(void 0, );
3236
3238
  const { id: _ignored, kind: _kind, ...rest } = params;
3237
- const effect = guard(() => _chunkWMRIG4XQcjs.mergeLayerEffect.call(void 0, _chunkWMRIG4XQcjs.defaultLayerEffect.call(void 0, kind, effectId), rest));
3239
+ const effect = guard(() => _chunkLL3RAN55cjs.mergeLayerEffect.call(void 0, _chunkLL3RAN55cjs.defaultLayerEffect.call(void 0, kind, effectId), rest));
3238
3240
  const items = [...current.items];
3239
3241
  const at = index === void 0 ? items.length : Math.max(0, Math.min(items.length, Math.floor(index)));
3240
3242
  items.splice(at, 0, effect);
@@ -3251,7 +3253,7 @@ function updateLayerEffect(layers, id, effectId, changes) {
3251
3253
  const i = requireEffect(layer, effectId);
3252
3254
  const current = layer.effects;
3253
3255
  const items = [...current.items];
3254
- items[i] = guard(() => _chunkWMRIG4XQcjs.mergeLayerEffect.call(void 0, items[i], changes));
3256
+ items[i] = guard(() => _chunkLL3RAN55cjs.mergeLayerEffect.call(void 0, items[i], changes));
3255
3257
  return setLayerEffects(layers, id, { ...current, items });
3256
3258
  }
3257
3259
  function removeLayerEffect(layers, id, effectId) {
@@ -3286,7 +3288,7 @@ function unionRect(a, b) {
3286
3288
  }
3287
3289
 
3288
3290
  // src/image-editor/layers/shape.ts
3289
- var SHAPE_RENDER_MARGIN = _chunkWMRIG4XQcjs.MAX_EFFECT_REACH;
3291
+ var SHAPE_RENDER_MARGIN = _chunkLL3RAN55cjs.MAX_EFFECT_REACH;
3290
3292
  var DEFAULT_MITER_LIMIT = 100;
3291
3293
  var fail2 = (message) => {
3292
3294
  throw new LayerOperationError(message);
@@ -3502,11 +3504,11 @@ function fillCoverage(geo, rect, rule, inverted = false) {
3502
3504
  function paintContext(env) {
3503
3505
  const tiles = /* @__PURE__ */ new Map();
3504
3506
  return {
3505
- light: _chunkWMRIG4XQcjs.DEFAULT_GLOBAL_LIGHT,
3507
+ light: _chunkLL3RAN55cjs.DEFAULT_GLOBAL_LIGHT,
3506
3508
  pattern: (id) => {
3507
3509
  if (tiles.has(id)) return tiles.get(id);
3508
- const p = _nullishCoalesce(_optionalChain([env, 'access', _44 => _44.pattern, 'optionalCall', _45 => _45(id)]), () => ( _chunkWMRIG4XQcjs.builtinPattern.call(void 0, id)));
3509
- const t = p && p.width > 0 && p.height > 0 && p.data.length >= p.width * p.height * 4 ? new (0, _chunkWMRIG4XQcjs.PatternTile)(p) : null;
3510
+ const p = _nullishCoalesce(_optionalChain([env, 'access', _44 => _44.pattern, 'optionalCall', _45 => _45(id)]), () => ( _chunkLL3RAN55cjs.builtinPattern.call(void 0, id)));
3511
+ const t = p && p.width > 0 && p.height > 0 && p.data.length >= p.width * p.height * 4 ? new (0, _chunkLL3RAN55cjs.PatternTile)(p) : null;
3510
3512
  tiles.set(id, t);
3511
3513
  return t;
3512
3514
  }
@@ -3537,9 +3539,9 @@ function renderShapeRect(layer, rect, env, ctx = paintContext(env)) {
3537
3539
  if (!fCov && !sCov) return null;
3538
3540
  const canvas = { x: 0, y: 0, width: env.width, height: env.height };
3539
3541
  const anchor = { x: geo.frame.x, y: geo.frame.y };
3540
- const fc = fCov ? _chunkWMRIG4XQcjs.effectFillColors.call(void 0, layer.fill, rect, geo.frame, canvas, anchor, ctx) : null;
3542
+ const fc = fCov ? _chunkLL3RAN55cjs.effectFillColors.call(void 0, layer.fill, rect, geo.frame, canvas, anchor, ctx) : null;
3541
3543
  const fo = _nullishCoalesce(_optionalChain([layer, 'access', _46 => _46.fill, 'optionalAccess', _47 => _47.opacity]), () => ( 1));
3542
- const sc = sCov ? _chunkWMRIG4XQcjs.effectFillColors.call(void 0, layer.stroke.paint, rect, geo.frame, canvas, anchor, ctx) : null;
3544
+ const sc = sCov ? _chunkLL3RAN55cjs.effectFillColors.call(void 0, layer.stroke.paint, rect, geo.frame, canvas, anchor, ctx) : null;
3543
3545
  const so = _nullishCoalesce(_optionalChain([layer, 'access', _48 => _48.stroke, 'optionalAccess', _49 => _49.paint, 'access', _50 => _50.opacity]), () => ( 1));
3544
3546
  const out = new Uint8ClampedArray(n * 4);
3545
3547
  let any = false;
@@ -3632,9 +3634,9 @@ function normalizeShapePaint(v, path = "paint") {
3632
3634
  offset: _nullishCoalesce(g.offset, () => ( { x: 0, y: 0 }))
3633
3635
  };
3634
3636
  try {
3635
- _chunkWMRIG4XQcjs.validateEffectGradient.call(void 0, gradient, `${path}.gradient`);
3637
+ _chunkLL3RAN55cjs.validateEffectGradient.call(void 0, gradient, `${path}.gradient`);
3636
3638
  } catch (e) {
3637
- if (e instanceof _chunkWMRIG4XQcjs.LayerEffectError) fail2(e.message);
3639
+ if (e instanceof _chunkLL3RAN55cjs.LayerEffectError) fail2(e.message);
3638
3640
  throw e;
3639
3641
  }
3640
3642
  if (gradient.stops.length < 1) fail2(`${path}.gradient.stops needs at least one { position, color }.`);
@@ -3846,7 +3848,7 @@ function updateShapeLayer(layers, id, change, env, action = "edit it") {
3846
3848
  if (!("annotation" in patch)) delete next.annotation;
3847
3849
  if (!next.components.length) fail2("A shape needs at least one component; delete the layer instead.");
3848
3850
  const rendered = rerenderShape(next, env);
3849
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
3851
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
3850
3852
  }
3851
3853
  function transformShapeComponents(components, f, affine) {
3852
3854
  return components.map((c) => {
@@ -3877,7 +3879,7 @@ function shapeAsPixelLayer(layer) {
3877
3879
  }
3878
3880
  function annotationPaint(color, opacity) {
3879
3881
  const c = parseCssColor(color);
3880
- if (!c || !_chunkWMRIG4XQcjs.parseEffectColor.call(void 0, c.hex)) return void 0;
3882
+ if (!c || !_chunkLL3RAN55cjs.parseEffectColor.call(void 0, c.hex)) return void 0;
3881
3883
  const a = c.alpha * opacity;
3882
3884
  return a !== 1 ? { type: "color", color: c.hex, opacity: a } : { type: "color", color: c.hex };
3883
3885
  }
@@ -3958,7 +3960,7 @@ function annotationOfShape(layer) {
3958
3960
  var fail3 = (message) => {
3959
3961
  throw new LayerOperationError(message);
3960
3962
  };
3961
- var TEXT_RENDER_MARGIN = _chunkWMRIG4XQcjs.MAX_EFFECT_REACH;
3963
+ var TEXT_RENDER_MARGIN = _chunkLL3RAN55cjs.MAX_EFFECT_REACH;
3962
3964
  function textMatrix(layer) {
3963
3965
  return _nullishCoalesce(layer.transform, () => ( _chunkVYW7JBTMcjs.IDENTITY_MATRIX));
3964
3966
  }
@@ -4244,7 +4246,7 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
4244
4246
  if (!next.runs.length) next.runs = [{ length: 0, style: _chunkVYW7JBTMcjs.styleAt.call(void 0, current.runs, 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE) }];
4245
4247
  if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkVYW7JBTMcjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4246
4248
  const rendered = rerenderText(next, env);
4247
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
4249
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
4248
4250
  }
4249
4251
  function replaceTextRange(layer, start, end, insert) {
4250
4252
  const text3 = layer.text.slice(0, start) + insert + layer.text.slice(end);
@@ -4617,23 +4619,23 @@ function isTransformAnchor(value) {
4617
4619
  return typeof value === "string" && value in ANCHOR_FRACTION;
4618
4620
  }
4619
4621
  function identityTransform(box2) {
4620
- return { box: { ...box2 }, corners: _chunkEJVDBITDcjs.boxQuad.call(void 0, box2) };
4622
+ return { box: { ...box2 }, corners: _chunkMUUXNRU4cjs.boxQuad.call(void 0, box2) };
4621
4623
  }
4622
4624
  function cornersFromMatrix(box2, m) {
4623
- const q2 = _chunkEJVDBITDcjs.boxQuad.call(void 0, box2);
4625
+ const q2 = _chunkMUUXNRU4cjs.boxQuad.call(void 0, box2);
4624
4626
  return [_chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[0]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[1]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[2]), _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, q2[3])];
4625
4627
  }
4626
4628
  function matrixFromCorners(box2, corners, eps = 1e-6) {
4627
4629
  const [tl, tr, br, bl] = corners;
4628
4630
  const size = 1 + Math.max(box2.width, box2.height);
4629
4631
  if (Math.abs(tl.x + br.x - tr.x - bl.x) > eps * size || Math.abs(tl.y + br.y - tr.y - bl.y) > eps * size) return null;
4630
- const h = _chunkEJVDBITDcjs.rectToQuad.call(void 0, box2, corners);
4631
- return h ? _chunkEJVDBITDcjs.affineFromHomography.call(void 0, h, 1e-9) : null;
4632
+ const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, box2, corners);
4633
+ return h ? _chunkMUUXNRU4cjs.affineFromHomography.call(void 0, h, 1e-9) : null;
4632
4634
  }
4633
4635
  function transformHomography(geometry) {
4634
- const h = _chunkEJVDBITDcjs.rectToQuad.call(void 0, geometry.box, geometry.corners);
4636
+ const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, geometry.box, geometry.corners);
4635
4637
  if (!h) return null;
4636
- return _chunkEJVDBITDcjs.homographyKeepsQuad.call(void 0, h, _chunkEJVDBITDcjs.boxQuad.call(void 0, geometry.box)) ? h : null;
4638
+ return _chunkMUUXNRU4cjs.homographyKeepsQuad.call(void 0, h, _chunkMUUXNRU4cjs.boxQuad.call(void 0, geometry.box)) ? h : null;
4637
4639
  }
4638
4640
  function hasWarp(geometry) {
4639
4641
  const w = geometry.warp;
@@ -4644,7 +4646,7 @@ function hasWarp(geometry) {
4644
4646
  }
4645
4647
  function isIdentityTransform(geometry) {
4646
4648
  if (hasWarp(geometry)) return false;
4647
- const q2 = _chunkEJVDBITDcjs.boxQuad.call(void 0, geometry.box);
4649
+ const q2 = _chunkMUUXNRU4cjs.boxQuad.call(void 0, geometry.box);
4648
4650
  return geometry.corners.every((c, i) => Math.abs(c.x - q2[i].x) < 1e-6 && Math.abs(c.y - q2[i].y) < 1e-6);
4649
4651
  }
4650
4652
  function transformMap(geometry) {
@@ -4652,8 +4654,8 @@ function transformMap(geometry) {
4652
4654
  if (!h) return null;
4653
4655
  const { box: box2 } = geometry;
4654
4656
  const warp = hasWarp(geometry) ? geometry.warp : null;
4655
- if (!warp) return (p) => _chunkEJVDBITDcjs.applyHomography.call(void 0, h, p);
4656
- return (p) => _chunkEJVDBITDcjs.applyHomography.call(void 0, h, _chunkVYW7JBTMcjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4657
+ if (!warp) return (p) => _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p);
4658
+ return (p) => _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, _chunkVYW7JBTMcjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4657
4659
  }
4658
4660
  function transformedPoint(geometry, fx, fy) {
4659
4661
  const f = transformMap(geometry);
@@ -4662,9 +4664,9 @@ function transformedPoint(geometry, fx, fy) {
4662
4664
  }
4663
4665
  function anchorPoint(geometry, anchor) {
4664
4666
  const [fx, fy] = ANCHOR_FRACTION[anchor];
4665
- const h = _chunkEJVDBITDcjs.rectToQuad.call(void 0, geometry.box, geometry.corners);
4667
+ const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, geometry.box, geometry.corners);
4666
4668
  const p = { x: geometry.box.x + fx * geometry.box.width, y: geometry.box.y + fy * geometry.box.height };
4667
- return _nullishCoalesce((h && _chunkEJVDBITDcjs.applyHomography.call(void 0, h, p)), () => ( p));
4669
+ return _nullishCoalesce((h && _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p)), () => ( p));
4668
4670
  }
4669
4671
  function transformedBox(geometry) {
4670
4672
  const f = transformMap(geometry);
@@ -4705,8 +4707,8 @@ function describeTransform(geometry, reference = "center") {
4705
4707
  const ref = referencePoint(geometry.box, reference);
4706
4708
  const bounds = transformedBox(geometry);
4707
4709
  if (!m) {
4708
- const h = _chunkEJVDBITDcjs.rectToQuad.call(void 0, geometry.box, geometry.corners);
4709
- const at2 = _nullishCoalesce((h && _chunkEJVDBITDcjs.applyHomography.call(void 0, h, ref)), () => ( ref));
4710
+ const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, geometry.box, geometry.corners);
4711
+ const at2 = _nullishCoalesce((h && _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, ref)), () => ( ref));
4710
4712
  return { affine: false, scaleX: 100, scaleY: 100, rotate: 0, skewX: 0, x: at2.x, y: at2.y, bounds, corners: geometry.corners };
4711
4713
  }
4712
4714
  const [a, b, c, d] = m;
@@ -4754,14 +4756,14 @@ function isValidWarp(mesh) {
4754
4756
  }
4755
4757
  function geometryHomography(geometry) {
4756
4758
  const m = matrixFromCorners(geometry.box, geometry.corners);
4757
- return m ? _chunkEJVDBITDcjs.homographyFromAffine.call(void 0, m) : transformHomography(geometry);
4759
+ return m ? _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m) : transformHomography(geometry);
4758
4760
  }
4759
4761
 
4760
4762
  // src/image-editor/layers/smart.ts
4761
4763
  var fail4 = (message) => {
4762
4764
  throw new LayerOperationError(message);
4763
4765
  };
4764
- var SMART_RENDER_MARGIN = _chunkWMRIG4XQcjs.MAX_EFFECT_REACH;
4766
+ var SMART_RENDER_MARGIN = _chunkLL3RAN55cjs.MAX_EFFECT_REACH;
4765
4767
  function newContentsId() {
4766
4768
  return newLayerId("so");
4767
4769
  }
@@ -4772,7 +4774,7 @@ function placementGeometry(layer) {
4772
4774
  return { box: contentsBox(layer.contents), corners: layer.placement.corners, warp: _nullishCoalesce(layer.placement.warp, () => ( null)) };
4773
4775
  }
4774
4776
  function placementAt(contents, x, y) {
4775
- return { corners: _chunkEJVDBITDcjs.boxQuad.call(void 0, { x, y, width: contents.width, height: contents.height }) };
4777
+ return { corners: _chunkMUUXNRU4cjs.boxQuad.call(void 0, { x, y, width: contents.width, height: contents.height }) };
4776
4778
  }
4777
4779
  function isContentsDecoded(contents) {
4778
4780
  return contents.kind === "raster" ? Boolean(contents.raster) : Boolean(contents.document);
@@ -4827,7 +4829,7 @@ function placementKey(p, canvas) {
4827
4829
  function integerMove(layer) {
4828
4830
  const g = placementGeometry(layer);
4829
4831
  if (hasWarp(g)) return null;
4830
- const q2 = _chunkEJVDBITDcjs.boxQuad.call(void 0, g.box);
4832
+ const q2 = _chunkMUUXNRU4cjs.boxQuad.call(void 0, g.box);
4831
4833
  const dx = g.corners[0].x - q2[0].x;
4832
4834
  const dy = g.corners[0].y - q2[0].y;
4833
4835
  if (Math.abs(dx - Math.round(dx)) > 1e-9 || Math.abs(dy - Math.round(dy)) > 1e-9) return null;
@@ -4868,7 +4870,7 @@ function placeContents(layer, canvas, options = {}) {
4868
4870
  k = step;
4869
4871
  let r = _optionalChain([options, 'access', _84 => _84.reduced, 'optionalAccess', _85 => _85.get, 'call', _86 => _86(k)]);
4870
4872
  if (!r) {
4871
- r = _chunkWMRIG4XQcjs.reduceSurface.call(void 0, src, k);
4873
+ r = _chunkLL3RAN55cjs.reduceSurface.call(void 0, src, k);
4872
4874
  _optionalChain([options, 'access', _87 => _87.reduced, 'optionalAccess', _88 => _88.set, 'call', _89 => _89(k, r)]);
4873
4875
  }
4874
4876
  source = r;
@@ -4878,15 +4880,15 @@ function placeContents(layer, canvas, options = {}) {
4878
4880
  if (hasWarp(g)) {
4879
4881
  const f = transformMap(g);
4880
4882
  if (!f) fail4("The placement folds the contents over itself or through the horizon; keep the corners a convex quad.");
4881
- out = _chunkWMRIG4XQcjs.warpSurface.call(void 0, source, (p) => f({ x: p.x * k, y: p.y * k }), { interpolation, source: box2, clip, step: step > 1 ? step : void 0 });
4883
+ out = _chunkLL3RAN55cjs.warpSurface.call(void 0, source, (p) => f({ x: p.x * k, y: p.y * k }), { interpolation, source: box2, clip, step: step > 1 ? step : void 0 });
4882
4884
  } else {
4883
4885
  const h = transformHomography(g);
4884
4886
  if (!h) fail4("The placement folds the contents over itself or through the horizon; keep the corners a convex quad.");
4885
- const hk = _chunkEJVDBITDcjs.multiplyHomographies.call(void 0, [k, 0, 0, 0, k, 0, 0, 0, 1], h);
4886
- out = _chunkWMRIG4XQcjs.transformSurface.call(void 0, source, hk, { interpolation, source: box2, clip, step: step > 1 ? step : void 0 });
4887
+ const hk = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, [k, 0, 0, 0, k, 0, 0, 0, 1], h);
4888
+ out = _chunkLL3RAN55cjs.transformSurface.call(void 0, source, hk, { interpolation, source: box2, clip, step: step > 1 ? step : void 0 });
4887
4889
  }
4888
4890
  } catch (e) {
4889
- if (e instanceof _chunkWMRIG4XQcjs.TransformTooLargeError) fail4(e.message);
4891
+ if (e instanceof _chunkLL3RAN55cjs.TransformTooLargeError) fail4(e.message);
4890
4892
  throw e;
4891
4893
  }
4892
4894
  }
@@ -4918,7 +4920,7 @@ function filterMaskCoverage(mask, canvas) {
4918
4920
  }
4919
4921
  const feather = _nullishCoalesce(mask.feather, () => ( 0));
4920
4922
  if (all && !(feather > 0)) return null;
4921
- if (feather > 0) v = _chunkWMRIG4XQcjs.gaussianBlur.call(void 0, v, W, H, feather, "clamp");
4923
+ if (feather > 0) v = _chunkLL3RAN55cjs.gaussianBlur.call(void 0, v, W, H, feather, "clamp");
4922
4924
  const density = _nullishCoalesce(mask.density, () => ( 1));
4923
4925
  if (density !== 1) for (let i = 0; i < v.length; i++) v[i] = 1 - density * (1 - v[i]);
4924
4926
  return v;
@@ -4940,7 +4942,7 @@ function applySmartFilters(placed, stack, canvas) {
4940
4942
  if (f.opacity >= 1) acc = out;
4941
4943
  else lerpInto(acc, out, f.opacity, null);
4942
4944
  } else {
4943
- _chunkWMRIG4XQcjs.blendTile.call(void 0, acc, out, f.blend, f.opacity, null);
4945
+ _chunkLL3RAN55cjs.blendTile.call(void 0, acc, out, f.blend, f.opacity, null);
4944
4946
  }
4945
4947
  }
4946
4948
  entry = { key, base, filtered: acc };
@@ -4987,7 +4989,7 @@ function normalizePlacement(raw, contents) {
4987
4989
  out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
4988
4990
  }
4989
4991
  if (raw.interpolation !== void 0) {
4990
- if (!_chunkWMRIG4XQcjs.isInterpolation.call(void 0, raw.interpolation)) fail4(`Unknown interpolation "${String(raw.interpolation)}"; use nearest, bilinear or bicubic.`);
4992
+ if (!_chunkLL3RAN55cjs.isInterpolation.call(void 0, raw.interpolation)) fail4(`Unknown interpolation "${String(raw.interpolation)}"; use nearest, bilinear or bicubic.`);
4991
4993
  if (raw.interpolation !== "bicubic") out.interpolation = raw.interpolation;
4992
4994
  }
4993
4995
  const g = { box: { x: 0, y: 0, width: contents.width, height: contents.height }, corners: out.corners, warp: _nullishCoalesce(out.warp, () => ( null)) };
@@ -5004,10 +5006,10 @@ function followMask(mask, before, after) {
5004
5006
  const h0 = placementHomography(before);
5005
5007
  const h1 = placementHomography(after);
5006
5008
  if (!h0 || !h1) return mask;
5007
- const inv = _chunkEJVDBITDcjs.invertHomography.call(void 0, h0);
5009
+ const inv = _chunkMUUXNRU4cjs.invertHomography.call(void 0, h0);
5008
5010
  if (!inv) return mask;
5009
- const delta = _chunkEJVDBITDcjs.multiplyHomographies.call(void 0, inv, h1);
5010
- const surface = _chunkWMRIG4XQcjs.transformSurface.call(void 0, mask.surface, delta, { interpolation: "bilinear" });
5011
+ const delta = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, inv, h1);
5012
+ const surface = _chunkLL3RAN55cjs.transformSurface.call(void 0, mask.surface, delta, { interpolation: "bilinear" });
5011
5013
  return { ...mask, surface };
5012
5014
  }
5013
5015
  function setSmartPlacement(layers, id, placement, canvas) {
@@ -5028,7 +5030,7 @@ function setSmartPlacement(layers, id, placement, canvas) {
5028
5030
  next.smartFilters = { ...next.smartFilters, mask: m };
5029
5031
  }
5030
5032
  next = rerender(next, canvas, "be transformed");
5031
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, masksMoved };
5033
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next), layer: next, masksMoved };
5032
5034
  }
5033
5035
  function offsetSmartObject(layers, id, dx, dy, canvas) {
5034
5036
  const layer = requireSmartObject(layers, id);
@@ -5050,7 +5052,7 @@ function offsetSmartObject(layers, id, dx, dy, canvas) {
5050
5052
  } else {
5051
5053
  next = rerender(next, canvas, "move");
5052
5054
  }
5053
- return _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next);
5055
+ return _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next);
5054
5056
  }
5055
5057
  function translateLayer(layer, dx, dy) {
5056
5058
  if (!dx && !dy) return layer;
@@ -5118,7 +5120,7 @@ function layerExtent(layer, surfaceOf, canvas) {
5118
5120
  } else {
5119
5121
  b = full;
5120
5122
  }
5121
- const m = _chunkWMRIG4XQcjs.effectsMargin.call(void 0, layer.effects);
5123
+ const m = _chunkLL3RAN55cjs.effectsMargin.call(void 0, layer.effects);
5122
5124
  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) };
5123
5125
  return b;
5124
5126
  }
@@ -5187,7 +5189,7 @@ function convertToSmartObject(layers, ids, canvas, options) {
5187
5189
  delete resolved.source;
5188
5190
  layer = resolved;
5189
5191
  }
5190
- if (_chunkWMRIG4XQcjs.flattenLayers.call(void 0, [layer]).some((x) => x.type === "pixel" && x.source === "document")) fail4(`Layer "${layer.name || layer.id}" holds the document image inside a group; convert the Background on its own.`);
5192
+ if (_chunkLL3RAN55cjs.flattenLayers.call(void 0, [layer]).some((x) => x.type === "pixel" && x.source === "document")) fail4(`Layer "${layer.name || layer.id}" holds the document image inside a group; convert the Background on its own.`);
5191
5193
  return translateLayer(layer, -b.x, -b.y);
5192
5194
  });
5193
5195
  if (nested[0].clipped) {
@@ -5214,8 +5216,8 @@ function convertToSmartObject(layers, ids, canvas, options) {
5214
5216
  smart = { ...smart, surface: renderSmartObject(smart, canvas) };
5215
5217
  const below = ordered.filter((l) => l.index < top.index).length;
5216
5218
  let out = layers;
5217
- for (const l of ordered) out = _chunkWMRIG4XQcjs.mapLayer.call(void 0, out, l.layer.id, () => null);
5218
- return { layers: _chunkWMRIG4XQcjs.insertLayer.call(void 0, out, smart, parent, top.index - below), layer: smart };
5219
+ for (const l of ordered) out = _chunkLL3RAN55cjs.mapLayer.call(void 0, out, l.layer.id, () => null);
5220
+ return { layers: _chunkLL3RAN55cjs.insertLayer.call(void 0, out, smart, parent, top.index - below), layer: smart };
5219
5221
  }
5220
5222
  function rasterizeSmartObject(layers, id) {
5221
5223
  const layer = requireSmartObject(layers, id);
@@ -5235,7 +5237,7 @@ function rasterizeSmartObject(layers, id) {
5235
5237
  if (layer.locks) out.locks = layer.locks;
5236
5238
  if (layer.effects) out.effects = layer.effects;
5237
5239
  if (layer.fillOpacity !== void 0) out.fillOpacity = layer.fillOpacity;
5238
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => out), layer: out };
5240
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => out), layer: out };
5239
5241
  }
5240
5242
  function copySmartObject(layers, id, linked, name) {
5241
5243
  const loc = requireLayer(layers, id);
@@ -5245,19 +5247,19 @@ function copySmartObject(layers, id, linked, name) {
5245
5247
  delete copy.psd;
5246
5248
  if (!linked) copy.contents = { ...layer.contents, id: newContentsId() };
5247
5249
  if (copy.smartFilters) copy.smartFilters = { ...copy.smartFilters, filters: copy.smartFilters.filters.map((f) => ({ ...f, id: newLayerId("flt") })) };
5248
- return { layers: _chunkWMRIG4XQcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _114 => _114.parent, 'optionalAccess', _115 => _115.id]), () => ( null)), loc.index + 1), layer: copy };
5250
+ return { layers: _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _114 => _114.parent, 'optionalAccess', _115 => _115.id]), () => ( null)), loc.index + 1), layer: copy };
5249
5251
  }
5250
5252
  function instancesOf(layers, contentsId) {
5251
- return _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart" && l.contents.id === contentsId).map((l) => l.id);
5253
+ return _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "smart" && l.contents.id === contentsId).map((l) => l.id);
5252
5254
  }
5253
5255
  function replaceContents(layers, contentsId, contents, canvas) {
5254
5256
  const ids = instancesOf(layers, contentsId);
5255
5257
  if (!ids.length) fail4(`No smart object uses contents "${contentsId}".`);
5256
- for (const id of ids) requireUnlocked(_chunkWMRIG4XQcjs.findLayer.call(void 0, layers, id).layer, "all", "replace its contents");
5258
+ for (const id of ids) requireUnlocked(_chunkLL3RAN55cjs.findLayer.call(void 0, layers, id).layer, "all", "replace its contents");
5257
5259
  const next = { ...contents, id: contentsId };
5258
5260
  let out = layers;
5259
5261
  for (const id of ids) {
5260
- out = _chunkWMRIG4XQcjs.mapLayer.call(void 0, out, id, (l) => {
5262
+ out = _chunkLL3RAN55cjs.mapLayer.call(void 0, out, id, (l) => {
5261
5263
  const layer = l;
5262
5264
  return rerender({ ...layer, contents: next, placement: refitPlacement(layer, next) }, canvas, "take the new contents");
5263
5265
  });
@@ -5274,8 +5276,8 @@ function refitPlacement(layer, contents) {
5274
5276
  const h = transformHomography(g);
5275
5277
  if (!h) return placementAt(contents, 0, 0);
5276
5278
  const shift = [1, 0, (W0 - W1) / 2, 0, 1, (H0 - H1) / 2, 0, 0, 1];
5277
- const hn = _chunkEJVDBITDcjs.multiplyHomographies.call(void 0, shift, h);
5278
- const pts = _chunkEJVDBITDcjs.boxQuad.call(void 0, { x: 0, y: 0, width: W1, height: H1 }).map((p) => {
5279
+ const hn = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, shift, h);
5280
+ const pts = _chunkMUUXNRU4cjs.boxQuad.call(void 0, { x: 0, y: 0, width: W1, height: H1 }).map((p) => {
5279
5281
  const w = hn[6] * p.x + hn[7] * p.y + hn[8];
5280
5282
  return { x: (hn[0] * p.x + hn[1] * p.y + hn[2]) / w, y: (hn[3] * p.x + hn[4] * p.y + hn[5]) / w };
5281
5283
  });
@@ -5320,7 +5322,7 @@ function addSmartFilter(layers, id, filter, canvas, index) {
5320
5322
  const at = index === void 0 ? filters.length : Math.max(0, Math.min(filters.length, Math.floor(index)));
5321
5323
  filters.splice(at, 0, filter);
5322
5324
  const next = withStack(layer, { ...stack, filters }, canvas);
5323
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter };
5325
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter };
5324
5326
  }
5325
5327
  function updateSmartFilter(layers, id, filterId, changes, canvas) {
5326
5328
  const layer = editableSmart(layers, id);
@@ -5342,7 +5344,7 @@ function updateSmartFilter(layers, id, filterId, changes, canvas) {
5342
5344
  const filters = [...layer.smartFilters.filters];
5343
5345
  filters[i] = merged2;
5344
5346
  const next = withStack(layer, { ...layer.smartFilters, filters }, canvas);
5345
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter: merged2 };
5347
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next), layer: next, filter: merged2 };
5346
5348
  }
5347
5349
  function removeSmartFilter(layers, id, filterId, canvas) {
5348
5350
  const layer = editableSmart(layers, id);
@@ -5350,7 +5352,7 @@ function removeSmartFilter(layers, id, filterId, canvas) {
5350
5352
  const stack = layer.smartFilters;
5351
5353
  const filters = stack.filters.filter((f) => f.id !== filterId);
5352
5354
  const next = withStack(layer, filters.length ? { ...stack, filters } : stack.enabled ? void 0 : { enabled: false, filters }, canvas);
5353
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5355
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5354
5356
  }
5355
5357
  function moveSmartFilter(layers, id, filterId, index, canvas) {
5356
5358
  const layer = editableSmart(layers, id);
@@ -5361,12 +5363,12 @@ function moveSmartFilter(layers, id, filterId, index, canvas) {
5361
5363
  const [f] = filters.splice(i, 1);
5362
5364
  filters.splice(index, 0, f);
5363
5365
  const next = withStack(layer, { ...layer.smartFilters, filters }, canvas);
5364
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5366
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5365
5367
  }
5366
5368
  function setSmartFiltersEnabled(layers, id, enabled, canvas) {
5367
5369
  const layer = editableSmart(layers, id);
5368
5370
  const next = withStack(layer, { ...stackOf(layer), enabled: Boolean(enabled) }, canvas);
5369
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5371
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5370
5372
  }
5371
5373
  function setSmartFilterMask(layers, id, mask, canvas) {
5372
5374
  const layer = editableSmart(layers, id);
@@ -5375,7 +5377,7 @@ function setSmartFilterMask(layers, id, mask, canvas) {
5375
5377
  if (mask) stack.mask = mask;
5376
5378
  else delete stack.mask;
5377
5379
  const next = withStack(layer, stack, canvas);
5378
- return { layers: _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5380
+ return { layers: _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => next), layer: next };
5379
5381
  }
5380
5382
  function withFilterMaskSurface(layer, surface, canvas) {
5381
5383
  const stack = stackOf(layer);
@@ -5389,7 +5391,7 @@ function placementBounds(layer) {
5389
5391
  // src/image-editor/layers/serialize.ts
5390
5392
  var LAYERED_SCHEMA_VERSION = 3;
5391
5393
  function serializePatterns(patterns) {
5392
- return patterns.map((p) => ({ id: p.id, name: p.name, png: _chunkEJVDBITDcjs.pngDataUrl.call(void 0, p.width, p.height, p.data) }));
5394
+ return patterns.map((p) => ({ id: p.id, name: p.name, png: _chunkDCLJNVZScjs.pngDataUrl.call(void 0, p.width, p.height, p.data) }));
5393
5395
  }
5394
5396
  function deserializePatterns(raw, problems = []) {
5395
5397
  if (!Array.isArray(raw)) return [];
@@ -5412,7 +5414,7 @@ function encodeSurface(surface) {
5412
5414
  let out = null;
5413
5415
  if (b) {
5414
5416
  const data = _chunk7ISPWEJAcjs.readRegion.call(void 0, surface, b);
5415
- out = { url: _chunkEJVDBITDcjs.pngDataUrl.call(void 0, b.width, b.height, data, surface.channels), x: b.x, y: b.y };
5417
+ out = { url: _chunkDCLJNVZScjs.pngDataUrl.call(void 0, b.width, b.height, data, surface.channels), x: b.x, y: b.y };
5416
5418
  }
5417
5419
  encodedCache.set(surface, out);
5418
5420
  return out;
@@ -5429,7 +5431,7 @@ function encodeDeepSurface(surface) {
5429
5431
  const view = new DataView(bytes.buffer);
5430
5432
  if (samples instanceof Uint16Array) for (let i = 0; i < samples.length; i++) view.setUint16(2 * i, samples[i], true);
5431
5433
  else for (let i = 0; i < samples.length; i++) view.setFloat32(4 * i, samples[i], true);
5432
- out = { depth, x: b.x, y: b.y, width: b.width, height: b.height, data: _chunkEJVDBITDcjs.bytesToBase64.call(void 0, _chunk643B2HKCcjs.deflate.call(void 0, bytes)) };
5434
+ out = { depth, x: b.x, y: b.y, width: b.width, height: b.height, data: _chunkDCLJNVZScjs.bytesToBase64.call(void 0, _chunk643B2HKCcjs.deflate.call(void 0, bytes)) };
5433
5435
  }
5434
5436
  deepCache.set(surface, out);
5435
5437
  return out;
@@ -5441,7 +5443,7 @@ function decodeDeepSurface(surface, raw, problems, label) {
5441
5443
  if (d.depth !== 16 && d.depth !== 32 || !(d.width > 0 && d.height > 0) || !Number.isInteger(d.x) || !Number.isInteger(d.y) || typeof d.data !== "string") throw new Error("malformed");
5442
5444
  const n = d.width * d.height * surface.channels;
5443
5445
  const size = d.depth === 16 ? 2 : 4;
5444
- const bytes = _chunk643B2HKCcjs.inflate.call(void 0, _chunkEJVDBITDcjs.base64ToBytes.call(void 0, d.data), { maxOutput: n * size });
5446
+ const bytes = _chunk643B2HKCcjs.inflate.call(void 0, _chunkDCLJNVZScjs.base64ToBytes.call(void 0, d.data), { maxOutput: n * size });
5445
5447
  if (bytes.length !== n * size) throw new Error("wrong length");
5446
5448
  const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
5447
5449
  const samples = d.depth === 16 ? new Uint16Array(n) : new Float32Array(n);
@@ -5470,7 +5472,7 @@ function baseFields(layer, ctx) {
5470
5472
  function serializeEffects(effects) {
5471
5473
  const out = { enabled: effects.enabled, items: JSON.parse(JSON.stringify(effects.items)) };
5472
5474
  if (effects.scale !== void 0 && effects.scale !== 1) out.scale = effects.scale;
5473
- if (effects.psd) out.psd = { key: effects.psd.key, data: _chunkEJVDBITDcjs.bytesToBase64.call(void 0, effects.psd.data) };
5475
+ if (effects.psd) out.psd = { key: effects.psd.key, data: _chunkDCLJNVZScjs.bytesToBase64.call(void 0, effects.psd.data) };
5474
5476
  return out;
5475
5477
  }
5476
5478
  function deserializeEffects(raw) {
@@ -5480,12 +5482,12 @@ function deserializeEffects(raw) {
5480
5482
  const p = r.psd;
5481
5483
  if (p && typeof p.key === "string" && typeof p.data === "string") {
5482
5484
  try {
5483
- psd = { key: p.key, data: _chunkEJVDBITDcjs.base64ToBytes.call(void 0, p.data) };
5485
+ psd = { key: p.key, data: _chunkDCLJNVZScjs.base64ToBytes.call(void 0, p.data) };
5484
5486
  } catch (e7) {
5485
5487
  psd = void 0;
5486
5488
  }
5487
5489
  }
5488
- return _chunkWMRIG4XQcjs.normalizeLayerEffects.call(void 0, { ...r, psd });
5490
+ return _chunkLL3RAN55cjs.normalizeLayerEffects.call(void 0, { ...r, psd });
5489
5491
  }
5490
5492
  function serializeMask(mask, hint, ctx) {
5491
5493
  const out = { defaultValue: mask.defaultValue };
@@ -5568,8 +5570,8 @@ function serializeType(layer, base, ctx) {
5568
5570
  if (layer.annotation) out.annotation = JSON.parse(JSON.stringify(layer.annotation));
5569
5571
  if (_optionalChain([layer, 'access', _123 => _123.psd, 'optionalAccess', _124 => _124.tySh]) || _optionalChain([layer, 'access', _125 => _125.psd, 'optionalAccess', _126 => _126.blocks, 'optionalAccess', _127 => _127.length])) {
5570
5572
  out.psd = {};
5571
- if (layer.psd.tySh) out.psd.tySh = _chunkEJVDBITDcjs.bytesToBase64.call(void 0, layer.psd.tySh);
5572
- if (_optionalChain([layer, 'access', _128 => _128.psd, 'access', _129 => _129.blocks, 'optionalAccess', _130 => _130.length])) out.psd.blocks = layer.psd.blocks.map((b) => ({ key: b.key, data: _chunkEJVDBITDcjs.bytesToBase64.call(void 0, b.data) }));
5573
+ if (layer.psd.tySh) out.psd.tySh = _chunkDCLJNVZScjs.bytesToBase64.call(void 0, layer.psd.tySh);
5574
+ if (_optionalChain([layer, 'access', _128 => _128.psd, 'access', _129 => _129.blocks, 'optionalAccess', _130 => _130.length])) out.psd.blocks = layer.psd.blocks.map((b) => ({ key: b.key, data: _chunkDCLJNVZScjs.bytesToBase64.call(void 0, b.data) }));
5573
5575
  if (layer.psd.signature) out.psd.signature = layer.psd.signature;
5574
5576
  }
5575
5577
  return out;
@@ -5607,8 +5609,8 @@ function readType(r, base, ctx) {
5607
5609
  if (r.annotation && typeof r.annotation === "object" && r.annotation.type === "text") layer.annotation = JSON.parse(JSON.stringify({ ...r.annotation, id: _nullishCoalesce(r.annotation.id, () => ( base.id)) }));
5608
5610
  if (r.psd && typeof r.psd === "object") {
5609
5611
  const psd = {};
5610
- if (typeof r.psd.tySh === "string") psd.tySh = _chunkEJVDBITDcjs.base64ToBytes.call(void 0, r.psd.tySh);
5611
- if (Array.isArray(r.psd.blocks)) psd.blocks = r.psd.blocks.filter((b) => b && typeof b.key === "string" && typeof b.data === "string").map((b) => ({ key: b.key, data: _chunkEJVDBITDcjs.base64ToBytes.call(void 0, b.data) }));
5612
+ if (typeof r.psd.tySh === "string") psd.tySh = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, r.psd.tySh);
5613
+ if (Array.isArray(r.psd.blocks)) psd.blocks = r.psd.blocks.filter((b) => b && typeof b.key === "string" && typeof b.data === "string").map((b) => ({ key: b.key, data: _chunkDCLJNVZScjs.base64ToBytes.call(void 0, b.data) }));
5612
5614
  if (typeof r.psd.signature === "string") psd.signature = r.psd.signature;
5613
5615
  if (psd.tySh || _optionalChain([psd, 'access', _139 => _139.blocks, 'optionalAccess', _140 => _140.length])) layer.psd = psd;
5614
5616
  }
@@ -5636,7 +5638,7 @@ function serializeShape(layer, base) {
5636
5638
  if (layer.inverted) out.inverted = true;
5637
5639
  if (layer.fillOpacity !== void 0 && layer.fillOpacity !== 1) out.fillOpacity = layer.fillOpacity;
5638
5640
  if (layer.annotation) out.annotation = JSON.parse(JSON.stringify(layer.annotation));
5639
- if (_optionalChain([layer, 'access', _145 => _145.psd, 'optionalAccess', _146 => _146.blocks, 'optionalAccess', _147 => _147.length])) out.psd = { blocks: layer.psd.blocks.map((b) => ({ key: b.key, data: _chunkEJVDBITDcjs.bytesToBase64.call(void 0, b.data) })), ...layer.psd.signature ? { signature: layer.psd.signature } : {} };
5641
+ if (_optionalChain([layer, 'access', _145 => _145.psd, 'optionalAccess', _146 => _146.blocks, 'optionalAccess', _147 => _147.length])) out.psd = { blocks: layer.psd.blocks.map((b) => ({ key: b.key, data: _chunkDCLJNVZScjs.bytesToBase64.call(void 0, b.data) })), ...layer.psd.signature ? { signature: layer.psd.signature } : {} };
5640
5642
  return out;
5641
5643
  }
5642
5644
  function readShape(r, base, ctx) {
@@ -5668,7 +5670,7 @@ function readShape(r, base, ctx) {
5668
5670
  if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) out.fillOpacity = num2(r.fillOpacity, 0, 1, 1);
5669
5671
  if (a && shapeFromAnnotation(a)) out.annotation = a;
5670
5672
  if (r.psd && Array.isArray(r.psd.blocks)) {
5671
- const blocks = r.psd.blocks.filter((b) => b && typeof b.key === "string" && typeof b.data === "string").map((b) => ({ key: b.key, data: _chunkEJVDBITDcjs.base64ToBytes.call(void 0, b.data) }));
5673
+ const blocks = r.psd.blocks.filter((b) => b && typeof b.key === "string" && typeof b.data === "string").map((b) => ({ key: b.key, data: _chunkDCLJNVZScjs.base64ToBytes.call(void 0, b.data) }));
5672
5674
  if (blocks.length) out.psd = { blocks };
5673
5675
  if (out.psd && typeof r.psd.signature === "string") out.psd.signature = r.psd.signature;
5674
5676
  }
@@ -5681,7 +5683,7 @@ function readShape(r, base, ctx) {
5681
5683
  function serializeSmartFilters(stack, layerId, ctx) {
5682
5684
  const out = {
5683
5685
  enabled: stack.enabled,
5684
- filters: stack.filters.map((f) => f.kind === "psd" ? { ...f, data: _chunkEJVDBITDcjs.bytesToBase64.call(void 0, f.data) } : JSON.parse(JSON.stringify(f)))
5686
+ filters: stack.filters.map((f) => f.kind === "psd" ? { ...f, data: _chunkDCLJNVZScjs.bytesToBase64.call(void 0, f.data) } : JSON.parse(JSON.stringify(f)))
5685
5687
  };
5686
5688
  if (stack.mask) out.mask = serializeMask(stack.mask, `${layerId}-filter-mask`, ctx);
5687
5689
  return out;
@@ -5707,7 +5709,7 @@ function serializeSmartObject(layer, base, ctx) {
5707
5709
  }
5708
5710
  if (layer.fillOpacity !== void 0 && layer.fillOpacity !== 1) out.fillOpacity = layer.fillOpacity;
5709
5711
  if (layer.psd) {
5710
- out.psd = { key: layer.psd.key, data: _chunkEJVDBITDcjs.bytesToBase64.call(void 0, layer.psd.data) };
5712
+ out.psd = { key: layer.psd.key, data: _chunkDCLJNVZScjs.bytesToBase64.call(void 0, layer.psd.data) };
5711
5713
  if (layer.psd.placed) out.psd.placed = layer.psd.placed;
5712
5714
  }
5713
5715
  return out;
@@ -5719,7 +5721,7 @@ function serializeContents(c, ctx) {
5719
5721
  if (enc) {
5720
5722
  if (enc.x !== 0 || enc.y !== 0) {
5721
5723
  const data = _chunk7ISPWEJAcjs.readRegion.call(void 0, c.raster, { x: 0, y: 0, width: c.width, height: c.height });
5722
- out.asset = ctx.addAsset(_chunkEJVDBITDcjs.pngDataUrl.call(void 0, c.width, c.height, data, 4), `contents-${c.id}`);
5724
+ out.asset = ctx.addAsset(_chunkDCLJNVZScjs.pngDataUrl.call(void 0, c.width, c.height, data, 4), `contents-${c.id}`);
5723
5725
  } else out.asset = ctx.addAsset(enc.url, `contents-${c.id}`);
5724
5726
  }
5725
5727
  }
@@ -5728,7 +5730,7 @@ function serializeContents(c, ctx) {
5728
5730
  if (c.document.globalLight) out.globalLight = { ...c.document.globalLight };
5729
5731
  if (_optionalChain([c, 'access', _152 => _152.document, 'access', _153 => _153.patterns, 'optionalAccess', _154 => _154.length])) out.patterns = serializePatterns(c.document.patterns);
5730
5732
  }
5731
- if (c.file) out.file = { type: c.file.type, data: _chunkEJVDBITDcjs.bytesToBase64.call(void 0, c.file.bytes) };
5733
+ if (c.file) out.file = { type: c.file.type, data: _chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes) };
5732
5734
  if (c.linked) out.linked = { path: c.linked.path };
5733
5735
  return out;
5734
5736
  }
@@ -5764,7 +5766,7 @@ async function serializeLayersExternal(layers, store) {
5764
5766
  for (const [id, url] of Object.entries(inline.assets)) {
5765
5767
  let ref = refs.get(url);
5766
5768
  if (!ref) {
5767
- const parsed = _chunkEJVDBITDcjs.parseDataUrl.call(void 0, url);
5769
+ const parsed = _chunkDCLJNVZScjs.parseDataUrl.call(void 0, url);
5768
5770
  const png = decodePngHeader(parsed.bytes);
5769
5771
  ref = await store.put(new Blob([parsed.bytes], { type: "image/png" }), { id, width: png.width, height: png.height });
5770
5772
  if (typeof ref !== "string" || !ref) throw new Error(`The asset store returned no reference for "${id}".`);
@@ -5792,7 +5794,7 @@ async function resolveExternalAssets(assets, store, problems) {
5792
5794
  try {
5793
5795
  const blob = await store.get(ref);
5794
5796
  const bytes = new Uint8Array(await blob.arrayBuffer());
5795
- out[id] = `data:image/png;base64,${_chunkEJVDBITDcjs.bytesToBase64.call(void 0, bytes)}`;
5797
+ out[id] = `data:image/png;base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, bytes)}`;
5796
5798
  } catch (err) {
5797
5799
  problems.push(`Asset "${id}" (${ref}) could not be fetched: ${err.message}`);
5798
5800
  }
@@ -5800,9 +5802,9 @@ async function resolveExternalAssets(assets, store, problems) {
5800
5802
  return out;
5801
5803
  }
5802
5804
  function decodePngDataUrl(url, channels) {
5803
- const parsed = _chunkEJVDBITDcjs.parseDataUrl.call(void 0, url);
5805
+ const parsed = _chunkDCLJNVZScjs.parseDataUrl.call(void 0, url);
5804
5806
  if (!parsed) throw new Error("Asset is not a data URL.");
5805
- const png = _chunkEJVDBITDcjs.decodePng.call(void 0, parsed.bytes, { keepGray: channels === 1 });
5807
+ const png = _chunkDCLJNVZScjs.decodePng.call(void 0, parsed.bytes, { keepGray: channels === 1 });
5806
5808
  if (png.channels === channels) return png;
5807
5809
  if (channels === 1) {
5808
5810
  const out2 = new Uint8ClampedArray(png.width * png.height);
@@ -5977,7 +5979,7 @@ function readContents(id, ctx) {
5977
5979
  const c = { id, name: typeof raw.name === "string" ? raw.name : "Contents", width, height, kind: raw.kind === "document" ? "document" : "raster" };
5978
5980
  if (raw.file && typeof raw.file.type === "string" && typeof raw.file.data === "string") {
5979
5981
  try {
5980
- c.file = { type: raw.file.type, bytes: _chunkEJVDBITDcjs.base64ToBytes.call(void 0, raw.file.data) };
5982
+ c.file = { type: raw.file.type, bytes: _chunkDCLJNVZScjs.base64ToBytes.call(void 0, raw.file.data) };
5981
5983
  } catch (e9) {
5982
5984
  ctx.problems.push(`Smart object contents "${c.name}": the embedded file could not be read`);
5983
5985
  }
@@ -6012,7 +6014,7 @@ function readSmartFilters(raw, ctx, what) {
6012
6014
  const opacity = num2(f.opacity, 0, 1, 1);
6013
6015
  if (f.kind === "psd") {
6014
6016
  try {
6015
- 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: _chunkEJVDBITDcjs.base64ToBytes.call(void 0, String(_nullishCoalesce(f.data, () => ( "")))), blend, opacity });
6017
+ 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: _chunkDCLJNVZScjs.base64ToBytes.call(void 0, String(_nullishCoalesce(f.data, () => ( "")))), blend, opacity });
6016
6018
  } catch (e10) {
6017
6019
  ctx.problems.push(`${what}: a Photoshop smart filter could not be read`);
6018
6020
  }
@@ -6038,7 +6040,7 @@ function readSmartObject(r, base, ctx) {
6038
6040
  try {
6039
6041
  const raw = { corners: p.corners };
6040
6042
  if (p.warp && _chunkVYW7JBTMcjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6041
- if (_chunkWMRIG4XQcjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
6043
+ if (_chunkLL3RAN55cjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
6042
6044
  placement = normalizePlacement(raw, contents);
6043
6045
  } catch (e) {
6044
6046
  ctx.problems.push(`${what}: its placement is invalid (${e instanceof Error ? e.message : String(e)}); it was placed at the top left`);
@@ -6050,7 +6052,7 @@ function readSmartObject(r, base, ctx) {
6050
6052
  if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) layer.fillOpacity = num2(r.fillOpacity, 0, 1, 1);
6051
6053
  if (r.psd && typeof r.psd.key === "string" && typeof r.psd.data === "string") {
6052
6054
  try {
6053
- layer.psd = { key: r.psd.key, data: _chunkEJVDBITDcjs.base64ToBytes.call(void 0, r.psd.data) };
6055
+ layer.psd = { key: r.psd.key, data: _chunkDCLJNVZScjs.base64ToBytes.call(void 0, r.psd.data) };
6054
6056
  if (typeof r.psd.placed === "string") layer.psd.placed = r.psd.placed;
6055
6057
  } catch (e11) {
6056
6058
  }
@@ -8607,14 +8609,14 @@ var toQuad = (p) => [
8607
8609
  function cornersFromQuad(quad, frame, contents) {
8608
8610
  if (quad.length !== 8 || !quad.every(Number.isFinite)) return null;
8609
8611
  const q2 = toQuad(quad);
8610
- const h = _chunkEJVDBITDcjs.rectToQuad.call(void 0, frame, q2);
8612
+ const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, frame, q2);
8611
8613
  if (!h) return null;
8612
- const out = _chunkEJVDBITDcjs.boxQuad.call(void 0, { x: 0, y: 0, width: contents.width, height: contents.height }).map((p) => _chunkEJVDBITDcjs.applyHomography.call(void 0, h, p));
8614
+ const out = _chunkMUUXNRU4cjs.boxQuad.call(void 0, { x: 0, y: 0, width: contents.width, height: contents.height }).map((p) => _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p));
8613
8615
  return out.every(Boolean) ? out : null;
8614
8616
  }
8615
8617
  function quadFromCorners(corners, frame, contents) {
8616
- const h = _chunkEJVDBITDcjs.rectToQuad.call(void 0, { x: 0, y: 0, width: contents.width, height: contents.height }, corners);
8617
- const pts = _chunkEJVDBITDcjs.boxQuad.call(void 0, frame).map((p) => _nullishCoalesce((h ? _chunkEJVDBITDcjs.applyHomography.call(void 0, h, p) : p), () => ( p)));
8618
+ const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, { x: 0, y: 0, width: contents.width, height: contents.height }, corners);
8619
+ const pts = _chunkMUUXNRU4cjs.boxQuad.call(void 0, frame).map((p) => _nullishCoalesce((h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p), () => ( p)));
8618
8620
  return pts.flatMap((p) => [p.x, p.y]);
8619
8621
  }
8620
8622
  var PLACED_KEYS = ["SoLd", "SoLE", "PlLd"];
@@ -9871,7 +9873,7 @@ function recordEffects(ctx, rec, name, notes, group) {
9871
9873
  }
9872
9874
  for (const e of parsed.effects.items) {
9873
9875
  for (const id of patternIds(e)) {
9874
- if (ctx.patterns.has(id) || _chunkWMRIG4XQcjs.builtinPattern.call(void 0, id)) continue;
9876
+ if (ctx.patterns.has(id) || _chunkLL3RAN55cjs.builtinPattern.call(void 0, id)) continue;
9875
9877
  ctx.warn.add("A pattern effect uses a pattern the file does not contain, and paints nothing", name);
9876
9878
  notes.push(`pattern "${id}" is not in the file`);
9877
9879
  }
@@ -10081,7 +10083,7 @@ function contentsFor(ctx, placed, name, notes) {
10081
10083
  document: { layers: nested.layers, globalLight: nested.globalLight, patterns: nested.patterns.length ? nested.patterns : void 0 }
10082
10084
  };
10083
10085
  } else if (t.ext === "png") {
10084
- const png = _chunkEJVDBITDcjs.decodePng.call(void 0, file.bytes);
10086
+ const png = _chunkDCLJNVZScjs.decodePng.call(void 0, file.bytes);
10085
10087
  out = { ...base, kind: "raster", width: png.width, height: png.height, raster: _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, png, 4, 0, 0) };
10086
10088
  } else {
10087
10089
  const size = _nullishCoalesce(placed.size, () => ( { width: 0, height: 0 }));
@@ -10147,7 +10149,7 @@ function importSmart(ctx, rec, name, notes, props) {
10147
10149
  ctx.warn.add("A smart object without readable contents came in with its stored pixels as contents", name);
10148
10150
  notes.push("contents missing");
10149
10151
  }
10150
- placement = { corners: _chunkEJVDBITDcjs.boxQuad.call(void 0, { x: rec.rect.left, y: rec.rect.top, width, height }) };
10152
+ placement = { corners: _chunkMUUXNRU4cjs.boxQuad.call(void 0, { x: rec.rect.left, y: rec.rect.top, width, height }) };
10151
10153
  preview = true;
10152
10154
  }
10153
10155
  const layer = { type: "smart", id: ctx.newId(name), ...props, contents, placement, surface, offset: { x: 0, y: 0 } };
@@ -10424,34 +10426,34 @@ function blendOf(d, key, fallback, notes) {
10424
10426
  function colorOf(d, fallback = "#000000") {
10425
10427
  if (!d) return fallback;
10426
10428
  const g = (k) => descNumber(d, k);
10427
- if (g("redFloat") !== void 0) return _chunkWMRIG4XQcjs.effectColorHex.call(void 0, [g("redFloat"), _nullishCoalesce(g("greenFloat"), () => ( 0)), _nullishCoalesce(g("blueFloat"), () => ( 0))]);
10429
+ if (g("redFloat") !== void 0) return _chunkLL3RAN55cjs.effectColorHex.call(void 0, [g("redFloat"), _nullishCoalesce(g("greenFloat"), () => ( 0)), _nullishCoalesce(g("blueFloat"), () => ( 0))]);
10428
10430
  switch (d.classId) {
10429
10431
  case "HSBC": {
10430
10432
  const rgb = decodePsdColor(1, [(_nullishCoalesce(g("H "), () => ( 0))) / 360 * 65535, (_nullishCoalesce(g("Strt"), () => ( 0))) / 100 * 65535, (_nullishCoalesce(g("Brgh"), () => ( 0))) / 100 * 65535]);
10431
- return rgb ? _chunkWMRIG4XQcjs.effectColorHex.call(void 0, rgb) : fallback;
10433
+ return rgb ? _chunkLL3RAN55cjs.effectColorHex.call(void 0, rgb) : fallback;
10432
10434
  }
10433
10435
  case "CMYC": {
10434
10436
  const inv = (k) => (1 - (_nullishCoalesce(g(k), () => ( 0))) / 100) * 65535;
10435
10437
  const rgb = decodePsdColor(2, [inv("Cyn "), inv("Mgnt"), inv("Ylw "), inv("Blck")]);
10436
- return rgb ? _chunkWMRIG4XQcjs.effectColorHex.call(void 0, rgb) : fallback;
10438
+ return rgb ? _chunkLL3RAN55cjs.effectColorHex.call(void 0, rgb) : fallback;
10437
10439
  }
10438
10440
  case "LbCl": {
10439
10441
  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]);
10440
- return rgb ? _chunkWMRIG4XQcjs.effectColorHex.call(void 0, rgb) : fallback;
10442
+ return rgb ? _chunkLL3RAN55cjs.effectColorHex.call(void 0, rgb) : fallback;
10441
10443
  }
10442
10444
  case "Grsc": {
10443
10445
  const v = 1 - (_nullishCoalesce(g("Gry "), () => ( 0))) / 100;
10444
- return _chunkWMRIG4XQcjs.effectColorHex.call(void 0, [v, v, v]);
10446
+ return _chunkLL3RAN55cjs.effectColorHex.call(void 0, [v, v, v]);
10445
10447
  }
10446
10448
  }
10447
10449
  const r = g("Rd ");
10448
10450
  const gr = g("Grn ");
10449
10451
  const b = g("Bl ");
10450
10452
  if (r === void 0 || gr === void 0 || b === void 0) return fallback;
10451
- return _chunkWMRIG4XQcjs.effectColorHex.call(void 0, [r / 255, gr / 255, b / 255]);
10453
+ return _chunkLL3RAN55cjs.effectColorHex.call(void 0, [r / 255, gr / 255, b / 255]);
10452
10454
  }
10453
10455
  function colorDesc(hex) {
10454
- const [r, g, b] = _nullishCoalesce(_chunkWMRIG4XQcjs.parseEffectColor.call(void 0, hex), () => ( [0, 0, 0]));
10456
+ const [r, g, b] = _nullishCoalesce(_chunkLL3RAN55cjs.parseEffectColor.call(void 0, hex), () => ( [0, 0, 0]));
10455
10457
  return descriptor("RGBC", [
10456
10458
  ["Rd ", dbl3(r * 255)],
10457
10459
  ["Grn ", dbl3(g * 255)],
@@ -10534,9 +10536,9 @@ function gradientOf(d, notes) {
10534
10536
  raw.forEach((s, i) => {
10535
10537
  if (i > 0 && Math.abs(s.mid - 0.5) > 1e-3) {
10536
10538
  const a = raw[i - 1];
10537
- const ca = _chunkWMRIG4XQcjs.parseEffectColor.call(void 0, a.color);
10538
- const cb = _chunkWMRIG4XQcjs.parseEffectColor.call(void 0, s.color);
10539
- stops.push({ position: a.position + (s.position - a.position) * s.mid, color: _chunkWMRIG4XQcjs.effectColorHex.call(void 0, ca.map((v, k) => (v + cb[k]) / 2)) });
10539
+ const ca = _chunkLL3RAN55cjs.parseEffectColor.call(void 0, a.color);
10540
+ const cb = _chunkLL3RAN55cjs.parseEffectColor.call(void 0, s.color);
10541
+ stops.push({ position: a.position + (s.position - a.position) * s.mid, color: _chunkLL3RAN55cjs.effectColorHex.call(void 0, ca.map((v, k) => (v + cb[k]) / 2)) });
10540
10542
  notes.add("gradient midpoints are drawn as straight segments");
10541
10543
  }
10542
10544
  stops.push({ position: s.position, color: s.color });
@@ -10648,8 +10650,8 @@ var KINDS = [
10648
10650
  ["FrFX", "frameFXMulti", "stroke"]
10649
10651
  ];
10650
10652
  function common(d, kind, notes) {
10651
- const def = _chunkWMRIG4XQcjs.defaultLayerEffect.call(void 0, kind, "x");
10652
- return { id: _chunkWMRIG4XQcjs.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) };
10653
+ const def = _chunkLL3RAN55cjs.defaultLayerEffect.call(void 0, kind, "x");
10654
+ return { id: _chunkLL3RAN55cjs.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) };
10653
10655
  }
10654
10656
  function readOne(kind, d, notes) {
10655
10657
  const size = (key, fallback) => clamp3(num3(d, key, fallback), 0, 250);
@@ -10692,7 +10694,7 @@ function readOne(kind, d, notes) {
10692
10694
  case "bevel-emboss": {
10693
10695
  const styles = { OtrB: "outer-bevel", InrB: "inner-bevel", Embs: "emboss", PlEb: "pillow-emboss", strokeEmboss: "stroke-emboss" };
10694
10696
  const out = {
10695
- id: _chunkWMRIG4XQcjs.newEffectId.call(void 0, ),
10697
+ id: _chunkLL3RAN55cjs.newEffectId.call(void 0, ),
10696
10698
  enabled: descBool(d, "enab") !== false,
10697
10699
  kind,
10698
10700
  style: _nullishCoalesce(styles[_nullishCoalesce(enumOf3(d, "bvlS"), () => ( ""))], () => ( "inner-bevel")),
@@ -10903,10 +10905,10 @@ function writeLfx2(effects) {
10903
10905
  ["Scl ", unit3("#Prc", 100)],
10904
10906
  ["masterFXSwitch", boolV3(effects.enabled)]
10905
10907
  ];
10906
- const scale = _chunkWMRIG4XQcjs.effectsScale.call(void 0, effects);
10908
+ const scale = _chunkLL3RAN55cjs.effectsScale.call(void 0, effects);
10907
10909
  let dropped = 0;
10908
10910
  for (const [single, multi, kind] of KINDS) {
10909
- const of = effects.items.filter((e) => e.kind === kind).map((e) => writeOne(_chunkWMRIG4XQcjs.scaleLayerEffect.call(void 0, e, scale)));
10911
+ const of = effects.items.filter((e) => e.kind === kind).map((e) => writeOne(_chunkLL3RAN55cjs.scaleLayerEffect.call(void 0, e, scale)));
10910
10912
  if (!of.length) continue;
10911
10913
  if (of.length === 1) items.push([single, obj3(of[0])]);
10912
10914
  else if (multi) items.push([multi, { type: "VlLs", items: of.map(obj3) }]);
@@ -10938,7 +10940,7 @@ function parseLrfx(data) {
10938
10940
  const colorAt = (rd) => {
10939
10941
  rd.u16();
10940
10942
  const c = [rd.u16(), rd.u16(), rd.u16(), rd.u16()];
10941
- return _chunkWMRIG4XQcjs.effectColorHex.call(void 0, [c[0] >> 8, c[1] >> 8, c[2] >> 8].map((v) => v / 255));
10943
+ return _chunkLL3RAN55cjs.effectColorHex.call(void 0, [c[0] >> 8, c[1] >> 8, c[2] >> 8].map((v) => v / 255));
10942
10944
  };
10943
10945
  const blendAt = (rd) => {
10944
10946
  rd.skip(4);
@@ -10957,7 +10959,7 @@ function parseLrfx(data) {
10957
10959
  const enabled = b.u8() !== 0;
10958
10960
  const useGlobalLight = b.u8() !== 0;
10959
10961
  const opacity = b.u8() / 255;
10960
- const base = { id: _chunkWMRIG4XQcjs.newEffectId.call(void 0, ), enabled, blend, opacity, color, angle, useGlobalLight, distance: clamp3(distance, 0, 3e4), size: clamp3(blur, 0, 250), antiAlias: false, noise: 0 };
10962
+ const base = { id: _chunkLL3RAN55cjs.newEffectId.call(void 0, ), enabled, blend, opacity, color, angle, useGlobalLight, distance: clamp3(distance, 0, 3e4), size: clamp3(blur, 0, 250), antiAlias: false, noise: 0 };
10961
10963
  items.push(key === "dsdw" ? { ...base, kind: "drop-shadow", spread: 0, knocksOut: true } : { ...base, kind: "inner-shadow", choke: 0 });
10962
10964
  } else if (key === "oglw" || key === "iglw") {
10963
10965
  b.u32();
@@ -10967,7 +10969,7 @@ function parseLrfx(data) {
10967
10969
  const blend = blendAt(b);
10968
10970
  const enabled = b.u8() !== 0;
10969
10971
  const opacity = b.u8() / 255;
10970
- const base = { id: _chunkWMRIG4XQcjs.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 };
10972
+ const base = { id: _chunkLL3RAN55cjs.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 };
10971
10973
  items.push(key === "oglw" ? { ...base, kind: "outer-glow", spread: 0 } : { ...base, kind: "inner-glow", choke: 0, source: "edge" });
10972
10974
  } else if (key === "sofi") {
10973
10975
  b.u32();
@@ -10975,7 +10977,7 @@ function parseLrfx(data) {
10975
10977
  const color = colorAt(b);
10976
10978
  const opacity = b.u8() / 255;
10977
10979
  const enabled = b.u8() !== 0;
10978
- items.push({ id: _chunkWMRIG4XQcjs.newEffectId.call(void 0, ), kind: "color-overlay", enabled, blend, opacity, color });
10980
+ items.push({ id: _chunkLL3RAN55cjs.newEffectId.call(void 0, ), kind: "color-overlay", enabled, blend, opacity, color });
10979
10981
  } else if (key === "bevl") notes.add("legacy bevels are not read");
10980
10982
  }
10981
10983
  return { effects: { enabled: true, items }, notes: [...notes] };
@@ -11091,7 +11093,7 @@ function smartContentsFile(c) {
11091
11093
  if (c.file) return { name: c.name, bytes: c.file.bytes };
11092
11094
  if (c.kind === "raster") {
11093
11095
  const data = _chunk7ISPWEJAcjs.readRegion.call(void 0, contentsSurface(c), { x: 0, y: 0, width: c.width, height: c.height });
11094
- return { name: `${base}.png`, bytes: _chunkEJVDBITDcjs.encodePng.call(void 0, c.width, c.height, data) };
11096
+ return { name: `${base}.png`, bytes: _chunkDCLJNVZScjs.encodePng.call(void 0, c.width, c.height, data) };
11095
11097
  }
11096
11098
  const doc = c.document;
11097
11099
  const merged2 = _chunk7ISPWEJAcjs.readRegion.call(void 0, contentsSurface(c), { x: 0, y: 0, width: c.width, height: c.height });
@@ -11158,7 +11160,7 @@ function exportPsd(input) {
11158
11160
  const key = layer.type === "group" ? "lfxs" : "lfx2";
11159
11161
  if (fx.psd) {
11160
11162
  const original = parseLfx2(fx.psd.data);
11161
- if (original ? _chunkWMRIG4XQcjs.effectsFingerprint.call(void 0, original.effects) === _chunkWMRIG4XQcjs.effectsFingerprint.call(void 0, fx) : !fx.items.length) return { key, data: padEven(fx.psd.data) };
11163
+ if (original ? _chunkLL3RAN55cjs.effectsFingerprint.call(void 0, original.effects) === _chunkLL3RAN55cjs.effectsFingerprint.call(void 0, fx) : !fx.items.length) return { key, data: padEven(fx.psd.data) };
11162
11164
  }
11163
11165
  if (!fx.items.length && fx.enabled && (_nullishCoalesce(fx.scale, () => ( 1))) === 1) return null;
11164
11166
  const { data, dropped } = writeLfx2(fx);
@@ -11379,7 +11381,7 @@ function exportPsd(input) {
11379
11381
  const byId = new Map((_nullishCoalesce(input.patterns, () => ( []))).map((p) => [p.id, p]));
11380
11382
  const embed = [];
11381
11383
  for (const id of patternIds2) {
11382
- const p = _nullishCoalesce(byId.get(id), () => ( _chunkWMRIG4XQcjs.builtinPattern.call(void 0, id)));
11384
+ const p = _nullishCoalesce(byId.get(id), () => ( _chunkLL3RAN55cjs.builtinPattern.call(void 0, id)));
11383
11385
  if (p) embed.push(p);
11384
11386
  else note(`Pattern "${id}" is not in the document and was not embedded`, id);
11385
11387
  }
@@ -11770,4 +11772,4 @@ function exportPsd(input) {
11770
11772
 
11771
11773
 
11772
11774
  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.applyAdjustmentLayersFloat = applyAdjustmentLayersFloat; exports.adjustmentLayersKey = adjustmentLayersKey; exports.applyAdjustments = applyAdjustments; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.removeAlpha = removeAlpha; exports.TEXT_ALIGNS = TEXT_ALIGNS; exports.SHAPE_OPERATIONS = SHAPE_OPERATIONS; exports.LIVE_SHAPE_KINDS = LIVE_SHAPE_KINDS; 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.isRenderedLayer = isRenderedLayer; exports.shapeLayers = shapeLayers; exports.smartObjectLayers = smartObjectLayers; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.depthMaskAlpha = depthMaskAlpha; exports.runLayerFilters = runLayerFilters; exports.LayerCompositor = LayerCompositor; exports.compositeDeep = compositeDeep; exports.DEFAULT_ADJUSTMENTS_VALUES = DEFAULT_ADJUSTMENTS_VALUES; exports.DEFAULT_TRANSFORM_VALUES = DEFAULT_TRANSFORM_VALUES; exports.DEFAULT_DEPTH_MASK_VALUES = DEFAULT_DEPTH_MASK_VALUES; exports.flattenPath = flattenPath; exports.rasterizeCoverage = rasterizeCoverage; exports.parseCssColor = parseCssColor; 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.SHAPE_RENDER_MARGIN = SHAPE_RENDER_MARGIN; exports.DEFAULT_MITER_LIMIT = DEFAULT_MITER_LIMIT; exports.mapSubpaths = mapSubpaths; exports.liveShapeSubpaths = liveShapeSubpaths; exports.liveComponent = liveComponent; exports.componentPath = componentPath; exports.shapeOutline = shapeOutline; exports.shapeGeometryBounds = shapeGeometryBounds; exports.shapeRenderClip = shapeRenderClip; exports.renderShapeRect = renderShapeRect; exports.renderShape = renderShape; exports.rerenderShape = rerenderShape; exports.normalizeShapePaint = normalizeShapePaint; exports.normalizeShapeStroke = normalizeShapeStroke; exports.normalizeLiveShape = normalizeLiveShape; exports.normalizeSubpaths = normalizeSubpaths; exports.requireOperation = requireOperation; exports.requireShapeLayer = requireShapeLayer; exports.createShapeLayer = createShapeLayer; exports.defaultShapeName = defaultShapeName; exports.updateShapeLayer = updateShapeLayer; exports.transformShapeComponents = transformShapeComponents; exports.offsetShape = offsetShape; exports.mergeShapeComponents = mergeShapeComponents; exports.shapeAsPixelLayer = shapeAsPixelLayer; exports.shapeFromAnnotation = shapeFromAnnotation; exports.annotationBlend = annotationBlend; exports.annotationOfShape = annotationOfShape; exports.TEXT_RENDER_MARGIN = TEXT_RENDER_MARGIN; exports.textMatrix = textMatrix; exports.textOutlines = textOutlines; exports.renderText = renderText; exports.rerenderText = rerenderText; exports.TEXT_STYLE_FIELDS = TEXT_STYLE_FIELDS; exports.patchTextStyle = patchTextStyle; exports.PARAGRAPH_STYLE_FIELDS = PARAGRAPH_STYLE_FIELDS; exports.patchParagraphStyle = patchParagraphStyle; exports.textRange = textRange; exports.requireTypeLayer = requireTypeLayer; exports.normalizeText = normalizeText; exports.typeLayerName = typeLayerName; exports.createTypeLayer = createTypeLayer; exports.updateTypeLayer = updateTypeLayer; exports.replaceTextRange = replaceTextRange; exports.transformTypeLayer = transformTypeLayer; exports.typeFrame = typeFrame; exports.typeAsPixelLayer = typeAsPixelLayer; exports.toTextSpace = toTextSpace; exports.typeFromAnnotation = typeFromAnnotation; exports.annotationOfType = annotationOfType; exports.BACKGROUND_LAYER_ID = BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = BACKGROUND_LAYER_NAME; exports.DEVELOP_FILTER_ID = DEVELOP_FILTER_ID; exports.BLUR_FILTER_ID = BLUR_FILTER_ID; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.legacyMaskOf = legacyMaskOf; exports.isDefaultDepthMask = isDefaultDepthMask; exports.developFromAdjustments = developFromAdjustments; exports.annotationLayerName = annotationLayerName; exports.annotationLayerFor = annotationLayerFor; exports.annotationOfLayer = annotationOfLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.backgroundLayer = backgroundLayer; exports.depthRasterMask = depthRasterMask; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.developTarget = developTarget; exports.legacyView = legacyView; exports.isLegacyShape = isLegacyShape; 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.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.encodeDeepSurface = encodeDeepSurface; exports.decodeDeepSurface = decodeDeepSurface; 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.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.decodePlanes = decodePlanes; exports.encodeRle = encodeRle; 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;
11773
- //# sourceMappingURL=chunk-HTAFDTNR.cjs.map
11775
+ //# sourceMappingURL=chunk-GLOOH65Y.cjs.map