@pixerate/editor 0.121.0 → 0.122.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 (36) hide show
  1. package/THIRD_PARTY_NOTICES.md +1 -1
  2. package/dist/{chunk-GLOOH65Y.cjs → chunk-4PUPGALM.cjs} +196 -103
  3. package/dist/chunk-4PUPGALM.cjs.map +1 -0
  4. package/dist/{chunk-4I54JSJ6.js → chunk-CLTTLLWA.js} +1089 -981
  5. package/dist/chunk-CLTTLLWA.js.map +1 -0
  6. package/dist/{chunk-LL3RAN55.cjs → chunk-DFFBJV3U.cjs} +1839 -1731
  7. package/dist/chunk-DFFBJV3U.cjs.map +1 -0
  8. package/dist/{chunk-E6N5KLMA.js → chunk-IX3YKUVK.js} +96 -3
  9. package/dist/chunk-IX3YKUVK.js.map +1 -0
  10. package/dist/{render-B05K68_h.d.ts → deep-DLwKZDFr.d.ts} +143 -134
  11. package/dist/{render-DnAbIKcs.d.cts → deep-QS3ppbMX.d.cts} +143 -134
  12. package/dist/{export-D2D8hb_u.d.ts → export-VmTofKIk.d.ts} +11 -4
  13. package/dist/{export-fP2hZYjm.d.cts → export-jKKj8Fg8.d.cts} +11 -4
  14. package/dist/image-editor/index.cjs +678 -672
  15. package/dist/image-editor/index.cjs.map +1 -1
  16. package/dist/image-editor/index.d.cts +17 -5
  17. package/dist/image-editor/index.d.ts +17 -5
  18. package/dist/image-editor/index.js +8 -2
  19. package/dist/image-editor/index.js.map +1 -1
  20. package/dist/paint-editor/index.cjs +68 -68
  21. package/dist/paint-editor/index.d.cts +2 -2
  22. package/dist/paint-editor/index.d.ts +2 -2
  23. package/dist/paint-editor/index.js +2 -2
  24. package/dist/raster/index.cjs +2 -2
  25. package/dist/raster/index.d.cts +29 -7
  26. package/dist/raster/index.d.ts +29 -7
  27. package/dist/raster/index.js +1 -1
  28. package/package.json +1 -1
  29. package/skills/pixerate-canvas/SKILL.md +23 -1
  30. package/skills/pixerate-image-editor/SKILL.md +7 -1
  31. package/skills/pixerate-image-editor/references/photoshop-files.md +4 -3
  32. package/skills/pixerate-paint-editor/SKILL.md +32 -7
  33. package/dist/chunk-4I54JSJ6.js.map +0 -1
  34. package/dist/chunk-E6N5KLMA.js.map +0 -1
  35. package/dist/chunk-GLOOH65Y.cjs.map +0 -1
  36. package/dist/chunk-LL3RAN55.cjs.map +0 -1
@@ -358,7 +358,10 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
358
358
 
359
359
 
360
360
 
361
- var _chunkGLOOH65Ycjs = require('../chunk-GLOOH65Y.cjs');
361
+
362
+
363
+
364
+ var _chunk4PUPGALMcjs = require('../chunk-4PUPGALM.cjs');
362
365
 
363
366
 
364
367
  var _chunkD6FH2YAXcjs = require('../chunk-D6FH2YAX.cjs');
@@ -416,7 +419,7 @@ var _chunkVJUVNERTcjs = require('../chunk-VJUVNERT.cjs');
416
419
 
417
420
 
418
421
 
419
- var _chunkLL3RAN55cjs = require('../chunk-LL3RAN55.cjs');
422
+ var _chunkDFFBJV3Ucjs = require('../chunk-DFFBJV3U.cjs');
420
423
 
421
424
 
422
425
 
@@ -846,7 +849,7 @@ function quickMaskPixels(mask, style = {}) {
846
849
 
847
850
  // src/image-editor/layers/render.ts
848
851
  function isQuarterTurn(rotate) {
849
- return _chunkGLOOH65Ycjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
852
+ return _chunk4PUPGALMcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
850
853
  }
851
854
  function isIntegerRect(r) {
852
855
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -854,7 +857,7 @@ function isIntegerRect(r) {
854
857
  function baseProjection(region, transform, baseW, baseH) {
855
858
  return {
856
859
  region,
857
- angle: _chunkGLOOH65Ycjs.normalizeAngle.call(void 0, transform.rotate),
860
+ angle: _chunk4PUPGALMcjs.normalizeAngle.call(void 0, transform.rotate),
858
861
  flipH: transform.flipH,
859
862
  flipV: transform.flipV,
860
863
  scale: 1,
@@ -863,14 +866,14 @@ function baseProjection(region, transform, baseW, baseH) {
863
866
  };
864
867
  }
865
868
  function projectQuarterTurn(src, srcRect, region, transform) {
866
- const rotated = _chunkGLOOH65Ycjs.getRotatedSize.call(void 0, region.width, region.height, transform);
869
+ const rotated = _chunk4PUPGALMcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
867
870
  const w = Math.max(1, Math.round(rotated.width));
868
871
  const h = Math.max(1, Math.round(rotated.height));
869
872
  const out = new Uint8ClampedArray(w * h * 4);
870
873
  const p = baseProjection(region, transform, w, h);
871
- const o = _chunkGLOOH65Ycjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
872
- const ox = _chunkGLOOH65Ycjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
873
- const oy = _chunkGLOOH65Ycjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
874
+ const o = _chunk4PUPGALMcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
875
+ const ox = _chunk4PUPGALMcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
876
+ const oy = _chunk4PUPGALMcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
874
877
  const ux = Math.round(ox.x - o.x);
875
878
  const vx = Math.round(ox.y - o.y);
876
879
  const uy = Math.round(oy.x - o.x);
@@ -899,23 +902,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
899
902
  const d = img.data;
900
903
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
901
904
  }
902
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunkGLOOH65Ycjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
905
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunk4PUPGALMcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
903
906
  }
904
907
  function needsLegacyBase(input) {
905
908
  const { stack, region, canvas, transform } = input;
906
- if (!_chunkGLOOH65Ycjs.isLegacyShape.call(void 0, stack)) return false;
909
+ if (!_chunk4PUPGALMcjs.isLegacyShape.call(void 0, stack)) return false;
907
910
  const bg = stack.layers[0];
908
911
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
909
912
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
910
913
  if (stack.outputOpacity < 1) return true;
911
- const blur = _chunkGLOOH65Ycjs.blurFilter.call(void 0, bg);
914
+ const blur = _chunk4PUPGALMcjs.blurFilter.call(void 0, bg);
912
915
  if (blur && blur.enabled && blur.radius > 0) {
913
916
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
914
- const angle = _chunkGLOOH65Ycjs.normalizeAngle.call(void 0, transform.rotate);
917
+ const angle = _chunk4PUPGALMcjs.normalizeAngle.call(void 0, transform.rotate);
915
918
  if (!full || angle === 90 || angle === 270) return true;
916
919
  }
917
920
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
918
- if (_chunkGLOOH65Ycjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
921
+ if (_chunk4PUPGALMcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
919
922
  return false;
920
923
  }
921
924
  var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : (l.type === "shape" || l.type === "type") && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
@@ -947,7 +950,7 @@ function coveringRect(region) {
947
950
  const y = Math.floor(region.y);
948
951
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
949
952
  }
950
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkGLOOH65Ycjs.LayerCompositor)()) {
953
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunk4PUPGALMcjs.LayerCompositor)()) {
951
954
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
952
955
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
953
956
  }
@@ -1081,8 +1084,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1081
1084
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1082
1085
  * trust dirty rectangles; exports use `exportCompositor`.
1083
1086
  */
1084
- __init8() {this.compositor = new (0, _chunkGLOOH65Ycjs.LayerCompositor)()}
1085
- __init9() {this.exportCompositor = new (0, _chunkGLOOH65Ycjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1087
+ __init8() {this.compositor = new (0, _chunk4PUPGALMcjs.LayerCompositor)()}
1088
+ __init9() {this.exportCompositor = new (0, _chunk4PUPGALMcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1086
1089
  /** How the host resolves layer pixels (set by the controller). */
1087
1090
 
1088
1091
  /**
@@ -1159,9 +1162,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1159
1162
  return;
1160
1163
  }
1161
1164
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1162
- const projection = _chunkGLOOH65Ycjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1165
+ const projection = _chunk4PUPGALMcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1163
1166
  const { region } = projection;
1164
- const rotated = _chunkGLOOH65Ycjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1167
+ const rotated = _chunk4PUPGALMcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1165
1168
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1166
1169
  let overlay = annotations;
1167
1170
  if (route === "legacy") {
@@ -1171,8 +1174,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1171
1174
  `${naturalWidth}x${naturalHeight}`,
1172
1175
  `${region.x},${region.y},${region.width},${region.height}`,
1173
1176
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1174
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkGLOOH65Ycjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1175
- _chunkGLOOH65Ycjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1177
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunk4PUPGALMcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1178
+ _chunk4PUPGALMcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1176
1179
  `${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _5 => _5.depthRange, 'optionalAccess', _6 => _6[0]])}-${_optionalChain([depthMask, 'access', _7 => _7.depthRange, 'optionalAccess', _8 => _8[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`,
1177
1180
  `d${this.displayKey}`
1178
1181
  ].join("|");
@@ -1206,7 +1209,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1206
1209
  }
1207
1210
  if (overlay.length > 0 || options.draftAnnotation) {
1208
1211
  ctx.save();
1209
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1212
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1210
1213
  ctx.beginPath();
1211
1214
  ctx.rect(region.x, region.y, region.width, region.height);
1212
1215
  ctx.clip();
@@ -1229,7 +1232,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1229
1232
  if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1230
1233
  ctx.save();
1231
1234
  try {
1232
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1235
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1233
1236
  ctx.beginPath();
1234
1237
  ctx.rect(region.x, region.y, region.width, region.height);
1235
1238
  ctx.clip();
@@ -1244,7 +1247,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1244
1247
  const b = options.brushCursor;
1245
1248
  ctx.save();
1246
1249
  try {
1247
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1250
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1248
1251
  const px2 = 1 / (projection.scale || 1);
1249
1252
  ctx.beginPath();
1250
1253
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1262,7 +1265,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1262
1265
  const t = options.textEdit;
1263
1266
  ctx.save();
1264
1267
  try {
1265
- const scr = (p) => _chunkGLOOH65Ycjs.projectImagePoint.call(void 0, p, projection);
1268
+ const scr = (p) => _chunk4PUPGALMcjs.projectImagePoint.call(void 0, p, projection);
1266
1269
  const poly = (pts) => {
1267
1270
  ctx.beginPath();
1268
1271
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1301,7 +1304,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1301
1304
  const t = options.freeTransform;
1302
1305
  ctx.save();
1303
1306
  try {
1304
- const scr = (p) => _chunkGLOOH65Ycjs.projectImagePoint.call(void 0, p, projection);
1307
+ const scr = (p) => _chunk4PUPGALMcjs.projectImagePoint.call(void 0, p, projection);
1305
1308
  ctx.beginPath();
1306
1309
  if (t.warp) {
1307
1310
  for (const c of t.warp.curves) {
@@ -1359,7 +1362,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1359
1362
  }
1360
1363
  if (isActivelyCropping) {
1361
1364
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1362
- this.drawCropOverlay(ctx, _chunkGLOOH65Ycjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1365
+ this.drawCropOverlay(ctx, _chunk4PUPGALMcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1363
1366
  }
1364
1367
  }
1365
1368
  /**
@@ -1368,7 +1371,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1368
1371
  */
1369
1372
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1370
1373
  const { adjustments, depthMask } = state;
1371
- const rotated = _chunkGLOOH65Ycjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1374
+ const rotated = _chunk4PUPGALMcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1372
1375
  const baseW = Math.max(1, Math.round(rotated.width));
1373
1376
  const baseH = Math.max(1, Math.round(rotated.height));
1374
1377
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1376,7 +1379,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1376
1379
  if (!baseCtx) return baseCanvas;
1377
1380
  const projection = getBaseProjection(region, transform, baseW, baseH);
1378
1381
  baseCtx.save();
1379
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1382
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1380
1383
  baseCtx.drawImage(
1381
1384
  img,
1382
1385
  region.x,
@@ -1391,8 +1394,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1391
1394
  baseCtx.restore();
1392
1395
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1393
1396
  if (imageData) {
1394
- const layerMasks = _chunkGLOOH65Ycjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1395
- _chunkGLOOH65Ycjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1397
+ const layerMasks = _chunk4PUPGALMcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1398
+ _chunk4PUPGALMcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1396
1399
  if (depthMask.enabled && depthMask.maskSource) {
1397
1400
  try {
1398
1401
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1403,7 +1406,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1403
1406
  const maskCtx = maskCanvas.getContext("2d");
1404
1407
  if (maskCtx) {
1405
1408
  maskCtx.save();
1406
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1409
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1407
1410
  maskCtx.drawImage(
1408
1411
  maskImg,
1409
1412
  region.x * sx,
@@ -1418,7 +1421,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1418
1421
  maskCtx.restore();
1419
1422
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1420
1423
  if (maskData) {
1421
- _chunkGLOOH65Ycjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1424
+ _chunk4PUPGALMcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1422
1425
  }
1423
1426
  }
1424
1427
  } catch (e7) {
@@ -1437,7 +1440,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1437
1440
  else if (this.baseRoute === "layers") route = "layers";
1438
1441
  else {
1439
1442
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1440
- const shaped = this.baseRoute === "legacy" && _chunkGLOOH65Ycjs.isLegacyShape.call(void 0, stack);
1443
+ const shaped = this.baseRoute === "legacy" && _chunk4PUPGALMcjs.isLegacyShape.call(void 0, stack);
1441
1444
  route = shaped || needsLegacyBase({
1442
1445
  stack,
1443
1446
  region,
@@ -1469,7 +1472,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1469
1472
  /** Loads what the compositor reads synchronously: depth maps (at canvas size) and annotation images. */
1470
1473
  /** Loads depth maps and annotation images the compositor reads synchronously. */
1471
1474
  async prepareLayerAssets(layers, width, height) {
1472
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers)) {
1475
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers)) {
1473
1476
  const source = _optionalChain([l, 'access', _40 => _40.mask, 'optionalAccess', _41 => _41.source]);
1474
1477
  if (_optionalChain([source, 'optionalAccess', _42 => _42.enabled]) && source.maskSource) {
1475
1478
  const key = `${source.maskSource}|${width}x${height}`;
@@ -1572,17 +1575,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1572
1575
  if (!comp) return null;
1573
1576
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1574
1577
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1575
- const rotated = _chunkGLOOH65Ycjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1578
+ const rotated = _chunk4PUPGALMcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1576
1579
  const baseW = Math.max(1, Math.round(rotated.width));
1577
1580
  const baseH = Math.max(1, Math.round(rotated.height));
1578
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkGLOOH65Ycjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1581
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunk4PUPGALMcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1579
1582
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1580
1583
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1581
1584
  const ctx = canvas.getContext("2d");
1582
1585
  if (!ctx) return null;
1583
1586
  ctx.clearRect(0, 0, baseW, baseH);
1584
1587
  ctx.save();
1585
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1588
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1586
1589
  ctx.beginPath();
1587
1590
  ctx.rect(region.x, region.y, region.width, region.height);
1588
1591
  ctx.clip();
@@ -1854,7 +1857,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1854
1857
  ctx.strokeStyle = "#3b82f6";
1855
1858
  ctx.lineWidth = 1.5;
1856
1859
  ctx.setLineDash([4, 4]);
1857
- const bounds = _chunkGLOOH65Ycjs.getAnnotationBounds.call(void 0, ann);
1860
+ const bounds = _chunk4PUPGALMcjs.getAnnotationBounds.call(void 0, ann);
1858
1861
  const pad = 4;
1859
1862
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1860
1863
  ctx.fillStyle = "#ffffff";
@@ -1875,7 +1878,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1875
1878
  }
1876
1879
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
1877
1880
  getAnnotationBounds(ann) {
1878
- return _chunkGLOOH65Ycjs.getAnnotationBounds.call(void 0, ann);
1881
+ return _chunk4PUPGALMcjs.getAnnotationBounds.call(void 0, ann);
1879
1882
  }
1880
1883
  /**
1881
1884
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -1957,8 +1960,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1957
1960
  }
1958
1961
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
1959
1962
  const { crop, transform, annotations } = state;
1960
- const region = crop ? _chunkGLOOH65Ycjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
1961
- const rotated = _chunkGLOOH65Ycjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1963
+ const region = crop ? _chunk4PUPGALMcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
1964
+ const rotated = _chunk4PUPGALMcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1962
1965
  const baseW = Math.max(1, Math.round(rotated.width));
1963
1966
  const baseH = Math.max(1, Math.round(rotated.height));
1964
1967
  const exportW = options.width || baseW;
@@ -1987,7 +1990,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1987
1990
  const bctx = baseCanvas.getContext("2d");
1988
1991
  if (bctx) {
1989
1992
  bctx.save();
1990
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
1993
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
1991
1994
  bctx.beginPath();
1992
1995
  bctx.rect(region.x, region.y, region.width, region.height);
1993
1996
  bctx.clip();
@@ -2000,7 +2003,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2000
2003
  if (options.includeAnnotations !== false && overlay.length > 0) {
2001
2004
  ctx.save();
2002
2005
  ctx.scale(exportW / baseW, exportH / baseH);
2003
- _chunkGLOOH65Ycjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2006
+ _chunk4PUPGALMcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2004
2007
  for (const ann of overlay) {
2005
2008
  await this.drawAnnotation(ctx, ann);
2006
2009
  }
@@ -2090,7 +2093,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2090
2093
  case "rect":
2091
2094
  case "image":
2092
2095
  case "text": {
2093
- const b = _chunkGLOOH65Ycjs.getAnnotationBounds.call(void 0, ann);
2096
+ const b = _chunk4PUPGALMcjs.getAnnotationBounds.call(void 0, ann);
2094
2097
  ctx.fillRect(b.x, b.y, b.width, b.height);
2095
2098
  break;
2096
2099
  }
@@ -2110,7 +2113,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2110
2113
  function getBaseProjection(region, transform, baseW, baseH) {
2111
2114
  return {
2112
2115
  region,
2113
- angle: _chunkGLOOH65Ycjs.normalizeAngle.call(void 0, transform.rotate),
2116
+ angle: _chunk4PUPGALMcjs.normalizeAngle.call(void 0, transform.rotate),
2114
2117
  flipH: transform.flipH,
2115
2118
  flipV: transform.flipV,
2116
2119
  scale: 1,
@@ -2214,8 +2217,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2214
2217
  }
2215
2218
  function toMask(width, height, coverage) {
2216
2219
  const out = new Uint8Array(coverage.length);
2217
- for (let i = 0; i < out.length; i++) out[i] = _chunkGLOOH65Ycjs.coverageToByte.call(void 0, coverage[i]);
2218
- return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, width, height, out);
2220
+ for (let i = 0; i < out.length; i++) out[i] = _chunk4PUPGALMcjs.coverageToByte.call(void 0, coverage[i]);
2221
+ return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, width, height, out);
2219
2222
  }
2220
2223
  function polygonSelection(width, height, points, options = {}) {
2221
2224
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2342,7 +2345,7 @@ function magicWand(pixels, seed, options = {}) {
2342
2345
  const { width: w, height: h } = pixels;
2343
2346
  const sx = Math.floor(seed.x);
2344
2347
  const sy = Math.floor(seed.y);
2345
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, w, h);
2348
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, w, h);
2346
2349
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2347
2350
  const marks = new Uint8Array(n);
2348
2351
  let bx0 = w;
@@ -2390,9 +2393,9 @@ function magicWand(pixels, seed, options = {}) {
2390
2393
  }
2391
2394
  }
2392
2395
  }
2393
- if (bx1 < 0) return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, w, h);
2394
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, w, h, marks);
2395
- return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0,
2396
+ if (bx1 < 0) return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, w, h);
2397
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, w, h, marks);
2398
+ return _chunk4PUPGALMcjs.createSelectionMask.call(void 0,
2396
2399
  w,
2397
2400
  h,
2398
2401
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -2414,7 +2417,7 @@ function colorRange(pixels, samples, options = {}) {
2414
2417
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
2415
2418
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
2416
2419
  const out = new Uint8Array(n);
2417
- if (!parsed.length) return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, w, h, out);
2420
+ if (!parsed.length) return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, w, h, out);
2418
2421
  for (let i = 0; i < n; i++) {
2419
2422
  const p = i * 4;
2420
2423
  if (data[p + 3] <= 0) continue;
@@ -2430,9 +2433,9 @@ function colorRange(pixels, samples, options = {}) {
2430
2433
  }
2431
2434
  if (k > best) best = k;
2432
2435
  }
2433
- out[i] = _chunkGLOOH65Ycjs.coverageToByte.call(void 0, best);
2436
+ out[i] = _chunk4PUPGALMcjs.coverageToByte.call(void 0, best);
2434
2437
  }
2435
- return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, w, h, out);
2438
+ return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, w, h, out);
2436
2439
  }
2437
2440
  var TONE_RANGE_PRESETS = {
2438
2441
  shadows: [0, 65],
@@ -2450,9 +2453,9 @@ function toneRange(pixels, range, falloff = 20) {
2450
2453
  if (d[p + 3] <= 0) continue;
2451
2454
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
2452
2455
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
2453
- out[i] = _chunkGLOOH65Ycjs.coverageToByte.call(void 0, 1 - outside / ramp);
2456
+ out[i] = _chunk4PUPGALMcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2454
2457
  }
2455
- return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2458
+ return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2456
2459
  }
2457
2460
  function hueRange(pixels, center) {
2458
2461
  const n = checkPixels(pixels);
@@ -2475,9 +2478,9 @@ function hueRange(pixels, center) {
2475
2478
  hue *= 60;
2476
2479
  let dh = ((hue - center) % 360 + 360) % 360;
2477
2480
  dh = Math.min(dh, 360 - dh);
2478
- out[i] = _chunkGLOOH65Ycjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2481
+ out[i] = _chunk4PUPGALMcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2479
2482
  }
2480
- return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2483
+ return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2481
2484
  }
2482
2485
 
2483
2486
  // src/image-editor/selection/refine.ts
@@ -2611,9 +2614,9 @@ function edgeWidth(guide, w, h, r) {
2611
2614
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
2612
2615
  }
2613
2616
  }
2614
- const gm = _chunkGLOOH65Ycjs.greyMorphology.call(void 0, g, w, h, r, true);
2615
- const hi = _chunkGLOOH65Ycjs.greyMorphology.call(void 0, y, w, h, r, true);
2616
- const lo = _chunkGLOOH65Ycjs.greyMorphology.call(void 0, y, w, h, r, false);
2617
+ const gm = _chunk4PUPGALMcjs.greyMorphology.call(void 0, g, w, h, r, true);
2618
+ const hi = _chunk4PUPGALMcjs.greyMorphology.call(void 0, y, w, h, r, true);
2619
+ const lo = _chunk4PUPGALMcjs.greyMorphology.call(void 0, y, w, h, r, false);
2617
2620
  const out = new Float32Array(n);
2618
2621
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
2619
2622
  return out;
@@ -2637,7 +2640,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2637
2640
  }
2638
2641
  }
2639
2642
  if (any) {
2640
- const dist = _chunkGLOOH65Ycjs.distanceTransform.call(void 0, boundary, w, h);
2643
+ const dist = _chunk4PUPGALMcjs.distanceTransform.call(void 0, boundary, w, h);
2641
2644
  const r = gfRadius(p);
2642
2645
  const q = guidedFilterColor(guide, m, w, h, r);
2643
2646
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -2653,17 +2656,17 @@ function refineCoverage(guide, m, w, h, params = {}) {
2653
2656
  }
2654
2657
  const ss = smoothSigma(p);
2655
2658
  if (ss >= 0.3) {
2656
- a = _chunkLL3RAN55cjs.gaussianBlur.call(void 0, a, w, h, ss, "clamp");
2659
+ a = _chunkDFFBJV3Ucjs.gaussianBlur.call(void 0, a, w, h, ss, "clamp");
2657
2660
  const gain = 1 + ss;
2658
2661
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2659
2662
  }
2660
- a = _chunkLL3RAN55cjs.gaussianBlur.call(void 0, a, w, h, featherSigma(p), "clamp");
2663
+ a = _chunkDFFBJV3Ucjs.gaussianBlur.call(void 0, a, w, h, featherSigma(p), "clamp");
2661
2664
  if (p.contrast > 0) {
2662
2665
  const gain = 1 / (1 - 0.99 * p.contrast / 100);
2663
2666
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2664
2667
  }
2665
2668
  const amount = shiftAmount(p);
2666
- if (Math.abs(amount) >= 1e-4) a = _chunkGLOOH65Ycjs.shiftCoverage.call(void 0, a, w, h, amount);
2669
+ if (Math.abs(amount) >= 1e-4) a = _chunk4PUPGALMcjs.shiftCoverage.call(void 0, a, w, h, amount);
2667
2670
  return a;
2668
2671
  }
2669
2672
  function guidePlanes(pixels, win) {
@@ -2707,15 +2710,15 @@ function refineSelection(pixels, mask, params = {}) {
2707
2710
  const out = new Uint8Array(mask.width * mask.height);
2708
2711
  for (let y = 0; y < wh; y++) {
2709
2712
  const dst = (y0 + y) * mask.width + x0;
2710
- for (let x = 0; x < ww; x++) out[dst + x] = _chunkGLOOH65Ycjs.coverageToByte.call(void 0, refined[y * ww + x]);
2713
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunk4PUPGALMcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2711
2714
  }
2712
- return _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2715
+ return _chunk4PUPGALMcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2713
2716
  }
2714
2717
 
2715
2718
  // src/image-editor/free-transform.ts
2716
2719
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
2717
2720
  var fail = (message) => {
2718
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(message);
2721
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(message);
2719
2722
  };
2720
2723
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
2721
2724
  function previewStep(scale) {
@@ -2795,7 +2798,7 @@ function liftMask(mask, sel, o) {
2795
2798
  var FreeTransformSession = (_class4 = class {
2796
2799
  constructor(host, init = {}) {;_class4.prototype.__init26.call(this);_class4.prototype.__init27.call(this);_class4.prototype.__init28.call(this);_class4.prototype.__init29.call(this);_class4.prototype.__init30.call(this);_class4.prototype.__init31.call(this);_class4.prototype.__init32.call(this);_class4.prototype.__init33.call(this);_class4.prototype.__init34.call(this);_class4.prototype.__init35.call(this);_class4.prototype.__init36.call(this);
2797
2800
  this.host = host;
2798
- if (init.interpolation !== void 0 && !_chunkLL3RAN55cjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
2801
+ if (init.interpolation !== void 0 && !_chunkDFFBJV3Ucjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
2799
2802
  this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
2800
2803
  const sel = host.selection();
2801
2804
  const selected = Boolean(_optionalChain([sel, 'optionalAccess', _58 => _58.bounds]));
@@ -2804,7 +2807,7 @@ var FreeTransformSession = (_class4 = class {
2804
2807
  fail(`Unknown content "${String(content)}"; use auto, layer, selection, selection-copy or selection-outline.`);
2805
2808
  }
2806
2809
  const targetId = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
2807
- const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkLL3RAN55cjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _59 => _59.layer]) : void 0;
2810
+ const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkDFFBJV3Ucjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _59 => _59.layer]) : void 0;
2808
2811
  const smartTarget = (_optionalChain([target, 'optionalAccess', _60 => _60.type]) === "smart" || _optionalChain([target, 'optionalAccess', _61 => _61.type]) === "shape" || _optionalChain([target, 'optionalAccess', _62 => _62.type]) === "type") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
2809
2812
  if (content === "auto") content = selected && !smartTarget ? "selection" : "layer";
2810
2813
  this.content = content;
@@ -2824,7 +2827,7 @@ var FreeTransformSession = (_class4 = class {
2824
2827
  } else {
2825
2828
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
2826
2829
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
2827
- const layer = _chunkGLOOH65Ycjs.requireLayer.call(void 0, layers, id).layer;
2830
+ const layer = _chunk4PUPGALMcjs.requireLayer.call(void 0, layers, id).layer;
2828
2831
  this.layerId = layer.id;
2829
2832
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
2830
2833
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -2835,20 +2838,20 @@ var FreeTransformSession = (_class4 = class {
2835
2838
  if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape" && layer.type !== "type") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape, type and smart object layers, layer masks (channel mask) and selections.`);
2836
2839
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
2837
2840
  if (content !== "selection-copy") {
2838
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "position", "transform it");
2839
- if (!maskAlone) _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
2841
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
2842
+ if (!maskAlone) _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
2840
2843
  }
2841
2844
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
2842
2845
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
2843
2846
  if (layer.type === "smart" && !maskAlone) {
2844
2847
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a smart object, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
2845
- if (!_chunkGLOOH65Ycjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
2848
+ if (!_chunk4PUPGALMcjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
2846
2849
  this.smart = layer;
2847
2850
  this.smartObject = true;
2848
- this.startGeometry = _chunkGLOOH65Ycjs.placementGeometry.call(void 0, layer);
2851
+ this.startGeometry = _chunk4PUPGALMcjs.placementGeometry.call(void 0, layer);
2849
2852
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
2850
2853
  this.startInterp = this.interp;
2851
- this.box = _chunkGLOOH65Ycjs.contentsBox.call(void 0, layer.contents);
2854
+ this.box = _chunk4PUPGALMcjs.contentsBox.call(void 0, layer.contents);
2852
2855
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
2853
2856
  this.geometryValue = this.startGeometry;
2854
2857
  this.shown = this.startLayers;
@@ -2856,8 +2859,8 @@ var FreeTransformSession = (_class4 = class {
2856
2859
  }
2857
2860
  if (layer.type === "type" && !maskAlone) {
2858
2861
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a type layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
2859
- const frame = _chunkGLOOH65Ycjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
2860
- const m = _chunkGLOOH65Ycjs.textMatrix.call(void 0, layer);
2862
+ const frame = _chunk4PUPGALMcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
2863
+ const m = _chunk4PUPGALMcjs.textMatrix.call(void 0, layer);
2861
2864
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
2862
2865
  this.typeTarget = layer;
2863
2866
  this.typeLayer = true;
@@ -2876,7 +2879,7 @@ var FreeTransformSession = (_class4 = class {
2876
2879
  }
2877
2880
  if (layer.type === "shape" && !maskAlone) {
2878
2881
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a shape layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
2879
- const g = _chunkGLOOH65Ycjs.shapeGeometryBounds.call(void 0, layer);
2882
+ const g = _chunk4PUPGALMcjs.shapeGeometryBounds.call(void 0, layer);
2880
2883
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
2881
2884
  const w = Math.max(g.width, 1);
2882
2885
  const h = Math.max(g.height, 1);
@@ -2924,7 +2927,7 @@ var FreeTransformSession = (_class4 = class {
2924
2927
  if (box) {
2925
2928
  const copy = {
2926
2929
  type: "pixel",
2927
- id: _chunkGLOOH65Ycjs.newLayerId.call(void 0, ),
2930
+ id: _chunk4PUPGALMcjs.newLayerId.call(void 0, ),
2928
2931
  name: `${layer.name || "Layer"} copy`,
2929
2932
  visible: true,
2930
2933
  opacity: 1,
@@ -2933,8 +2936,8 @@ var FreeTransformSession = (_class4 = class {
2933
2936
  offset: { ...o }
2934
2937
  };
2935
2938
  this.copyId = copy.id;
2936
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, layers, layer.id);
2937
- this.startLayers = _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _66 => _66.parent, 'optionalAccess', _67 => _67.id]), () => ( null)), loc.index + 1);
2939
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, layers, layer.id);
2940
+ this.startLayers = _chunkDFFBJV3Ucjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _66 => _66.parent, 'optionalAccess', _67 => _67.id]), () => ( null)), loc.index + 1);
2938
2941
  this.parts.push({ what: "pixels", offset: o, moving: lifted, base: null, reduced: /* @__PURE__ */ new Map() });
2939
2942
  moves.push("pixels");
2940
2943
  }
@@ -2948,7 +2951,7 @@ var FreeTransformSession = (_class4 = class {
2948
2951
  if (!box) fail(content === "layer" ? "The layer has no pixels to transform." : "The selection holds no pixels of this layer; select some, or transform the outline (content selection-outline).");
2949
2952
  this.box = box;
2950
2953
  this.moves = moves;
2951
- this.startGeometry = _chunkGLOOH65Ycjs.identityTransform.call(void 0, box);
2954
+ this.startGeometry = _chunk4PUPGALMcjs.identityTransform.call(void 0, box);
2952
2955
  this.startInterp = this.interp;
2953
2956
  this.geometryValue = this.startGeometry;
2954
2957
  this.shown = this.startLayers;
@@ -3017,7 +3020,7 @@ var FreeTransformSession = (_class4 = class {
3017
3020
  update(changes, preview = {}) {
3018
3021
  this.check();
3019
3022
  if (changes.interpolation !== void 0) {
3020
- if (!_chunkLL3RAN55cjs.isInterpolation.call(void 0, changes.interpolation)) fail(`Unknown interpolation "${String(changes.interpolation)}"; use nearest, bilinear or bicubic.`);
3023
+ if (!_chunkDFFBJV3Ucjs.isInterpolation.call(void 0, changes.interpolation)) fail(`Unknown interpolation "${String(changes.interpolation)}"; use nearest, bilinear or bicubic.`);
3021
3024
  this.interp = changes.interpolation;
3022
3025
  }
3023
3026
  const next = {
@@ -3026,8 +3029,8 @@ var FreeTransformSession = (_class4 = class {
3026
3029
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
3027
3030
  };
3028
3031
  if (next.corners.length !== 4 || !next.corners.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) fail("corners must be four finite points: top-left, top-right, bottom-right, bottom-left.");
3029
- if (!_chunkGLOOH65Ycjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3030
- if (this.typeTarget && (_chunkGLOOH65Ycjs.hasWarp.call(void 0, next) || !_chunkGLOOH65Ycjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3032
+ if (!_chunk4PUPGALMcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3033
+ if (this.typeTarget && (_chunk4PUPGALMcjs.hasWarp.call(void 0, next) || !_chunk4PUPGALMcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3031
3034
  fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram, no warp); rasterize the layer (rasterize_layer) for distort, perspective or warp.");
3032
3035
  }
3033
3036
  this.geometryValue = next;
@@ -3039,10 +3042,10 @@ var FreeTransformSession = (_class4 = class {
3039
3042
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
3040
3043
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
3041
3044
  const g = this.geometryValue;
3042
- const identity = _chunkGLOOH65Ycjs.isIdentityTransform.call(void 0, g);
3043
- const warp = _chunkGLOOH65Ycjs.hasWarp.call(void 0, g);
3044
- const h = warp ? null : _chunkGLOOH65Ycjs.geometryHomography.call(void 0, g);
3045
- const f = warp ? _chunkGLOOH65Ycjs.transformMap.call(void 0, g) : null;
3045
+ const identity = _chunk4PUPGALMcjs.isIdentityTransform.call(void 0, g);
3046
+ const warp = _chunk4PUPGALMcjs.hasWarp.call(void 0, g);
3047
+ const h = warp ? null : _chunk4PUPGALMcjs.geometryHomography.call(void 0, g);
3048
+ const f = warp ? _chunk4PUPGALMcjs.transformMap.call(void 0, g) : null;
3046
3049
  const step = final ? 1 : previewStep(preview.scale);
3047
3050
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
3048
3051
  let layers = this.startLayers;
@@ -3060,7 +3063,7 @@ var FreeTransformSession = (_class4 = class {
3060
3063
  k = step;
3061
3064
  let r = part.reduced.get(k);
3062
3065
  if (!r) {
3063
- r = _chunkLL3RAN55cjs.reduceSurface.call(void 0, part.moving, k);
3066
+ r = _chunkDFFBJV3Ucjs.reduceSurface.call(void 0, part.moving, k);
3064
3067
  part.reduced.set(k, r);
3065
3068
  }
3066
3069
  src = r;
@@ -3069,33 +3072,33 @@ var FreeTransformSession = (_class4 = class {
3069
3072
  if (preview.clip && !final) opts.clip = { x: Math.floor(preview.clip.x - o.x), y: Math.floor(preview.clip.y - o.y), width: Math.ceil(preview.clip.width) + 1, height: Math.ceil(preview.clip.height) + 1 };
3070
3073
  try {
3071
3074
  if (f) {
3072
- moved = _chunkLL3RAN55cjs.warpSurface.call(void 0, src, (p) => {
3075
+ moved = _chunkDFFBJV3Ucjs.warpSurface.call(void 0, src, (p) => {
3073
3076
  const q = f({ x: p.x * k + o.x, y: p.y * k + o.y });
3074
3077
  return q && { x: q.x - o.x, y: q.y - o.y };
3075
3078
  }, opts);
3076
3079
  } else {
3077
3080
  const hl = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, [k, 0, 0, 0, k, 0, 0, 0, 1], T(o.x, o.y)), h), T(-o.x, -o.y));
3078
- moved = _chunkLL3RAN55cjs.transformSurface.call(void 0, src, hl, opts);
3081
+ moved = _chunkDFFBJV3Ucjs.transformSurface.call(void 0, src, hl, opts);
3079
3082
  }
3080
3083
  } catch (e) {
3081
- if (e instanceof _chunkLL3RAN55cjs.TransformTooLargeError) fail(e.message);
3084
+ if (e instanceof _chunkDFFBJV3Ucjs.TransformTooLargeError) fail(e.message);
3082
3085
  throw e;
3083
3086
  }
3084
3087
  }
3085
- const result = part.base ? _chunkLL3RAN55cjs.compositeSurfaceOver.call(void 0, part.base, moved) : moved;
3088
+ const result = part.base ? _chunkDFFBJV3Ucjs.compositeSurfaceOver.call(void 0, part.base, moved) : moved;
3086
3089
  if (part.what === "selection") {
3087
3090
  const { width, height } = this.host.canvas();
3088
3091
  const data = new Uint8Array(_chunk7ISPWEJAcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
3089
- const next = _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, width, height, data);
3092
+ const next = _chunk4PUPGALMcjs.createSelectionMask.call(void 0, width, height, data);
3090
3093
  selection = next.bounds ? next : null;
3091
3094
  } else if (part.what === "pixels") {
3092
- layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, targetId, (l) => {
3095
+ layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, targetId, (l) => {
3093
3096
  const next = { ...l, surface: result };
3094
3097
  delete next.source;
3095
3098
  return next;
3096
3099
  });
3097
3100
  } else {
3098
- layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, targetId, (l) => ({ ...l, mask: { ...l.mask, surface: result } }));
3101
+ layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, targetId, (l) => ({ ...l, mask: { ...l.mask, surface: result } }));
3099
3102
  }
3100
3103
  }
3101
3104
  return { layers, selection };
@@ -3108,15 +3111,15 @@ var FreeTransformSession = (_class4 = class {
3108
3111
  resampleShape(final, preview, warpMap, h) {
3109
3112
  const layer = this.shape;
3110
3113
  let components = layer.components;
3111
- if (!_chunkGLOOH65Ycjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3114
+ if (!_chunk4PUPGALMcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3112
3115
  const affine = !warpMap && h && Math.abs(h[6]) < 1e-12 && Math.abs(h[7]) < 1e-12 && Math.abs(h[8] - 1) < 1e-12 ? [h[0], h[3], h[1], h[4], h[2], h[5]] : void 0;
3113
3116
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
3114
- components = _chunkGLOOH65Ycjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3117
+ components = _chunk4PUPGALMcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3115
3118
  }
3116
3119
  const moved = { ...layer, components };
3117
3120
  delete moved.annotation;
3118
- const surface = _chunkGLOOH65Ycjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3119
- return _chunkLL3RAN55cjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3121
+ const surface = _chunk4PUPGALMcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3122
+ return _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3120
3123
  }
3121
3124
  /**
3122
3125
  * A type layer with its text matrix set from the corners (affine only: scale, rotate, skew and
@@ -3125,17 +3128,17 @@ var FreeTransformSession = (_class4 = class {
3125
3128
  resampleType() {
3126
3129
  const layer = this.typeTarget;
3127
3130
  const g = this.geometryValue;
3128
- if (_chunkGLOOH65Ycjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3129
- const m = _chunkGLOOH65Ycjs.matrixFromCorners.call(void 0, g.box, g.corners);
3131
+ if (_chunk4PUPGALMcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3132
+ const m = _chunk4PUPGALMcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3130
3133
  if (!m) fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram); rasterize the layer for distort or perspective.");
3131
3134
  const next = { ...layer, transform: m };
3132
3135
  delete next.annotation;
3133
- let layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkGLOOH65Ycjs.rerenderText.call(void 0, next, this.host.textEnv()));
3134
- const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkVYW7JBTMcjs.invertMatrix.call(void 0, _chunkGLOOH65Ycjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3136
+ let layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunk4PUPGALMcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3137
+ const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkVYW7JBTMcjs.invertMatrix.call(void 0, _chunk4PUPGALMcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3135
3138
  for (const part of this.parts) {
3136
3139
  if (part.what !== "mask") continue;
3137
- const surface = _chunkLL3RAN55cjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
3138
- layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, layer.id, (l) => ({ ...l, mask: { ...l.mask, surface } }));
3140
+ const surface = _chunkDFFBJV3Ucjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
3141
+ layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, layer.id, (l) => ({ ...l, mask: { ...l.mask, surface } }));
3139
3142
  }
3140
3143
  return layers;
3141
3144
  }
@@ -3147,25 +3150,25 @@ var FreeTransformSession = (_class4 = class {
3147
3150
  const canvas = this.host.canvas();
3148
3151
  try {
3149
3152
  if (final) {
3150
- const res = _chunkGLOOH65Ycjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3153
+ const res = _chunk4PUPGALMcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3151
3154
  this.smartMasksMoved = res.masksMoved;
3152
3155
  return res.layers;
3153
3156
  }
3154
3157
  const step = previewStep(preview.scale);
3155
- const surface = _chunkGLOOH65Ycjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3156
- return _chunkLL3RAN55cjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3158
+ const surface = _chunk4PUPGALMcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3159
+ return _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3157
3160
  } catch (e) {
3158
- if (e instanceof _chunkLL3RAN55cjs.TransformTooLargeError) fail(e.message);
3161
+ if (e instanceof _chunkDFFBJV3Ucjs.TransformTooLargeError) fail(e.message);
3159
3162
  throw e;
3160
3163
  }
3161
3164
  }
3162
3165
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
3163
3166
  isChanged() {
3164
3167
  const g = this.geometryValue;
3165
- if (!this.smart && !this.typeTarget) return !_chunkGLOOH65Ycjs.isIdentityTransform.call(void 0, g);
3168
+ if (!this.smart && !this.typeTarget) return !_chunk4PUPGALMcjs.isIdentityTransform.call(void 0, g);
3166
3169
  const a = this.startGeometry;
3167
3170
  const same = g.corners.every((c, i) => Math.abs(c.x - a.corners[i].x) < 1e-9 && Math.abs(c.y - a.corners[i].y) < 1e-9);
3168
- const warp = (w, box) => w && _chunkGLOOH65Ycjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3171
+ const warp = (w, box) => w && _chunk4PUPGALMcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3169
3172
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
3170
3173
  }
3171
3174
  render(preview) {
@@ -3197,7 +3200,7 @@ var FreeTransformSession = (_class4 = class {
3197
3200
  result(changed, layers, selection) {
3198
3201
  let bounds = null;
3199
3202
  const id = _nullishCoalesce(this.copyId, () => ( this.layerId));
3200
- const layer = id ? _optionalChain([_chunkLL3RAN55cjs.findLayer.call(void 0, layers, id), 'optionalAccess', _68 => _68.layer]) : void 0;
3203
+ const layer = id ? _optionalChain([_chunkDFFBJV3Ucjs.findLayer.call(void 0, layers, id), 'optionalAccess', _68 => _68.layer]) : void 0;
3201
3204
  if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _69 => _69.type]) === "pixel") bounds = toDoc(_chunk7ISPWEJAcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
3202
3205
  else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _70 => _70.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _71 => _71.type]) === "shape" || _optionalChain([layer, 'optionalAccess', _72 => _72.type]) === "type")) bounds = _chunk7ISPWEJAcjs.contentBounds.call(void 0, layer.surface);
3203
3206
  else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _73 => _73.mask])) bounds = toDoc(_chunk7ISPWEJAcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
@@ -3388,7 +3391,7 @@ function convertSurfaceColors(surface, t) {
3388
3391
  }
3389
3392
 
3390
3393
  // src/image-editor/controller.ts
3391
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunkGLOOH65Ycjs.LAYERED_SCHEMA_VERSION;
3394
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunk4PUPGALMcjs.LAYERED_SCHEMA_VERSION;
3392
3395
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge"];
3393
3396
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
3394
3397
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -3582,7 +3585,7 @@ var PaintStrokeSession = (_class5 = class {
3582
3585
  for (const t of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
3583
3586
  const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, t.tx, t.ty);
3584
3587
  const cur = regions.get(key);
3585
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkGLOOH65Ycjs.unionRect.call(void 0, cur.r, r) : r });
3588
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunk4PUPGALMcjs.unionRect.call(void 0, cur.r, r) : r });
3586
3589
  }
3587
3590
  }
3588
3591
  for (const [key, { tx, ty, r }] of regions) {
@@ -3614,7 +3617,7 @@ var PaintStrokeSession = (_class5 = class {
3614
3617
  }
3615
3618
  /** Finishes the stroke (one undo step) and returns what changed. */
3616
3619
  end() {
3617
- if (this.closed) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("This stroke has already ended.");
3620
+ if (this.closed) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("This stroke has already ended.");
3618
3621
  const last = _nullishCoalesce(this.last, () => ( void 0));
3619
3622
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
3620
3623
  _optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
@@ -3706,9 +3709,9 @@ function deepOfWorkTile(w, depth, read, base) {
3706
3709
  }
3707
3710
  function keepDeepLayers(prev, next) {
3708
3711
  const before = /* @__PURE__ */ new Map();
3709
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, prev)) before.set(l.id, l);
3712
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, prev)) before.set(l.id, l);
3710
3713
  let out = next;
3711
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, next)) {
3714
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, next)) {
3712
3715
  const p = before.get(l.id);
3713
3716
  if (!p || p === l) continue;
3714
3717
  let layer = l;
@@ -3722,7 +3725,7 @@ function keepDeepLayers(prev, next) {
3722
3725
  const surface = _chunk7ISPWEJAcjs.keepDeepSamples.call(void 0, pm.surface, m.surface);
3723
3726
  if (surface !== m.surface) layer = { ...layer, mask: { ...m, surface } };
3724
3727
  }
3725
- if (layer !== l) out = _chunkLL3RAN55cjs.mapLayer.call(void 0, out, l.id, () => layer);
3728
+ if (layer !== l) out = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, out, l.id, () => layer);
3726
3729
  }
3727
3730
  return out;
3728
3731
  }
@@ -3738,20 +3741,20 @@ function sameTile(a, b) {
3738
3741
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
3739
3742
  return true;
3740
3743
  }
3741
- var DEFAULT_ADJUSTMENTS = _chunkGLOOH65Ycjs.DEFAULT_ADJUSTMENTS_VALUES;
3744
+ var DEFAULT_ADJUSTMENTS = _chunk4PUPGALMcjs.DEFAULT_ADJUSTMENTS_VALUES;
3742
3745
  function normalizeStoredAdjustments(stored) {
3743
3746
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
3744
3747
  const out = {
3745
3748
  ...DEFAULT_ADJUSTMENTS,
3746
3749
  ...stored,
3747
- process: _chunkGLOOH65Ycjs.normalizeProcessVersion.call(void 0, stored.process)
3750
+ process: _chunk4PUPGALMcjs.normalizeProcessVersion.call(void 0, stored.process)
3748
3751
  };
3749
- const layers = _chunkGLOOH65Ycjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
3752
+ const layers = _chunk4PUPGALMcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
3750
3753
  if (layers.length) out.layers = layers;
3751
3754
  else delete out.layers;
3752
3755
  return out;
3753
3756
  }
3754
- var isLayered = (data) => Boolean(data && data.version === _chunkGLOOH65Ycjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
3757
+ var isLayered = (data) => Boolean(data && data.version === _chunk4PUPGALMcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
3755
3758
  function migrateSerializedImageEditorState(data) {
3756
3759
  if (isLayered(data)) {
3757
3760
  const out = {
@@ -3783,10 +3786,10 @@ function migrateSerializedImageEditorState(data) {
3783
3786
  function migrateToLayeredState(data, size) {
3784
3787
  const clean = migrateSerializedImageEditorState(data);
3785
3788
  if (isLayered(clean)) return clean;
3786
- const stack = _chunkGLOOH65Ycjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
3787
- const { layers, assets } = _chunkGLOOH65Ycjs.serializeLayers.call(void 0, stack.layers);
3789
+ const stack = _chunk4PUPGALMcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
3790
+ const { layers, assets } = _chunk4PUPGALMcjs.serializeLayers.call(void 0, stack.layers);
3788
3791
  const out = {
3789
- version: _chunkGLOOH65Ycjs.LAYERED_SCHEMA_VERSION,
3792
+ version: _chunk4PUPGALMcjs.LAYERED_SCHEMA_VERSION,
3790
3793
  width: Math.round(size.width),
3791
3794
  height: Math.round(size.height),
3792
3795
  layers,
@@ -3800,8 +3803,8 @@ function migrateToLayeredState(data, size) {
3800
3803
  if (clean.selection) out.selection = clean.selection;
3801
3804
  return out;
3802
3805
  }
3803
- var DEFAULT_TRANSFORM = _chunkGLOOH65Ycjs.DEFAULT_TRANSFORM_VALUES;
3804
- var DEFAULT_DEPTH_MASK = _chunkGLOOH65Ycjs.DEFAULT_DEPTH_MASK_VALUES;
3806
+ var DEFAULT_TRANSFORM = _chunk4PUPGALMcjs.DEFAULT_TRANSFORM_VALUES;
3807
+ var DEFAULT_DEPTH_MASK = _chunk4PUPGALMcjs.DEFAULT_DEPTH_MASK_VALUES;
3805
3808
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
3806
3809
  var ImageEditorController = (_class6 = class {
3807
3810
 
@@ -3824,7 +3827,7 @@ var ImageEditorController = (_class6 = class {
3824
3827
  __init56() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
3825
3828
  __init57() {this.viewKey = []}
3826
3829
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
3827
- __init58() {this.compositor = new (0, _chunkGLOOH65Ycjs.LayerCompositor)()}
3830
+ __init58() {this.compositor = new (0, _chunk4PUPGALMcjs.LayerCompositor)()}
3828
3831
  constructor(options = {}) {;_class6.prototype.__init48.call(this);_class6.prototype.__init49.call(this);_class6.prototype.__init50.call(this);_class6.prototype.__init51.call(this);_class6.prototype.__init52.call(this);_class6.prototype.__init53.call(this);_class6.prototype.__init54.call(this);_class6.prototype.__init55.call(this);_class6.prototype.__init56.call(this);_class6.prototype.__init57.call(this);_class6.prototype.__init58.call(this);_class6.prototype.__init59.call(this);_class6.prototype.__init60.call(this);_class6.prototype.__init61.call(this);_class6.prototype.__init62.call(this);_class6.prototype.__init63.call(this);_class6.prototype.__init64.call(this);_class6.prototype.__init65.call(this);_class6.prototype.__init66.call(this);_class6.prototype.__init67.call(this);_class6.prototype.__init68.call(this);_class6.prototype.__init69.call(this);_class6.prototype.__init70.call(this);
3829
3832
  this.maxHistoryDepth = _nullishCoalesce(options.maxHistoryDepth, () => ( 50));
3830
3833
  if (options.textShaper !== void 0) this.textShaperValue = options.textShaper;
@@ -3874,7 +3877,7 @@ var ImageEditorController = (_class6 = class {
3874
3877
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
3875
3878
  if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
3876
3879
  try {
3877
- this.state.selection = normalizeSelection(_chunkGLOOH65Ycjs.deserializeSelection.call(void 0, options.initialState.selection));
3880
+ this.state.selection = normalizeSelection(_chunk4PUPGALMcjs.deserializeSelection.call(void 0, options.initialState.selection));
3878
3881
  } catch (e14) {
3879
3882
  }
3880
3883
  }
@@ -3980,7 +3983,7 @@ var ImageEditorController = (_class6 = class {
3980
3983
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
3981
3984
  this.viewKey = key;
3982
3985
  const { width, height } = this.naturalSize;
3983
- const view = _chunkGLOOH65Ycjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
3986
+ const view = _chunk4PUPGALMcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
3984
3987
  s.adjustments = view.adjustments;
3985
3988
  s.depthMask = view.depthMask;
3986
3989
  s.annotations = view.annotations;
@@ -4134,7 +4137,7 @@ var ImageEditorController = (_class6 = class {
4134
4137
  applyCropPreset(ratio) {
4135
4138
  this.recordHistory();
4136
4139
  const { width, height } = this.state.imageDimensions;
4137
- if (ratio && _chunkGLOOH65Ycjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4140
+ if (ratio && _chunk4PUPGALMcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4138
4141
  ratio = 1 / ratio;
4139
4142
  }
4140
4143
  if (!ratio) {
@@ -4190,7 +4193,7 @@ var ImageEditorController = (_class6 = class {
4190
4193
  return this.state.layers;
4191
4194
  }
4192
4195
  getLayer(id) {
4193
- return _optionalChain([_chunkLL3RAN55cjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _130 => _130.layer]);
4196
+ return _optionalChain([_chunkDFFBJV3Ucjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _130 => _130.layer]);
4194
4197
  }
4195
4198
  /** The active layer, or `undefined`. */
4196
4199
  getActiveLayer() {
@@ -4216,7 +4219,7 @@ var ImageEditorController = (_class6 = class {
4216
4219
  */
4217
4220
  getLayerPixels(id) {
4218
4221
  const layer = this.getLayer(id);
4219
- if (!layer || !_chunkGLOOH65Ycjs.hasSurface.call(void 0, layer)) return null;
4222
+ if (!layer || !_chunk4PUPGALMcjs.hasSurface.call(void 0, layer)) return null;
4220
4223
  const surface = this.surfaceOf(layer);
4221
4224
  const b = _chunk7ISPWEJAcjs.contentBounds.call(void 0, surface);
4222
4225
  if (!b) return null;
@@ -4229,7 +4232,7 @@ var ImageEditorController = (_class6 = class {
4229
4232
  */
4230
4233
  getLayerBounds(id) {
4231
4234
  const layer = this.getLayer(id);
4232
- if (!layer || !_chunkGLOOH65Ycjs.hasSurface.call(void 0, layer)) return null;
4235
+ if (!layer || !_chunk4PUPGALMcjs.hasSurface.call(void 0, layer)) return null;
4233
4236
  const surface = this.surfaceOf(layer);
4234
4237
  let b = this.boundsCache.get(surface);
4235
4238
  if (b === void 0) {
@@ -4244,9 +4247,9 @@ var ImageEditorController = (_class6 = class {
4244
4247
  */
4245
4248
  getLayerDataURL(id) {
4246
4249
  const layer = this.getLayer(id);
4247
- if (!layer || !_chunkGLOOH65Ycjs.hasSurface.call(void 0, layer)) return null;
4250
+ if (!layer || !_chunk4PUPGALMcjs.hasSurface.call(void 0, layer)) return null;
4248
4251
  const surface = this.surfaceOf(layer);
4249
- const enc = _chunkGLOOH65Ycjs.encodeSurface.call(void 0, surface);
4252
+ const enc = _chunk4PUPGALMcjs.encodeSurface.call(void 0, surface);
4250
4253
  return enc ? enc.url : null;
4251
4254
  }
4252
4255
  /**
@@ -4260,7 +4263,7 @@ var ImageEditorController = (_class6 = class {
4260
4263
  let layers = this.state.layers;
4261
4264
  if (options.layerIds) {
4262
4265
  const keep = new Set(options.layerIds);
4263
- layers = _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).filter((l) => keep.has(l.id) && l.type !== "group");
4266
+ layers = _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers).filter((l) => keep.has(l.id) && l.type !== "group");
4264
4267
  }
4265
4268
  const data = this.compositor.composite(layers, r, this.compositorSources());
4266
4269
  return { width: r.width, height: r.height, data };
@@ -4365,7 +4368,7 @@ var ImageEditorController = (_class6 = class {
4365
4368
  this.state.layers = next;
4366
4369
  _optionalChain([extra, 'optionalCall', _140 => _140()]);
4367
4370
  if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
4368
- if (this.state.activeLayerId && !_chunkLL3RAN55cjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
4371
+ if (this.state.activeLayerId && !_chunkDFFBJV3Ucjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
4369
4372
  this.state.activeLayerId = null;
4370
4373
  this.state.activeTarget = "pixels";
4371
4374
  }
@@ -4374,7 +4377,7 @@ var ImageEditorController = (_class6 = class {
4374
4377
  /** The default position of a new layer: above the active layer, else the top of the stack. */
4375
4378
  newLayerPlacement(placement) {
4376
4379
  if (placement.aboveId || placement.belowId || placement.parentId || placement.index !== void 0) return placement;
4377
- const active = this.state.activeLayerId ? _chunkLL3RAN55cjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId) : null;
4380
+ const active = this.state.activeLayerId ? _chunkDFFBJV3Ucjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId) : null;
4378
4381
  return active ? { aboveId: active.layer.id } : {};
4379
4382
  }
4380
4383
  /**
@@ -4388,19 +4391,19 @@ var ImageEditorController = (_class6 = class {
4388
4391
  if (init.pixels) {
4389
4392
  const px2 = init.pixels;
4390
4393
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
4391
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4394
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4392
4395
  }
4393
4396
  surface = _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, px2, 4);
4394
4397
  } else if (init.color !== void 0) {
4395
4398
  const c = parseColor(init.color);
4396
4399
  surface = _chunk7ISPWEJAcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunk7ISPWEJAcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
4397
4400
  }
4398
- const blend = _chunkGLOOH65Ycjs.parseBlend.call(void 0, init.blend);
4399
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("opacity must be from 0 to 1.");
4400
- const ids = new Set(_chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4401
+ const blend = _chunk4PUPGALMcjs.parseBlend.call(void 0, init.blend);
4402
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("opacity must be from 0 to 1.");
4403
+ const ids = new Set(_chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4401
4404
  const layer = {
4402
4405
  type: "pixel",
4403
- id: init.id && !ids.has(init.id) ? init.id : _chunkGLOOH65Ycjs.newLayerId.call(void 0, ),
4406
+ id: init.id && !ids.has(init.id) ? init.id : _chunk4PUPGALMcjs.newLayerId.call(void 0, ),
4404
4407
  name: _optionalChain([init, 'access', _141 => _141.name, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()]) || this.nextLayerName(),
4405
4408
  visible: _nullishCoalesce(init.visible, () => ( true)),
4406
4409
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -4409,7 +4412,7 @@ var ImageEditorController = (_class6 = class {
4409
4412
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
4410
4413
  };
4411
4414
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
4412
- const next = _chunkGLOOH65Ycjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4415
+ const next = _chunk4PUPGALMcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4413
4416
  this.commitLayers(next, () => {
4414
4417
  this.state.activeLayerId = layer.id;
4415
4418
  this.state.activeTarget = "pixels";
@@ -4449,25 +4452,25 @@ var ImageEditorController = (_class6 = class {
4449
4452
  try {
4450
4453
  img = await this.renderer.imageCache.get(src);
4451
4454
  } catch (e20) {
4452
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4455
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4453
4456
  }
4454
4457
  const w = img.naturalWidth || img.width;
4455
4458
  const h = img.naturalHeight || img.height;
4456
4459
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
4457
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4460
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4458
4461
  ctx.drawImage(img, 0, 0, w, h);
4459
4462
  const data = ctx.getImageData(0, 0, w, h);
4460
4463
  return { width: w, height: h, data: data.data };
4461
4464
  }
4462
4465
  nextLayerName() {
4463
- const names = new Set(_chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.name));
4466
+ const names = new Set(_chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.name));
4464
4467
  let n = 1;
4465
4468
  while (names.has(`Layer ${n}`)) n++;
4466
4469
  return `Layer ${n}`;
4467
4470
  }
4468
4471
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
4469
4472
  duplicateLayer(id, name) {
4470
- const res = _chunkGLOOH65Ycjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4473
+ const res = _chunk4PUPGALMcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4471
4474
  this.commitLayers(res.layers, () => {
4472
4475
  this.state.activeLayerId = res.id;
4473
4476
  });
@@ -4475,17 +4478,17 @@ var ImageEditorController = (_class6 = class {
4475
4478
  }
4476
4479
  /** Deletes a layer (refused when locked), as one undo step. */
4477
4480
  removeLayer(id) {
4478
- const next = _chunkGLOOH65Ycjs.removeLayer.call(void 0, this.state.layers, id);
4481
+ const next = _chunk4PUPGALMcjs.removeLayer.call(void 0, this.state.layers, id);
4479
4482
  this.commitLayers(next, () => {
4480
- if (this.state.selectedAnnotationId && !_chunkLL3RAN55cjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkGLOOH65Ycjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _145 => _145.id]) === this.state.selectedAnnotationId)) {
4483
+ if (this.state.selectedAnnotationId && !_chunkDFFBJV3Ucjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunk4PUPGALMcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _145 => _145.id]) === this.state.selectedAnnotationId)) {
4481
4484
  this.state.selectedAnnotationId = null;
4482
4485
  }
4483
4486
  });
4484
4487
  }
4485
4488
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
4486
4489
  moveLayer(id, placement) {
4487
- const next = _chunkGLOOH65Ycjs.moveLayer.call(void 0, this.state.layers, id, placement);
4488
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, next, id);
4490
+ const next = _chunk4PUPGALMcjs.moveLayer.call(void 0, this.state.layers, id, placement);
4491
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, next, id);
4489
4492
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _146 => _146.parent, 'optionalAccess', _147 => _147.id]), () => ( null)), index: loc.index };
4490
4493
  this.commitLayers(next);
4491
4494
  return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _148 => _148.parent, 'optionalAccess', _149 => _149.id]), () => ( null)), index: loc.index };
@@ -4495,23 +4498,23 @@ var ImageEditorController = (_class6 = class {
4495
4498
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
4496
4499
  */
4497
4500
  setLayerProperties(id, props, commitToHistory = true) {
4498
- const next = _chunkGLOOH65Ycjs.setLayerProperties.call(void 0, this.state.layers, id, props);
4501
+ const next = _chunk4PUPGALMcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
4499
4502
  this.commitLayers(next, void 0, commitToHistory);
4500
- return _chunkLL3RAN55cjs.findLayer.call(void 0, next, id).layer;
4503
+ return _chunkDFFBJV3Ucjs.findLayer.call(void 0, next, id).layer;
4501
4504
  }
4502
4505
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
4503
4506
  addGroup(init = {}) {
4504
- const blend = init.blend === void 0 ? "pass-through" : _chunkGLOOH65Ycjs.parseBlend.call(void 0, init.blend, true);
4507
+ const blend = init.blend === void 0 ? "pass-through" : _chunk4PUPGALMcjs.parseBlend.call(void 0, init.blend, true);
4505
4508
  const group = {
4506
4509
  type: "group",
4507
- id: _chunkGLOOH65Ycjs.newLayerId.call(void 0, "group"),
4510
+ id: _chunk4PUPGALMcjs.newLayerId.call(void 0, "group"),
4508
4511
  name: _optionalChain([init, 'access', _150 => _150.name, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]) || "Group",
4509
4512
  visible: true,
4510
4513
  opacity: 1,
4511
4514
  blend,
4512
4515
  children: []
4513
4516
  };
4514
- const next = _chunkGLOOH65Ycjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
4517
+ const next = _chunk4PUPGALMcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
4515
4518
  this.commitLayers(next, () => {
4516
4519
  this.state.activeLayerId = group.id;
4517
4520
  this.state.activeTarget = "pixels";
@@ -4520,7 +4523,7 @@ var ImageEditorController = (_class6 = class {
4520
4523
  }
4521
4524
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
4522
4525
  groupLayers(ids, name) {
4523
- const res = _chunkGLOOH65Ycjs.groupLayers.call(void 0, this.state.layers, ids, name);
4526
+ const res = _chunk4PUPGALMcjs.groupLayers.call(void 0, this.state.layers, ids, name);
4524
4527
  this.commitLayers(res.layers, () => {
4525
4528
  this.state.activeLayerId = res.id;
4526
4529
  });
@@ -4528,7 +4531,7 @@ var ImageEditorController = (_class6 = class {
4528
4531
  }
4529
4532
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
4530
4533
  ungroupLayer(id) {
4531
- const res = _chunkGLOOH65Ycjs.ungroupLayer.call(void 0, this.state.layers, id);
4534
+ const res = _chunk4PUPGALMcjs.ungroupLayer.call(void 0, this.state.layers, id);
4532
4535
  this.commitLayers(res.layers);
4533
4536
  return res.ids;
4534
4537
  }
@@ -4537,48 +4540,48 @@ var ImageEditorController = (_class6 = class {
4537
4540
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
4538
4541
  */
4539
4542
  offsetLayer(id, move, commitToHistory = true) {
4540
- const layer = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id).layer;
4543
+ const layer = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4541
4544
  if (layer.type === "smart") {
4542
4545
  const tl = layer.placement.corners[0];
4543
4546
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
4544
4547
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
4545
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("x and y must be numbers.");
4546
- this.commitLayers(_chunkGLOOH65Ycjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
4547
- const moved = _chunkLL3RAN55cjs.findLayer.call(void 0, this.state.layers, id).layer;
4548
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("x and y must be numbers.");
4549
+ this.commitLayers(_chunk4PUPGALMcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
4550
+ const moved = _chunkDFFBJV3Ucjs.findLayer.call(void 0, this.state.layers, id).layer;
4548
4551
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
4549
4552
  }
4550
4553
  if (layer.type === "shape") {
4551
- const g = _nullishCoalesce(_chunkGLOOH65Ycjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
4554
+ const g = _nullishCoalesce(_chunk4PUPGALMcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
4552
4555
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
4553
4556
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
4554
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("x and y must be numbers.");
4555
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "position", "move it");
4556
- let moved = _chunkGLOOH65Ycjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
4557
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("x and y must be numbers.");
4558
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "position", "move it");
4559
+ let moved = _chunk4PUPGALMcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
4557
4560
  const mask = layer.mask;
4558
4561
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
4559
- this.commitLayers(_chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
4560
- const b = _nullishCoalesce(_chunkGLOOH65Ycjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
4562
+ this.commitLayers(_chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
4563
+ const b = _nullishCoalesce(_chunk4PUPGALMcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
4561
4564
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
4562
4565
  }
4563
4566
  if (layer.type === "type") {
4564
4567
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
4565
4568
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
4566
4569
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
4567
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("x and y must be numbers.");
4568
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "position", "move it");
4570
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("x and y must be numbers.");
4571
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "position", "move it");
4569
4572
  const mx = Math.round(dx);
4570
4573
  const my = Math.round(dy);
4571
- let moved = { ..._chunkGLOOH65Ycjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, layer.surface, mx, my) };
4574
+ let moved = { ..._chunk4PUPGALMcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, layer.surface, mx, my) };
4572
4575
  const mask = layer.mask;
4573
4576
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
4574
- this.commitLayers(_chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
4577
+ this.commitLayers(_chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
4575
4578
  const t = _nullishCoalesce(moved.transform, () => ( [1, 0, 0, 1, 0, 0]));
4576
4579
  return { offset: { x: Math.round(t[4]), y: Math.round(t[5]) }, bounds: this.getLayerBounds(id) };
4577
4580
  }
4578
4581
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
4579
4582
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
4580
4583
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
4581
- const next = _chunkGLOOH65Ycjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
4584
+ const next = _chunk4PUPGALMcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
4582
4585
  this.commitLayers(next, void 0, commitToHistory);
4583
4586
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
4584
4587
  }
@@ -4588,11 +4591,11 @@ var ImageEditorController = (_class6 = class {
4588
4591
  * target when the layer is active.
4589
4592
  */
4590
4593
  addLayerMask(id, from = "reveal-all", props = {}) {
4591
- const layer = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id).layer;
4594
+ const layer = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4592
4595
  let mask;
4593
4596
  if (from === "selection") {
4594
4597
  const sel = this.state.selection;
4595
- if (!_optionalChain([sel, 'optionalAccess', _153 => _153.bounds])) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
4598
+ if (!_optionalChain([sel, 'optionalAccess', _153 => _153.bounds])) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
4596
4599
  mask = this.maskFromSelection(sel, props);
4597
4600
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
4598
4601
  mask = { ...mask, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
@@ -4601,7 +4604,7 @@ var ImageEditorController = (_class6 = class {
4601
4604
  const v = from === "reveal-all" ? 255 : 0;
4602
4605
  mask = withMaskProps({ surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
4603
4606
  }
4604
- const next = _chunkGLOOH65Ycjs.setLayerMask.call(void 0, this.state.layers, id, mask);
4607
+ const next = _chunk4PUPGALMcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
4605
4608
  this.commitLayers(next, () => {
4606
4609
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
4607
4610
  });
@@ -4609,18 +4612,18 @@ var ImageEditorController = (_class6 = class {
4609
4612
  }
4610
4613
  /** Removes a layer's mask (one undo step). */
4611
4614
  removeLayerMask(id) {
4612
- const layer = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id).layer;
4613
- if (!layer.mask) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4614
- this.commitLayers(_chunkGLOOH65Ycjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
4615
+ const layer = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4616
+ if (!layer.mask) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4617
+ this.commitLayers(_chunk4PUPGALMcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
4615
4618
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
4616
4619
  });
4617
4620
  }
4618
4621
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
4619
4622
  setLayerMaskProps(id, props, commitToHistory = true) {
4620
- const layer = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id).layer;
4621
- if (!layer.mask) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
4623
+ const layer = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4624
+ if (!layer.mask) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
4622
4625
  const mask = withMaskProps(layer.mask, props);
4623
- this.commitLayers(_chunkGLOOH65Ycjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
4626
+ this.commitLayers(_chunk4PUPGALMcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
4624
4627
  return mask;
4625
4628
  }
4626
4629
  /**
@@ -4628,11 +4631,11 @@ var ImageEditorController = (_class6 = class {
4628
4631
  * the depth map) and removes the mask, as one undo step.
4629
4632
  */
4630
4633
  async applyLayerMask(id) {
4631
- const loc = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id);
4634
+ const loc = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id);
4632
4635
  const layer = loc.layer;
4633
- if (layer.type !== "pixel") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
4634
- if (!layer.mask) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4635
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
4636
+ if (layer.type !== "pixel") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
4637
+ if (!layer.mask) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4638
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
4636
4639
  const { width, height } = this.naturalSize;
4637
4640
  await this.renderer.prepareLayerAssets([layer], width, height);
4638
4641
  const sources = this.renderer.compositorSources(width, height);
@@ -4655,7 +4658,7 @@ var ImageEditorController = (_class6 = class {
4655
4658
  const next = { ...layer, surface: out };
4656
4659
  delete next.mask;
4657
4660
  delete next.source;
4658
- this.commitLayers(_chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => next), () => {
4661
+ this.commitLayers(_chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => next), () => {
4659
4662
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
4660
4663
  });
4661
4664
  }
@@ -4665,13 +4668,13 @@ var ImageEditorController = (_class6 = class {
4665
4668
  */
4666
4669
  layerViaCopy(options = {}) {
4667
4670
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
4668
- if (!id) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
4669
- const loc = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id);
4671
+ if (!id) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
4672
+ const loc = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id);
4670
4673
  const layer = loc.layer;
4671
- if (layer.type !== "pixel") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
4674
+ if (layer.type !== "pixel") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
4672
4675
  const sel = this.state.selection;
4673
- if (!_optionalChain([sel, 'optionalAccess', _154 => _154.bounds])) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
4674
- if (options.cut) _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
4676
+ if (!_optionalChain([sel, 'optionalAccess', _154 => _154.bounds])) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
4677
+ if (options.cut) _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
4675
4678
  const surface = this.surfaceOf(layer);
4676
4679
  const sb = sel.bounds;
4677
4680
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -4687,7 +4690,7 @@ var ImageEditorController = (_class6 = class {
4687
4690
  }
4688
4691
  const copy = {
4689
4692
  type: "pixel",
4690
- id: _chunkGLOOH65Ycjs.newLayerId.call(void 0, ),
4693
+ id: _chunk4PUPGALMcjs.newLayerId.call(void 0, ),
4691
4694
  name: _optionalChain([options, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
4692
4695
  visible: true,
4693
4696
  opacity: 1,
@@ -4695,11 +4698,11 @@ var ImageEditorController = (_class6 = class {
4695
4698
  surface: _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
4696
4699
  offset: { ...layer.offset }
4697
4700
  };
4698
- let next = _chunkLL3RAN55cjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _158 => _158.parent, 'optionalAccess', _159 => _159.id]), () => ( null)), loc.index + 1);
4701
+ let next = _chunkDFFBJV3Ucjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _158 => _158.parent, 'optionalAccess', _159 => _159.id]), () => ( null)), loc.index + 1);
4699
4702
  if (kept) {
4700
4703
  const cutLayer = { ...layer, surface: _chunk7ISPWEJAcjs.writeRegion.call(void 0, surface, src, kept) };
4701
4704
  delete cutLayer.source;
4702
- next = _chunkLL3RAN55cjs.mapLayer.call(void 0, next, id, () => cutLayer);
4705
+ next = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, next, id, () => cutLayer);
4703
4706
  }
4704
4707
  this.commitLayers(next, () => {
4705
4708
  this.state.activeLayerId = copy.id;
@@ -4760,7 +4763,7 @@ var ImageEditorController = (_class6 = class {
4760
4763
  * Refused while another transform is open.
4761
4764
  */
4762
4765
  beginFreeTransform(init = {}) {
4763
- if (this.getFreeTransform()) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
4766
+ if (this.getFreeTransform()) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
4764
4767
  const session = new FreeTransformSession(this.transformHost(), init);
4765
4768
  this.openTransform = session;
4766
4769
  this.notify();
@@ -4774,26 +4777,26 @@ var ImageEditorController = (_class6 = class {
4774
4777
  */
4775
4778
  transformLayer(spec) {
4776
4779
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
4777
- if (given > 1) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give only one of matrix, corners and params.");
4778
- if (!given && spec.warp === void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
4780
+ if (given > 1) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give only one of matrix, corners and params.");
4781
+ if (!given && spec.warp === void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
4779
4782
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
4780
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
4783
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
4781
4784
  }
4782
4785
  if (spec.matrix) {
4783
4786
  const [a, b, c, d] = spec.matrix;
4784
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
4787
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
4785
4788
  }
4786
4789
  const session = this.beginFreeTransform(spec);
4787
4790
  try {
4788
4791
  const g = session.startGeometry;
4789
- const corners = spec.matrix ? g.corners.map((p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkGLOOH65Ycjs.applyParams.call(void 0, g, spec.params) : g.corners;
4792
+ const corners = spec.matrix ? g.corners.map((p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunk4PUPGALMcjs.applyParams.call(void 0, g, spec.params) : g.corners;
4790
4793
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
4791
4794
  if (spec.warp) {
4792
4795
  if ("style" in spec.warp) {
4793
- if (!_chunkVYW7JBTMcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
4794
- warp = _chunkGLOOH65Ycjs.presetWarp.call(void 0, session.box, spec.warp);
4796
+ if (!_chunkVYW7JBTMcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
4797
+ warp = _chunk4PUPGALMcjs.presetWarp.call(void 0, session.box, spec.warp);
4795
4798
  } else {
4796
- if (!_chunkGLOOH65Ycjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
4799
+ if (!_chunk4PUPGALMcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
4797
4800
  warp = spec.warp;
4798
4801
  }
4799
4802
  }
@@ -4806,10 +4809,10 @@ var ImageEditorController = (_class6 = class {
4806
4809
  }
4807
4810
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
4808
4811
  flipLayer(axis, init = {}) {
4809
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
4812
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
4810
4813
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
4811
4814
  try {
4812
- session.update({ corners: _chunkGLOOH65Ycjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
4815
+ session.update({ corners: _chunk4PUPGALMcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
4813
4816
  return session.commit();
4814
4817
  } catch (e) {
4815
4818
  session.cancel();
@@ -4821,10 +4824,10 @@ var ImageEditorController = (_class6 = class {
4821
4824
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
4822
4825
  */
4823
4826
  rotateLayer90(turn, init = {}) {
4824
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
4827
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
4825
4828
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
4826
4829
  try {
4827
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkGLOOH65Ycjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
4830
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunk4PUPGALMcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
4828
4831
  const cx = b.x + b.width / 2;
4829
4832
  const cy = b.y + b.height / 2;
4830
4833
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
@@ -4839,22 +4842,22 @@ var ImageEditorController = (_class6 = class {
4839
4842
  }
4840
4843
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
4841
4844
  addLayerFilter(id, filter) {
4842
- const f = _chunkGLOOH65Ycjs.normalizeFilter.call(void 0, filter);
4843
- const next = _chunkGLOOH65Ycjs.addLayerFilter.call(void 0, this.state.layers, id, f);
4845
+ const f = _chunk4PUPGALMcjs.normalizeFilter.call(void 0, filter);
4846
+ const next = _chunk4PUPGALMcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
4844
4847
  this.commitLayers(next);
4845
- return _nullishCoalesce(_chunkLL3RAN55cjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4848
+ return _nullishCoalesce(_chunkDFFBJV3Ucjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4846
4849
  }
4847
4850
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
4848
4851
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
4849
- const next = _chunkGLOOH65Ycjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
4852
+ const next = _chunk4PUPGALMcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
4850
4853
  this.commitLayers(next, void 0, commitToHistory);
4851
- return _nullishCoalesce(_chunkLL3RAN55cjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4854
+ return _nullishCoalesce(_chunkDFFBJV3Ucjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4852
4855
  }
4853
4856
  /** Removes one filter (one undo step). Returns the remaining filters. */
4854
4857
  removeLayerFilter(id, filterId) {
4855
- const next = _chunkGLOOH65Ycjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
4858
+ const next = _chunk4PUPGALMcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
4856
4859
  this.commitLayers(next);
4857
- return _nullishCoalesce(_chunkLL3RAN55cjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4860
+ return _nullishCoalesce(_chunkDFFBJV3Ucjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4858
4861
  }
4859
4862
  // --- Smart objects ---
4860
4863
  get canvasSize() {
@@ -4868,8 +4871,8 @@ var ImageEditorController = (_class6 = class {
4868
4871
  */
4869
4872
  convertToSmartObject(ids, options = {}) {
4870
4873
  const list = _optionalChain([ids, 'optionalAccess', _163 => _163.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
4871
- if (!list.length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
4872
- const res = _chunkGLOOH65Ycjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
4874
+ if (!list.length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
4875
+ const res = _chunk4PUPGALMcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
4873
4876
  this.commitLayers(res.layers, () => {
4874
4877
  this.state.activeLayerId = res.layer.id;
4875
4878
  this.state.activeTarget = "pixels";
@@ -4878,7 +4881,7 @@ var ImageEditorController = (_class6 = class {
4878
4881
  }
4879
4882
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
4880
4883
  rasterizeSmartObject(id) {
4881
- const res = _chunkGLOOH65Ycjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
4884
+ const res = _chunk4PUPGALMcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
4882
4885
  this.commitLayers(res.layers, () => {
4883
4886
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
4884
4887
  });
@@ -4886,10 +4889,10 @@ var ImageEditorController = (_class6 = class {
4886
4889
  }
4887
4890
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
4888
4891
  getSmartObject(id) {
4889
- const layer = _chunkGLOOH65Ycjs.requireSmartObject.call(void 0, this.state.layers, id);
4892
+ const layer = _chunk4PUPGALMcjs.requireSmartObject.call(void 0, this.state.layers, id);
4890
4893
  const c = layer.contents;
4891
- const g = _chunkGLOOH65Ycjs.placementGeometry.call(void 0, layer);
4892
- const readout = _chunkGLOOH65Ycjs.describeTransform.call(void 0, g);
4894
+ const g = _chunk4PUPGALMcjs.placementGeometry.call(void 0, layer);
4895
+ const readout = _chunk4PUPGALMcjs.describeTransform.call(void 0, g);
4893
4896
  const stack = layer.smartFilters;
4894
4897
  return {
4895
4898
  layerId: layer.id,
@@ -4899,11 +4902,11 @@ var ImageEditorController = (_class6 = class {
4899
4902
  kind: c.kind,
4900
4903
  width: c.width,
4901
4904
  height: c.height,
4902
- decoded: _chunkGLOOH65Ycjs.isContentsDecoded.call(void 0, c),
4905
+ decoded: _chunk4PUPGALMcjs.isContentsDecoded.call(void 0, c),
4903
4906
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _164 => _164.file, 'optionalAccess', _165 => _165.type]), () => ( null)),
4904
4907
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _166 => _166.linked, 'optionalAccess', _167 => _167.path]), () => ( null)),
4905
- instances: _chunkGLOOH65Ycjs.instancesOf.call(void 0, this.state.layers, c.id),
4906
- layerCount: c.document ? _chunkLL3RAN55cjs.flattenLayers.call(void 0, c.document.layers).length : 0
4908
+ instances: _chunk4PUPGALMcjs.instancesOf.call(void 0, this.state.layers, c.id),
4909
+ layerCount: c.document ? _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, c.document.layers).length : 0
4907
4910
  },
4908
4911
  placement: {
4909
4912
  corners: g.corners.map((p) => ({ x: p.x, y: p.y })),
@@ -4914,8 +4917,8 @@ var ImageEditorController = (_class6 = class {
4914
4917
  scaleY: readout.scaleY,
4915
4918
  rotate: readout.rotate,
4916
4919
  skewX: readout.skewX,
4917
- center: _chunkGLOOH65Ycjs.anchorPoint.call(void 0, g, "center"),
4918
- bounds: _chunkGLOOH65Ycjs.transformedBox.call(void 0, g)
4920
+ center: _chunk4PUPGALMcjs.anchorPoint.call(void 0, g, "center"),
4921
+ bounds: _chunk4PUPGALMcjs.transformedBox.call(void 0, g)
4919
4922
  },
4920
4923
  smartFilters: {
4921
4924
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _168 => _168.enabled]), () => ( true)),
@@ -4932,7 +4935,7 @@ var ImageEditorController = (_class6 = class {
4932
4935
  * change. Returns the new placement summary.
4933
4936
  */
4934
4937
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
4935
- const res = _chunkGLOOH65Ycjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
4938
+ const res = _chunk4PUPGALMcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
4936
4939
  this.commitLayers(res.layers, void 0, commitToHistory);
4937
4940
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
4938
4941
  }
@@ -4945,23 +4948,23 @@ var ImageEditorController = (_class6 = class {
4945
4948
  * nothing is relative to the current transform.
4946
4949
  */
4947
4950
  setSmartObjectTransform(id, spec) {
4948
- const layer = _chunkGLOOH65Ycjs.requireSmartObject.call(void 0, this.state.layers, id);
4949
- const g = _chunkGLOOH65Ycjs.placementGeometry.call(void 0, layer);
4951
+ const layer = _chunk4PUPGALMcjs.requireSmartObject.call(void 0, this.state.layers, id);
4952
+ const g = _chunk4PUPGALMcjs.placementGeometry.call(void 0, layer);
4950
4953
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
4951
4954
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
4952
- if (ways > 1) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
4955
+ if (ways > 1) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
4953
4956
  let corners = g.corners;
4954
4957
  if (spec.corners) corners = spec.corners;
4955
4958
  else if (spec.matrix) {
4956
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
4959
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
4957
4960
  const [a, b, c, d] = spec.matrix;
4958
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
4959
- corners = _chunkGLOOH65Ycjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
4961
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
4962
+ corners = _chunk4PUPGALMcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
4960
4963
  } else if (numeric.length) {
4961
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
4962
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`${k} must be a finite number.`);
4963
- const now = _chunkGLOOH65Ycjs.describeTransform.call(void 0, g);
4964
- const centre = _chunkGLOOH65Ycjs.anchorPoint.call(void 0, g, "center");
4964
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
4965
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`${k} must be a finite number.`);
4966
+ const now = _chunk4PUPGALMcjs.describeTransform.call(void 0, g);
4967
+ const centre = _chunk4PUPGALMcjs.anchorPoint.call(void 0, g, "center");
4965
4968
  const params = {
4966
4969
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
4967
4970
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -4969,20 +4972,20 @@ var ImageEditorController = (_class6 = class {
4969
4972
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
4970
4973
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
4971
4974
  };
4972
- const m = _chunkGLOOH65Ycjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
4975
+ const m = _chunk4PUPGALMcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
4973
4976
  const cx = g.box.width / 2;
4974
4977
  const cy = g.box.height / 2;
4975
4978
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
4976
- corners = _chunkGLOOH65Ycjs.cornersFromMatrix.call(void 0, g.box, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, m, _chunkVYW7JBTMcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
4979
+ corners = _chunk4PUPGALMcjs.cornersFromMatrix.call(void 0, g.box, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, m, _chunkVYW7JBTMcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
4977
4980
  }
4978
4981
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
4979
4982
  if (spec.warp === null) warp = null;
4980
4983
  else if (spec.warp) {
4981
4984
  if ("style" in spec.warp) {
4982
- if (!_chunkVYW7JBTMcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
4983
- warp = _chunkGLOOH65Ycjs.presetWarp.call(void 0, g.box, spec.warp);
4985
+ if (!_chunkVYW7JBTMcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
4986
+ warp = _chunk4PUPGALMcjs.presetWarp.call(void 0, g.box, spec.warp);
4984
4987
  } else {
4985
- if (!_chunkGLOOH65Ycjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
4988
+ if (!_chunk4PUPGALMcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
4986
4989
  warp = spec.warp;
4987
4990
  }
4988
4991
  }
@@ -4996,16 +4999,16 @@ var ImageEditorController = (_class6 = class {
4996
4999
  * the layers that changed.
4997
5000
  */
4998
5001
  replaceSmartObjectContents(id, source) {
4999
- const layer = _chunkGLOOH65Ycjs.requireSmartObject.call(void 0, this.state.layers, id);
5002
+ const layer = _chunk4PUPGALMcjs.requireSmartObject.call(void 0, this.state.layers, id);
5000
5003
  let contents;
5001
5004
  if ("contents" in source) contents = source.contents;
5002
- else if ("pixels" in source) contents = _chunkGLOOH65Ycjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5005
+ else if ("pixels" in source) contents = _chunk4PUPGALMcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5003
5006
  else {
5004
- const psd = _chunkGLOOH65Ycjs.importPsd.call(void 0, source.psd, { newId: () => _chunkGLOOH65Ycjs.newLayerId.call(void 0, ) });
5005
- contents = _chunkGLOOH65Ycjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5007
+ const psd = _chunk4PUPGALMcjs.importPsd.call(void 0, source.psd, { newId: () => _chunk4PUPGALMcjs.newLayerId.call(void 0, ) });
5008
+ contents = _chunk4PUPGALMcjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5006
5009
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
5007
5010
  }
5008
- const res = _chunkGLOOH65Ycjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5011
+ const res = _chunk4PUPGALMcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5009
5012
  this.commitLayers(res.layers);
5010
5013
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
5011
5014
  }
@@ -5020,16 +5023,16 @@ var ImageEditorController = (_class6 = class {
5020
5023
  * and bytes.
5021
5024
  */
5022
5025
  exportSmartObjectContents(id) {
5023
- const layer = _chunkGLOOH65Ycjs.requireSmartObject.call(void 0, this.state.layers, id);
5026
+ const layer = _chunk4PUPGALMcjs.requireSmartObject.call(void 0, this.state.layers, id);
5024
5027
  const c = layer.contents;
5025
5028
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
5026
5029
  if (c.file) {
5027
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkGLOOH65Ycjs.BROWSER_IMAGE_TYPES };
5030
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunk4PUPGALMcjs.BROWSER_IMAGE_TYPES };
5028
5031
  const ext = c.file.type.toLowerCase();
5029
5032
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
5030
5033
  }
5031
- if (!_chunkGLOOH65Ycjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5032
- const f = _chunkGLOOH65Ycjs.smartContentsFile.call(void 0, c);
5034
+ if (!_chunk4PUPGALMcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5035
+ const f = _chunk4PUPGALMcjs.smartContentsFile.call(void 0, c);
5033
5036
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
5034
5037
  }
5035
5038
  /**
@@ -5038,7 +5041,7 @@ var ImageEditorController = (_class6 = class {
5038
5041
  * undo step. Returns the copy's id.
5039
5042
  */
5040
5043
  copySmartObject(id, linked = false, name) {
5041
- const res = _chunkGLOOH65Ycjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5044
+ const res = _chunk4PUPGALMcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5042
5045
  this.commitLayers(res.layers, () => {
5043
5046
  this.state.activeLayerId = res.layer.id;
5044
5047
  this.state.activeTarget = "pixels";
@@ -5047,31 +5050,31 @@ var ImageEditorController = (_class6 = class {
5047
5050
  }
5048
5051
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
5049
5052
  addSmartFilter(id, filter, index) {
5050
- const res = _chunkGLOOH65Ycjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkGLOOH65Ycjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5053
+ const res = _chunk4PUPGALMcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunk4PUPGALMcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5051
5054
  this.commitLayers(res.layers);
5052
5055
  return res.filter;
5053
5056
  }
5054
5057
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
5055
5058
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
5056
- const res = _chunkGLOOH65Ycjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5059
+ const res = _chunk4PUPGALMcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5057
5060
  this.commitLayers(res.layers, void 0, commitToHistory);
5058
5061
  return res.filter;
5059
5062
  }
5060
5063
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
5061
5064
  removeSmartFilter(id, filterId) {
5062
- const res = _chunkGLOOH65Ycjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5065
+ const res = _chunk4PUPGALMcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5063
5066
  this.commitLayers(res.layers);
5064
5067
  return _nullishCoalesce(_optionalChain([res, 'access', _171 => _171.layer, 'access', _172 => _172.smartFilters, 'optionalAccess', _173 => _173.filters]), () => ( []));
5065
5068
  }
5066
5069
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
5067
5070
  moveSmartFilter(id, filterId, index) {
5068
- const res = _chunkGLOOH65Ycjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5071
+ const res = _chunk4PUPGALMcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5069
5072
  this.commitLayers(res.layers);
5070
5073
  return _nullishCoalesce(_optionalChain([res, 'access', _174 => _174.layer, 'access', _175 => _175.smartFilters, 'optionalAccess', _176 => _176.filters]), () => ( []));
5071
5074
  }
5072
5075
  /** Turns a smart object's whole filter stack on or off (one undo step). */
5073
5076
  setSmartFiltersEnabled(id, enabled) {
5074
- const res = _chunkGLOOH65Ycjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5077
+ const res = _chunk4PUPGALMcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5075
5078
  this.commitLayers(res.layers);
5076
5079
  return _nullishCoalesce(_optionalChain([res, 'access', _177 => _177.layer, 'access', _178 => _178.smartFilters, 'optionalAccess', _179 => _179.enabled]), () => ( true));
5077
5080
  }
@@ -5081,21 +5084,21 @@ var ImageEditorController = (_class6 = class {
5081
5084
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
5082
5085
  */
5083
5086
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
5084
- const layer = _chunkGLOOH65Ycjs.requireSmartObject.call(void 0, this.state.layers, id);
5087
+ const layer = _chunk4PUPGALMcjs.requireSmartObject.call(void 0, this.state.layers, id);
5085
5088
  let mask;
5086
5089
  if (from === "none") mask = null;
5087
5090
  else if (from === "keep") {
5088
- if (!_optionalChain([layer, 'access', _180 => _180.smartFilters, 'optionalAccess', _181 => _181.mask])) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5091
+ if (!_optionalChain([layer, 'access', _180 => _180.smartFilters, 'optionalAccess', _181 => _181.mask])) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5089
5092
  mask = withMaskProps(layer.smartFilters.mask, props);
5090
5093
  } else if (from === "selection") {
5091
5094
  const sel = this.state.selection;
5092
- if (!_optionalChain([sel, 'optionalAccess', _182 => _182.bounds])) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5095
+ if (!_optionalChain([sel, 'optionalAccess', _182 => _182.bounds])) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5093
5096
  mask = this.maskFromSelection(sel, props);
5094
5097
  } else {
5095
5098
  const v = from === "reveal-all" ? 255 : 0;
5096
5099
  mask = withMaskProps({ surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5097
5100
  }
5098
- const res = _chunkGLOOH65Ycjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5101
+ const res = _chunk4PUPGALMcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5099
5102
  this.commitLayers(res.layers, () => {
5100
5103
  if (this.state.activeLayerId !== id) return;
5101
5104
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -5110,18 +5113,18 @@ var ImageEditorController = (_class6 = class {
5110
5113
  */
5111
5114
  async prepareSmartObjects() {
5112
5115
  const pending = /* @__PURE__ */ new Map();
5113
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers)) {
5114
- if (l.type === "smart" && !_chunkGLOOH65Ycjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkGLOOH65Ycjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5116
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers)) {
5117
+ if (l.type === "smart" && !_chunk4PUPGALMcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunk4PUPGALMcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5115
5118
  }
5116
5119
  const left = [];
5117
5120
  for (const [cid, c] of pending) {
5118
5121
  try {
5119
- const url = `data:${_chunkGLOOH65Ycjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5122
+ const url = `data:${_chunk4PUPGALMcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5120
5123
  const px2 = await this.decodeImage(url);
5121
- const decoded = { ...c, kind: "raster", raster: _chunkGLOOH65Ycjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5124
+ const decoded = { ...c, kind: "raster", raster: _chunk4PUPGALMcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5122
5125
  const swap = (layers) => {
5123
5126
  let out = layers;
5124
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkLL3RAN55cjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
5127
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
5125
5128
  return out;
5126
5129
  };
5127
5130
  this.state.layers = swap(this.state.layers);
@@ -5146,10 +5149,10 @@ var ImageEditorController = (_class6 = class {
5146
5149
  * Contents can nest. Returns the contents' size and layer ids.
5147
5150
  */
5148
5151
  editSmartObjectContents(id) {
5149
- if (this.getFreeTransform()) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5150
- const layer = _chunkGLOOH65Ycjs.requireSmartObject.call(void 0, this.state.layers, id);
5152
+ if (this.getFreeTransform()) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5153
+ const layer = _chunk4PUPGALMcjs.requireSmartObject.call(void 0, this.state.layers, id);
5151
5154
  const c = layer.contents;
5152
- if (!_chunkGLOOH65Ycjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _186 => _186.file, 'optionalAccess', _187 => _187.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5155
+ if (!_chunk4PUPGALMcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _186 => _186.file, 'optionalAccess', _187 => _187.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5153
5156
  const saved = {
5154
5157
  state: { ...this.state },
5155
5158
  undo: this.undoStack,
@@ -5160,7 +5163,7 @@ var ImageEditorController = (_class6 = class {
5160
5163
  samplePixelsOverride: this.samplePixelsOverride,
5161
5164
  psdResolution: this.psdResolution
5162
5165
  };
5163
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkGLOOH65Ycjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5166
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunk4PUPGALMcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5164
5167
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
5165
5168
  const s = this.state;
5166
5169
  this.state = {
@@ -5168,7 +5171,7 @@ var ImageEditorController = (_class6 = class {
5168
5171
  sourceUrl: null,
5169
5172
  imageDimensions: { width: c.width, height: c.height },
5170
5173
  crop: null,
5171
- transform: { ..._chunkGLOOH65Ycjs.DEFAULT_TRANSFORM_VALUES },
5174
+ transform: { ..._chunk4PUPGALMcjs.DEFAULT_TRANSFORM_VALUES },
5172
5175
  layers,
5173
5176
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
5174
5177
  activeTarget: "pixels",
@@ -5192,7 +5195,7 @@ var ImageEditorController = (_class6 = class {
5192
5195
  this.viewKey = [];
5193
5196
  this.initialSnapshot = this.captureHistoryEntry();
5194
5197
  this.notify();
5195
- return { layerId: layer.id, depth: this.contentsStack.length, width: c.width, height: c.height, layerIds: _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).map((l) => l.id) };
5198
+ return { layerId: layer.id, depth: this.contentsStack.length, width: c.width, height: c.height, layerIds: _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers).map((l) => l.id) };
5196
5199
  }
5197
5200
  /**
5198
5201
  * Closes the innermost open contents: with `save` (default) the edited layers become the smart
@@ -5201,24 +5204,24 @@ var ImageEditorController = (_class6 = class {
5201
5204
  */
5202
5205
  closeSmartObjectContents(save = true) {
5203
5206
  const top = this.contentsStack.pop();
5204
- if (!top) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5207
+ if (!top) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5205
5208
  if (_optionalChain([this, 'access', _193 => _193.openTransform, 'optionalAccess', _194 => _194.isOpen])) this.openTransform.cancel();
5206
5209
  this.openTransform = null;
5207
5210
  const edited = this.state;
5208
5211
  const changed = save && this.undoStack.length > 0;
5209
5212
  let next = null;
5210
5213
  if (changed) {
5211
- const layer = _optionalChain([_chunkLL3RAN55cjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _195 => _195.layer]);
5214
+ const layer = _optionalChain([_chunkDFFBJV3Ucjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _195 => _195.layer]);
5212
5215
  const old = _optionalChain([layer, 'optionalAccess', _196 => _196.contents]);
5213
5216
  const { width, height } = edited.imageDimensions;
5214
5217
  const only = edited.layers.length === 1 ? edited.layers[0] : null;
5215
5218
  const plain3 = _optionalChain([only, 'optionalAccess', _197 => _197.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _198 => _198.filters, 'optionalAccess', _199 => _199.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
5216
5219
  if (_optionalChain([old, 'optionalAccess', _200 => _200.kind]) === "raster" && plain3) {
5217
5220
  const px2 = _chunk7ISPWEJAcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
5218
- next = _chunkGLOOH65Ycjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5221
+ next = _chunk4PUPGALMcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5219
5222
  } else {
5220
5223
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
5221
- next = _chunkGLOOH65Ycjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _201 => _201.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _202 => _202.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5224
+ next = _chunk4PUPGALMcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _201 => _201.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _202 => _202.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5222
5225
  }
5223
5226
  }
5224
5227
  const saved = top.saved;
@@ -5237,7 +5240,7 @@ var ImageEditorController = (_class6 = class {
5237
5240
  this.notify();
5238
5241
  return { layerId: top.layerId, changed: false, layerIds: [] };
5239
5242
  }
5240
- const res = _chunkGLOOH65Ycjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5243
+ const res = _chunk4PUPGALMcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5241
5244
  this.commitLayers(res.layers);
5242
5245
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
5243
5246
  }
@@ -5252,35 +5255,35 @@ var ImageEditorController = (_class6 = class {
5252
5255
  // --- Layer effects ---
5253
5256
  /** A layer's effects (an empty, enabled list when it has none). */
5254
5257
  getLayerEffects(id) {
5255
- return _chunkGLOOH65Ycjs.layerEffectsOf.call(void 0, _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id).layer);
5258
+ return _chunk4PUPGALMcjs.layerEffectsOf.call(void 0, _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5256
5259
  }
5257
5260
  /**
5258
5261
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
5259
5262
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
5260
5263
  */
5261
5264
  addLayerEffect(id, kind, params = {}, index) {
5262
- const res = _chunkGLOOH65Ycjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5265
+ const res = _chunk4PUPGALMcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5263
5266
  this.commitLayers(res.layers);
5264
5267
  return { effect: res.effect, effects: this.getLayerEffects(id) };
5265
5268
  }
5266
5269
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
5267
5270
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
5268
- this.commitLayers(_chunkGLOOH65Ycjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5271
+ this.commitLayers(_chunk4PUPGALMcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5269
5272
  return this.getLayerEffects(id);
5270
5273
  }
5271
5274
  /** Removes one effect (one undo step). Returns the remaining effects. */
5272
5275
  removeLayerEffect(id, effectId) {
5273
- this.commitLayers(_chunkGLOOH65Ycjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5276
+ this.commitLayers(_chunk4PUPGALMcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5274
5277
  return this.getLayerEffects(id);
5275
5278
  }
5276
5279
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
5277
5280
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
5278
- this.commitLayers(_chunkGLOOH65Ycjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5281
+ this.commitLayers(_chunk4PUPGALMcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5279
5282
  return this.getLayerEffects(id);
5280
5283
  }
5281
5284
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
5282
5285
  setLayerEffects(id, effects, commitToHistory = true) {
5283
- this.commitLayers(_chunkGLOOH65Ycjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5286
+ this.commitLayers(_chunk4PUPGALMcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5284
5287
  return this.getLayerEffects(id);
5285
5288
  }
5286
5289
  __init67() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -5301,15 +5304,15 @@ var ImageEditorController = (_class6 = class {
5301
5304
  }
5302
5305
  /** The light effects with "use global light" follow. */
5303
5306
  getGlobalLight() {
5304
- return { ..._nullishCoalesce(this.state.globalLight, () => ( _chunkLL3RAN55cjs.DEFAULT_GLOBAL_LIGHT)) };
5307
+ return { ..._nullishCoalesce(this.state.globalLight, () => ( _chunkDFFBJV3Ucjs.DEFAULT_GLOBAL_LIGHT)) };
5305
5308
  }
5306
5309
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
5307
5310
  setGlobalLight(light, commitToHistory = true) {
5308
5311
  const next = { ...this.getGlobalLight(), ...light };
5309
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5310
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5312
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5313
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5311
5314
  if (commitToHistory) this.recordHistory();
5312
- if (next.angle === _chunkLL3RAN55cjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkLL3RAN55cjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
5315
+ if (next.angle === _chunkDFFBJV3Ucjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkDFFBJV3Ucjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
5313
5316
  else this.state.globalLight = next;
5314
5317
  this.notify();
5315
5318
  return this.getGlobalLight();
@@ -5317,17 +5320,17 @@ var ImageEditorController = (_class6 = class {
5317
5320
  /** Composites `layers` (in isolation) over `rect` into a surface, loading depth maps first. */
5318
5321
  async compositeToSurface(layers, rect) {
5319
5322
  const { width, height } = this.naturalSize;
5320
- if (_chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
5321
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5323
+ if (_chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
5324
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5322
5325
  }
5323
5326
  await this.renderer.prepareLayerAssets(layers, width, height);
5324
5327
  const sources = this.renderer.compositorSources(width, height);
5325
5328
  const depth = this.bitDepth;
5326
5329
  if (depth !== 8) {
5327
- const samples = _chunkLL3RAN55cjs.workingToSamples.call(void 0, _chunkGLOOH65Ycjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5330
+ const samples = _chunkDFFBJV3Ucjs.workingToSamples.call(void 0, _chunk4PUPGALMcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5328
5331
  return _chunk7ISPWEJAcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
5329
5332
  }
5330
- const data = new (0, _chunkGLOOH65Ycjs.LayerCompositor)().composite(layers, rect, sources);
5333
+ const data = new (0, _chunk4PUPGALMcjs.LayerCompositor)().composite(layers, rect, sources);
5331
5334
  return _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
5332
5335
  }
5333
5336
  /**
@@ -5340,22 +5343,22 @@ var ImageEditorController = (_class6 = class {
5340
5343
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
5341
5344
  const depth = this.bitDepth;
5342
5345
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunk7ISPWEJAcjs.to16From8.call(void 0, this.compositePixels(r).data) };
5343
- const data = _chunkLL3RAN55cjs.workingToSamples.call(void 0, _chunkGLOOH65Ycjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5346
+ const data = _chunkDFFBJV3Ucjs.workingToSamples.call(void 0, _chunk4PUPGALMcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5344
5347
  return { width: r.width, height: r.height, depth, data };
5345
5348
  }
5346
5349
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
5347
5350
  paintBounds(layer) {
5348
5351
  const { width, height } = this.naturalSize;
5349
5352
  const canvas = { x: 0, y: 0, width, height };
5350
- if (_chunkGLOOH65Ycjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5353
+ if (_chunk4PUPGALMcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5351
5354
  if (layer.type === "annotation") {
5352
- const b = _chunkGLOOH65Ycjs.getAnnotationBounds.call(void 0, layer.annotation);
5355
+ const b = _chunk4PUPGALMcjs.getAnnotationBounds.call(void 0, layer.annotation);
5353
5356
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
5354
5357
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
5355
5358
  }
5356
5359
  if (layer.type === "group") {
5357
5360
  let r = null;
5358
- for (const c of layer.children) r = _chunkGLOOH65Ycjs.unionRect.call(void 0, r, this.paintBounds(c));
5361
+ for (const c of layer.children) r = _chunk4PUPGALMcjs.unionRect.call(void 0, r, this.paintBounds(c));
5359
5362
  return _nullishCoalesce(r, () => ( canvas));
5360
5363
  }
5361
5364
  return canvas;
@@ -5366,17 +5369,17 @@ var ImageEditorController = (_class6 = class {
5366
5369
  * Returns the merged id.
5367
5370
  */
5368
5371
  async mergeDown(id) {
5369
- const loc = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id);
5372
+ const loc = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id);
5370
5373
  const upper = loc.layer;
5371
5374
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
5372
5375
  const lower = siblings[loc.index - 1];
5373
- if (!lower) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5374
- if (lower.type !== "pixel") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5375
- if (!upper.visible) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5376
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5377
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5378
- let rect = _nullishCoalesce(_chunkGLOOH65Ycjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5379
- const reach = Math.max(_chunkLL3RAN55cjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkLL3RAN55cjs.effectsMargin.call(void 0, upper.effects));
5376
+ if (!lower) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5377
+ if (lower.type !== "pixel") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5378
+ if (!upper.visible) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5379
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5380
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5381
+ let rect = _nullishCoalesce(_chunk4PUPGALMcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5382
+ const reach = Math.max(_chunkDFFBJV3Ucjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkDFFBJV3Ucjs.effectsMargin.call(void 0, upper.effects));
5380
5383
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
5381
5384
  const base = { ...lower, blend: "normal", opacity: 1 };
5382
5385
  delete base.clipped;
@@ -5387,8 +5390,8 @@ var ImageEditorController = (_class6 = class {
5387
5390
  delete merged.filters;
5388
5391
  delete merged.source;
5389
5392
  delete merged.effects;
5390
- let next = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => null);
5391
- next = _chunkLL3RAN55cjs.mapLayer.call(void 0, next, lower.id, () => merged);
5393
+ let next = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => null);
5394
+ next = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, next, lower.id, () => merged);
5392
5395
  this.commitLayers(next, () => {
5393
5396
  this.state.activeLayerId = merged.id;
5394
5397
  this.state.activeTarget = "pixels";
@@ -5401,12 +5404,12 @@ var ImageEditorController = (_class6 = class {
5401
5404
  */
5402
5405
  async mergeVisible() {
5403
5406
  const visible = this.state.layers.filter((l) => l.visible);
5404
- if (!visible.length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("No layer is visible.");
5407
+ if (!visible.length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("No layer is visible.");
5405
5408
  const { width, height } = this.naturalSize;
5406
5409
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
5407
5410
  const merged = {
5408
5411
  type: "pixel",
5409
- id: _chunkGLOOH65Ycjs.newLayerId.call(void 0, ),
5412
+ id: _chunk4PUPGALMcjs.newLayerId.call(void 0, ),
5410
5413
  name: "Merged",
5411
5414
  visible: true,
5412
5415
  opacity: 1,
@@ -5430,8 +5433,8 @@ var ImageEditorController = (_class6 = class {
5430
5433
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
5431
5434
  const bg = {
5432
5435
  type: "pixel",
5433
- id: _chunkGLOOH65Ycjs.BACKGROUND_LAYER_ID,
5434
- name: _chunkGLOOH65Ycjs.BACKGROUND_LAYER_NAME,
5436
+ id: _chunk4PUPGALMcjs.BACKGROUND_LAYER_ID,
5437
+ name: _chunk4PUPGALMcjs.BACKGROUND_LAYER_NAME,
5435
5438
  visible: true,
5436
5439
  opacity: 1,
5437
5440
  blend: "normal",
@@ -5458,7 +5461,7 @@ var ImageEditorController = (_class6 = class {
5458
5461
  const k = Math.min(1, side / Math.max(width, height));
5459
5462
  const tw = Math.max(1, Math.round(width * k));
5460
5463
  const th = Math.max(1, Math.round(height * k));
5461
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkGLOOH65Ycjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5464
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunk4PUPGALMcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5462
5465
  if (!surface) return null;
5463
5466
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
5464
5467
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -5544,7 +5547,7 @@ var ImageEditorController = (_class6 = class {
5544
5547
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
5545
5548
  */
5546
5549
  setCloneSource(point) {
5547
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
5550
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
5548
5551
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
5549
5552
  this.state.paint = { ...this.state.paint, cloneSource: source };
5550
5553
  this.notify();
@@ -5562,27 +5565,27 @@ var ImageEditorController = (_class6 = class {
5562
5565
  /** Resolves and validates what a stroke, fill or clear paints into. */
5563
5566
  paintTarget(layerId, channel, action) {
5564
5567
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
5565
- if (!id) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
5566
- const layer = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id).layer;
5568
+ if (!id) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
5569
+ const layer = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5567
5570
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
5568
5571
  if (ch === "mask") {
5569
- if (!layer.mask) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
5570
- if (layer.mask.source) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
5571
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "all", action);
5572
+ if (!layer.mask) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
5573
+ if (layer.mask.source) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
5574
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "all", action);
5572
5575
  } else if (ch === "filter-mask") {
5573
5576
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _210 => _210.smartFilters, 'optionalAccess', _211 => _211.mask])) {
5574
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
5577
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
5575
5578
  }
5576
- if (!_chunkGLOOH65Ycjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
5577
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "all", action);
5579
+ if (!_chunk4PUPGALMcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
5580
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "all", action);
5578
5581
  } else {
5579
- if (layer.type === "smart") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
5580
- if (layer.type === "shape") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
5581
- if (layer.type === "type") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
5582
- if (layer.type !== "pixel") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
5583
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "pixels", action);
5582
+ if (layer.type === "smart") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
5583
+ if (layer.type === "shape") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
5584
+ if (layer.type === "type") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
5585
+ if (layer.type !== "pixel") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
5586
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "pixels", action);
5584
5587
  }
5585
- if (!layer.visible) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
5588
+ if (!layer.visible) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
5586
5589
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
5587
5590
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
5588
5591
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _212 => _212.locks, 'optionalAccess', _213 => _213.transparency]));
@@ -5591,7 +5594,7 @@ var ImageEditorController = (_class6 = class {
5591
5594
  /** The layer with its pixels (or mask) replaced by `surface`. */
5592
5595
  withSurface(layer, channel, surface) {
5593
5596
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
5594
- if (channel === "filter-mask") return _chunkGLOOH65Ycjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
5597
+ if (channel === "filter-mask") return _chunk4PUPGALMcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
5595
5598
  const next = { ...layer, surface };
5596
5599
  delete next.source;
5597
5600
  return next;
@@ -5604,10 +5607,10 @@ var ImageEditorController = (_class6 = class {
5604
5607
  */
5605
5608
  beginStroke(init = {}) {
5606
5609
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
5607
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
5610
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
5608
5611
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
5609
5612
  if (tool === "mixer" && target.channel !== "pixels") {
5610
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
5613
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
5611
5614
  }
5612
5615
  const brush = _chunkL3PXFMOFcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
5613
5616
  const color = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
@@ -5635,7 +5638,7 @@ var ImageEditorController = (_class6 = class {
5635
5638
  retouchStroke(tool, init, brush, target, apply) {
5636
5639
  const settings = _chunkK7V27T72cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
5637
5640
  const mask = target.channel !== "pixels";
5638
- if (tool === "sponge" && mask) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
5641
+ if (tool === "sponge" && mask) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
5639
5642
  if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkK7V27T72cjs.RetouchDabStroke)(brush, pixels, _chunkK7V27T72cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
5640
5643
  if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkK7V27T72cjs.RetouchDabStroke)(brush, pixels, _chunkK7V27T72cjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
5641
5644
  const retouchApply = {
@@ -5688,7 +5691,7 @@ var ImageEditorController = (_class6 = class {
5688
5691
  }
5689
5692
  if (init.source) this.setCloneSource(init.source);
5690
5693
  const cs = this.state.paint.cloneSource;
5691
- if (!cs) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
5694
+ if (!cs) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
5692
5695
  let offset = { x: 0, y: 0 };
5693
5696
  let first = { x: 0, y: 0 };
5694
5697
  const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
@@ -5723,7 +5726,7 @@ var ImageEditorController = (_class6 = class {
5723
5726
  const sources = this.compositorSources();
5724
5727
  if (depth) {
5725
5728
  return new (0, _chunkK7V27T72cjs.TilePixelSource)((tx, ty) => {
5726
- const w = _chunkGLOOH65Ycjs.compositeDeep.call(void 0, layers, { x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE }, sources, depth);
5729
+ const w = _chunk4PUPGALMcjs.compositeDeep.call(void 0, layers, { x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE }, sources, depth);
5727
5730
  for (let i = 0; i < w.length; i += 4) {
5728
5731
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunk7ISPWEJAcjs.srgbEncode.call(void 0, w[i + c]);
5729
5732
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -5731,7 +5734,7 @@ var ImageEditorController = (_class6 = class {
5731
5734
  return w;
5732
5735
  }, 4);
5733
5736
  }
5734
- const compositor = new (0, _chunkGLOOH65Ycjs.LayerCompositor)();
5737
+ const compositor = new (0, _chunk4PUPGALMcjs.LayerCompositor)();
5735
5738
  return new (0, _chunkK7V27T72cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
5736
5739
  }
5737
5740
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
@@ -5753,14 +5756,14 @@ var ImageEditorController = (_class6 = class {
5753
5756
  }
5754
5757
  /** @internal Shows a stroke's live surface (no history). */
5755
5758
  _strokeUpdate(layerId, channel, surface, rects) {
5756
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
5759
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
5757
5760
  this.notify(channel === "filter-mask" ? void 0 : rects);
5758
5761
  }
5759
5762
  /** @internal Commits a finished stroke as one undo step (`before` is the pre-stroke state). */
5760
5763
  _strokeCommit(before, layerId, channel, surface) {
5761
5764
  if (surface) {
5762
5765
  const prev = before.layers;
5763
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
5766
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
5764
5767
  if (this.bitDepth !== 8) this.state.layers = keepDeepLayers(prev, this.state.layers);
5765
5768
  } else this.state.layers = before.layers;
5766
5769
  if (surface && !this.isApplyingHistory) {
@@ -5781,9 +5784,9 @@ var ImageEditorController = (_class6 = class {
5781
5784
  * document bounds and the number of dabs.
5782
5785
  */
5783
5786
  paintStroke(init) {
5784
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("points must hold at least one { x, y } point.");
5787
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("points must hold at least one { x, y } point.");
5785
5788
  for (const p of init.points) {
5786
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _221 => _221.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _222 => _222.y]))) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
5789
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _221 => _221.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _222 => _222.y]))) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
5787
5790
  }
5788
5791
  const session = this.beginStroke(init);
5789
5792
  session.push(init.points);
@@ -5809,8 +5812,8 @@ var ImageEditorController = (_class6 = class {
5809
5812
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
5810
5813
  const { width, height } = this.naturalSize;
5811
5814
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
5812
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("opacity must be from 0 to 1.");
5813
- const blend = _nullishCoalesce(_chunkGLOOH65Ycjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
5815
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("opacity must be from 0 to 1.");
5816
+ const blend = _nullishCoalesce(_chunk4PUPGALMcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
5814
5817
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _223 => _223.state, 'access', _224 => _224.selection, 'optionalAccess', _225 => _225.bounds]) ? this.state.selection : null;
5815
5818
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _226 => _226.bounds]), () => ( { x: 0, y: 0, width, height }));
5816
5819
  const coverage = new (0, _chunkL3PXFMOFcjs.CoverageMap)();
@@ -5839,14 +5842,14 @@ var ImageEditorController = (_class6 = class {
5839
5842
  };
5840
5843
  const depth = target.channel !== "filter-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
5841
5844
  const surface = paintCoverageInto(target.surface, coverage, apply, [region], depth);
5842
- const next = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => this.withSurface(l, target.channel, surface));
5845
+ const next = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => this.withSurface(l, target.channel, surface));
5843
5846
  this.commitLayers(next);
5844
5847
  return { layerId: target.id, channel: target.channel, bounds: region, dabs: 0 };
5845
5848
  }
5846
5849
  // --- Adjustments ---
5847
5850
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
5848
5851
  developLayer() {
5849
- return _chunkGLOOH65Ycjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
5852
+ return _chunk4PUPGALMcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
5850
5853
  }
5851
5854
  /**
5852
5855
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -5861,18 +5864,18 @@ var ImageEditorController = (_class6 = class {
5861
5864
  const target = this.developLayer();
5862
5865
  let layers = this.state.layers;
5863
5866
  if (target && (DEVELOP_KEYS.some((k) => k in partial) || "process" in partial)) {
5864
- layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, target.id, (l) => withDevelop(l, partial));
5867
+ layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, target.id, (l) => withDevelop(l, partial));
5865
5868
  }
5866
5869
  if ("blur" in partial && typeof partial.blur === "number") {
5867
5870
  const blur = Math.max(0, partial.blur);
5868
5871
  if (this.state.legacyOutputBlur !== void 0) this.state.legacyOutputBlur = blur;
5869
- else if (target) layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, target.id, (l) => withBlur(l, blur));
5872
+ else if (target) layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, target.id, (l) => withBlur(l, blur));
5870
5873
  }
5871
5874
  if ("opacity" in partial && typeof partial.opacity === "number") {
5872
5875
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
5873
5876
  }
5874
5877
  if ("layers" in partial) {
5875
- layers = this.replaceAdjustmentNodes(layers, _chunkGLOOH65Ycjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
5878
+ layers = this.replaceAdjustmentNodes(layers, _chunk4PUPGALMcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
5876
5879
  }
5877
5880
  this.state.layers = layers;
5878
5881
  this.notify();
@@ -5880,7 +5883,7 @@ var ImageEditorController = (_class6 = class {
5880
5883
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
5881
5884
  get isProcessOutdated() {
5882
5885
  this.syncViews();
5883
- return _chunkGLOOH65Ycjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkGLOOH65Ycjs.LATEST_PROCESS_VERSION;
5886
+ return _chunk4PUPGALMcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunk4PUPGALMcjs.LATEST_PROCESS_VERSION;
5884
5887
  }
5885
5888
  /**
5886
5889
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -5888,7 +5891,7 @@ var ImageEditorController = (_class6 = class {
5888
5891
  */
5889
5892
  upgradeProcess() {
5890
5893
  if (!this.isProcessOutdated) return false;
5891
- this.setAdjustments({ process: _chunkGLOOH65Ycjs.LATEST_PROCESS_VERSION });
5894
+ this.setAdjustments({ process: _chunk4PUPGALMcjs.LATEST_PROCESS_VERSION });
5892
5895
  return true;
5893
5896
  }
5894
5897
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -5896,10 +5899,10 @@ var ImageEditorController = (_class6 = class {
5896
5899
  this.recordHistory();
5897
5900
  const target = this.developLayer();
5898
5901
  if (target) {
5899
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0,
5902
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0,
5900
5903
  this.state.layers,
5901
5904
  target.id,
5902
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkGLOOH65Ycjs.LATEST_PROCESS_VERSION }), 0)
5905
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunk4PUPGALMcjs.LATEST_PROCESS_VERSION }), 0)
5903
5906
  );
5904
5907
  }
5905
5908
  delete this.state.legacyOutputBlur;
@@ -5916,7 +5919,7 @@ var ImageEditorController = (_class6 = class {
5916
5919
  return this.getAdjustmentLayers().find((l) => l.id === id);
5917
5920
  }
5918
5921
  adjustmentNodes(layers = this.state.layers) {
5919
- return _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "adjustment");
5922
+ return _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "adjustment");
5920
5923
  }
5921
5924
  /**
5922
5925
  * Where a new layer goes when no position is given: directly above the topmost layer that is
@@ -5930,26 +5933,26 @@ var ImageEditorController = (_class6 = class {
5930
5933
  /** Inserts `node` by `aboveId` / `parentId` / adjustment index / default position. */
5931
5934
  placeLayer(layers, node, where) {
5932
5935
  if (where.aboveId) {
5933
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, layers, where.aboveId);
5934
- if (loc) return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _227 => _227.parent, 'optionalAccess', _228 => _228.id]), () => ( null)), loc.index + 1);
5936
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, layers, where.aboveId);
5937
+ if (loc) return _chunkDFFBJV3Ucjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _227 => _227.parent, 'optionalAccess', _228 => _228.id]), () => ( null)), loc.index + 1);
5935
5938
  }
5936
5939
  if (where.parentId) {
5937
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, layers, where.parentId);
5938
- if (loc && loc.layer.type === "group") return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, node, loc.layer.id);
5940
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, layers, where.parentId);
5941
+ if (loc && loc.layer.type === "group") return _chunkDFFBJV3Ucjs.insertLayer.call(void 0, layers, node, loc.layer.id);
5939
5942
  }
5940
5943
  if (where.adjustmentIndex !== void 0) {
5941
5944
  const nodes = this.adjustmentNodes(layers);
5942
5945
  const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
5943
5946
  if (at < nodes.length) {
5944
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, layers, nodes[at].id);
5945
- return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _229 => _229.parent, 'optionalAccess', _230 => _230.id]), () => ( null)), loc.index);
5947
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, layers, nodes[at].id);
5948
+ return _chunkDFFBJV3Ucjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _229 => _229.parent, 'optionalAccess', _230 => _230.id]), () => ( null)), loc.index);
5946
5949
  }
5947
5950
  if (nodes.length) {
5948
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
5949
- return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _231 => _231.parent, 'optionalAccess', _232 => _232.id]), () => ( null)), loc.index + 1);
5951
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
5952
+ return _chunkDFFBJV3Ucjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _231 => _231.parent, 'optionalAccess', _232 => _232.id]), () => ( null)), loc.index + 1);
5950
5953
  }
5951
5954
  }
5952
- return _chunkLL3RAN55cjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
5955
+ return _chunkDFFBJV3Ucjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
5953
5956
  }
5954
5957
  /** `setAdjustments({ layers })`: updates nodes by id in place, removes missing ones, adds new ones. */
5955
5958
  replaceAdjustmentNodes(layers, next) {
@@ -5958,12 +5961,12 @@ var ImageEditorController = (_class6 = class {
5958
5961
  let out = layers;
5959
5962
  for (const node of this.adjustmentNodes(layers)) {
5960
5963
  const update = byId.get(node.id);
5961
- out = _chunkLL3RAN55cjs.mapLayer.call(void 0, out, node.id, () => update ? mergeAdjustmentNode(node, update, width, height) : null);
5964
+ out = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, out, node.id, () => update ? mergeAdjustmentNode(node, update, width, height) : null);
5962
5965
  }
5963
5966
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
5964
5967
  for (const l of next) {
5965
5968
  if (existing.has(l.id)) continue;
5966
- out = this.placeLayer(out, _chunkGLOOH65Ycjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
5969
+ out = this.placeLayer(out, _chunk4PUPGALMcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
5967
5970
  }
5968
5971
  const order = next.map((l) => l.id);
5969
5972
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -5977,8 +5980,8 @@ var ImageEditorController = (_class6 = class {
5977
5980
  */
5978
5981
  addAdjustmentLayer(init, index) {
5979
5982
  const spec = typeof init === "string" ? { kind: init } : init;
5980
- const ids = new Set(_chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5981
- const layer = _chunkGLOOH65Ycjs.createAdjustmentLayer.call(void 0, spec.kind, {
5983
+ const ids = new Set(_chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5984
+ const layer = _chunk4PUPGALMcjs.createAdjustmentLayer.call(void 0, spec.kind, {
5982
5985
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
5983
5986
  name: spec.name,
5984
5987
  params: spec.params,
@@ -5987,10 +5990,10 @@ var ImageEditorController = (_class6 = class {
5987
5990
  blend: spec.blend,
5988
5991
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
5989
5992
  });
5990
- while (ids.has(layer.id)) layer.id = _chunkGLOOH65Ycjs.newLayerId.call(void 0, "adj");
5993
+ while (ids.has(layer.id)) layer.id = _chunk4PUPGALMcjs.newLayerId.call(void 0, "adj");
5991
5994
  const { width, height } = this.naturalSize;
5992
5995
  this.recordHistory();
5993
- const node = _chunkGLOOH65Ycjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
5996
+ const node = _chunk4PUPGALMcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
5994
5997
  const positioned = Boolean(spec.aboveId || spec.parentId);
5995
5998
  this.state.layers = this.placeLayer(this.state.layers, node, {
5996
5999
  aboveId: spec.aboveId,
@@ -6006,11 +6009,11 @@ var ImageEditorController = (_class6 = class {
6006
6009
  * Returns false for an unknown id.
6007
6010
  */
6008
6011
  updateAdjustmentLayer(id, update, commitToHistory = true) {
6009
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, this.state.layers, id);
6012
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, this.state.layers, id);
6010
6013
  if (!loc || loc.layer.type !== "adjustment") return false;
6011
6014
  const { width, height } = this.naturalSize;
6012
6015
  const node = loc.layer;
6013
- const merged = _chunkGLOOH65Ycjs.normalizeAdjustmentLayer.call(void 0, {
6016
+ const merged = _chunk4PUPGALMcjs.normalizeAdjustmentLayer.call(void 0, {
6014
6017
  id: node.id,
6015
6018
  kind: node.kind,
6016
6019
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -6030,20 +6033,20 @@ var ImageEditorController = (_class6 = class {
6030
6033
  params: merged.params
6031
6034
  };
6032
6035
  if (update.mask !== void 0) {
6033
- const mask = update.mask ? _chunkGLOOH65Ycjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6036
+ const mask = update.mask ? _chunk4PUPGALMcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6034
6037
  if (mask) next.mask = mask;
6035
6038
  else delete next.mask;
6036
6039
  }
6037
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => next);
6040
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => next);
6038
6041
  this.notify();
6039
6042
  return true;
6040
6043
  }
6041
6044
  /** Removes a layer as one undo step. Returns false for an unknown id. */
6042
6045
  removeAdjustmentLayer(id) {
6043
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, this.state.layers, id);
6046
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, this.state.layers, id);
6044
6047
  if (!loc || loc.layer.type !== "adjustment") return false;
6045
6048
  this.recordHistory();
6046
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => null);
6049
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => null);
6047
6050
  if (this.state.activeLayerId === id) this.state.activeLayerId = null;
6048
6051
  this.notify();
6049
6052
  return true;
@@ -6056,9 +6059,9 @@ var ImageEditorController = (_class6 = class {
6056
6059
  if (to === from) return layers;
6057
6060
  const node = nodes[from];
6058
6061
  const anchor = nodes[to];
6059
- const without = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, id, () => null);
6060
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, without, anchor.id);
6061
- return _chunkLL3RAN55cjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _233 => _233.parent, 'optionalAccess', _234 => _234.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
6062
+ const without = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, id, () => null);
6063
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, without, anchor.id);
6064
+ return _chunkDFFBJV3Ucjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _233 => _233.parent, 'optionalAccess', _234 => _234.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
6062
6065
  }
6063
6066
  /** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
6064
6067
  moveAdjustmentLayer(id, toIndex) {
@@ -6083,7 +6086,7 @@ var ImageEditorController = (_class6 = class {
6083
6086
  if (!nodes.length) return;
6084
6087
  this.recordHistory();
6085
6088
  let layers = this.state.layers;
6086
- for (const n of nodes) layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, n.id, () => null);
6089
+ for (const n of nodes) layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, n.id, () => null);
6087
6090
  this.state.layers = layers;
6088
6091
  if (nodes.some((n) => n.id === this.state.activeLayerId)) this.state.activeLayerId = null;
6089
6092
  this.notify();
@@ -6117,8 +6120,8 @@ var ImageEditorController = (_class6 = class {
6117
6120
  const { width, height } = this.naturalSize;
6118
6121
  let next = null;
6119
6122
  if (mask) {
6120
- const sized = mask.width === width && mask.height === height ? mask : _chunkGLOOH65Ycjs.resizeSelection.call(void 0, mask, width, height);
6121
- next = _chunkGLOOH65Ycjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6123
+ const sized = mask.width === width && mask.height === height ? mask : _chunk4PUPGALMcjs.resizeSelection.call(void 0, mask, width, height);
6124
+ next = _chunk4PUPGALMcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6122
6125
  } else if (mode !== "replace") {
6123
6126
  return false;
6124
6127
  }
@@ -6132,7 +6135,7 @@ var ImageEditorController = (_class6 = class {
6132
6135
  /** Select › All. */
6133
6136
  selectAll() {
6134
6137
  const { width, height } = this.naturalSize;
6135
- return this.setSelection(_chunkGLOOH65Ycjs.fullSelection.call(void 0, width, height));
6138
+ return this.setSelection(_chunk4PUPGALMcjs.fullSelection.call(void 0, width, height));
6136
6139
  }
6137
6140
  /** Select › Deselect. */
6138
6141
  deselect() {
@@ -6141,11 +6144,11 @@ var ImageEditorController = (_class6 = class {
6141
6144
  /** Select › Inverse (with nothing selected, selects everything). */
6142
6145
  invertSelection() {
6143
6146
  const { width, height } = this.naturalSize;
6144
- const current = _nullishCoalesce(this.state.selection, () => ( _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, width, height)));
6145
- return this.setSelection(_chunkGLOOH65Ycjs.invertSelection.call(void 0, current));
6147
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunk4PUPGALMcjs.createSelectionMask.call(void 0, width, height)));
6148
+ return this.setSelection(_chunk4PUPGALMcjs.invertSelection.call(void 0, current));
6146
6149
  }
6147
6150
  shapeCommand(mask, options) {
6148
- const shaped = options.feather && options.feather > 0 ? _chunkGLOOH65Ycjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6151
+ const shaped = options.feather && options.feather > 0 ? _chunk4PUPGALMcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6149
6152
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
6150
6153
  }
6151
6154
  /** Rectangular marquee in natural image pixels. */
@@ -6199,11 +6202,11 @@ var ImageEditorController = (_class6 = class {
6199
6202
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
6200
6203
  return null;
6201
6204
  }
6202
- const legacy = _chunkGLOOH65Ycjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6205
+ const legacy = _chunk4PUPGALMcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6203
6206
  if (options.sample === "active-layer") {
6204
6207
  const layer = this.getActiveLayer();
6205
6208
  if (!layer || layer.type !== "pixel") {
6206
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6209
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6207
6210
  }
6208
6211
  const surface = layer.source === "document" && options.pixels ? _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
6209
6212
  return { width, height, data: _chunk7ISPWEJAcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -6212,7 +6215,7 @@ var ImageEditorController = (_class6 = class {
6212
6215
  this.syncViews();
6213
6216
  if (legacy && !options.pixels) {
6214
6217
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
6215
- _chunkGLOOH65Ycjs.applyAdjustments.call(void 0, copy, _chunkGLOOH65Ycjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6218
+ _chunk4PUPGALMcjs.applyAdjustments.call(void 0, copy, _chunk4PUPGALMcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6216
6219
  return copy;
6217
6220
  }
6218
6221
  const pixels = options.pixels;
@@ -6224,7 +6227,7 @@ var ImageEditorController = (_class6 = class {
6224
6227
  };
6225
6228
  const stack = withoutAnnotations(this.state.layers);
6226
6229
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
6227
- const data = new (0, _chunkGLOOH65Ycjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6230
+ const data = new (0, _chunk4PUPGALMcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6228
6231
  return { width, height, data };
6229
6232
  }
6230
6233
  async requirePixels(options) {
@@ -6251,7 +6254,7 @@ var ImageEditorController = (_class6 = class {
6251
6254
  modifySelection(op, radius) {
6252
6255
  const sel = this.state.selection;
6253
6256
  if (!_optionalChain([sel, 'optionalAccess', _240 => _240.bounds])) return false;
6254
- return this.setSelection(_chunkGLOOH65Ycjs.modifySelection.call(void 0, sel, op, radius));
6257
+ return this.setSelection(_chunk4PUPGALMcjs.modifySelection.call(void 0, sel, op, radius));
6255
6258
  }
6256
6259
  /**
6257
6260
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -6282,7 +6285,7 @@ var ImageEditorController = (_class6 = class {
6282
6285
  } else {
6283
6286
  pixels = source;
6284
6287
  }
6285
- this.setSelection(_chunkGLOOH65Ycjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6288
+ this.setSelection(_chunk4PUPGALMcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6286
6289
  return this.getSelection();
6287
6290
  }
6288
6291
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -6294,7 +6297,7 @@ var ImageEditorController = (_class6 = class {
6294
6297
  // --- Layer masks ---
6295
6298
  maskFromSelection(sel, props = {}) {
6296
6299
  const { width, height } = this.naturalSize;
6297
- const sized = sel.width === width && sel.height === height ? sel : _chunkGLOOH65Ycjs.resizeSelection.call(void 0, sel, width, height);
6300
+ const sized = sel.width === width && sel.height === height ? sel : _chunk4PUPGALMcjs.resizeSelection.call(void 0, sel, width, height);
6298
6301
  const mask = { surface: _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
6299
6302
  return withMaskProps(mask, props);
6300
6303
  }
@@ -6308,10 +6311,10 @@ var ImageEditorController = (_class6 = class {
6308
6311
  return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
6309
6312
  }
6310
6313
  setLayerMask(layerId, mask, commitToHistory = true) {
6311
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, this.state.layers, layerId);
6314
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, this.state.layers, layerId);
6312
6315
  if (!loc) return false;
6313
6316
  if (commitToHistory) this.recordHistory();
6314
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
6317
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
6315
6318
  const next = { ...l };
6316
6319
  if (mask) next.mask = mask;
6317
6320
  else delete next.mask;
@@ -6340,7 +6343,7 @@ var ImageEditorController = (_class6 = class {
6340
6343
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6341
6344
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
6342
6345
  const data = _chunk7ISPWEJAcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
6343
- const sel = _chunkGLOOH65Ycjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6346
+ const sel = _chunk4PUPGALMcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6344
6347
  return this.setSelection(sel, mode);
6345
6348
  }
6346
6349
  // --- Histogram ---
@@ -6368,11 +6371,11 @@ var ImageEditorController = (_class6 = class {
6368
6371
  if (target) {
6369
6372
  const merged = { ...this.state.depthMask, ...partial };
6370
6373
  merged.depthRange = [...merged.depthRange];
6371
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6374
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6372
6375
  const next = { ...l };
6373
- if (_chunkGLOOH65Ycjs.isDefaultDepthMask.call(void 0, merged)) {
6376
+ if (_chunk4PUPGALMcjs.isDefaultDepthMask.call(void 0, merged)) {
6374
6377
  if (_optionalChain([next, 'access', _246 => _246.mask, 'optionalAccess', _247 => _247.source])) delete next.mask;
6375
- } else next.mask = _chunkGLOOH65Ycjs.depthRasterMask.call(void 0, merged);
6378
+ } else next.mask = _chunk4PUPGALMcjs.depthRasterMask.call(void 0, merged);
6376
6379
  return next;
6377
6380
  });
6378
6381
  }
@@ -6382,7 +6385,7 @@ var ImageEditorController = (_class6 = class {
6382
6385
  this.recordHistory();
6383
6386
  const target = this.developLayer();
6384
6387
  if (_optionalChain([target, 'optionalAccess', _248 => _248.mask, 'optionalAccess', _249 => _249.source])) {
6385
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6388
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6386
6389
  const next = { ...l };
6387
6390
  delete next.mask;
6388
6391
  return next;
@@ -6393,7 +6396,7 @@ var ImageEditorController = (_class6 = class {
6393
6396
  // --- Annotations & Layers ---
6394
6397
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
6395
6398
  annotationLayer(id) {
6396
- return _chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkGLOOH65Ycjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _250 => _250.id]) === id);
6399
+ return _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunk4PUPGALMcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _250 => _250.id]) === id);
6397
6400
  }
6398
6401
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
6399
6402
  annotationEnv() {
@@ -6409,9 +6412,9 @@ var ImageEditorController = (_class6 = class {
6409
6412
  this.recordHistory();
6410
6413
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
6411
6414
  const fullAnnotation = { ...annotation, id };
6412
- const layer = _chunkGLOOH65Ycjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
6413
- const loc = placement.aboveId ? _chunkLL3RAN55cjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
6414
- this.state.layers = loc ? _chunkLL3RAN55cjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _251 => _251.parent, 'optionalAccess', _252 => _252.id]), () => ( null)), loc.index + 1) : _chunkLL3RAN55cjs.insertLayer.call(void 0, this.state.layers, layer, null);
6415
+ const layer = _chunk4PUPGALMcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
6416
+ const loc = placement.aboveId ? _chunkDFFBJV3Ucjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
6417
+ this.state.layers = loc ? _chunkDFFBJV3Ucjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _251 => _251.parent, 'optionalAccess', _252 => _252.id]), () => ( null)), loc.index + 1) : _chunkDFFBJV3Ucjs.insertLayer.call(void 0, this.state.layers, layer, null);
6415
6418
  this.state.selectedAnnotationId = id;
6416
6419
  this.notify();
6417
6420
  return id;
@@ -6421,17 +6424,17 @@ var ImageEditorController = (_class6 = class {
6421
6424
  this.recordHistory();
6422
6425
  }
6423
6426
  const layer = this.annotationLayer(id);
6424
- const current = layer ? _chunkGLOOH65Ycjs.annotationOfLayer.call(void 0, layer) : null;
6427
+ const current = layer ? _chunk4PUPGALMcjs.annotationOfLayer.call(void 0, layer) : null;
6425
6428
  if (layer && current) {
6426
6429
  const annotation = { ...current, ...partial, id };
6427
- const name = layer.name === _chunkGLOOH65Ycjs.annotationLayerName.call(void 0, current) ? _chunkGLOOH65Ycjs.annotationLayerName.call(void 0, annotation) : layer.name;
6428
- this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
6430
+ const name = layer.name === _chunk4PUPGALMcjs.annotationLayerName.call(void 0, current) ? _chunk4PUPGALMcjs.annotationLayerName.call(void 0, annotation) : layer.name;
6431
+ this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
6429
6432
  }
6430
6433
  this.notify();
6431
6434
  }
6432
6435
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
6433
6436
  layerForAnnotation(layer, annotation, name) {
6434
- const fresh = _chunkGLOOH65Ycjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
6437
+ const fresh = _chunk4PUPGALMcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
6435
6438
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
6436
6439
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
6437
6440
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -6441,7 +6444,7 @@ var ImageEditorController = (_class6 = class {
6441
6444
  removeAnnotation(id) {
6442
6445
  this.recordHistory();
6443
6446
  const layer = this.annotationLayer(id);
6444
- if (layer) this.state.layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, layer.id, () => null);
6447
+ if (layer) this.state.layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, layer.id, () => null);
6445
6448
  if (this.state.selectedAnnotationId === id) {
6446
6449
  this.state.selectedAnnotationId = null;
6447
6450
  }
@@ -6451,7 +6454,7 @@ var ImageEditorController = (_class6 = class {
6451
6454
  clearAnnotations() {
6452
6455
  this.recordHistory();
6453
6456
  let layers = this.state.layers;
6454
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, l.id, () => null);
6457
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, l.id, () => null);
6455
6458
  this.state.layers = layers;
6456
6459
  this.state.selectedAnnotationId = null;
6457
6460
  this.notify();
@@ -6530,7 +6533,7 @@ var ImageEditorController = (_class6 = class {
6530
6533
  this.syncViews();
6531
6534
  if (_optionalChain([options, 'optionalAccess', _253 => _253.layerIds])) {
6532
6535
  const keep = new Set(options.layerIds);
6533
- const layers = _chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
6536
+ const layers = _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
6534
6537
  return this.renderer.renderExport(source, { ...this.state, layers }, options);
6535
6538
  }
6536
6539
  return this.renderer.renderExport(source, this.state, options);
@@ -6661,10 +6664,10 @@ var ImageEditorController = (_class6 = class {
6661
6664
  /** No source image, and no layer reading one (an opened PSD): the layers are the whole document. */
6662
6665
  isSourceless() {
6663
6666
  if (this.imageElement || this.state.sourceUrl || !this.state.layers.length) return false;
6664
- return !_chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).some((l) => l.type === "pixel" && l.source === "document");
6667
+ return !_chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).some((l) => l.type === "pixel" && l.source === "document");
6665
6668
  }
6666
6669
  get isMultiLayer() {
6667
- return _chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" || l.type === "group").length > 1;
6670
+ return _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" || l.type === "group").length > 1;
6668
6671
  }
6669
6672
  /**
6670
6673
  * Applies an inpainted result (natural image space, see `toSourceDataURL`) as ONE undoable step.
@@ -6699,8 +6702,8 @@ var ImageEditorController = (_class6 = class {
6699
6702
  return;
6700
6703
  }
6701
6704
  const target = this.developLayer();
6702
- if (!target) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("There is no pixel layer to mask.");
6703
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, target, "all", "mask it");
6705
+ if (!target) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("There is no pixel layer to mask.");
6706
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, target, "all", "mask it");
6704
6707
  const { width, height } = this.naturalSize;
6705
6708
  let px2 = await this.decodeImage(newDataUrl);
6706
6709
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -6708,7 +6711,7 @@ var ImageEditorController = (_class6 = class {
6708
6711
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
6709
6712
  let surface = _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
6710
6713
  if (target.offset.x || target.offset.y) surface = _chunk7ISPWEJAcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
6711
- this.commitLayers(_chunkGLOOH65Ycjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
6714
+ this.commitLayers(_chunk4PUPGALMcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
6712
6715
  return target.id;
6713
6716
  }
6714
6717
  // --- Type layers ---
@@ -6732,7 +6735,7 @@ var ImageEditorController = (_class6 = class {
6732
6735
  return _nullishCoalesce(_optionalChain([this, 'access', _257 => _257.getTextShaper, 'call', _258 => _258(), 'optionalAccess', _259 => _259.families, 'optionalCall', _260 => _260()]), () => ( ["sans-serif", "serif", "monospace"]));
6733
6736
  }
6734
6737
  typeInfo(id) {
6735
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6738
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6736
6739
  const ranges = (runs) => {
6737
6740
  let at = 0;
6738
6741
  return runs.map((r) => {
@@ -6775,25 +6778,25 @@ var ImageEditorController = (_class6 = class {
6775
6778
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
6776
6779
  */
6777
6780
  addTextLayer(init) {
6778
- const text = _chunkGLOOH65Ycjs.normalizeText.call(void 0, init.text);
6779
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("x and y must be numbers (document pixels).");
6780
- const style = _chunkGLOOH65Ycjs.patchTextStyle.call(void 0, { ..._chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
6781
- const paragraph = _chunkGLOOH65Ycjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
6781
+ const text = _chunk4PUPGALMcjs.normalizeText.call(void 0, init.text);
6782
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("x and y must be numbers (document pixels).");
6783
+ const style = _chunk4PUPGALMcjs.patchTextStyle.call(void 0, { ..._chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
6784
+ const paragraph = _chunk4PUPGALMcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
6782
6785
  let frame = { kind: "point" };
6783
6786
  if (init.box) {
6784
6787
  const { width, height } = init.box;
6785
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
6788
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
6786
6789
  frame = { kind: "box", width, height };
6787
6790
  }
6788
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("rotation must be a number of degrees.");
6789
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("opacity must be between 0 and 1.");
6790
- if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
6791
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("rotation must be a number of degrees.");
6792
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("opacity must be between 0 and 1.");
6793
+ if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
6791
6794
  const t = [1, 0, 0, 1, init.x, init.y];
6792
6795
  const transform = init.rotation ? _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, t, _chunkVYW7JBTMcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
6793
- const layer = _chunkGLOOH65Ycjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkGLOOH65Ycjs.typeLayerName.call(void 0, text))) }, this.textEnv());
6796
+ const layer = _chunk4PUPGALMcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunk4PUPGALMcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
6794
6797
  if (init.opacity !== void 0) layer.opacity = init.opacity;
6795
6798
  if (init.blend !== void 0) layer.blend = init.blend;
6796
- const next = _chunkGLOOH65Ycjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6799
+ const next = _chunk4PUPGALMcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6797
6800
  this.commitLayers(next, () => {
6798
6801
  this.state.activeLayerId = layer.id;
6799
6802
  this.state.activeTarget = "pixels";
@@ -6805,28 +6808,28 @@ var ImageEditorController = (_class6 = class {
6805
6808
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
6806
6809
  */
6807
6810
  setText(id, text, range = {}, commitToHistory = true) {
6808
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6809
- const insert = _chunkGLOOH65Ycjs.normalizeText.call(void 0, text);
6810
- const [start, end] = _chunkGLOOH65Ycjs.textRange.call(void 0, layer.text, range.start, range.end);
6811
- const { layers } = _chunkGLOOH65Ycjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkGLOOH65Ycjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
6811
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6812
+ const insert = _chunk4PUPGALMcjs.normalizeText.call(void 0, text);
6813
+ const [start, end] = _chunk4PUPGALMcjs.textRange.call(void 0, layer.text, range.start, range.end);
6814
+ const { layers } = _chunk4PUPGALMcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunk4PUPGALMcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
6812
6815
  this.commitLayers(layers, void 0, commitToHistory);
6813
6816
  return this.typeInfo(id);
6814
6817
  }
6815
6818
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
6816
6819
  setTextStyle(id, style, range = {}, commitToHistory = true) {
6817
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6818
- const [start, end] = _chunkGLOOH65Ycjs.textRange.call(void 0, layer.text, range.start, range.end);
6819
- if (!Object.keys(style).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give at least one style field to set.");
6820
- _chunkGLOOH65Ycjs.patchTextStyle.call(void 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, style);
6821
- const { layers } = _chunkGLOOH65Ycjs.updateTypeLayer.call(void 0,
6820
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6821
+ const [start, end] = _chunk4PUPGALMcjs.textRange.call(void 0, layer.text, range.start, range.end);
6822
+ if (!Object.keys(style).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give at least one style field to set.");
6823
+ _chunk4PUPGALMcjs.patchTextStyle.call(void 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, style);
6824
+ const { layers } = _chunk4PUPGALMcjs.updateTypeLayer.call(void 0,
6822
6825
  this.state.layers,
6823
6826
  id,
6824
6827
  (l) => {
6825
6828
  if (start === end) {
6826
- if (l.text.length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
6827
- return { runs: [{ length: 0, style: _chunkGLOOH65Ycjs.patchTextStyle.call(void 0, _chunkVYW7JBTMcjs.styleAt.call(void 0, l.runs, 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE), style) }] };
6829
+ if (l.text.length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
6830
+ return { runs: [{ length: 0, style: _chunk4PUPGALMcjs.patchTextStyle.call(void 0, _chunkVYW7JBTMcjs.styleAt.call(void 0, l.runs, 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE), style) }] };
6828
6831
  }
6829
- return { runs: _chunkVYW7JBTMcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkGLOOH65Ycjs.patchTextStyle.call(void 0, s, style)) };
6832
+ return { runs: _chunkVYW7JBTMcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunk4PUPGALMcjs.patchTextStyle.call(void 0, s, style)) };
6830
6833
  },
6831
6834
  this.textEnv(),
6832
6835
  "restyle its text"
@@ -6836,11 +6839,11 @@ var ImageEditorController = (_class6 = class {
6836
6839
  }
6837
6840
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
6838
6841
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
6839
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6840
- const [start, end] = _chunkGLOOH65Ycjs.textRange.call(void 0, layer.text, range.start, range.end);
6841
- if (!Object.keys(style).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give at least one paragraph field to set.");
6842
- _chunkGLOOH65Ycjs.patchParagraphStyle.call(void 0, {}, style);
6843
- const { layers } = _chunkGLOOH65Ycjs.updateTypeLayer.call(void 0,
6842
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6843
+ const [start, end] = _chunk4PUPGALMcjs.textRange.call(void 0, layer.text, range.start, range.end);
6844
+ if (!Object.keys(style).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give at least one paragraph field to set.");
6845
+ _chunk4PUPGALMcjs.patchParagraphStyle.call(void 0, {}, style);
6846
+ const { layers } = _chunk4PUPGALMcjs.updateTypeLayer.call(void 0,
6844
6847
  this.state.layers,
6845
6848
  id,
6846
6849
  (l) => {
@@ -6849,7 +6852,7 @@ var ImageEditorController = (_class6 = class {
6849
6852
  const a = at;
6850
6853
  at += p.length;
6851
6854
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
6852
- return touches || !l.text.length ? { length: p.length, style: _chunkGLOOH65Ycjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
6855
+ return touches || !l.text.length ? { length: p.length, style: _chunk4PUPGALMcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
6853
6856
  });
6854
6857
  return { paragraphs };
6855
6858
  },
@@ -6865,21 +6868,21 @@ var ImageEditorController = (_class6 = class {
6865
6868
  * paragraph. Also resizes a box. One undo step.
6866
6869
  */
6867
6870
  setTextFrame(id, frame, commitToHistory = true) {
6868
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6869
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("width and height must be at least 1 pixel.");
6870
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("kind must be point or box.");
6871
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6872
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("width and height must be at least 1 pixel.");
6873
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("kind must be point or box.");
6871
6874
  const shaper = this.getTextShaper();
6872
- const { layers } = _chunkGLOOH65Ycjs.updateTypeLayer.call(void 0,
6875
+ const { layers } = _chunk4PUPGALMcjs.updateTypeLayer.call(void 0,
6873
6876
  this.state.layers,
6874
6877
  id,
6875
6878
  (l) => {
6876
6879
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
6877
- if (!shaper) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
6880
+ if (!shaper) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
6878
6881
  const lines = _chunkVYW7JBTMcjs.layoutText.call(void 0, l, shaper).lines;
6879
6882
  const first = lines[0];
6880
6883
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
6881
6884
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
6882
- const m = _chunkGLOOH65Ycjs.textMatrix.call(void 0, l);
6885
+ const m = _chunk4PUPGALMcjs.textMatrix.call(void 0, l);
6883
6886
  const shifted = [m[0], m[1], m[2], m[3], m[0] * dx + m[2] * dy + m[4], m[1] * dx + m[3] * dy + m[5]];
6884
6887
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
6885
6888
  return { frame: nextFrame, transform: shifted };
@@ -6896,13 +6899,13 @@ var ImageEditorController = (_class6 = class {
6896
6899
  * `warnings` says when other colours were dropped. One undo step.
6897
6900
  */
6898
6901
  convertTextToShape(id) {
6899
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6900
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "all", "convert it");
6902
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6903
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
6901
6904
  const shaper = this.getTextShaper();
6902
- if (!shaper) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
6903
- const parts = _chunkGLOOH65Ycjs.textOutlines.call(void 0, layer, shaper);
6905
+ if (!shaper) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
6906
+ const parts = _chunk4PUPGALMcjs.textOutlines.call(void 0, layer, shaper);
6904
6907
  const subpaths = parts.flatMap((p) => _chunkVYW7JBTMcjs.bezierToSubpaths.call(void 0, p.path));
6905
- if (!subpaths.length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
6908
+ if (!subpaths.length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
6906
6909
  const warnings = [];
6907
6910
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
6908
6911
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
@@ -6910,31 +6913,31 @@ var ImageEditorController = (_class6 = class {
6910
6913
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
6911
6914
  const first = _nullishCoalesce(_optionalChain([layer, 'access', _261 => _261.runs, 'access', _262 => _262.find, 'call', _263 => _263((r) => r.length > 0), 'optionalAccess', _264 => _264.style]), () => ( _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE));
6912
6915
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
6913
- const shape = _chunkGLOOH65Ycjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
6916
+ const shape = _chunk4PUPGALMcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
6914
6917
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
6915
6918
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
6916
- this.commitLayers(_chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
6919
+ this.commitLayers(_chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
6917
6920
  return { layerId: id, warnings };
6918
6921
  }
6919
6922
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
6920
6923
  getTextLayout(id) {
6921
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6924
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6922
6925
  const shaper = this.getTextShaper();
6923
6926
  return shaper ? _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper) : null;
6924
6927
  }
6925
6928
  /** The text index nearest a document point (for clicks on a type layer). */
6926
6929
  textIndexAt(id, point) {
6927
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6930
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6928
6931
  const layout = this.getTextLayout(id);
6929
- return layout ? _chunkVYW7JBTMcjs.textIndexAt.call(void 0, layout, _chunkGLOOH65Ycjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
6932
+ return layout ? _chunkVYW7JBTMcjs.textIndexAt.call(void 0, layout, _chunk4PUPGALMcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
6930
6933
  }
6931
6934
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
6932
6935
  textCaret(id, index) {
6933
- const layer = _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, this.state.layers, id);
6936
+ const layer = _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6934
6937
  const layout = this.getTextLayout(id);
6935
6938
  if (!layout) return null;
6936
6939
  const c = _chunkVYW7JBTMcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
6937
- const m = _chunkGLOOH65Ycjs.textMatrix.call(void 0, layer);
6940
+ const m = _chunk4PUPGALMcjs.textMatrix.call(void 0, layer);
6938
6941
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
6939
6942
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
6940
6943
  }
@@ -6945,14 +6948,14 @@ var ImageEditorController = (_class6 = class {
6945
6948
  }
6946
6949
  /** One component from tool or UI input (validated). */
6947
6950
  componentFrom(spec, path) {
6948
- const op = _chunkGLOOH65Ycjs.requireOperation.call(void 0, spec.op, `${path}op`);
6949
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
6950
- if (spec.shape !== void 0) return _chunkGLOOH65Ycjs.liveComponent.call(void 0, _chunkGLOOH65Ycjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
6951
- if (spec.subpaths !== void 0) return { op, subpaths: _chunkGLOOH65Ycjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
6952
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
6951
+ const op = _chunk4PUPGALMcjs.requireOperation.call(void 0, spec.op, `${path}op`);
6952
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
6953
+ if (spec.shape !== void 0) return _chunk4PUPGALMcjs.liveComponent.call(void 0, _chunk4PUPGALMcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
6954
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunk4PUPGALMcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
6955
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
6953
6956
  }
6954
6957
  shapeInfo(id) {
6955
- const layer = _chunkGLOOH65Ycjs.requireShapeLayer.call(void 0, this.state.layers, id);
6958
+ const layer = _chunk4PUPGALMcjs.requireShapeLayer.call(void 0, this.state.layers, id);
6956
6959
  const r = (n) => Math.round(n * 1e3) / 1e3;
6957
6960
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
6958
6961
  const info = {
@@ -6963,12 +6966,12 @@ var ImageEditorController = (_class6 = class {
6963
6966
  op: c.op,
6964
6967
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
6965
6968
  subpaths: _chunkVYW7JBTMcjs.roundSubpaths.call(void 0, c.subpaths),
6966
- bounds: box(_chunkGLOOH65Ycjs.shapeGeometryBounds.call(void 0, { components: [c] }))
6969
+ bounds: box(_chunk4PUPGALMcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
6967
6970
  })),
6968
6971
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
6969
6972
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
6970
6973
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
6971
- geometryBounds: box(_chunkGLOOH65Ycjs.shapeGeometryBounds.call(void 0, layer)),
6974
+ geometryBounds: box(_chunk4PUPGALMcjs.shapeGeometryBounds.call(void 0, layer)),
6972
6975
  bounds: this.getLayerBounds(id)
6973
6976
  };
6974
6977
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -6985,17 +6988,17 @@ var ImageEditorController = (_class6 = class {
6985
6988
  */
6986
6989
  addShapeLayer(init) {
6987
6990
  const specs = _optionalChain([init, 'access', _269 => _269.components, 'optionalAccess', _270 => _270.length]) ? init.components : [init];
6988
- if (_optionalChain([init, 'access', _271 => _271.components, 'optionalAccess', _272 => _272.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
6991
+ if (_optionalChain([init, 'access', _271 => _271.components, 'optionalAccess', _272 => _272.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
6989
6992
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _273 => _273.components, 'optionalAccess', _274 => _274.length]) ? `components[${i}].` : ""));
6990
- const stroke = init.stroke ? _chunkGLOOH65Ycjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
6993
+ const stroke = init.stroke ? _chunk4PUPGALMcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
6991
6994
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
6992
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkGLOOH65Ycjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkGLOOH65Ycjs.normalizeShapePaint.call(void 0, init.fill, "fill");
6993
- if (!fill && !stroke) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
6994
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
6995
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("opacity must be between 0 and 1.");
6996
- if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
6997
- const layer = _chunkGLOOH65Ycjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
6998
- const next = _chunkGLOOH65Ycjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6995
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunk4PUPGALMcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunk4PUPGALMcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
6996
+ if (!fill && !stroke) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
6997
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
6998
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("opacity must be between 0 and 1.");
6999
+ if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7000
+ const layer = _chunk4PUPGALMcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7001
+ const next = _chunk4PUPGALMcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6999
7002
  this.commitLayers(next, () => {
7000
7003
  this.state.activeLayerId = layer.id;
7001
7004
  this.state.activeTarget = "pixels";
@@ -7008,18 +7011,18 @@ var ImageEditorController = (_class6 = class {
7008
7011
  * only those settings of the current stroke. Returns the shape.
7009
7012
  */
7010
7013
  setShapeStyle(id, changes, commitToHistory = true) {
7011
- const layer = _chunkGLOOH65Ycjs.requireShapeLayer.call(void 0, this.state.layers, id);
7012
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkGLOOH65Ycjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7013
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkGLOOH65Ycjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7014
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7014
+ const layer = _chunk4PUPGALMcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7015
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunk4PUPGALMcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7016
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunk4PUPGALMcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7017
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7015
7018
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
7016
- const { layers } = _chunkGLOOH65Ycjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7019
+ const { layers } = _chunk4PUPGALMcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7017
7020
  this.commitLayers(layers, void 0, commitToHistory);
7018
7021
  return this.shapeInfo(id);
7019
7022
  }
7020
7023
  componentIndex(layer, index) {
7021
7024
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
7022
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7025
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7023
7026
  }
7024
7027
  return index;
7025
7028
  }
@@ -7029,36 +7032,36 @@ var ImageEditorController = (_class6 = class {
7029
7032
  * the live shape) or its operation. Returns the shape.
7030
7033
  */
7031
7034
  setShapeComponent(id, index, change, commitToHistory = true) {
7032
- const layer = _chunkGLOOH65Ycjs.requireShapeLayer.call(void 0, this.state.layers, id);
7035
+ const layer = _chunk4PUPGALMcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7033
7036
  const i = this.componentIndex(layer, index);
7034
7037
  const current = layer.components[i];
7035
7038
  let shape = change.shape;
7036
7039
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
7037
7040
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
7038
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkGLOOH65Ycjs.requireOperation.call(void 0, change.op) };
7041
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunk4PUPGALMcjs.requireOperation.call(void 0, change.op) };
7039
7042
  const components = layer.components.map((c, k) => k === i ? next : c);
7040
- const { layers } = _chunkGLOOH65Ycjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7043
+ const { layers } = _chunk4PUPGALMcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7041
7044
  this.commitLayers(layers, void 0, commitToHistory);
7042
7045
  return this.shapeInfo(id);
7043
7046
  }
7044
7047
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
7045
7048
  addShapeComponent(id, spec, index) {
7046
- const layer = _chunkGLOOH65Ycjs.requireShapeLayer.call(void 0, this.state.layers, id);
7049
+ const layer = _chunk4PUPGALMcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7047
7050
  const c = this.componentFrom(spec, "");
7048
7051
  const at = index === void 0 ? layer.components.length : index;
7049
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7052
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7050
7053
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
7051
- const { layers } = _chunkGLOOH65Ycjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7054
+ const { layers } = _chunk4PUPGALMcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7052
7055
  this.commitLayers(layers);
7053
7056
  return this.shapeInfo(id);
7054
7057
  }
7055
7058
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
7056
7059
  removeShapeComponent(id, index) {
7057
- const layer = _chunkGLOOH65Ycjs.requireShapeLayer.call(void 0, this.state.layers, id);
7060
+ const layer = _chunk4PUPGALMcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7058
7061
  const i = this.componentIndex(layer, index);
7059
- if (layer.components.length === 1) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7062
+ if (layer.components.length === 1) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7060
7063
  const components = layer.components.filter((_, k) => k !== i);
7061
- const { layers } = _chunkGLOOH65Ycjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7064
+ const { layers } = _chunk4PUPGALMcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7062
7065
  this.commitLayers(layers);
7063
7066
  return this.shapeInfo(id);
7064
7067
  }
@@ -7067,10 +7070,10 @@ var ImageEditorController = (_class6 = class {
7067
7070
  * shapes become paths), as one undo step. Returns the shape.
7068
7071
  */
7069
7072
  mergeShapeComponents(id) {
7070
- const layer = _chunkGLOOH65Ycjs.requireShapeLayer.call(void 0, this.state.layers, id);
7071
- if (layer.components.length < 2) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7072
- const components = _chunkGLOOH65Ycjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7073
- const { layers } = _chunkGLOOH65Ycjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7073
+ const layer = _chunk4PUPGALMcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7074
+ if (layer.components.length < 2) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7075
+ const components = _chunk4PUPGALMcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7076
+ const { layers } = _chunk4PUPGALMcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7074
7077
  this.commitLayers(layers);
7075
7078
  return this.shapeInfo(id);
7076
7079
  }
@@ -7080,8 +7083,8 @@ var ImageEditorController = (_class6 = class {
7080
7083
  * step. Returns the layer id.
7081
7084
  */
7082
7085
  async rasterizeLayer(id) {
7083
- const layer = _chunkGLOOH65Ycjs.requireLayer.call(void 0, this.state.layers, id).layer;
7084
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7086
+ const layer = _chunk4PUPGALMcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7087
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7085
7088
  const { width, height } = this.naturalSize;
7086
7089
  const canvas = { x: 0, y: 0, width, height };
7087
7090
  let next;
@@ -7097,8 +7100,8 @@ var ImageEditorController = (_class6 = class {
7097
7100
  if (layer.locks) next.locks = layer.locks;
7098
7101
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
7099
7102
  } else if (layer.type === "pixel") {
7100
- if (!_optionalChain([layer, 'access', _275 => _275.filters, 'optionalAccess', _276 => _276.length])) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7101
- _chunkGLOOH65Ycjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7103
+ if (!_optionalChain([layer, 'access', _275 => _275.filters, 'optionalAccess', _276 => _276.length])) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7104
+ _chunk4PUPGALMcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7102
7105
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
7103
7106
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
7104
7107
  delete content.mask;
@@ -7115,12 +7118,12 @@ var ImageEditorController = (_class6 = class {
7115
7118
  } else if (layer.type === "smart") {
7116
7119
  return this.rasterizeSmartObject(id);
7117
7120
  } else if (layer.type === "shape" || layer.type === "type") {
7118
- next = layer.type === "shape" ? _chunkGLOOH65Ycjs.shapeAsPixelLayer.call(void 0, layer) : _chunkGLOOH65Ycjs.typeAsPixelLayer.call(void 0, layer);
7121
+ next = layer.type === "shape" ? _chunk4PUPGALMcjs.shapeAsPixelLayer.call(void 0, layer) : _chunk4PUPGALMcjs.typeAsPixelLayer.call(void 0, layer);
7119
7122
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _277 => _277.annotation, 'optionalAccess', _278 => _278.id])) this.state.selectedAnnotationId = null;
7120
7123
  } else {
7121
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
7124
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
7122
7125
  }
7123
- this.commitLayers(_chunkLL3RAN55cjs.mapLayer.call(void 0, this.state.layers, id, () => next));
7126
+ this.commitLayers(_chunkDFFBJV3Ucjs.mapLayer.call(void 0, this.state.layers, id, () => next));
7124
7127
  return id;
7125
7128
  }
7126
7129
  // --- PSD ---
@@ -7143,7 +7146,7 @@ var ImageEditorController = (_class6 = class {
7143
7146
  setColorMode(mode, options = {}) {
7144
7147
  let next;
7145
7148
  if (mode === "rgb") {
7146
- if (options.profile !== void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7149
+ if (options.profile !== void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7147
7150
  next = null;
7148
7151
  } else if (mode === "lab") next = { mode: "lab" };
7149
7152
  else if (mode === "cmyk") {
@@ -7151,14 +7154,14 @@ var ImageEditorController = (_class6 = class {
7151
7154
  try {
7152
7155
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
7153
7156
  } catch (e) {
7154
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7157
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7155
7158
  }
7156
7159
  const cs = resolveProfile(doc).colorSpace;
7157
- if (cs !== "cmyk") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7160
+ if (cs !== "cmyk") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7158
7161
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7159
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7162
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7160
7163
  next = { mode: "cmyk", profile: doc, intent };
7161
- } else throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7164
+ } else throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7162
7165
  this.recordHistory();
7163
7166
  if (next) this.state.colorMode = next;
7164
7167
  else delete this.state.colorMode;
@@ -7171,10 +7174,10 @@ var ImageEditorController = (_class6 = class {
7171
7174
  try {
7172
7175
  doc = documentProfile(profile);
7173
7176
  } catch (e) {
7174
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7177
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7175
7178
  }
7176
7179
  const cs = resolveProfile(doc).colorSpace;
7177
- if (cs !== "rgb") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7180
+ if (cs !== "rgb") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7178
7181
  return doc;
7179
7182
  }
7180
7183
  /**
@@ -7200,7 +7203,7 @@ var ImageEditorController = (_class6 = class {
7200
7203
  convertToProfile(profile, options = {}) {
7201
7204
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
7202
7205
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7203
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7206
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7204
7207
  const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7205
7208
  const converted = [];
7206
7209
  const unconverted = [];
@@ -7238,12 +7241,12 @@ var ImageEditorController = (_class6 = class {
7238
7241
  try {
7239
7242
  doc = documentProfile(setup.profile);
7240
7243
  } catch (e) {
7241
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7244
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7242
7245
  }
7243
7246
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
7244
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7247
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7245
7248
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
7246
- if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7249
+ if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7247
7250
  this.state.proofSetup = next;
7248
7251
  this.notify();
7249
7252
  return next;
@@ -7260,14 +7263,14 @@ var ImageEditorController = (_class6 = class {
7260
7263
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
7261
7264
  dst = resolveProfile(documentProfile(to));
7262
7265
  } catch (e) {
7263
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7266
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7264
7267
  }
7265
- if (src.colorSpace !== "rgb") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7268
+ if (src.colorSpace !== "rgb") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7266
7269
  const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7267
7270
  const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
7268
7271
  return colors.map((input) => {
7269
7272
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
7270
- if (!m) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7273
+ if (!m) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7271
7274
  const n = parseInt(m[1], 16);
7272
7275
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
7273
7276
  const out = new Float32Array(16);
@@ -7293,7 +7296,7 @@ var ImageEditorController = (_class6 = class {
7293
7296
  * the ids of the layers whose pixels changed.
7294
7297
  */
7295
7298
  setBitDepth(depth) {
7296
- if (!_chunk7ISPWEJAcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7299
+ if (!_chunk7ISPWEJAcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7297
7300
  const changed = [];
7298
7301
  const withMask = (l) => {
7299
7302
  const m = l.mask;
@@ -7326,7 +7329,7 @@ var ImageEditorController = (_class6 = class {
7326
7329
  psdColorOptions(warnings) {
7327
7330
  const m = this.state.colorMode;
7328
7331
  if (!m) return { iccProfile: profileBytes(this.state.colorProfile) };
7329
- if (_chunkLL3RAN55cjs.flattenLayers.call(void 0, this.state.layers).some((l) => l.type === "adjustment" && l.visible)) {
7332
+ if (_chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.state.layers).some((l) => l.type === "adjustment" && l.visible)) {
7330
7333
  warnings.push(`Adjustment layers were written with their RGB settings; in a ${m.mode.toUpperCase()} file Photoshop applies them to its own channels, so they may look different there.`);
7331
7334
  }
7332
7335
  const planes = colorModePlanes(this.state.colorProfile, m);
@@ -7341,7 +7344,7 @@ var ImageEditorController = (_class6 = class {
7341
7344
  * Throws `PsdError` for files that cannot be read at all.
7342
7345
  */
7343
7346
  loadPsd(bytes) {
7344
- const result = _chunkGLOOH65Ycjs.importPsd.call(void 0, bytes, { newId: () => _chunkGLOOH65Ycjs.newLayerId.call(void 0, ) });
7347
+ const result = _chunk4PUPGALMcjs.importPsd.call(void 0, bytes, { newId: () => _chunk4PUPGALMcjs.newLayerId.call(void 0, ) });
7345
7348
  this.abandonContents();
7346
7349
  this.recordHistory();
7347
7350
  const s = this.state;
@@ -7351,12 +7354,12 @@ var ImageEditorController = (_class6 = class {
7351
7354
  if (!this.samplePixelsOverride) this.samplePixels = null;
7352
7355
  s.layers = this.checkPsdFonts(result);
7353
7356
  s.crop = null;
7354
- s.transform = { ..._chunkGLOOH65Ycjs.DEFAULT_TRANSFORM_VALUES };
7357
+ s.transform = { ..._chunk4PUPGALMcjs.DEFAULT_TRANSFORM_VALUES };
7355
7358
  s.outputOpacity = 1;
7356
7359
  delete s.legacyOutputBlur;
7357
7360
  s.selection = null;
7358
7361
  s.selectedAnnotationId = null;
7359
- const pixels = _chunkLL3RAN55cjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "pixel");
7362
+ const pixels = _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "pixel");
7360
7363
  s.activeLayerId = pixels.length ? pixels[pixels.length - 1].id : null;
7361
7364
  s.activeTarget = "pixels";
7362
7365
  this.psdResolution = result.resolution;
@@ -7384,7 +7387,7 @@ var ImageEditorController = (_class6 = class {
7384
7387
  this.lastLoadProblems = result.warnings;
7385
7388
  this.notify();
7386
7389
  return {
7387
- layerIds: _chunkLL3RAN55cjs.flattenLayers.call(void 0, result.layers).map((l) => l.id),
7390
+ layerIds: _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, result.layers).map((l) => l.id),
7388
7391
  warnings: result.warnings,
7389
7392
  width: result.width,
7390
7393
  height: result.height,
@@ -7397,14 +7400,14 @@ var ImageEditorController = (_class6 = class {
7397
7400
  */
7398
7401
  checkPsdFonts(result) {
7399
7402
  const shaper = this.getTextShaper();
7400
- const types = _chunkLL3RAN55cjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "type");
7403
+ const types = _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "type");
7401
7404
  if (!types.length) return result.layers;
7402
7405
  let layers = result.layers;
7403
7406
  const missing = /* @__PURE__ */ new Map();
7404
7407
  for (const l of types) {
7405
7408
  const fonts = shaper ? _chunkVYW7JBTMcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
7406
7409
  if (!fonts.length) continue;
7407
- layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
7410
+ layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
7408
7411
  for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
7409
7412
  }
7410
7413
  for (const [font, names] of missing) {
@@ -7430,7 +7433,7 @@ var ImageEditorController = (_class6 = class {
7430
7433
  const canRasterize = this.renderer.canRasterize();
7431
7434
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
7432
7435
  const sources = this.renderer.compositorSources(width, height);
7433
- const compositor = new (0, _chunkGLOOH65Ycjs.LayerCompositor)();
7436
+ const compositor = new (0, _chunk4PUPGALMcjs.LayerCompositor)();
7434
7437
  const bakeMask = (layer) => {
7435
7438
  const mask = layer.mask;
7436
7439
  if (!_optionalChain([mask, 'optionalAccess', _289 => _289.source])) return mask;
@@ -7512,7 +7515,7 @@ var ImageEditorController = (_class6 = class {
7512
7515
  out.surface = this.surfaceOf(layer);
7513
7516
  delete out.source;
7514
7517
  }
7515
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _293 => _293.filters, 'optionalAccess', _294 => _294.filter, 'call', _295 => _295(_chunkGLOOH65Ycjs.isActiveFilter)]), () => ( []));
7518
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _293 => _293.filters, 'optionalAccess', _294 => _294.filter, 'call', _295 => _295(_chunk4PUPGALMcjs.isActiveFilter)]), () => ( []));
7516
7519
  if (active.length) {
7517
7520
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
7518
7521
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -7545,8 +7548,8 @@ var ImageEditorController = (_class6 = class {
7545
7548
  const color = this.psdColorOptions(warnings);
7546
7549
  if (color.colorMode && this.bitDepth !== 8) warnings.push(`${color.colorMode.toUpperCase()} files are written at 8 bits per channel; the ${this.bitDepth}-bit samples were rounded.`);
7547
7550
  const depth = color.colorMode ? 8 : this.bitDepth;
7548
- const mergedDeep = depth === 8 ? void 0 : _chunkLL3RAN55cjs.workingToSamples.call(void 0, _chunkGLOOH65Ycjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
7549
- const result = _chunkGLOOH65Ycjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
7551
+ const mergedDeep = depth === 8 ? void 0 : _chunkDFFBJV3Ucjs.workingToSamples.call(void 0, _chunk4PUPGALMcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
7552
+ const result = _chunk4PUPGALMcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
7550
7553
  warnings.push(...result.warnings);
7551
7554
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
7552
7555
  }
@@ -7562,13 +7565,13 @@ var ImageEditorController = (_class6 = class {
7562
7565
  if (!this.samplePixelsOverride) this.samplePixels = null;
7563
7566
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
7564
7567
  this.state.selection = normalizeSelection(
7565
- _chunkGLOOH65Ycjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
7568
+ _chunk4PUPGALMcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
7566
7569
  );
7567
7570
  }
7568
7571
  let layers = this.state.layers;
7569
7572
  if (sx !== 1 || sy !== 1) {
7570
7573
  if (this.state.crop) {
7571
- this.state.crop = _chunkGLOOH65Ycjs.clampCropToImage.call(void 0,
7574
+ this.state.crop = _chunk4PUPGALMcjs.clampCropToImage.call(void 0,
7572
7575
  {
7573
7576
  x: Math.round(this.state.crop.x * sx),
7574
7577
  y: Math.round(this.state.crop.y * sy),
@@ -7581,26 +7584,26 @@ var ImageEditorController = (_class6 = class {
7581
7584
  }
7582
7585
  layers = resizeLegacyMasks(layers, prev, next.dimensions);
7583
7586
  const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _299 => _299.state, 'access', _300 => _300.patterns, 'optionalAccess', _301 => _301.find, 'call', _302 => _302((p) => p.id === pid)]), () => ( null)) };
7584
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers)) {
7587
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers)) {
7585
7588
  if (l.type === "annotation") {
7586
- layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
7589
+ layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
7587
7590
  } else if (l.type === "shape") {
7588
7591
  const a = l.annotation;
7589
7592
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
7590
- const fromAnnotation = scaled ? _chunkGLOOH65Ycjs.shapeFromAnnotation.call(void 0, scaled) : null;
7593
+ const fromAnnotation = scaled ? _chunk4PUPGALMcjs.shapeFromAnnotation.call(void 0, scaled) : null;
7591
7594
  const m = [sx, 0, 0, sy, 0, 0];
7592
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _303 => _303.components]), () => ( _chunkGLOOH65Ycjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
7595
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _303 => _303.components]), () => ( _chunk4PUPGALMcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
7593
7596
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
7594
7597
  if (scaled && fromAnnotation) moved.annotation = scaled;
7595
7598
  else delete moved.annotation;
7596
- layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, l.id, () => _chunkGLOOH65Ycjs.rerenderShape.call(void 0, moved, env));
7599
+ layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, l.id, () => _chunk4PUPGALMcjs.rerenderShape.call(void 0, moved, env));
7597
7600
  }
7598
7601
  }
7599
7602
  }
7600
- const bg = _chunkGLOOH65Ycjs.developTarget.call(void 0, layers, null);
7601
- if (bg && bg.source !== "document") layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
7603
+ const bg = _chunk4PUPGALMcjs.developTarget.call(void 0, layers, null);
7604
+ if (bg && bg.source !== "document") layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
7602
7605
  if (clearAnnotations) {
7603
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkLL3RAN55cjs.mapLayer.call(void 0, layers, l.id, () => null);
7606
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, layers, l.id, () => null);
7604
7607
  this.state.selectedAnnotationId = null;
7605
7608
  }
7606
7609
  this.state.layers = layers;
@@ -7618,7 +7621,7 @@ var ImageEditorController = (_class6 = class {
7618
7621
  let out;
7619
7622
  try {
7620
7623
  out = this.serializeState();
7621
- if (_optionalChain([this, 'access', _307 => _307.state, 'access', _308 => _308.selection, 'optionalAccess', _309 => _309.bounds])) out.selection = _chunkGLOOH65Ycjs.serializeSelection.call(void 0, this.state.selection);
7624
+ if (_optionalChain([this, 'access', _307 => _307.state, 'access', _308 => _308.selection, 'optionalAccess', _309 => _309.bounds])) out.selection = _chunk4PUPGALMcjs.serializeSelection.call(void 0, this.state.selection);
7622
7625
  } finally {
7623
7626
  if (root) {
7624
7627
  this.state = current;
@@ -7626,8 +7629,8 @@ var ImageEditorController = (_class6 = class {
7626
7629
  this.viewKey = [];
7627
7630
  }
7628
7631
  }
7629
- if (!options || out.version !== _chunkGLOOH65Ycjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
7630
- return _chunkGLOOH65Ycjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
7632
+ if (!options || out.version !== _chunk4PUPGALMcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
7633
+ return _chunk4PUPGALMcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
7631
7634
  }
7632
7635
  /**
7633
7636
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -7635,12 +7638,12 @@ var ImageEditorController = (_class6 = class {
7635
7638
  * out and listed in `lastLoadProblems`.
7636
7639
  */
7637
7640
  async loadJSONAsync(data, options = {}) {
7638
- if (data.version !== _chunkGLOOH65Ycjs.LAYERED_SCHEMA_VERSION || !data.assets) {
7641
+ if (data.version !== _chunk4PUPGALMcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
7639
7642
  this.loadJSON(data);
7640
7643
  return;
7641
7644
  }
7642
7645
  const problems = [];
7643
- const assets = await _chunkGLOOH65Ycjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
7646
+ const assets = await _chunk4PUPGALMcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
7644
7647
  this.loadJSON({ ...data, assets });
7645
7648
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
7646
7649
  }
@@ -7652,7 +7655,7 @@ var ImageEditorController = (_class6 = class {
7652
7655
  let selection = null;
7653
7656
  if (data.selection) {
7654
7657
  try {
7655
- selection = normalizeSelection(_chunkGLOOH65Ycjs.deserializeSelection.call(void 0, data.selection));
7658
+ selection = normalizeSelection(_chunk4PUPGALMcjs.deserializeSelection.call(void 0, data.selection));
7656
7659
  } catch (e25) {
7657
7660
  selection = null;
7658
7661
  }
@@ -7670,8 +7673,8 @@ var ImageEditorController = (_class6 = class {
7670
7673
  if (isLayered(data)) {
7671
7674
  const problems = [];
7672
7675
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
7673
- const storedPatterns = _chunkGLOOH65Ycjs.deserializePatterns.call(void 0, data.patterns, []);
7674
- s.layers = _chunkGLOOH65Ycjs.deserializeLayers.call(void 0, data.layers, {
7676
+ const storedPatterns = _chunk4PUPGALMcjs.deserializePatterns.call(void 0, data.patterns, []);
7677
+ s.layers = _chunk4PUPGALMcjs.deserializeLayers.call(void 0, data.layers, {
7675
7678
  assets: _nullishCoalesce(data.assets, () => ( {})),
7676
7679
  problems,
7677
7680
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -7685,11 +7688,11 @@ var ImageEditorController = (_class6 = class {
7685
7688
  s.outputOpacity = data.opacity;
7686
7689
  if (typeof data.legacyOutputBlur === "number" && data.legacyOutputBlur >= 0) s.legacyOutputBlur = data.legacyOutputBlur;
7687
7690
  else delete s.legacyOutputBlur;
7688
- s.activeLayerId = data.activeLayerId && _chunkLL3RAN55cjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : null;
7691
+ s.activeLayerId = data.activeLayerId && _chunkDFFBJV3Ucjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : null;
7689
7692
  const light = data.globalLight;
7690
7693
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
7691
7694
  else delete s.globalLight;
7692
- const patterns = _chunkGLOOH65Ycjs.deserializePatterns.call(void 0, data.patterns, problems);
7695
+ const patterns = _chunk4PUPGALMcjs.deserializePatterns.call(void 0, data.patterns, problems);
7693
7696
  if (patterns.length) s.patterns = patterns;
7694
7697
  else delete s.patterns;
7695
7698
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -7705,7 +7708,7 @@ var ImageEditorController = (_class6 = class {
7705
7708
  }
7706
7709
  } else {
7707
7710
  const { width, height } = this.naturalSize;
7708
- const stack = _chunkGLOOH65Ycjs.layersFromLegacy.call(void 0, data, width, height);
7711
+ const stack = _chunk4PUPGALMcjs.layersFromLegacy.call(void 0, data, width, height);
7709
7712
  s.layers = stack.layers;
7710
7713
  s.outputOpacity = stack.outputOpacity;
7711
7714
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
@@ -7726,7 +7729,7 @@ var ImageEditorController = (_class6 = class {
7726
7729
  }
7727
7730
  serializeState() {
7728
7731
  const { width, height } = this.naturalSize;
7729
- const view = _chunkGLOOH65Ycjs.legacyView.call(void 0, this.stack(), width, height, null);
7732
+ const view = _chunk4PUPGALMcjs.legacyView.call(void 0, this.stack(), width, height, null);
7730
7733
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _310 => _310.state, 'access', _311 => _311.patterns, 'optionalAccess', _312 => _312.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
7731
7734
  return {
7732
7735
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -7741,9 +7744,9 @@ var ImageEditorController = (_class6 = class {
7741
7744
  annotations: JSON.parse(JSON.stringify(view.annotations))
7742
7745
  };
7743
7746
  }
7744
- const { layers, assets, smartContents } = _chunkGLOOH65Ycjs.serializeLayers.call(void 0, this.state.layers);
7747
+ const { layers, assets, smartContents } = _chunk4PUPGALMcjs.serializeLayers.call(void 0, this.state.layers);
7745
7748
  const out = {
7746
- version: _chunkGLOOH65Ycjs.LAYERED_SCHEMA_VERSION,
7749
+ version: _chunk4PUPGALMcjs.LAYERED_SCHEMA_VERSION,
7747
7750
  width,
7748
7751
  height,
7749
7752
  layers,
@@ -7755,7 +7758,7 @@ var ImageEditorController = (_class6 = class {
7755
7758
  };
7756
7759
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
7757
7760
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
7758
- if (_optionalChain([this, 'access', _316 => _316.state, 'access', _317 => _317.patterns, 'optionalAccess', _318 => _318.length])) out.patterns = _chunkGLOOH65Ycjs.serializePatterns.call(void 0, this.state.patterns);
7761
+ if (_optionalChain([this, 'access', _316 => _316.state, 'access', _317 => _317.patterns, 'optionalAccess', _318 => _318.length])) out.patterns = _chunk4PUPGALMcjs.serializePatterns.call(void 0, this.state.patterns);
7759
7762
  if (smartContents) out.smartContents = smartContents;
7760
7763
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
7761
7764
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -7767,7 +7770,7 @@ function serializeAdjustments(adjustments) {
7767
7770
  const out = { ...adjustments };
7768
7771
  if (_optionalChain([out, 'access', _319 => _319.layers, 'optionalAccess', _320 => _320.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
7769
7772
  else delete out.layers;
7770
- if (_chunkGLOOH65Ycjs.normalizeProcessVersion.call(void 0, out.process) === _chunkGLOOH65Ycjs.LEGACY_PROCESS_VERSION) {
7773
+ if (_chunk4PUPGALMcjs.normalizeProcessVersion.call(void 0, out.process) === _chunk4PUPGALMcjs.LEGACY_PROCESS_VERSION) {
7771
7774
  delete out.process;
7772
7775
  if (!out.tint) delete out.tint;
7773
7776
  }
@@ -7778,7 +7781,7 @@ function withDevelop(layer, partial) {
7778
7781
  let i = filters.findIndex((f) => f.kind === "develop");
7779
7782
  if (i === -1) {
7780
7783
  filters.unshift({
7781
- id: layer.source === "document" ? _chunkGLOOH65Ycjs.DEVELOP_FILTER_ID : _chunkGLOOH65Ycjs.newLayerId.call(void 0, "flt"),
7784
+ id: layer.source === "document" ? _chunk4PUPGALMcjs.DEVELOP_FILTER_ID : _chunk4PUPGALMcjs.newLayerId.call(void 0, "flt"),
7782
7785
  kind: "develop",
7783
7786
  enabled: true,
7784
7787
  brightness: 0,
@@ -7787,7 +7790,7 @@ function withDevelop(layer, partial) {
7787
7790
  exposure: 0,
7788
7791
  temperature: 0,
7789
7792
  tint: 0,
7790
- process: _chunkGLOOH65Ycjs.LATEST_PROCESS_VERSION
7793
+ process: _chunk4PUPGALMcjs.LATEST_PROCESS_VERSION
7791
7794
  });
7792
7795
  i = 0;
7793
7796
  }
@@ -7796,7 +7799,7 @@ function withDevelop(layer, partial) {
7796
7799
  const v = partial[k];
7797
7800
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
7798
7801
  }
7799
- if ("process" in partial) next.process = _chunkGLOOH65Ycjs.normalizeProcessVersion.call(void 0, partial.process);
7802
+ if ("process" in partial) next.process = _chunk4PUPGALMcjs.normalizeProcessVersion.call(void 0, partial.process);
7800
7803
  filters[i] = next;
7801
7804
  return { ...layer, filters };
7802
7805
  }
@@ -7805,7 +7808,7 @@ function withBlur(layer, radius) {
7805
7808
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
7806
7809
  if (radius > 0) {
7807
7810
  filters.push({
7808
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _324 => _324.id]), () => ( (layer.source === "document" ? _chunkGLOOH65Ycjs.BLUR_FILTER_ID : _chunkGLOOH65Ycjs.newLayerId.call(void 0, "flt")))),
7811
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _324 => _324.id]), () => ( (layer.source === "document" ? _chunk4PUPGALMcjs.BLUR_FILTER_ID : _chunk4PUPGALMcjs.newLayerId.call(void 0, "flt")))),
7809
7812
  kind: "blur",
7810
7813
  enabled: true,
7811
7814
  radius
@@ -7829,7 +7832,7 @@ function mergeAdjustmentNode(node, update, width, height) {
7829
7832
  if (!update.mask) delete next.mask;
7830
7833
  else {
7831
7834
  const current = node.mask && !node.mask.source ? node.mask : null;
7832
- const memo = current ? _chunkGLOOH65Ycjs.legacyMaskOf.call(void 0, current, width, height) : null;
7835
+ const memo = current ? _chunk4PUPGALMcjs.legacyMaskOf.call(void 0, current, width, height) : null;
7833
7836
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
7834
7837
  next.mask = withMaskProps(current, {
7835
7838
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -7837,7 +7840,7 @@ function mergeAdjustmentNode(node, update, width, height) {
7837
7840
  enabled: update.mask.enabled !== false
7838
7841
  });
7839
7842
  } else {
7840
- const m = _chunkGLOOH65Ycjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
7843
+ const m = _chunk4PUPGALMcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
7841
7844
  if (m) next.mask = m;
7842
7845
  else delete next.mask;
7843
7846
  }
@@ -7873,12 +7876,12 @@ function resizeLegacyMasks(layers, from, to) {
7873
7876
  const th = Math.max(1, Math.round(to.height));
7874
7877
  if (fw === tw && fh === th) return layers;
7875
7878
  let out = layers;
7876
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers)) {
7879
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers)) {
7877
7880
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
7878
7881
  const old = l.mask;
7879
- const mask = _chunkGLOOH65Ycjs.rasterMaskFromLegacy.call(void 0, _chunkGLOOH65Ycjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
7882
+ const mask = _chunk4PUPGALMcjs.rasterMaskFromLegacy.call(void 0, _chunk4PUPGALMcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
7880
7883
  if (!mask) continue;
7881
- out = _chunkLL3RAN55cjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
7884
+ out = _chunkDFFBJV3Ucjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
7882
7885
  }
7883
7886
  return out;
7884
7887
  }
@@ -7891,7 +7894,7 @@ function isOpaqueInside(surface, width, height) {
7891
7894
  return true;
7892
7895
  }
7893
7896
  function collectStateTiles(layers, into) {
7894
- for (const l of _chunkLL3RAN55cjs.flattenLayers.call(void 0, layers)) {
7897
+ for (const l of _chunkDFFBJV3Ucjs.flattenLayers.call(void 0, layers)) {
7895
7898
  if (l.type === "pixel" && l.source !== "document") _chunk7ISPWEJAcjs.collectTiles.call(void 0, l.surface, into);
7896
7899
  if (l.mask && !l.mask.source) _chunk7ISPWEJAcjs.collectTiles.call(void 0, l.mask.surface, into);
7897
7900
  if (l.type === "shape" || l.type === "type") _chunk7ISPWEJAcjs.collectTiles.call(void 0, l.surface, into);
@@ -7972,12 +7975,12 @@ function withoutAnnotations(layers) {
7972
7975
  function parseColor(value) {
7973
7976
  if (Array.isArray(value)) {
7974
7977
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
7975
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
7978
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
7976
7979
  }
7977
7980
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
7978
7981
  }
7979
7982
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
7980
- if (!m) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
7983
+ if (!m) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
7981
7984
  let hex = m[1];
7982
7985
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
7983
7986
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -8127,7 +8130,7 @@ function loadImageEditorDocument(input) {
8127
8130
  // Optional: only present when something was selected when saving.
8128
8131
  selection: {
8129
8132
  parse: (value) => {
8130
- const mask = _chunkGLOOH65Ycjs.deserializeSelection.call(void 0, value);
8133
+ const mask = _chunk4PUPGALMcjs.deserializeSelection.call(void 0, value);
8131
8134
  const v = value;
8132
8135
  return { width: mask.width, height: mask.height, rle: v.rle };
8133
8136
  },
@@ -8215,7 +8218,7 @@ function loadLayeredDocument(doc) {
8215
8218
  },
8216
8219
  selection: {
8217
8220
  parse: (value) => {
8218
- const mask = _chunkGLOOH65Ycjs.deserializeSelection.call(void 0, value);
8221
+ const mask = _chunk4PUPGALMcjs.deserializeSelection.call(void 0, value);
8219
8222
  const v = value;
8220
8223
  return { width: mask.width, height: mask.height, rle: v.rle };
8221
8224
  },
@@ -8609,14 +8612,14 @@ function describeSelection(mask) {
8609
8612
  // src/image-editor/selection-tools.ts
8610
8613
  var modeSchema = {
8611
8614
  type: "string",
8612
- enum: [..._chunkGLOOH65Ycjs.SELECTION_MODES],
8615
+ enum: [..._chunk4PUPGALMcjs.SELECTION_MODES],
8613
8616
  description: "How the result combines with the current selection (default replace)."
8614
8617
  };
8615
8618
  var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
8616
8619
  function summary(controller) {
8617
8620
  const sel = controller.getSelection();
8618
8621
  const { width, height } = controller.getState().imageDimensions;
8619
- const area = _chunkGLOOH65Ycjs.selectionArea.call(void 0, sel);
8622
+ const area = _chunk4PUPGALMcjs.selectionArea.call(void 0, sel);
8620
8623
  return {
8621
8624
  empty: !sel,
8622
8625
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _336 => _336.bounds]), () => ( null)),
@@ -8662,7 +8665,7 @@ function createImageSelectionTools(controller) {
8662
8665
  },
8663
8666
  annotations: writeAnnotations("Select a region", true),
8664
8667
  handler: ({ shape, x, y, width, height, mode, feather }) => {
8665
- const opts = { mode: _chunkGLOOH65Ycjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
8668
+ const opts = { mode: _chunk4PUPGALMcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
8666
8669
  switch (shape) {
8667
8670
  case "all":
8668
8671
  controller.selectAll();
@@ -8715,7 +8718,7 @@ function createImageSelectionTools(controller) {
8715
8718
  annotations: writeAnnotations("Select by colour", true),
8716
8719
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
8717
8720
  const common = {
8718
- mode: _chunkGLOOH65Ycjs.parseSelectionMode.call(void 0, mode),
8721
+ mode: _chunk4PUPGALMcjs.parseSelectionMode.call(void 0, mode),
8719
8722
  sampleMerged: sampleMerged === true,
8720
8723
  sample: _nullishCoalesce(sample, () => ( "composite"))
8721
8724
  };
@@ -8736,7 +8739,7 @@ function createImageSelectionTools(controller) {
8736
8739
  inputSchema: {
8737
8740
  type: "object",
8738
8741
  properties: {
8739
- op: { type: "string", enum: [..._chunkGLOOH65Ycjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
8742
+ op: { type: "string", enum: [..._chunk4PUPGALMcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
8740
8743
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
8741
8744
  },
8742
8745
  required: ["op", "radius"],
@@ -8744,7 +8747,7 @@ function createImageSelectionTools(controller) {
8744
8747
  },
8745
8748
  annotations: writeAnnotations("Modify the selection"),
8746
8749
  handler: ({ op, radius }) => {
8747
- if (!_chunkGLOOH65Ycjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
8750
+ if (!_chunk4PUPGALMcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
8748
8751
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
8749
8752
  controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
8750
8753
  return summary(controller);
@@ -8788,7 +8791,7 @@ function createImageSelectionTools(controller) {
8788
8791
  type: "object",
8789
8792
  properties: {
8790
8793
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
8791
- kind: { type: "string", enum: _chunkGLOOH65Ycjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
8794
+ kind: { type: "string", enum: _chunk4PUPGALMcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
8792
8795
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
8793
8796
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
8794
8797
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -8808,11 +8811,11 @@ function createImageSelectionTools(controller) {
8808
8811
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
8809
8812
  controller.applySelectionAsLayerMask(layerId, props);
8810
8813
  id = layerId;
8811
- } else if (_chunkGLOOH65Ycjs.isAdjustmentKind.call(void 0, kind)) {
8814
+ } else if (_chunk4PUPGALMcjs.isAdjustmentKind.call(void 0, kind)) {
8812
8815
  id = controller.addAdjustmentLayer({
8813
8816
  kind,
8814
8817
  params,
8815
- mask: _chunkGLOOH65Ycjs.layerMaskFromSelection.call(void 0, sel, props)
8818
+ mask: _chunk4PUPGALMcjs.layerMaskFromSelection.call(void 0, sel, props)
8816
8819
  });
8817
8820
  } else {
8818
8821
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -8949,11 +8952,11 @@ function createImageEditTools(controller) {
8949
8952
  const geometry2 = () => {
8950
8953
  const s = controller.getState();
8951
8954
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
8952
- const out = _chunkGLOOH65Ycjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
8955
+ const out = _chunk4PUPGALMcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
8953
8956
  return {
8954
8957
  image: { ...s.imageDimensions },
8955
8958
  crop: s.crop ? { ...s.crop } : null,
8956
- rotation: _chunkGLOOH65Ycjs.normalizeAngle.call(void 0, s.transform.rotate),
8959
+ rotation: _chunk4PUPGALMcjs.normalizeAngle.call(void 0, s.transform.rotate),
8957
8960
  flipH: s.transform.flipH,
8958
8961
  flipV: s.transform.flipV,
8959
8962
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -9188,7 +9191,7 @@ function describeLayer(layer, activeId, boundsOf) {
9188
9191
  const out = {
9189
9192
  id: layer.id,
9190
9193
  type: layer.type,
9191
- name: layer.name || (layer.type === "adjustment" ? _chunkGLOOH65Ycjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9194
+ name: layer.name || (layer.type === "adjustment" ? _chunk4PUPGALMcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9192
9195
  visible: layer.visible,
9193
9196
  opacity: round3(layer.opacity),
9194
9197
  blend: layer.blend,
@@ -9268,7 +9271,7 @@ function placementFrom(args) {
9268
9271
  function createImageLayerTools(controller) {
9269
9272
  const describe = (id) => {
9270
9273
  const s = controller.getState();
9271
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, s.layers, id);
9274
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, s.layers, id);
9272
9275
  if (!loc) return null;
9273
9276
  return {
9274
9277
  ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
@@ -9277,8 +9280,8 @@ function createImageLayerTools(controller) {
9277
9280
  };
9278
9281
  };
9279
9282
  const exists = (id, what = "layerId") => {
9280
- if (typeof id !== "string" || !id) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9281
- _chunkGLOOH65Ycjs.requireLayer.call(void 0, controller.getLayers(), id);
9283
+ if (typeof id !== "string" || !id) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9284
+ _chunk4PUPGALMcjs.requireLayer.call(void 0, controller.getLayers(), id);
9282
9285
  return id;
9283
9286
  };
9284
9287
  const listLayers = {
@@ -9314,7 +9317,7 @@ function createImageLayerTools(controller) {
9314
9317
  handler: ({ layerId, target }) => {
9315
9318
  const id = exists(layerId);
9316
9319
  const layer = controller.getLayer(id);
9317
- if (target === "mask" && !layer.mask) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9320
+ if (target === "mask" && !layer.mask) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9318
9321
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
9319
9322
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
9320
9323
  }
@@ -9339,7 +9342,7 @@ function createImageLayerTools(controller) {
9339
9342
  },
9340
9343
  annotations: { title: "Add a pixel layer", ...WRITE2 },
9341
9344
  handler: async (args) => {
9342
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give color or image, not both.");
9345
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give color or image, not both.");
9343
9346
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
9344
9347
  const init = {
9345
9348
  name: args.name,
@@ -9429,7 +9432,7 @@ function createImageLayerTools(controller) {
9429
9432
  const id = exists(args.layerId);
9430
9433
  const props = {};
9431
9434
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
9432
- if (!Object.keys(props).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give at least one property to change.");
9435
+ if (!Object.keys(props).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give at least one property to change.");
9433
9436
  controller.setLayerProperties(id, props);
9434
9437
  return { layer: describe(id) };
9435
9438
  }
@@ -9523,8 +9526,8 @@ function createImageLayerTools(controller) {
9523
9526
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
9524
9527
  handler: ({ layerId, x, y, dx, dy }) => {
9525
9528
  const id = exists(layerId);
9526
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give x and y, or dx and dy.");
9527
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give x / y or dx / dy, not both.");
9529
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give x and y, or dx and dy.");
9530
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
9528
9531
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
9529
9532
  }
9530
9533
  };
@@ -9596,7 +9599,7 @@ function createImageLayerTools(controller) {
9596
9599
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
9597
9600
  handler: ({ layerId, density, feather, enabled, linked }) => {
9598
9601
  const id = exists(layerId);
9599
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give density, feather, enabled or linked.");
9602
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give density, feather, enabled or linked.");
9600
9603
  const mask = controller.setLayerMaskProps(id, {
9601
9604
  density,
9602
9605
  feather,
@@ -9679,7 +9682,7 @@ function createImageLayerTools(controller) {
9679
9682
  handler: (args) => {
9680
9683
  const id = exists(args.layerId);
9681
9684
  const changes = filterValues(args);
9682
- if (!Object.keys(changes).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give at least one value to change.");
9685
+ if (!Object.keys(changes).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give at least one value to change.");
9683
9686
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
9684
9687
  }
9685
9688
  };
@@ -9926,8 +9929,8 @@ function settingsSchema(forUpdate) {
9926
9929
  }
9927
9930
  function patternList(controller) {
9928
9931
  const doc = controller.getDocumentPatterns().map((p) => ({ id: p.id, name: p.name, width: p.width, height: p.height, builtin: false }));
9929
- const builtins = _chunkLL3RAN55cjs.builtinPatternIds.call(void 0, ).map((id) => {
9930
- const p = _chunkLL3RAN55cjs.builtinPattern.call(void 0, id);
9932
+ const builtins = _chunkDFFBJV3Ucjs.builtinPatternIds.call(void 0, ).map((id) => {
9933
+ const p = _chunkDFFBJV3Ucjs.builtinPattern.call(void 0, id);
9931
9934
  return { id, name: p.name, width: p.width, height: p.height, builtin: true };
9932
9935
  });
9933
9936
  return [...doc, ...builtins];
@@ -9936,15 +9939,15 @@ function describeLayerEffects(effects) {
9936
9939
  return {
9937
9940
  enabled: effects.enabled,
9938
9941
  scale: _nullishCoalesce(effects.scale, () => ( 1)),
9939
- margin: _chunkLL3RAN55cjs.effectsMargin.call(void 0, effects),
9942
+ margin: _chunkDFFBJV3Ucjs.effectsMargin.call(void 0, effects),
9940
9943
  fromPsd: Boolean(effects.psd),
9941
- effects: effects.items.map((e) => ({ ...JSON.parse(JSON.stringify(e)), label: _chunkLL3RAN55cjs.layerEffectLabel.call(void 0, e.kind) }))
9944
+ effects: effects.items.map((e) => ({ ...JSON.parse(JSON.stringify(e)), label: _chunkDFFBJV3Ucjs.layerEffectLabel.call(void 0, e.kind) }))
9942
9945
  };
9943
9946
  }
9944
9947
  function createImageEffectTools(controller) {
9945
9948
  const layerArg = (id) => {
9946
- if (typeof id !== "string" || !id) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
9947
- _chunkGLOOH65Ycjs.requireLayer.call(void 0, controller.getLayers(), id);
9949
+ if (typeof id !== "string" || !id) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
9950
+ _chunk4PUPGALMcjs.requireLayer.call(void 0, controller.getLayers(), id);
9948
9951
  return id;
9949
9952
  };
9950
9953
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -9954,7 +9957,7 @@ function createImageEffectTools(controller) {
9954
9957
  description: "Returns a layer's effects: the master switch (enabled), Scale Effects (scale, 1 = 100 %), margin (px the effects reach beyond the shape), whether they came from a PSD, and every effect with its id, kind, label and all settings. Also returns the document global light and the pattern ids pattern effects can use.",
9955
9958
  inputSchema: { type: "object", properties: { layerId: LAYER_ID3 }, required: ["layerId"], additionalProperties: false },
9956
9959
  annotations: { title: "List layer effects", ...READ3 },
9957
- handler: ({ layerId }) => result(layerArg(layerId), { globalLight: controller.getGlobalLight(), patterns: patternList(controller), kinds: [..._chunkLL3RAN55cjs.LAYER_EFFECT_KINDS] })
9960
+ handler: ({ layerId }) => result(layerArg(layerId), { globalLight: controller.getGlobalLight(), patterns: patternList(controller), kinds: [..._chunkDFFBJV3Ucjs.LAYER_EFFECT_KINDS] })
9958
9961
  };
9959
9962
  const add2 = {
9960
9963
  name: "add_layer_effect",
@@ -9965,7 +9968,7 @@ function createImageEffectTools(controller) {
9965
9968
  $defs: DEFS,
9966
9969
  properties: {
9967
9970
  layerId: LAYER_ID3,
9968
- kind: { type: "string", enum: [..._chunkLL3RAN55cjs.LAYER_EFFECT_KINDS], description: "Effect kind." },
9971
+ kind: { type: "string", enum: [..._chunkDFFBJV3Ucjs.LAYER_EFFECT_KINDS], description: "Effect kind." },
9969
9972
  settings: settingsSchema(false),
9970
9973
  index: { type: "integer", minimum: 0, description: "Position in the layer's effect list (default the end)." }
9971
9974
  },
@@ -9975,7 +9978,7 @@ function createImageEffectTools(controller) {
9975
9978
  annotations: { title: "Add a layer effect", ...WRITE3 },
9976
9979
  handler: ({ layerId, kind, settings, index }) => {
9977
9980
  const id = layerArg(layerId);
9978
- if (!_chunkLL3RAN55cjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`kind must be one of ${_chunkLL3RAN55cjs.LAYER_EFFECT_KINDS.join(", ")}.`);
9981
+ if (!_chunkDFFBJV3Ucjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`kind must be one of ${_chunkDFFBJV3Ucjs.LAYER_EFFECT_KINDS.join(", ")}.`);
9979
9982
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
9980
9983
  return result(id, { effectId: effect.id });
9981
9984
  }
@@ -9995,7 +9998,7 @@ function createImageEffectTools(controller) {
9995
9998
  handler: ({ layerId, effectId, settings }) => {
9996
9999
  const id = layerArg(layerId);
9997
10000
  const changes = _nullishCoalesce(settings, () => ( {}));
9998
- if (!Object.keys(changes).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give at least one setting to change.");
10001
+ if (!Object.keys(changes).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give at least one setting to change.");
9999
10002
  controller.updateLayerEffect(id, effectId, changes);
10000
10003
  return result(id);
10001
10004
  }
@@ -10047,7 +10050,7 @@ function createImageEffectTools(controller) {
10047
10050
  },
10048
10051
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
10049
10052
  handler: ({ angle, altitude }) => {
10050
- if (angle === void 0 && altitude === void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give angle, altitude or both.");
10053
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give angle, altitude or both.");
10051
10054
  const next = {};
10052
10055
  if (angle !== void 0) next.angle = angle;
10053
10056
  if (altitude !== void 0) next.altitude = altitude;
@@ -10232,7 +10235,7 @@ var PaintGesture = (_class7 = class {
10232
10235
  if (layer.type !== "pixel" && layer.type !== "shape" && layer.type !== "smart") throw new Error(`Only pixel, shape and smart object layers move; "${layer.name}" is a ${layer.type} layer.`);
10233
10236
  if (_optionalChain([layer, 'access', _350 => _350.locks, 'optionalAccess', _351 => _351.all]) || _optionalChain([layer, 'access', _352 => _352.locks, 'optionalAccess', _353 => _353.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
10234
10237
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
10235
- const b = _chunkGLOOH65Ycjs.shapeGeometryBounds.call(void 0, layer);
10238
+ const b = _chunk4PUPGALMcjs.shapeGeometryBounds.call(void 0, layer);
10236
10239
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
10237
10240
  })();
10238
10241
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -10385,7 +10388,7 @@ function createImagePaintTools(controller) {
10385
10388
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
10386
10389
  handler: (args) => {
10387
10390
  const tool = args.tool;
10388
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
10391
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
10389
10392
  const result = controller.paintStroke({
10390
10393
  tool,
10391
10394
  points: args.points,
@@ -10492,7 +10495,7 @@ function profileArg(v) {
10492
10495
  try {
10493
10496
  return _chunkDCLJNVZScjs.base64ToBytes.call(void 0, s.slice(4));
10494
10497
  } catch (e27) {
10495
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("The icc: value is not valid base64.");
10498
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("The icc: value is not valid base64.");
10496
10499
  }
10497
10500
  }
10498
10501
  return s;
@@ -10557,10 +10560,10 @@ function createImageColorTools(controller) {
10557
10560
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
10558
10561
  handler: (args) => {
10559
10562
  if (args.off === true) {
10560
- if (args.profile !== void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give either off true or a profile, not both.");
10563
+ if (args.profile !== void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give either off true or a profile, not both.");
10561
10564
  return controller.setProofSetup(null);
10562
10565
  }
10563
- if (args.profile === void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
10566
+ if (args.profile === void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
10564
10567
  const s = controller.setProofSetup({
10565
10568
  profile: profileArg(args.profile),
10566
10569
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -10612,7 +10615,7 @@ function createImageColorTools(controller) {
10612
10615
  },
10613
10616
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
10614
10617
  handler: (args) => {
10615
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
10618
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
10616
10619
  return controller.setColorMode(args.mode, {
10617
10620
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
10618
10621
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -10677,7 +10680,7 @@ function checkSource(controller, source) {
10677
10680
  const p = source;
10678
10681
  const { width, height } = controller.getState().imageDimensions;
10679
10682
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
10680
- throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
10683
+ throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
10681
10684
  }
10682
10685
  return p;
10683
10686
  }
@@ -10871,10 +10874,10 @@ function createImageRetouchTools(controller) {
10871
10874
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
10872
10875
  handler: (args) => {
10873
10876
  if (args.clear === true) {
10874
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give either clear true or x and y, not both.");
10877
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give either clear true or x and y, not both.");
10875
10878
  return controller.setCloneSource(null);
10876
10879
  }
10877
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
10880
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
10878
10881
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
10879
10882
  }
10880
10883
  };
@@ -10895,11 +10898,11 @@ var DATA = {
10895
10898
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
10896
10899
  };
10897
10900
  function psdBytesFromBase64(data) {
10898
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunkGLOOH65Ycjs.PsdError)("data is required: the PSD file as base64.");
10901
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunk4PUPGALMcjs.PsdError)("data is required: the PSD file as base64.");
10899
10902
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
10900
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkGLOOH65Ycjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
10903
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunk4PUPGALMcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
10901
10904
  const bytes = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, body);
10902
- if (bytes.length < 26) throw new (0, _chunkGLOOH65Ycjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
10905
+ if (bytes.length < 26) throw new (0, _chunk4PUPGALMcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
10903
10906
  return bytes;
10904
10907
  }
10905
10908
  function createImagePsdTools(controller) {
@@ -10910,7 +10913,7 @@ function createImagePsdTools(controller) {
10910
10913
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
10911
10914
  annotations: { title: "Inspect a PSD", ...READ7 },
10912
10915
  handler: ({ data }) => {
10913
- const res = _chunkGLOOH65Ycjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
10916
+ const res = _chunk4PUPGALMcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
10914
10917
  return {
10915
10918
  width: res.width,
10916
10919
  height: res.height,
@@ -10985,7 +10988,7 @@ var TARGET3 = {
10985
10988
  enum: ["pixels", "mask"],
10986
10989
  description: "pixels (default) moves the pixels and a linked mask; mask moves an unlinked mask alone (a linked mask always moves with its pixels)."
10987
10990
  },
10988
- interpolation: { type: "string", enum: _chunkLL3RAN55cjs.INTERPOLATIONS, description: "Resampling: nearest (hard pixels), bilinear or bicubic (default, Photoshop\u2019s Bicubic)." }
10991
+ interpolation: { type: "string", enum: _chunkDFFBJV3Ucjs.INTERPOLATIONS, description: "Resampling: nearest (hard pixels), bilinear or bicubic (default, Photoshop\u2019s Bicubic)." }
10989
10992
  };
10990
10993
  var GEOMETRY = {
10991
10994
  scaleX: { type: "number", description: "Width in percent of the frame (default 100; negative flips horizontally)." },
@@ -10997,7 +11000,7 @@ var GEOMETRY = {
10997
11000
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
10998
11001
  reference: {
10999
11002
  description: "Fixed point of scale, skew and rotate: an anchor of the frame (top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right; default center) or a document point {x, y}.",
11000
- anyOf: [{ type: "string", enum: _chunkGLOOH65Ycjs.TRANSFORM_ANCHORS }, POINT]
11003
+ anyOf: [{ type: "string", enum: _chunk4PUPGALMcjs.TRANSFORM_ANCHORS }, POINT]
11001
11004
  },
11002
11005
  matrix: {
11003
11006
  type: "array",
@@ -11018,14 +11021,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
11018
11021
  function geometryFrom(args) {
11019
11022
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
11020
11023
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
11021
- if (ways === 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11022
- if (ways > 1) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11024
+ if (ways === 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11025
+ if (ways > 1) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11023
11026
  if (args.matrix !== void 0) return { matrix: args.matrix };
11024
11027
  if (args.corners !== void 0) return { corners: args.corners };
11025
11028
  const params = {};
11026
11029
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
11027
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11028
- if (typeof params.reference === "string" && !_chunkGLOOH65Ycjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkGLOOH65Ycjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11030
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11031
+ if (typeof params.reference === "string" && !_chunk4PUPGALMcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunk4PUPGALMcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11029
11032
  return { params };
11030
11033
  }
11031
11034
  function targetFrom(args) {
@@ -11074,7 +11077,7 @@ function createImageTransformTools(controller) {
11074
11077
  moved: [...s.moves],
11075
11078
  frame: { ...s.box },
11076
11079
  corners: s.startGeometry.corners.map(roundPoint),
11077
- center: roundPoint(_chunkGLOOH65Ycjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11080
+ center: roundPoint(_chunk4PUPGALMcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11078
11081
  };
11079
11082
  if (s.smartObject) out.smartObject = true;
11080
11083
  s.cancel();
@@ -11129,11 +11132,11 @@ function createImageTransformTools(controller) {
11129
11132
  annotations: { title: "Warp a layer", ...WRITE6 },
11130
11133
  handler: (args) => {
11131
11134
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
11132
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11133
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give a preset style or a mesh.");
11135
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11136
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give a preset style or a mesh.");
11134
11137
  let warp;
11135
11138
  if (hasPreset) {
11136
- if (args.style === void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
11139
+ if (args.style === void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
11137
11140
  warp = {
11138
11141
  style: args.style,
11139
11142
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -11144,7 +11147,7 @@ function createImageTransformTools(controller) {
11144
11147
  } else {
11145
11148
  const m = args.mesh;
11146
11149
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
11147
- if (m.points.length !== want) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11150
+ if (m.points.length !== want) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11148
11151
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
11149
11152
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
11150
11153
  }
@@ -11239,13 +11242,13 @@ function settingsFrom(args) {
11239
11242
  return out;
11240
11243
  }
11241
11244
  function imageArg(image) {
11242
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
11245
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
11243
11246
  return image.trim();
11244
11247
  }
11245
11248
  function createImageSmartObjectTools(controller) {
11246
11249
  const smartId = (id) => {
11247
- if (typeof id !== "string" || !id) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
11248
- _chunkGLOOH65Ycjs.requireSmartObject.call(void 0, controller.getLayers(), id);
11250
+ if (typeof id !== "string" || !id) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
11251
+ _chunk4PUPGALMcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
11249
11252
  return id;
11250
11253
  };
11251
11254
  const info = (id) => {
@@ -11257,7 +11260,7 @@ function createImageSmartObjectTools(controller) {
11257
11260
  };
11258
11261
  const layerSummary = (id) => {
11259
11262
  const s = controller.getState();
11260
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, s.layers, id);
11263
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, s.layers, id);
11261
11264
  return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _357 => _357.parent, 'optionalAccess', _358 => _358.id]), () => ( null)), index: loc.index } : null;
11262
11265
  };
11263
11266
  const getSmart = {
@@ -11282,7 +11285,7 @@ function createImageSmartObjectTools(controller) {
11282
11285
  },
11283
11286
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
11284
11287
  handler: ({ layerIds, name }) => {
11285
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkGLOOH65Ycjs.requireLayer.call(void 0, controller.getLayers(), id2);
11288
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunk4PUPGALMcjs.requireLayer.call(void 0, controller.getLayers(), id2);
11286
11289
  const id = controller.convertToSmartObject(layerIds, { name });
11287
11290
  return { layer: layerSummary(id), smartObject: info(id) };
11288
11291
  }
@@ -11340,7 +11343,7 @@ function createImageSmartObjectTools(controller) {
11340
11343
  }
11341
11344
  ]
11342
11345
  },
11343
- interpolation: { type: "string", enum: _chunkLL3RAN55cjs.INTERPOLATIONS, description: "Resampling: nearest, bilinear or bicubic (default: as before, bicubic for new smart objects)." }
11346
+ interpolation: { type: "string", enum: _chunkDFFBJV3Ucjs.INTERPOLATIONS, description: "Resampling: nearest, bilinear or bicubic (default: as before, bicubic for new smart objects)." }
11344
11347
  },
11345
11348
  required: ["layerId"],
11346
11349
  additionalProperties: false
@@ -11355,12 +11358,12 @@ function createImageSmartObjectTools(controller) {
11355
11358
  else if (w) {
11356
11359
  const m = w;
11357
11360
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
11358
- if (m.points.length !== want) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11361
+ if (m.points.length !== want) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11359
11362
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
11360
11363
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
11361
11364
  }
11362
11365
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
11363
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
11366
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
11364
11367
  const res = controller.setSmartObjectTransform(id, {
11365
11368
  corners: args.corners,
11366
11369
  matrix: args.matrix,
@@ -11485,7 +11488,7 @@ function createImageSmartObjectTools(controller) {
11485
11488
  handler: (args) => {
11486
11489
  const id = smartId(args.layerId);
11487
11490
  const changes = settingsFrom(args);
11488
- if (!Object.keys(changes).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give at least one value to change.");
11491
+ if (!Object.keys(changes).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give at least one value to change.");
11489
11492
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
11490
11493
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
11491
11494
  }
@@ -11806,13 +11809,13 @@ function geometry(args) {
11806
11809
  }
11807
11810
  function createImageShapeTools(controller) {
11808
11811
  const shapeId = (id) => {
11809
- if (typeof id !== "string" || !id) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
11810
- _chunkGLOOH65Ycjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
11812
+ if (typeof id !== "string" || !id) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
11813
+ _chunk4PUPGALMcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
11811
11814
  return id;
11812
11815
  };
11813
11816
  const layerSummary = (id) => {
11814
11817
  const s = controller.getState();
11815
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, s.layers, id);
11818
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, s.layers, id);
11816
11819
  return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _359 => _359.parent, 'optionalAccess', _360 => _360.id]), () => ( null)), index: loc.index } : null;
11817
11820
  };
11818
11821
  const get = {
@@ -11882,7 +11885,7 @@ function createImageShapeTools(controller) {
11882
11885
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
11883
11886
  handler: ({ layerId, fill, stroke, fillRule }) => {
11884
11887
  const id = shapeId(layerId);
11885
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
11888
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
11886
11889
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
11887
11890
  }
11888
11891
  };
@@ -11931,7 +11934,7 @@ function createImageShapeTools(controller) {
11931
11934
  handler: ({ layerId, componentIndex, ...rest }) => {
11932
11935
  const id = shapeId(layerId);
11933
11936
  const change = geometry(rest);
11934
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("Give shape, subpaths or op to change.");
11937
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("Give shape, subpaths or op to change.");
11935
11938
  return controller.setShapeComponent(id, componentIndex, change);
11936
11939
  }
11937
11940
  };
@@ -12005,13 +12008,13 @@ function pick2(args, keys) {
12005
12008
  }
12006
12009
  function createImageTypeTools(controller) {
12007
12010
  const typeId = (id) => {
12008
- if (typeof id !== "string" || !id) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12009
- _chunkGLOOH65Ycjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12011
+ if (typeof id !== "string" || !id) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12012
+ _chunk4PUPGALMcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12010
12013
  return id;
12011
12014
  };
12012
12015
  const layerSummary = (id) => {
12013
12016
  const s = controller.getState();
12014
- const loc = _chunkLL3RAN55cjs.findLayer.call(void 0, s.layers, id);
12017
+ const loc = _chunkDFFBJV3Ucjs.findLayer.call(void 0, s.layers, id);
12015
12018
  return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _361 => _361.parent, 'optionalAccess', _362 => _362.id]), () => ( null)), index: loc.index } : null;
12016
12019
  };
12017
12020
  const range = (args) => ({ start: args.start, end: args.end });
@@ -12086,7 +12089,7 @@ function createImageTypeTools(controller) {
12086
12089
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
12087
12090
  handler: (args) => {
12088
12091
  const style = pick2(args, Object.keys(STYLE));
12089
- if (!Object.keys(style).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12092
+ if (!Object.keys(style).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12090
12093
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
12091
12094
  }
12092
12095
  };
@@ -12098,7 +12101,7 @@ function createImageTypeTools(controller) {
12098
12101
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
12099
12102
  handler: (args) => {
12100
12103
  const style = pick2(args, Object.keys(PARAGRAPH));
12101
- if (!Object.keys(style).length) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12104
+ if (!Object.keys(style).length) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12102
12105
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
12103
12106
  }
12104
12107
  };
@@ -12120,7 +12123,7 @@ function createImageTypeTools(controller) {
12120
12123
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
12121
12124
  handler: ({ layerId, kind, width, height }) => {
12122
12125
  const id = typeId(layerId);
12123
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkGLOOH65Ycjs.LayerOperationError)("kind box needs width and height in pixels.");
12126
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunk4PUPGALMcjs.LayerOperationError)("kind box needs width and height in pixels.");
12124
12127
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
12125
12128
  }
12126
12129
  };
@@ -12142,7 +12145,7 @@ function createImageTypeTools(controller) {
12142
12145
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
12143
12146
  function adjustmentsSummary(adjustments) {
12144
12147
  return {
12145
- process: _chunkGLOOH65Ycjs.normalizeProcessVersion.call(void 0, adjustments.process),
12148
+ process: _chunk4PUPGALMcjs.normalizeProcessVersion.call(void 0, adjustments.process),
12146
12149
  values: readAdjustmentControls(adjustments),
12147
12150
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
12148
12151
  };
@@ -12185,7 +12188,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12185
12188
  default: def,
12186
12189
  ...requiresProcess ? { requiresProcess } : {}
12187
12190
  })),
12188
- layerKinds: _chunkGLOOH65Ycjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12191
+ layerKinds: _chunk4PUPGALMcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12189
12192
  kind,
12190
12193
  label,
12191
12194
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -12271,7 +12274,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12271
12274
  const result = { applied, clamped };
12272
12275
  if (typeof label === "string" && label) result.label = label;
12273
12276
  const notes = [];
12274
- if ("tint" in applied && _chunkGLOOH65Ycjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
12277
+ if ("tint" in applied && _chunk4PUPGALMcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
12275
12278
  notes.push("Tint has no effect on process 1 edits.");
12276
12279
  }
12277
12280
  if (notes.length) result.notes = notes;
@@ -12281,11 +12284,11 @@ function createImageEditorToolProvider(controller, options = {}) {
12281
12284
  const addLayer = {
12282
12285
  name: "add_adjustment_layer",
12283
12286
  title: "Add an adjustment layer",
12284
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkGLOOH65Ycjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
12287
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunk4PUPGALMcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
12285
12288
  inputSchema: {
12286
12289
  type: "object",
12287
12290
  properties: {
12288
- kind: { type: "string", enum: _chunkGLOOH65Ycjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
12291
+ kind: { type: "string", enum: _chunk4PUPGALMcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
12289
12292
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
12290
12293
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
12291
12294
  blend: { type: "string", enum: _chunk7ISPWEJAcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -12304,7 +12307,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12304
12307
  openWorldHint: false
12305
12308
  },
12306
12309
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
12307
- if (!_chunkGLOOH65Ycjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
12310
+ if (!_chunk4PUPGALMcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
12308
12311
  if (blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
12309
12312
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
12310
12313
  for (const ref of [aboveId, parentId]) {
@@ -12398,7 +12401,7 @@ function boxToCurvePoint(x, y, width, height) {
12398
12401
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
12399
12402
  }
12400
12403
  function curveSvgPath(points, width, height, samples = 64) {
12401
- const lut = _chunkGLOOH65Ycjs.curveLutFromLevels.call(void 0, points);
12404
+ const lut = _chunk4PUPGALMcjs.curveLutFromLevels.call(void 0, points);
12402
12405
  const n = lut.length - 1;
12403
12406
  let d = "";
12404
12407
  for (let i = 0; i <= samples; i++) {
@@ -12825,7 +12828,7 @@ var TextEditSession = (_class10 = class {
12825
12828
  __init83() {this.listeners = /* @__PURE__ */ new Set()}
12826
12829
  __init84() {this.error = null}
12827
12830
  get layer() {
12828
- const l = _optionalChain([_chunkLL3RAN55cjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _377 => _377.layer]);
12831
+ const l = _optionalChain([_chunkDFFBJV3Ucjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _377 => _377.layer]);
12829
12832
  if (!l || l.type !== "type") throw new Error("The type layer being edited is gone.");
12830
12833
  return l;
12831
12834
  }
@@ -12840,7 +12843,7 @@ var TextEditSession = (_class10 = class {
12840
12843
  }
12841
12844
  /** Whether the layer still exists (it can be deleted or undone away while editing). */
12842
12845
  get alive() {
12843
- return _optionalChain([_chunkLL3RAN55cjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _378 => _378.layer, 'access', _379 => _379.type]) === "type";
12846
+ return _optionalChain([_chunkDFFBJV3Ucjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _378 => _378.layer, 'access', _379 => _379.type]) === "type";
12844
12847
  }
12845
12848
  subscribe(fn) {
12846
12849
  this.listeners.add(fn);
@@ -13012,7 +13015,7 @@ var TextEditSession = (_class10 = class {
13012
13015
  overlay() {
13013
13016
  const layer = this.layer;
13014
13017
  const layout = this.layout();
13015
- const m = _chunkGLOOH65Ycjs.textMatrix.call(void 0, layer);
13018
+ const m = _chunk4PUPGALMcjs.textMatrix.call(void 0, layer);
13016
13019
  const at = (x, y) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, { x, y });
13017
13020
  let frame = null;
13018
13021
  if (layer.frame.kind === "box") frame = [at(0, 0), at(layer.frame.width, 0), at(layer.frame.width, layer.frame.height), at(0, layer.frame.height)];
@@ -13048,7 +13051,7 @@ var TextEditSession = (_class10 = class {
13048
13051
  }
13049
13052
  if (this.layer.name === "Text" && this.changed) {
13050
13053
  try {
13051
- this.controller.setLayerProperties(this.layerId, { name: _chunkGLOOH65Ycjs.typeLayerName.call(void 0, this.text) }, false);
13054
+ this.controller.setLayerProperties(this.layerId, { name: _chunk4PUPGALMcjs.typeLayerName.call(void 0, this.text) }, false);
13052
13055
  } catch (e29) {
13053
13056
  }
13054
13057
  }
@@ -13059,7 +13062,7 @@ function typeLayerAt(controller, p, slop = 4) {
13059
13062
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
13060
13063
  for (const l of layers) {
13061
13064
  if (!l.visible) continue;
13062
- const inv = invert(_chunkGLOOH65Ycjs.textMatrix.call(void 0, l));
13065
+ const inv = invert(_chunk4PUPGALMcjs.textMatrix.call(void 0, l));
13063
13066
  const q = _chunkVYW7JBTMcjs.applyMatrix.call(void 0, inv, p);
13064
13067
  let b = null;
13065
13068
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
@@ -13170,7 +13173,7 @@ function layerPanelRows(layers, activeId) {
13170
13173
  }
13171
13174
  function layerLabel(layer) {
13172
13175
  if (layer.name) return layer.name;
13173
- if (layer.type === "adjustment") return _chunkGLOOH65Ycjs.adjustmentKindLabel.call(void 0, layer.kind);
13176
+ if (layer.type === "adjustment") return _chunk4PUPGALMcjs.adjustmentKindLabel.call(void 0, layer.kind);
13174
13177
  return layer.type === "group" ? "Group" : "Layer";
13175
13178
  }
13176
13179
  function layerBadge(layer) {
@@ -13206,7 +13209,7 @@ function dropZone(fraction, isGroup) {
13206
13209
  }
13207
13210
  function dropPlacement(layers, dragId, targetId, zone) {
13208
13211
  if (dragId === targetId) return null;
13209
- const target = _chunkLL3RAN55cjs.findLayer.call(void 0, layers, targetId);
13212
+ const target = _chunkDFFBJV3Ucjs.findLayer.call(void 0, layers, targetId);
13210
13213
  if (!target) return null;
13211
13214
  if (zone === "inside" && target.layer.type === "group") return { parentId: targetId };
13212
13215
  return zone === "above" ? { aboveId: targetId } : { belowId: targetId };
@@ -13214,7 +13217,7 @@ function dropPlacement(layers, dragId, targetId, zone) {
13214
13217
  function layerMenu(controller) {
13215
13218
  const s = controller.getState();
13216
13219
  const active = controller.getActiveLayer();
13217
- const loc = active ? _chunkLL3RAN55cjs.findLayer.call(void 0, s.layers, active.id) : null;
13220
+ const loc = active ? _chunkDFFBJV3Ucjs.findLayer.call(void 0, s.layers, active.id) : null;
13218
13221
  const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
13219
13222
  const below = loc ? siblings[loc.index - 1] : void 0;
13220
13223
  const hasSel = controller.hasSelection;
@@ -13396,18 +13399,18 @@ function layerEffectsPanel(layer) {
13396
13399
  reason: readOnly ? "The layer is locked; unlock it to change its effects." : void 0,
13397
13400
  enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _423 => _423.enabled]), () => ( true)),
13398
13401
  scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _424 => _424.scale]), () => ( 1)),
13399
- rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _425 => _425.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkLL3RAN55cjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
13402
+ rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _425 => _425.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkDFFBJV3Ucjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
13400
13403
  };
13401
13404
  }
13402
13405
  function layerEffectsBadge(layer) {
13403
13406
  if (!_optionalChain([layer, 'access', _426 => _426.effects, 'optionalAccess', _427 => _427.items, 'access', _428 => _428.length])) return null;
13404
- return _chunkLL3RAN55cjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
13407
+ return _chunkDFFBJV3Ucjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
13405
13408
  }
13406
- var LAYER_EFFECT_MENU = _chunkLL3RAN55cjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkLL3RAN55cjs.layerEffectLabel.call(void 0, kind) }));
13409
+ var LAYER_EFFECT_MENU = _chunkDFFBJV3Ucjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkDFFBJV3Ucjs.layerEffectLabel.call(void 0, kind) }));
13407
13410
  var BLENDS = _chunk7ISPWEJAcjs.BLEND_MODES.filter((m) => m.id !== "pigment").map((m) => ({ value: m.id, label: m.label }));
13408
13411
  var opt = (...pairs) => pairs.map(([value, label]) => ({ value, label }));
13409
13412
  function patternOptions(patterns) {
13410
- return [...patterns.map((p) => ({ value: p.id, label: p.name || p.id })), ..._chunkLL3RAN55cjs.builtinPatternIds.call(void 0, ).map((id) => ({ value: id, label: _chunkLL3RAN55cjs.builtinPattern.call(void 0, id).name }))];
13413
+ return [...patterns.map((p) => ({ value: p.id, label: p.name || p.id })), ..._chunkDFFBJV3Ucjs.builtinPatternIds.call(void 0, ).map((id) => ({ value: id, label: _chunkDFFBJV3Ucjs.builtinPattern.call(void 0, id).name }))];
13411
13414
  }
13412
13415
  function getPath(o, path) {
13413
13416
  let v = o;
@@ -13537,7 +13540,7 @@ function layerEffectControls(e, patterns = []) {
13537
13540
  }
13538
13541
  }
13539
13542
  function fillOfType(current, type, patterns) {
13540
- if (type === "gradient") return { type: "gradient", gradient: _chunkLL3RAN55cjs.defaultEffectGradient.call(void 0, ) };
13543
+ if (type === "gradient") return { type: "gradient", gradient: _chunkDFFBJV3Ucjs.defaultEffectGradient.call(void 0, ) };
13541
13544
  if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _435 => _435[0], 'optionalAccess', _436 => _436.id]), () => ( "checker")), scale: 1 };
13542
13545
  return { type: "color", color: current.type === "color" ? current.color : "#000000" };
13543
13546
  }
@@ -13757,7 +13760,7 @@ var FreeTransformTool = (_class12 = class {
13757
13760
  if (this.active) return null;
13758
13761
  try {
13759
13762
  if (!init.layerId && init.content !== "selection-outline" && !this.controller.getState().activeLayerId) {
13760
- const top = [..._chunkLL3RAN55cjs.flattenLayers.call(void 0, this.controller.getState().layers)].reverse().find((l) => l.type === "pixel" && l.visible);
13763
+ const top = [..._chunkDFFBJV3Ucjs.flattenLayers.call(void 0, this.controller.getState().layers)].reverse().find((l) => l.type === "pixel" && l.visible);
13761
13764
  if (top) this.controller.setActiveLayer(top.id);
13762
13765
  }
13763
13766
  const s = this.controller.beginFreeTransform(init);
@@ -14084,7 +14087,7 @@ var FreeTransformTool = (_class12 = class {
14084
14087
  bar() {
14085
14088
  const s = this.session;
14086
14089
  if (!s || !this.corners) return null;
14087
- const read = _chunkGLOOH65Ycjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14090
+ const read = _chunk4PUPGALMcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14088
14091
  return {
14089
14092
  affine: read.affine,
14090
14093
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -14109,7 +14112,7 @@ var FreeTransformTool = (_class12 = class {
14109
14112
  this.changed();
14110
14113
  return;
14111
14114
  }
14112
- const m = _chunkGLOOH65Ycjs.matrixFromParams.call(void 0, s.box, {
14115
+ const m = _chunk4PUPGALMcjs.matrixFromParams.call(void 0, s.box, {
14113
14116
  scaleX: next.scaleX,
14114
14117
  scaleY: next.scaleY,
14115
14118
  rotate: next.rotate,
@@ -14119,7 +14122,7 @@ var FreeTransformTool = (_class12 = class {
14119
14122
  dx: next.x - this.refBox.x,
14120
14123
  dy: next.y - this.refBox.y
14121
14124
  });
14122
- this.setCorners(_chunkGLOOH65Ycjs.cornersFromMatrix.call(void 0, s.box, m));
14125
+ this.setCorners(_chunk4PUPGALMcjs.cornersFromMatrix.call(void 0, s.box, m));
14123
14126
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
14124
14127
  this.changed();
14125
14128
  }
@@ -15051,5 +15054,8 @@ var FreeTransformTool = (_class12 = class {
15051
15054
 
15052
15055
 
15053
15056
 
15054
- exports.ADJUSTMENT_KEYS = _chunkGLOOH65Ycjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkGLOOH65Ycjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkGLOOH65Ycjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkGLOOH65Ycjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkGLOOH65Ycjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkGLOOH65Ycjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunk7ISPWEJAcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunk7ISPWEJAcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkGLOOH65Ycjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkL3PXFMOFcjs.BODY_SCATTER; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkK7V27T72cjs.BrushstrokeCache; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkL3PXFMOFcjs.CoverageMap; exports.D50 = _chunkGLOOH65Ycjs.D50; exports.D65 = _chunkGLOOH65Ycjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkVYW7JBTMcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkL3PXFMOFcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkL3PXFMOFcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkL3PXFMOFcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkLL3RAN55cjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkGLOOH65Ycjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkL3PXFMOFcjs.DEFAULT_MIXER; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkK7V27T72cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkL3PXFMOFcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkL3PXFMOFcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkL3PXFMOFcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkGLOOH65Ycjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkLL3RAN55cjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkL3PXFMOFcjs.DRY_EPS; exports.DabWalker = _chunkL3PXFMOFcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkGLOOH65Ycjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkL3PXFMOFcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkL3PXFMOFcjs.EX; exports.EY = _chunkL3PXFMOFcjs.EY; exports.FLAG_ALIVE = _chunkL3PXFMOFcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkL3PXFMOFcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkL3PXFMOFcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkL3PXFMOFcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkL3PXFMOFcjs.FLAG_TOP; exports.FLAG_WET = _chunkL3PXFMOFcjs.FLAG_WET; exports.FLAT = _chunkL3PXFMOFcjs.FLAT; exports.FREE_INTERVAL = _chunkL3PXFMOFcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkGLOOH65Ycjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkL3PXFMOFcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkGLOOH65Ycjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkGLOOH65Ycjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkLL3RAN55cjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkGLOOH65Ycjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkGLOOH65Ycjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkLL3RAN55cjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkGLOOH65Ycjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkGLOOH65Ycjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkGLOOH65Ycjs.LUMA_709; exports.LayerCompositor = _chunkGLOOH65Ycjs.LayerCompositor; exports.LayerEffectError = _chunkLL3RAN55cjs.LayerEffectError; exports.LayerOperationError = _chunkGLOOH65Ycjs.LayerOperationError; exports.MAX_BATCH = _chunkL3PXFMOFcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkL3PXFMOFcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkLL3RAN55cjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkGLOOH65Ycjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkL3PXFMOFcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkLL3RAN55cjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkL3PXFMOFcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkL3PXFMOFcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkGLOOH65Ycjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkGLOOH65Ycjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkL3PXFMOFcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkL3PXFMOFcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkL3PXFMOFcjs.MIXING_MODELS; exports.MixerStroke = _chunkL3PXFMOFcjs.MixerStroke; exports.OPP = _chunkL3PXFMOFcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunk7ISPWEJAcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkL3PXFMOFcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkGLOOH65Ycjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkL3PXFMOFcjs.PARAM; exports.PARAM_FLOATS = _chunkL3PXFMOFcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkGLOOH65Ycjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunk7ISPWEJAcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkL3PXFMOFcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkL3PXFMOFcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunk7ISPWEJAcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkL3PXFMOFcjs.PLANE; exports.PLANE_BYTES = _chunkL3PXFMOFcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkGLOOH65Ycjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkL3PXFMOFcjs.P_D0; exports.P_EDGE = _chunkL3PXFMOFcjs.P_EDGE; exports.P_FX = _chunkL3PXFMOFcjs.P_FX; exports.P_FY = _chunkL3PXFMOFcjs.P_FY; exports.P_H = _chunkL3PXFMOFcjs.P_H; exports.P_P0 = _chunkL3PXFMOFcjs.P_P0; exports.P_RHO = _chunkL3PXFMOFcjs.P_RHO; exports.P_SW = _chunkL3PXFMOFcjs.P_SW; exports.P_UX = _chunkL3PXFMOFcjs.P_UX; exports.P_UY = _chunkL3PXFMOFcjs.P_UY; exports.PaintExchange = _chunkL3PXFMOFcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkLL3RAN55cjs.PatternPlacement; exports.PatternTile = _chunkLL3RAN55cjs.PatternTile; exports.PsdError = _chunkGLOOH65Ycjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkK7V27T72cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkK7V27T72cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkK7V27T72cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkGLOOH65Ycjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkGLOOH65Ycjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkL3PXFMOFcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunk7ISPWEJAcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkGLOOH65Ycjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkGLOOH65Ycjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkL3PXFMOFcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkL3PXFMOFcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkL3PXFMOFcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkGLOOH65Ycjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkK7V27T72cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkL3PXFMOFcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkL3PXFMOFcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkGLOOH65Ycjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkL3PXFMOFcjs.SmudgeTip; exports.StrokeCoverage = _chunkL3PXFMOFcjs.StrokeCoverage; exports.SurfaceDraft = _chunk7ISPWEJAcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkGLOOH65Ycjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkGLOOH65Ycjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkGLOOH65Ycjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk7ISPWEJAcjs.TILE; exports.TILE_SHIFT = _chunk7ISPWEJAcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkGLOOH65Ycjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkGLOOH65Ycjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkK7V27T72cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkGLOOH65Ycjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkL3PXFMOFcjs.TileMedium; exports.TilePixelSource = _chunkK7V27T72cjs.TilePixelSource; exports.TiledSurface = _chunk7ISPWEJAcjs.TiledSurface; exports.TransformTooLargeError = _chunkLL3RAN55cjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkL3PXFMOFcjs.U_MAX; exports.VIBRANCE_GREY = _chunkGLOOH65Ycjs.VIBRANCE_GREY; exports.W9 = _chunkL3PXFMOFcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkVYW7JBTMcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkVYW7JBTMcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkL3PXFMOFcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkL3PXFMOFcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkL3PXFMOFcjs.WET_TILE; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetMedium = _chunkL3PXFMOFcjs.WetMedium; exports.WetWorkerPool = _chunkL3PXFMOFcjs.WetWorkerPool; exports.WetWorld = _chunkL3PXFMOFcjs.WetWorld; exports.WetWorldError = _chunkL3PXFMOFcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkGLOOH65Ycjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkGLOOH65Ycjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkGLOOH65Ycjs.activeSmartFilters; exports.addLayerEffect = _chunkGLOOH65Ycjs.addLayerEffect; exports.addLayerFilter = _chunkGLOOH65Ycjs.addLayerFilter; exports.addSmartFilter = _chunkGLOOH65Ycjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkGLOOH65Ycjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkGLOOH65Ycjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkGLOOH65Ycjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkGLOOH65Ycjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkGLOOH65Ycjs.anchorPoint; exports.annotationBlend = _chunkGLOOH65Ycjs.annotationBlend; exports.annotationLayerFor = _chunkGLOOH65Ycjs.annotationLayerFor; exports.annotationLayerName = _chunkGLOOH65Ycjs.annotationLayerName; exports.annotationOfLayer = _chunkGLOOH65Ycjs.annotationOfLayer; exports.annotationOfShape = _chunkGLOOH65Ycjs.annotationOfShape; exports.annotationOfType = _chunkGLOOH65Ycjs.annotationOfType; exports.applyAdjustmentLayers = _chunkGLOOH65Ycjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkGLOOH65Ycjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkGLOOH65Ycjs.applyAdjustments; exports.applyBoxBlur = _chunkGLOOH65Ycjs.applyBoxBlur; exports.applyDepthMask = _chunkGLOOH65Ycjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkGLOOH65Ycjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkGLOOH65Ycjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkGLOOH65Ycjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkGLOOH65Ycjs.applyParams; exports.applyProcess2Adjustments = _chunkGLOOH65Ycjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkK7V27T72cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkGLOOH65Ycjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkL3PXFMOFcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkL3PXFMOFcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkK7V27T72cjs.applyToneToDeepTile; exports.backgroundLayer = _chunkGLOOH65Ycjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkK7V27T72cjs.bestOffset; exports.blackWhiteGray = _chunkGLOOH65Ycjs.blackWhiteGray; exports.blendChannel = _chunk7ISPWEJAcjs.blendChannel; exports.blendImageData = _chunk7ISPWEJAcjs.blendImageData; exports.blendLum = _chunk7ISPWEJAcjs.blendLum; exports.blendPixel = _chunk7ISPWEJAcjs.blendPixel; exports.blendRadius = _chunkL3PXFMOFcjs.blendRadius; exports.blendRgb = _chunk7ISPWEJAcjs.blendRgb; exports.blendTile = _chunkLL3RAN55cjs.blendTile; exports.blenderDab = _chunkL3PXFMOFcjs.blenderDab; exports.blurFilter = _chunkGLOOH65Ycjs.blurFilter; exports.borderCoverage = _chunkGLOOH65Ycjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkGLOOH65Ycjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkGLOOH65Ycjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkK7V27T72cjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkK7V27T72cjs.brushstrokeKey; exports.brushstrokeSamples = _chunkK7V27T72cjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkK7V27T72cjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkK7V27T72cjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkK7V27T72cjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkGLOOH65Ycjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkGLOOH65Ycjs.buildToneLut; exports.builtinPattern = _chunkLL3RAN55cjs.builtinPattern; exports.builtinPatternIds = _chunkLL3RAN55cjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkGLOOH65Ycjs.calculateCropDrag; exports.canShareMemory = _chunkL3PXFMOFcjs.canShareMemory; exports.canvasCompositeOperation = _chunk7ISPWEJAcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkGLOOH65Ycjs.canvasToImagePoint; exports.caretAt = _chunkVYW7JBTMcjs.caretAt; exports.changedTiles = _chunkLL3RAN55cjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkGLOOH65Ycjs.clampCropToImage; exports.cleanMixer = _chunkL3PXFMOFcjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunk7ISPWEJAcjs.collectTiles; exports.colorBalanceChannel = _chunkGLOOH65Ycjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkGLOOH65Ycjs.combineSelections; exports.compileAdjustmentLayer = _chunkGLOOH65Ycjs.compileAdjustmentLayer; exports.componentPath = _chunkGLOOH65Ycjs.componentPath; exports.compositeDeep = _chunkGLOOH65Ycjs.compositeDeep; exports.compositeSurfaceOver = _chunkLL3RAN55cjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkGLOOH65Ycjs.computeSelectionBounds; exports.contentBounds = _chunk7ISPWEJAcjs.contentBounds; exports.contentsBox = _chunkGLOOH65Ycjs.contentsBox; exports.contentsSurface = _chunkGLOOH65Ycjs.contentsSurface; exports.contractCoverage = _chunkGLOOH65Ycjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunk7ISPWEJAcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkGLOOH65Ycjs.convertToSmartObject; exports.copySmartObject = _chunkGLOOH65Ycjs.copySmartObject; exports.cornersFromMatrix = _chunkGLOOH65Ycjs.cornersFromMatrix; exports.coverageTileCoord = _chunkL3PXFMOFcjs.coverageTileCoord; exports.coverageToByte = _chunkGLOOH65Ycjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkGLOOH65Ycjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkL3PXFMOFcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkVYW7JBTMcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkVYW7JBTMcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkVYW7JBTMcjs.createOutlineTextShaper; exports.createPigment = _chunk7ISPWEJAcjs.createPigment; exports.createPigmentTools = _chunkL3PXFMOFcjs.createPigmentTools; exports.createSelectionMask = _chunkGLOOH65Ycjs.createSelectionMask; exports.createShapeLayer = _chunkGLOOH65Ycjs.createShapeLayer; exports.createTypeLayer = _chunkGLOOH65Ycjs.createTypeLayer; exports.cssFont = _chunkVYW7JBTMcjs.cssFont; exports.cssFontFamily = _chunkVYW7JBTMcjs.cssFontFamily; exports.curveLut = _chunkLL3RAN55cjs.curveLut; exports.curveLutFromLevels = _chunkGLOOH65Ycjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkL3PXFMOFcjs.dabCoverage; exports.dabRect = _chunkL3PXFMOFcjs.dabRect; exports.decodeDeepSurface = _chunkGLOOH65Ycjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkGLOOH65Ycjs.decodeLayerChannel; exports.decodeLayerMask = _chunkGLOOH65Ycjs.decodeLayerMask; exports.decodeMergedImage = _chunkGLOOH65Ycjs.decodeMergedImage; exports.decodePlanes = _chunkGLOOH65Ycjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkGLOOH65Ycjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkGLOOH65Ycjs.decodeSelectionRle; exports.deepBytes = _chunk7ISPWEJAcjs.deepBytes; exports.deepTile = _chunk7ISPWEJAcjs.deepTile; exports.defaultAdjustmentParams = _chunkGLOOH65Ycjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkLL3RAN55cjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkLL3RAN55cjs.defaultLayerEffect; exports.defaultShapeName = _chunkGLOOH65Ycjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkGLOOH65Ycjs.depthMaskAlpha; exports.depthOf = _chunk7ISPWEJAcjs.depthOf; exports.depthRasterMask = _chunkGLOOH65Ycjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkGLOOH65Ycjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkGLOOH65Ycjs.deserializeEffects; exports.deserializeLayer = _chunkGLOOH65Ycjs.deserializeLayer; exports.deserializeLayers = _chunkGLOOH65Ycjs.deserializeLayers; exports.deserializePatterns = _chunkGLOOH65Ycjs.deserializePatterns; exports.deserializeSelection = _chunkGLOOH65Ycjs.deserializeSelection; exports.developFilter = _chunkGLOOH65Ycjs.developFilter; exports.developFromAdjustments = _chunkGLOOH65Ycjs.developFromAdjustments; exports.developTarget = _chunkGLOOH65Ycjs.developTarget; exports.dexp = _chunkL3PXFMOFcjs.dexp; exports.dilateMask = _chunkK7V27T72cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkGLOOH65Ycjs.distanceTransform; exports.dlog = _chunkL3PXFMOFcjs.dlog; exports.documentContents = _chunkGLOOH65Ycjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkK7V27T72cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkK7V27T72cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkL3PXFMOFcjs.dpow; exports.dragWarpMeshPoint = _chunkVYW7JBTMcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkL3PXFMOFcjs.dsincos; exports.duplicateLayer = _chunkGLOOH65Ycjs.duplicateLayer; exports.edgeBits = _chunkL3PXFMOFcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkLL3RAN55cjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkLL3RAN55cjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkLL3RAN55cjs.effectsFingerprint; exports.effectsMargin = _chunkLL3RAN55cjs.effectsMargin; exports.effectsScale = _chunkLL3RAN55cjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk7ISPWEJAcjs.emptySurface; exports.encodeDeepSurface = _chunkGLOOH65Ycjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkGLOOH65Ycjs.encodeRle; exports.encodeSelectionRle = _chunkGLOOH65Ycjs.encodeSelectionRle; exports.encodeSurface = _chunkGLOOH65Ycjs.encodeSurface; exports.evalWarpMesh = _chunkVYW7JBTMcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkGLOOH65Ycjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkL3PXFMOFcjs.exchangeRates; exports.expNeg = _chunkL3PXFMOFcjs.expNeg; exports.expandCoverage = _chunkGLOOH65Ycjs.expandCoverage; exports.exportPsd = _chunkGLOOH65Ycjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkGLOOH65Ycjs.featherCoverage; exports.fillRect = _chunk7ISPWEJAcjs.fillRect; exports.filmPixel = _chunkL3PXFMOFcjs.filmPixel; exports.filmReflectance = _chunkL3PXFMOFcjs.filmReflectance; exports.filterMaskCoverage = _chunkGLOOH65Ycjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkLL3RAN55cjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunk7ISPWEJAcjs.finishTile; exports.fitParagraphRuns = _chunkVYW7JBTMcjs.fitParagraphRuns; exports.fitRuns = _chunkVYW7JBTMcjs.fitRuns; exports.flattenLayers = _chunkLL3RAN55cjs.flattenLayers; exports.flattenPath = _chunkGLOOH65Ycjs.flattenPath; exports.flipCorners = _chunkGLOOH65Ycjs.flipCorners; exports.flowField = _chunkL3PXFMOFcjs.flowField; exports.fontOf = _chunkVYW7JBTMcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkGLOOH65Ycjs.fullSelection; exports.gaussianBlur = _chunkLL3RAN55cjs.gaussianBlur; exports.geometryHomography = _chunkGLOOH65Ycjs.geometryHomography; exports.getAnnotationBounds = _chunkGLOOH65Ycjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkGLOOH65Ycjs.getCropCursor; exports.getRotatedSize = _chunkGLOOH65Ycjs.getRotatedSize; exports.getViewportMetrics = _chunkGLOOH65Ycjs.getViewportMetrics; exports.getViewportProjection = _chunkGLOOH65Ycjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkGLOOH65Ycjs.greyMorphology; exports.groupLayers = _chunkGLOOH65Ycjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkLL3RAN55cjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkGLOOH65Ycjs.hasResampledLegacyMask; exports.hasSurface = _chunkGLOOH65Ycjs.hasSurface; exports.hasWarp = _chunkGLOOH65Ycjs.hasWarp; exports.hashMaskContent = _chunkGLOOH65Ycjs.hashMaskContent; exports.hashNoise = _chunkLL3RAN55cjs.hashNoise; exports.healPixels = _chunkK7V27T72cjs.healPixels; exports.hexToRgb = _chunkGLOOH65Ycjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkGLOOH65Ycjs.hitTestAnnotation; exports.hitTestCrop = _chunkGLOOH65Ycjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkGLOOH65Ycjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkGLOOH65Ycjs.hueRangeTables; exports.hueRangeWeight = _chunkGLOOH65Ycjs.hueRangeWeight; exports.hueSaturation = _chunkGLOOH65Ycjs.hueSaturation; exports.identityCurve = _chunkGLOOH65Ycjs.identityCurve; exports.identityLevels = _chunkGLOOH65Ycjs.identityLevels; exports.identityTransform = _chunkGLOOH65Ycjs.identityTransform; exports.identityWarpMesh = _chunkVYW7JBTMcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkGLOOH65Ycjs.imageToCanvasPoint; exports.importPsd = _chunkGLOOH65Ycjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkLL3RAN55cjs.insertLayer; exports.instancesOf = _chunkGLOOH65Ycjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkGLOOH65Ycjs.invertMatrix3; exports.invertSelection = _chunkGLOOH65Ycjs.invertSelection; exports.isActiveFilter = _chunkGLOOH65Ycjs.isActiveFilter; exports.isAdjustmentKind = _chunkGLOOH65Ycjs.isAdjustmentKind; exports.isBitDepth = _chunk7ISPWEJAcjs.isBitDepth; exports.isBlendMode = _chunk7ISPWEJAcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkK7V27T72cjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkGLOOH65Ycjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkGLOOH65Ycjs.isDefaultDepthMask; exports.isIdentityTransform = _chunkGLOOH65Ycjs.isIdentityTransform; exports.isInterpolation = _chunkLL3RAN55cjs.isInterpolation; exports.isLayerEffectKind = _chunkLL3RAN55cjs.isLayerEffectKind; exports.isLayerLocked = _chunkLL3RAN55cjs.isLayerLocked; exports.isLegacyShape = _chunkGLOOH65Ycjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunk7ISPWEJAcjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkGLOOH65Ycjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkGLOOH65Ycjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkGLOOH65Ycjs.isSelectionEmpty; exports.isSelectionMode = _chunkGLOOH65Ycjs.isSelectionMode; exports.isSeparableBlendMode = _chunk7ISPWEJAcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkGLOOH65Ycjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkGLOOH65Ycjs.isTransformAnchor; exports.isValidWarp = _chunkGLOOH65Ycjs.isValidWarp; exports.keepDeepSamples = _chunk7ISPWEJAcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkGLOOH65Ycjs.kelvinToTemperature; exports.keysWeight = _chunkLL3RAN55cjs.keysWeight; exports.latticeViscosity = _chunkL3PXFMOFcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkLL3RAN55cjs.layerEffectFields; exports.layerEffectLabel = _chunkLL3RAN55cjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkGLOOH65Ycjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkGLOOH65Ycjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkGLOOH65Ycjs.layerMaskFromSelection; exports.layerMaskKey = _chunkGLOOH65Ycjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkGLOOH65Ycjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkGLOOH65Ycjs.layerTree; exports.layerTypeLabel = _chunkGLOOH65Ycjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkGLOOH65Ycjs.layersFromLegacy; exports.layoutText = _chunkVYW7JBTMcjs.layoutText; exports.legacyAdjustmentLayer = _chunkGLOOH65Ycjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkGLOOH65Ycjs.legacyMaskOf; exports.legacyView = _chunkGLOOH65Ycjs.legacyView; exports.lerpPigment = _chunk7ISPWEJAcjs.lerpPigment; exports.lerpPigmentInto = _chunk7ISPWEJAcjs.lerpPigmentInto; exports.levelsValue = _chunkGLOOH65Ycjs.levelsValue; exports.linearSrgbToXy = _chunkGLOOH65Ycjs.linearSrgbToXy; exports.linearToSrgb = _chunkGLOOH65Ycjs.linearToSrgb; exports.linearToSrgb8 = _chunkL3PXFMOFcjs.linearToSrgb8; exports.liveComponent = _chunkGLOOH65Ycjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkGLOOH65Ycjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkL3PXFMOFcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkL3PXFMOFcjs.loadWetKernel; exports.luma = _chunkK7V27T72cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkGLOOH65Ycjs.mapCropHandle; exports.mapLayer = _chunkLL3RAN55cjs.mapLayer; exports.mapSubpaths = _chunkGLOOH65Ycjs.mapSubpaths; exports.maskBounds = _chunkK7V27T72cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkGLOOH65Ycjs.matrixFromCorners; exports.matrixFromParams = _chunkGLOOH65Ycjs.matrixFromParams; exports.membraneFill = _chunkK7V27T72cjs.membraneFill; exports.mergeLayerEffect = _chunkLL3RAN55cjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkGLOOH65Ycjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunk7ISPWEJAcjs.mixPigment8; exports.mixPigmentRgb = _chunk7ISPWEJAcjs.mixPigmentRgb; exports.mixPigments = _chunk7ISPWEJAcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkL3PXFMOFcjs.mixerRates; exports.modifySelection = _chunkGLOOH65Ycjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkGLOOH65Ycjs.moveLayer; exports.moveSmartFilter = _chunkGLOOH65Ycjs.moveSmartFilter; exports.mulMatrix3 = _chunkGLOOH65Ycjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkGLOOH65Ycjs.neutralHueRange; exports.newContentsId = _chunkGLOOH65Ycjs.newContentsId; exports.newEffectId = _chunkLL3RAN55cjs.newEffectId; exports.newLayerId = _chunkGLOOH65Ycjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkGLOOH65Ycjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkGLOOH65Ycjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkGLOOH65Ycjs.normalizeAngle; exports.normalizeBlendMode = _chunk7ISPWEJAcjs.normalizeBlendMode; exports.normalizeBlender = _chunkL3PXFMOFcjs.normalizeBlender; exports.normalizeBrush = _chunkL3PXFMOFcjs.normalizeBrush; exports.normalizeFilter = _chunkGLOOH65Ycjs.normalizeFilter; exports.normalizeFlow = _chunkL3PXFMOFcjs.normalizeFlow; exports.normalizeLayerEffects = _chunkLL3RAN55cjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkGLOOH65Ycjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkGLOOH65Ycjs.normalizeLiveShape; exports.normalizeMixer = _chunkL3PXFMOFcjs.normalizeMixer; exports.normalizePlacement = _chunkGLOOH65Ycjs.normalizePlacement; exports.normalizeProcessVersion = _chunkGLOOH65Ycjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkK7V27T72cjs.normalizeRetouch; exports.normalizeShapePaint = _chunkGLOOH65Ycjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkGLOOH65Ycjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkGLOOH65Ycjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkL3PXFMOFcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkGLOOH65Ycjs.normalizeSubpaths; exports.normalizeText = _chunkGLOOH65Ycjs.normalizeText; exports.normalizeTilt = _chunkL3PXFMOFcjs.normalizeTilt; exports.normalizeWetParams = _chunkL3PXFMOFcjs.normalizeWetParams; exports.offsetLayer = _chunkGLOOH65Ycjs.offsetLayer; exports.offsetShape = _chunkGLOOH65Ycjs.offsetShape; exports.offsetSmartObject = _chunkGLOOH65Ycjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunk7ISPWEJAcjs.packRgba; exports.packWetParams = _chunkL3PXFMOFcjs.packWetParams; exports.paintPathStroke = _chunkK7V27T72cjs.paintPathStroke; exports.paragraphRanges = _chunkVYW7JBTMcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkGLOOH65Ycjs.parseAdjustmentBlock; exports.parseBlend = _chunkGLOOH65Ycjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkGLOOH65Ycjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunkLL3RAN55cjs.parseEffectColor; exports.parseLfx2 = _chunkGLOOH65Ycjs.parseLfx2; exports.parseLrfx = _chunkGLOOH65Ycjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePatternBlock = _chunkGLOOH65Ycjs.parsePatternBlock; exports.parseSelectionMode = _chunkGLOOH65Ycjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkGLOOH65Ycjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkGLOOH65Ycjs.patchParagraphStyle; exports.patchTextStyle = _chunkGLOOH65Ycjs.patchTextStyle; exports.pathStrokeCoverage = _chunkK7V27T72cjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkK7V27T72cjs.pathStrokeDabs; exports.perDabStrength = _chunkK7V27T72cjs.perDabStrength; exports.photoFilterMatrix = _chunkGLOOH65Ycjs.photoFilterMatrix; exports.pigment8 = _chunk7ISPWEJAcjs.pigment8; exports.pigmentColor = _chunkL3PXFMOFcjs.pigmentColor; exports.pigmentOf = _chunkL3PXFMOFcjs.pigmentOf; exports.pixelLayerBounds = _chunkGLOOH65Ycjs.pixelLayerBounds; exports.pixelLayers = _chunkGLOOH65Ycjs.pixelLayers; exports.pixelPigment = _chunkL3PXFMOFcjs.pixelPigment; exports.placeContents = _chunkGLOOH65Ycjs.placeContents; exports.placeLayer = _chunkGLOOH65Ycjs.placeLayer; exports.placementAt = _chunkGLOOH65Ycjs.placementAt; exports.placementBounds = _chunkGLOOH65Ycjs.placementBounds; exports.placementGeometry = _chunkGLOOH65Ycjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkGLOOH65Ycjs.posterizeValue; exports.presetWarp = _chunkGLOOH65Ycjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkGLOOH65Ycjs.projectImagePoint; exports.projectImageRect = _chunkGLOOH65Ycjs.projectImageRect; exports.projectMaskCoverage = _chunkGLOOH65Ycjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunk7ISPWEJAcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkGLOOH65Ycjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkGLOOH65Ycjs.psdToLayers; exports.pullWarpMesh = _chunkVYW7JBTMcjs.pullWarpMesh; exports.put255 = _chunkL3PXFMOFcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkGLOOH65Ycjs.rangeLightness; exports.rasterContents = _chunkGLOOH65Ycjs.rasterContents; exports.rasterMaskFromLegacy = _chunkGLOOH65Ycjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkGLOOH65Ycjs.rasterizeCoverage; exports.rasterizeDab = _chunkL3PXFMOFcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkGLOOH65Ycjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunk7ISPWEJAcjs.readDeepRegion; exports.readPixel = _chunk7ISPWEJAcjs.readPixel; exports.readPsd = _chunkGLOOH65Ycjs.readPsd; exports.readRegion = _chunk7ISPWEJAcjs.readRegion; exports.readSourceRegion = _chunkK7V27T72cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkLL3RAN55cjs.reduceSurface; exports.referencePoint = _chunkGLOOH65Ycjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunk7ISPWEJAcjs.reflectanceToRgb; exports.removeAlpha = _chunkGLOOH65Ycjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkGLOOH65Ycjs.removeLayer; exports.removeLayerEffect = _chunkGLOOH65Ycjs.removeLayerEffect; exports.removeLayerFilter = _chunkGLOOH65Ycjs.removeLayerFilter; exports.removeSmartFilter = _chunkGLOOH65Ycjs.removeSmartFilter; exports.renderBrushstroke = _chunkK7V27T72cjs.renderBrushstroke; exports.renderLayerEffects = _chunkLL3RAN55cjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkGLOOH65Ycjs.renderShape; exports.renderShapeRect = _chunkGLOOH65Ycjs.renderShapeRect; exports.renderSmartObject = _chunkGLOOH65Ycjs.renderSmartObject; exports.renderText = _chunkGLOOH65Ycjs.renderText; exports.replaceContents = _chunkGLOOH65Ycjs.replaceContents; exports.replaceTextRange = _chunkGLOOH65Ycjs.replaceTextRange; exports.requireLayer = _chunkGLOOH65Ycjs.requireLayer; exports.requireOperation = _chunkGLOOH65Ycjs.requireOperation; exports.requireShapeLayer = _chunkGLOOH65Ycjs.requireShapeLayer; exports.requireSmartObject = _chunkGLOOH65Ycjs.requireSmartObject; exports.requireTypeLayer = _chunkGLOOH65Ycjs.requireTypeLayer; exports.requireUnlocked = _chunkGLOOH65Ycjs.requireUnlocked; exports.rerender = _chunkGLOOH65Ycjs.rerender; exports.rerenderShape = _chunkGLOOH65Ycjs.rerenderShape; exports.rerenderText = _chunkGLOOH65Ycjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkGLOOH65Ycjs.resizeSelection; exports.resizeWarpMesh = _chunkVYW7JBTMcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkGLOOH65Ycjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkVYW7JBTMcjs.restyleRange; exports.rgbToGray = _chunkGLOOH65Ycjs.rgbToGray; exports.rgbToHsl = _chunkGLOOH65Ycjs.rgbToHsl; exports.rgbToReflectance = _chunk7ISPWEJAcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkK7V27T72cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkGLOOH65Ycjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkGLOOH65Ycjs.sampleLut; exports.sampleToneLut = _chunkGLOOH65Ycjs.sampleToneLut; exports.saturationOf = _chunkK7V27T72cjs.saturationOf; exports.scaleLayerEffect = _chunkLL3RAN55cjs.scaleLayerEffect; exports.seamlessClone = _chunkK7V27T72cjs.seamlessClone; exports.selectionArea = _chunkGLOOH65Ycjs.selectionArea; exports.selectionFromCoverage = _chunkGLOOH65Ycjs.selectionFromCoverage; exports.selectionFromPixels = _chunkGLOOH65Ycjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkGLOOH65Ycjs.selectionToCoverage; exports.selectionToPixels = _chunkGLOOH65Ycjs.selectionToPixels; exports.selectionValueAt = _chunkGLOOH65Ycjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkGLOOH65Ycjs.serializeContents; exports.serializeEffects = _chunkGLOOH65Ycjs.serializeEffects; exports.serializeLayer = _chunkGLOOH65Ycjs.serializeLayer; exports.serializeLayers = _chunkGLOOH65Ycjs.serializeLayers; exports.serializeLayersExternal = _chunkGLOOH65Ycjs.serializeLayersExternal; exports.serializePatterns = _chunkGLOOH65Ycjs.serializePatterns; exports.serializeSelection = _chunkGLOOH65Ycjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkGLOOH65Ycjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkGLOOH65Ycjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkGLOOH65Ycjs.setLayerMask; exports.setLayerProperties = _chunkGLOOH65Ycjs.setLayerProperties; exports.setLum = _chunk7ISPWEJAcjs.setLum; exports.setPigmentColor = _chunk7ISPWEJAcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkGLOOH65Ycjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkGLOOH65Ycjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkGLOOH65Ycjs.setSmartPlacement; exports.shadeTile = _chunkL3PXFMOFcjs.shadeTile; exports.shapeAsPixelLayer = _chunkGLOOH65Ycjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkGLOOH65Ycjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkGLOOH65Ycjs.shapeGeometryBounds; exports.shapeLayers = _chunkGLOOH65Ycjs.shapeLayers; exports.shapeOutline = _chunkGLOOH65Ycjs.shapeOutline; exports.shapeRenderClip = _chunkGLOOH65Ycjs.shapeRenderClip; exports.shiftCoverage = _chunkGLOOH65Ycjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkGLOOH65Ycjs.smartObjectLayers; exports.smoothCoverage = _chunkGLOOH65Ycjs.smoothCoverage; exports.smoothPoints = _chunkL3PXFMOFcjs.smoothPoints; exports.smudgeEffect = _chunkK7V27T72cjs.smudgeEffect; exports.solidSurface = _chunk7ISPWEJAcjs.solidSurface; exports.solveMembrane = _chunkK7V27T72cjs.solveMembrane; exports.spliceRuns = _chunkVYW7JBTMcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkK7V27T72cjs.sponge; exports.spongeEffect = _chunkK7V27T72cjs.spongeEffect; exports.spotHealPixels = _chunkK7V27T72cjs.spotHealPixels; exports.spotHealWindow = _chunkK7V27T72cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkL3PXFMOFcjs.srgbByteToLinear; exports.srgbDecode = _chunk7ISPWEJAcjs.srgbDecode; exports.srgbEncode = _chunk7ISPWEJAcjs.srgbEncode; exports.srgbToLinear = _chunkGLOOH65Ycjs.srgbToLinear; exports.standardBlendMode = _chunk7ISPWEJAcjs.standardBlendMode; exports.stepSlotTs = _chunkL3PXFMOFcjs.stepSlotTs; exports.styleAt = _chunkVYW7JBTMcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunk7ISPWEJAcjs.surfaceBytes; exports.surfaceDepth = _chunk7ISPWEJAcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunk7ISPWEJAcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk7ISPWEJAcjs.surfaceFromPixels; exports.surfacesEqual = _chunk7ISPWEJAcjs.surfacesEqual; exports.tempTintToXy = _chunkGLOOH65Ycjs.tempTintToXy; exports.temperatureToKelvin = _chunkGLOOH65Ycjs.temperatureToKelvin; exports.textIndexAt = _chunkVYW7JBTMcjs.textIndexAt; exports.textMatrix = _chunkGLOOH65Ycjs.textMatrix; exports.textOutlines = _chunkGLOOH65Ycjs.textOutlines; exports.textRange = _chunkGLOOH65Ycjs.textRange; exports.tileCoord = _chunk7ISPWEJAcjs.tileCoord; exports.tileKey = _chunk7ISPWEJAcjs.tileKey; exports.tileRect = _chunk7ISPWEJAcjs.tileRect; exports.tileSamples = _chunk7ISPWEJAcjs.tileSamples; exports.tileSamples16 = _chunk7ISPWEJAcjs.tileSamples16; exports.tileSamples32 = _chunk7ISPWEJAcjs.tileSamples32; exports.tilesInRect = _chunk7ISPWEJAcjs.tilesInRect; exports.tipFalloff = _chunkL3PXFMOFcjs.tipFalloff; exports.tipReach = _chunkL3PXFMOFcjs.tipReach; exports.tipShape = _chunkL3PXFMOFcjs.tipShape; exports.to16From32 = _chunk7ISPWEJAcjs.to16From32; exports.to16From8 = _chunk7ISPWEJAcjs.to16From8; exports.to32From16 = _chunk7ISPWEJAcjs.to32From16; exports.to32From8 = _chunk7ISPWEJAcjs.to32From8; exports.to8From16 = _chunk7ISPWEJAcjs.to8From16; exports.to8From32 = _chunk7ISPWEJAcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkGLOOH65Ycjs.toTextSpace; exports.toneCurve = _chunkGLOOH65Ycjs.toneCurve; exports.toneLuts = _chunkGLOOH65Ycjs.toneLuts; exports.toneOf = _chunkK7V27T72cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkGLOOH65Ycjs.transformHomography; exports.transformMap = _chunkGLOOH65Ycjs.transformMap; exports.transformShapeComponents = _chunkGLOOH65Ycjs.transformShapeComponents; exports.transformSurface = _chunkLL3RAN55cjs.transformSurface; exports.transformTypeLayer = _chunkGLOOH65Ycjs.transformTypeLayer; exports.transformedBounds = _chunkLL3RAN55cjs.transformedBounds; exports.transformedBox = _chunkGLOOH65Ycjs.transformedBox; exports.transformedPoint = _chunkGLOOH65Ycjs.transformedPoint; exports.translateSurface = _chunk7ISPWEJAcjs.translateSurface; exports.typeAsPixelLayer = _chunkGLOOH65Ycjs.typeAsPixelLayer; exports.typeFrame = _chunkGLOOH65Ycjs.typeFrame; exports.typeFromAnnotation = _chunkGLOOH65Ycjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkGLOOH65Ycjs.typeLayerName; exports.ungroupLayer = _chunkGLOOH65Ycjs.ungroupLayer; exports.uniformTile = _chunk7ISPWEJAcjs.uniformTile; exports.unionRect = _chunkGLOOH65Ycjs.unionRect; exports.unprojectCanvasPoint = _chunkGLOOH65Ycjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkGLOOH65Ycjs.updateLayerEffect; exports.updateLayerFilter = _chunkGLOOH65Ycjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkGLOOH65Ycjs.updateLayerMaskProps; exports.updateShapeLayer = _chunkGLOOH65Ycjs.updateShapeLayer; exports.updateSmartFilter = _chunkGLOOH65Ycjs.updateSmartFilter; exports.updateTypeLayer = _chunkGLOOH65Ycjs.updateTypeLayer; exports.uvToXy = _chunkGLOOH65Ycjs.uvToXy; exports.validateEffectGradient = _chunkLL3RAN55cjs.validateEffectGradient; exports.validateLayerEffect = _chunkLL3RAN55cjs.validateLayerEffect; exports.validateLayerEffects = _chunkLL3RAN55cjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkGLOOH65Ycjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkGLOOH65Ycjs.vibranceLinear; exports.vibrancePixel = _chunkGLOOH65Ycjs.vibrancePixel; exports.walkDabs = _chunkL3PXFMOFcjs.walkDabs; exports.warpMeshEditPoints = _chunkVYW7JBTMcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkVYW7JBTMcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkVYW7JBTMcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkVYW7JBTMcjs.warpPresetMesh; exports.warpSurface = _chunkLL3RAN55cjs.warpSurface; exports.wbMatrix = _chunkGLOOH65Ycjs.wbMatrix; exports.wetSimdSupported = _chunkL3PXFMOFcjs.wetSimdSupported; exports.wetSupport = _chunkL3PXFMOFcjs.wetSupport; exports.whiteBalanceFromSample = _chunkGLOOH65Ycjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkGLOOH65Ycjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkGLOOH65Ycjs.withFilterMaskSurface; exports.withNewIds = _chunkGLOOH65Ycjs.withNewIds; exports.writeAdjustmentBlock = _chunkGLOOH65Ycjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunk7ISPWEJAcjs.writeDeepRegion; exports.writeLfx2 = _chunkGLOOH65Ycjs.writeLfx2; exports.writePatternBlock = _chunkGLOOH65Ycjs.writePatternBlock; exports.writePsd = _chunkGLOOH65Ycjs.writePsd; exports.writeRegion = _chunk7ISPWEJAcjs.writeRegion; exports.xyToTempTint = _chunkGLOOH65Ycjs.xyToTempTint; exports.xyToUv = _chunkGLOOH65Ycjs.xyToUv;
15057
+
15058
+
15059
+
15060
+ exports.ADJUSTMENT_KEYS = _chunk4PUPGALMcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunk4PUPGALMcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunk4PUPGALMcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunk4PUPGALMcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunk4PUPGALMcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunk4PUPGALMcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunk7ISPWEJAcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunk7ISPWEJAcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunk4PUPGALMcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkL3PXFMOFcjs.BODY_SCATTER; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkK7V27T72cjs.BrushstrokeCache; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkL3PXFMOFcjs.CoverageMap; exports.D50 = _chunk4PUPGALMcjs.D50; exports.D65 = _chunk4PUPGALMcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkVYW7JBTMcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkL3PXFMOFcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkL3PXFMOFcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkL3PXFMOFcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkDFFBJV3Ucjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunk4PUPGALMcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkL3PXFMOFcjs.DEFAULT_MIXER; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkK7V27T72cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkL3PXFMOFcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkL3PXFMOFcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkL3PXFMOFcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunk4PUPGALMcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkDFFBJV3Ucjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkL3PXFMOFcjs.DRY_EPS; exports.DabWalker = _chunkL3PXFMOFcjs.DabWalker; exports.EMPTY_DISTANCE = _chunk4PUPGALMcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkL3PXFMOFcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkL3PXFMOFcjs.EX; exports.EY = _chunkL3PXFMOFcjs.EY; exports.FLAG_ALIVE = _chunkL3PXFMOFcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkL3PXFMOFcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkL3PXFMOFcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkL3PXFMOFcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkL3PXFMOFcjs.FLAG_TOP; exports.FLAG_WET = _chunkL3PXFMOFcjs.FLAG_WET; exports.FLAT = _chunkL3PXFMOFcjs.FLAT; exports.FREE_INTERVAL = _chunkL3PXFMOFcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunk4PUPGALMcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkL3PXFMOFcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunk4PUPGALMcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunk4PUPGALMcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkDFFBJV3Ucjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunk4PUPGALMcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunk4PUPGALMcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkDFFBJV3Ucjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunk4PUPGALMcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunk4PUPGALMcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunk4PUPGALMcjs.LUMA_709; exports.LayerCompositor = _chunk4PUPGALMcjs.LayerCompositor; exports.LayerEffectError = _chunkDFFBJV3Ucjs.LayerEffectError; exports.LayerOperationError = _chunk4PUPGALMcjs.LayerOperationError; exports.MAX_BATCH = _chunkL3PXFMOFcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkL3PXFMOFcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkDFFBJV3Ucjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunk4PUPGALMcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkL3PXFMOFcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkDFFBJV3Ucjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkL3PXFMOFcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkL3PXFMOFcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunk4PUPGALMcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunk4PUPGALMcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkL3PXFMOFcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkL3PXFMOFcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkL3PXFMOFcjs.MIXING_MODELS; exports.MixerStroke = _chunkL3PXFMOFcjs.MixerStroke; exports.OPP = _chunkL3PXFMOFcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunk7ISPWEJAcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkL3PXFMOFcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunk4PUPGALMcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkL3PXFMOFcjs.PARAM; exports.PARAM_FLOATS = _chunkL3PXFMOFcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunk4PUPGALMcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunk7ISPWEJAcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkL3PXFMOFcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkL3PXFMOFcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunk7ISPWEJAcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkL3PXFMOFcjs.PLANE; exports.PLANE_BYTES = _chunkL3PXFMOFcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunk4PUPGALMcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkL3PXFMOFcjs.P_D0; exports.P_EDGE = _chunkL3PXFMOFcjs.P_EDGE; exports.P_FX = _chunkL3PXFMOFcjs.P_FX; exports.P_FY = _chunkL3PXFMOFcjs.P_FY; exports.P_H = _chunkL3PXFMOFcjs.P_H; exports.P_P0 = _chunkL3PXFMOFcjs.P_P0; exports.P_RHO = _chunkL3PXFMOFcjs.P_RHO; exports.P_SW = _chunkL3PXFMOFcjs.P_SW; exports.P_UX = _chunkL3PXFMOFcjs.P_UX; exports.P_UY = _chunkL3PXFMOFcjs.P_UY; exports.PaintExchange = _chunkL3PXFMOFcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkDFFBJV3Ucjs.PatternPlacement; exports.PatternTile = _chunkDFFBJV3Ucjs.PatternTile; exports.PsdError = _chunk4PUPGALMcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkK7V27T72cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkK7V27T72cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkK7V27T72cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunk4PUPGALMcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunk4PUPGALMcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkL3PXFMOFcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunk7ISPWEJAcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunk4PUPGALMcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunk4PUPGALMcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkL3PXFMOFcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkL3PXFMOFcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkL3PXFMOFcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunk4PUPGALMcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkK7V27T72cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkL3PXFMOFcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkL3PXFMOFcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunk4PUPGALMcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkL3PXFMOFcjs.SmudgeTip; exports.StrokeCoverage = _chunkL3PXFMOFcjs.StrokeCoverage; exports.SurfaceDraft = _chunk7ISPWEJAcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunk4PUPGALMcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunk4PUPGALMcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunk4PUPGALMcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk7ISPWEJAcjs.TILE; exports.TILE_SHIFT = _chunk7ISPWEJAcjs.TILE_SHIFT; exports.TINT_SCALE = _chunk4PUPGALMcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunk4PUPGALMcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkK7V27T72cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunk4PUPGALMcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkL3PXFMOFcjs.TileMedium; exports.TilePixelSource = _chunkK7V27T72cjs.TilePixelSource; exports.TiledSurface = _chunk7ISPWEJAcjs.TiledSurface; exports.TransformTooLargeError = _chunkDFFBJV3Ucjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkL3PXFMOFcjs.U_MAX; exports.VIBRANCE_GREY = _chunk4PUPGALMcjs.VIBRANCE_GREY; exports.W9 = _chunkL3PXFMOFcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkVYW7JBTMcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkVYW7JBTMcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkL3PXFMOFcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkL3PXFMOFcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkL3PXFMOFcjs.WET_TILE; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetMedium = _chunkL3PXFMOFcjs.WetMedium; exports.WetWorkerPool = _chunkL3PXFMOFcjs.WetWorkerPool; exports.WetWorld = _chunkL3PXFMOFcjs.WetWorld; exports.WetWorldError = _chunkL3PXFMOFcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunk4PUPGALMcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunk4PUPGALMcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunk4PUPGALMcjs.activeSmartFilters; exports.addLayerEffect = _chunk4PUPGALMcjs.addLayerEffect; exports.addLayerFilter = _chunk4PUPGALMcjs.addLayerFilter; exports.addSmartFilter = _chunk4PUPGALMcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunk4PUPGALMcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunk4PUPGALMcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunk4PUPGALMcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunk4PUPGALMcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunk4PUPGALMcjs.anchorPoint; exports.annotationBlend = _chunk4PUPGALMcjs.annotationBlend; exports.annotationLayerFor = _chunk4PUPGALMcjs.annotationLayerFor; exports.annotationLayerName = _chunk4PUPGALMcjs.annotationLayerName; exports.annotationOfLayer = _chunk4PUPGALMcjs.annotationOfLayer; exports.annotationOfShape = _chunk4PUPGALMcjs.annotationOfShape; exports.annotationOfType = _chunk4PUPGALMcjs.annotationOfType; exports.applyAdjustmentLayers = _chunk4PUPGALMcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunk4PUPGALMcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunk4PUPGALMcjs.applyAdjustments; exports.applyBoxBlur = _chunk4PUPGALMcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunk4PUPGALMcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunk4PUPGALMcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunk4PUPGALMcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunk4PUPGALMcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunk4PUPGALMcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunk4PUPGALMcjs.applyParams; exports.applyProcess2Adjustments = _chunk4PUPGALMcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunk4PUPGALMcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkK7V27T72cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunk4PUPGALMcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkL3PXFMOFcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkL3PXFMOFcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkK7V27T72cjs.applyToneToDeepTile; exports.backgroundLayer = _chunk4PUPGALMcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkK7V27T72cjs.bestOffset; exports.blackWhiteGray = _chunk4PUPGALMcjs.blackWhiteGray; exports.blendChannel = _chunk7ISPWEJAcjs.blendChannel; exports.blendImageData = _chunk7ISPWEJAcjs.blendImageData; exports.blendLum = _chunk7ISPWEJAcjs.blendLum; exports.blendPixel = _chunk7ISPWEJAcjs.blendPixel; exports.blendRadius = _chunkL3PXFMOFcjs.blendRadius; exports.blendRgb = _chunk7ISPWEJAcjs.blendRgb; exports.blendTile = _chunkDFFBJV3Ucjs.blendTile; exports.blenderDab = _chunkL3PXFMOFcjs.blenderDab; exports.blurFilter = _chunk4PUPGALMcjs.blurFilter; exports.borderCoverage = _chunk4PUPGALMcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunk4PUPGALMcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunk4PUPGALMcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkK7V27T72cjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkK7V27T72cjs.brushstrokeKey; exports.brushstrokeSamples = _chunkK7V27T72cjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkK7V27T72cjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkK7V27T72cjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkK7V27T72cjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunk4PUPGALMcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunk4PUPGALMcjs.buildToneLut; exports.builtinPattern = _chunkDFFBJV3Ucjs.builtinPattern; exports.builtinPatternIds = _chunkDFFBJV3Ucjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunk4PUPGALMcjs.calculateCropDrag; exports.canShareMemory = _chunkL3PXFMOFcjs.canShareMemory; exports.canvasCompositeOperation = _chunk7ISPWEJAcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunk4PUPGALMcjs.canvasToImagePoint; exports.caretAt = _chunkVYW7JBTMcjs.caretAt; exports.changedTiles = _chunkDFFBJV3Ucjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunk4PUPGALMcjs.clampCropToImage; exports.cleanMixer = _chunkL3PXFMOFcjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunk7ISPWEJAcjs.collectTiles; exports.colorBalanceChannel = _chunk4PUPGALMcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunk4PUPGALMcjs.combineSelections; exports.compileAdjustmentLayer = _chunk4PUPGALMcjs.compileAdjustmentLayer; exports.componentPath = _chunk4PUPGALMcjs.componentPath; exports.compositeDeep = _chunk4PUPGALMcjs.compositeDeep; exports.compositeSurfaceOver = _chunkDFFBJV3Ucjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunk4PUPGALMcjs.computeSelectionBounds; exports.contentBounds = _chunk7ISPWEJAcjs.contentBounds; exports.contentsBox = _chunk4PUPGALMcjs.contentsBox; exports.contentsSurface = _chunk4PUPGALMcjs.contentsSurface; exports.contractCoverage = _chunk4PUPGALMcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunk7ISPWEJAcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunk4PUPGALMcjs.convertToSmartObject; exports.copySmartObject = _chunk4PUPGALMcjs.copySmartObject; exports.cornersFromMatrix = _chunk4PUPGALMcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkL3PXFMOFcjs.coverageTileCoord; exports.coverageToByte = _chunk4PUPGALMcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunk4PUPGALMcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkL3PXFMOFcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkVYW7JBTMcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkVYW7JBTMcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkVYW7JBTMcjs.createOutlineTextShaper; exports.createPigment = _chunk7ISPWEJAcjs.createPigment; exports.createPigmentTools = _chunkL3PXFMOFcjs.createPigmentTools; exports.createSelectionMask = _chunk4PUPGALMcjs.createSelectionMask; exports.createShapeLayer = _chunk4PUPGALMcjs.createShapeLayer; exports.createTypeLayer = _chunk4PUPGALMcjs.createTypeLayer; exports.cssFont = _chunkVYW7JBTMcjs.cssFont; exports.cssFontFamily = _chunkVYW7JBTMcjs.cssFontFamily; exports.curveLut = _chunkDFFBJV3Ucjs.curveLut; exports.curveLutFromLevels = _chunk4PUPGALMcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkL3PXFMOFcjs.dabCoverage; exports.dabRect = _chunkL3PXFMOFcjs.dabRect; exports.decodeDeepSurface = _chunk4PUPGALMcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunk4PUPGALMcjs.decodeLayerChannel; exports.decodeLayerMask = _chunk4PUPGALMcjs.decodeLayerMask; exports.decodeMergedImage = _chunk4PUPGALMcjs.decodeMergedImage; exports.decodePlanes = _chunk4PUPGALMcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunk4PUPGALMcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunk4PUPGALMcjs.decodeSelectionRle; exports.deepBytes = _chunk7ISPWEJAcjs.deepBytes; exports.deepTile = _chunk7ISPWEJAcjs.deepTile; exports.defaultAdjustmentParams = _chunk4PUPGALMcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkDFFBJV3Ucjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkDFFBJV3Ucjs.defaultLayerEffect; exports.defaultShapeName = _chunk4PUPGALMcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunk4PUPGALMcjs.depthMaskAlpha; exports.depthOf = _chunk7ISPWEJAcjs.depthOf; exports.depthRasterMask = _chunk4PUPGALMcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunk4PUPGALMcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunk4PUPGALMcjs.deserializeEffects; exports.deserializeLayer = _chunk4PUPGALMcjs.deserializeLayer; exports.deserializeLayers = _chunk4PUPGALMcjs.deserializeLayers; exports.deserializePatterns = _chunk4PUPGALMcjs.deserializePatterns; exports.deserializeSelection = _chunk4PUPGALMcjs.deserializeSelection; exports.developFilter = _chunk4PUPGALMcjs.developFilter; exports.developFromAdjustments = _chunk4PUPGALMcjs.developFromAdjustments; exports.developTarget = _chunk4PUPGALMcjs.developTarget; exports.dexp = _chunkL3PXFMOFcjs.dexp; exports.dilateMask = _chunkK7V27T72cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunk4PUPGALMcjs.distanceTransform; exports.dlog = _chunkL3PXFMOFcjs.dlog; exports.documentContents = _chunk4PUPGALMcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkK7V27T72cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkK7V27T72cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkL3PXFMOFcjs.dpow; exports.dragWarpMeshPoint = _chunkVYW7JBTMcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkL3PXFMOFcjs.dsincos; exports.duplicateLayer = _chunk4PUPGALMcjs.duplicateLayer; exports.edgeBits = _chunkL3PXFMOFcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkDFFBJV3Ucjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkDFFBJV3Ucjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkDFFBJV3Ucjs.effectsFingerprint; exports.effectsMargin = _chunkDFFBJV3Ucjs.effectsMargin; exports.effectsScale = _chunkDFFBJV3Ucjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk7ISPWEJAcjs.emptySurface; exports.encodeDeepSurface = _chunk4PUPGALMcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunk4PUPGALMcjs.encodeRle; exports.encodeSelectionRle = _chunk4PUPGALMcjs.encodeSelectionRle; exports.encodeSurface = _chunk4PUPGALMcjs.encodeSurface; exports.evalWarpMesh = _chunkVYW7JBTMcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunk4PUPGALMcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkL3PXFMOFcjs.exchangeRates; exports.expNeg = _chunkL3PXFMOFcjs.expNeg; exports.expandCoverage = _chunk4PUPGALMcjs.expandCoverage; exports.exportPsd = _chunk4PUPGALMcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunk4PUPGALMcjs.featherCoverage; exports.fillRect = _chunk7ISPWEJAcjs.fillRect; exports.filmPixel = _chunkL3PXFMOFcjs.filmPixel; exports.filmReflectance = _chunkL3PXFMOFcjs.filmReflectance; exports.filterMaskCoverage = _chunk4PUPGALMcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkDFFBJV3Ucjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunk7ISPWEJAcjs.finishTile; exports.fitParagraphRuns = _chunkVYW7JBTMcjs.fitParagraphRuns; exports.fitRuns = _chunkVYW7JBTMcjs.fitRuns; exports.flattenLayers = _chunkDFFBJV3Ucjs.flattenLayers; exports.flattenPath = _chunk4PUPGALMcjs.flattenPath; exports.flipCorners = _chunk4PUPGALMcjs.flipCorners; exports.flowField = _chunkL3PXFMOFcjs.flowField; exports.fontOf = _chunkVYW7JBTMcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunk4PUPGALMcjs.fullSelection; exports.gaussianBlur = _chunkDFFBJV3Ucjs.gaussianBlur; exports.geometryHomography = _chunk4PUPGALMcjs.geometryHomography; exports.getAnnotationBounds = _chunk4PUPGALMcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunk4PUPGALMcjs.getCropCursor; exports.getRotatedSize = _chunk4PUPGALMcjs.getRotatedSize; exports.getViewportMetrics = _chunk4PUPGALMcjs.getViewportMetrics; exports.getViewportProjection = _chunk4PUPGALMcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunk4PUPGALMcjs.greyMorphology; exports.groupLayers = _chunk4PUPGALMcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkDFFBJV3Ucjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunk4PUPGALMcjs.hasResampledLegacyMask; exports.hasSurface = _chunk4PUPGALMcjs.hasSurface; exports.hasWarp = _chunk4PUPGALMcjs.hasWarp; exports.hashMaskContent = _chunk4PUPGALMcjs.hashMaskContent; exports.hashNoise = _chunkDFFBJV3Ucjs.hashNoise; exports.healPixels = _chunkK7V27T72cjs.healPixels; exports.hexToRgb = _chunk4PUPGALMcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunk4PUPGALMcjs.hitTestAnnotation; exports.hitTestCrop = _chunk4PUPGALMcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunk4PUPGALMcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunk4PUPGALMcjs.hueRangeTables; exports.hueRangeWeight = _chunk4PUPGALMcjs.hueRangeWeight; exports.hueSaturation = _chunk4PUPGALMcjs.hueSaturation; exports.identityCurve = _chunk4PUPGALMcjs.identityCurve; exports.identityLevels = _chunk4PUPGALMcjs.identityLevels; exports.identityTransform = _chunk4PUPGALMcjs.identityTransform; exports.identityWarpMesh = _chunkVYW7JBTMcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunk4PUPGALMcjs.imageToCanvasPoint; exports.importPsd = _chunk4PUPGALMcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkDFFBJV3Ucjs.insertLayer; exports.instancesOf = _chunk4PUPGALMcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunk4PUPGALMcjs.invertMatrix3; exports.invertSelection = _chunk4PUPGALMcjs.invertSelection; exports.isActiveFilter = _chunk4PUPGALMcjs.isActiveFilter; exports.isAdjustmentKind = _chunk4PUPGALMcjs.isAdjustmentKind; exports.isBitDepth = _chunk7ISPWEJAcjs.isBitDepth; exports.isBlendMode = _chunk7ISPWEJAcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkK7V27T72cjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunk4PUPGALMcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunk4PUPGALMcjs.isDefaultDepthMask; exports.isIdentityTransform = _chunk4PUPGALMcjs.isIdentityTransform; exports.isInterpolation = _chunkDFFBJV3Ucjs.isInterpolation; exports.isLayerEffectKind = _chunkDFFBJV3Ucjs.isLayerEffectKind; exports.isLayerLocked = _chunkDFFBJV3Ucjs.isLayerLocked; exports.isLegacyShape = _chunk4PUPGALMcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunk7ISPWEJAcjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunk4PUPGALMcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunk4PUPGALMcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunk4PUPGALMcjs.isSelectionEmpty; exports.isSelectionMode = _chunk4PUPGALMcjs.isSelectionMode; exports.isSeparableBlendMode = _chunk7ISPWEJAcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunk4PUPGALMcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunk4PUPGALMcjs.isTransformAnchor; exports.isValidWarp = _chunk4PUPGALMcjs.isValidWarp; exports.keepDeepSamples = _chunk7ISPWEJAcjs.keepDeepSamples; exports.kelvinToTemperature = _chunk4PUPGALMcjs.kelvinToTemperature; exports.keysWeight = _chunkDFFBJV3Ucjs.keysWeight; exports.latticeViscosity = _chunkL3PXFMOFcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkDFFBJV3Ucjs.layerEffectFields; exports.layerEffectLabel = _chunkDFFBJV3Ucjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunk4PUPGALMcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunk4PUPGALMcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunk4PUPGALMcjs.layerMaskFromSelection; exports.layerMaskKey = _chunk4PUPGALMcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunk4PUPGALMcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunk4PUPGALMcjs.layerTree; exports.layerTypeLabel = _chunk4PUPGALMcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunk4PUPGALMcjs.layersFromLegacy; exports.layoutText = _chunkVYW7JBTMcjs.layoutText; exports.legacyAdjustmentLayer = _chunk4PUPGALMcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunk4PUPGALMcjs.legacyMaskOf; exports.legacyView = _chunk4PUPGALMcjs.legacyView; exports.lerpPigment = _chunk7ISPWEJAcjs.lerpPigment; exports.lerpPigmentInto = _chunk7ISPWEJAcjs.lerpPigmentInto; exports.levelsValue = _chunk4PUPGALMcjs.levelsValue; exports.linearSrgbToXy = _chunk4PUPGALMcjs.linearSrgbToXy; exports.linearToSrgb = _chunk4PUPGALMcjs.linearToSrgb; exports.linearToSrgb8 = _chunkL3PXFMOFcjs.linearToSrgb8; exports.liveComponent = _chunk4PUPGALMcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunk4PUPGALMcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkL3PXFMOFcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkL3PXFMOFcjs.loadWetKernel; exports.luma = _chunkK7V27T72cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunk4PUPGALMcjs.mapCropHandle; exports.mapLayer = _chunkDFFBJV3Ucjs.mapLayer; exports.mapSubpaths = _chunk4PUPGALMcjs.mapSubpaths; exports.maskBounds = _chunkK7V27T72cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunk4PUPGALMcjs.matrixFromCorners; exports.matrixFromParams = _chunk4PUPGALMcjs.matrixFromParams; exports.membraneFill = _chunkK7V27T72cjs.membraneFill; exports.mergeLayerEffect = _chunkDFFBJV3Ucjs.mergeLayerEffect; exports.mergeShapeComponents = _chunk4PUPGALMcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunk7ISPWEJAcjs.mixPigment8; exports.mixPigmentRgb = _chunk7ISPWEJAcjs.mixPigmentRgb; exports.mixPigments = _chunk7ISPWEJAcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkL3PXFMOFcjs.mixerRates; exports.modifySelection = _chunk4PUPGALMcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunk4PUPGALMcjs.moveLayer; exports.moveSmartFilter = _chunk4PUPGALMcjs.moveSmartFilter; exports.mulMatrix3 = _chunk4PUPGALMcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunk4PUPGALMcjs.neutralHueRange; exports.newContentsId = _chunk4PUPGALMcjs.newContentsId; exports.newEffectId = _chunkDFFBJV3Ucjs.newEffectId; exports.newLayerId = _chunk4PUPGALMcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunk4PUPGALMcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunk4PUPGALMcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunk4PUPGALMcjs.normalizeAngle; exports.normalizeBlendMode = _chunk7ISPWEJAcjs.normalizeBlendMode; exports.normalizeBlender = _chunkL3PXFMOFcjs.normalizeBlender; exports.normalizeBrush = _chunkL3PXFMOFcjs.normalizeBrush; exports.normalizeFilter = _chunk4PUPGALMcjs.normalizeFilter; exports.normalizeFlow = _chunkL3PXFMOFcjs.normalizeFlow; exports.normalizeLayerEffects = _chunkDFFBJV3Ucjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunk4PUPGALMcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunk4PUPGALMcjs.normalizeLiveShape; exports.normalizeMixer = _chunkL3PXFMOFcjs.normalizeMixer; exports.normalizePlacement = _chunk4PUPGALMcjs.normalizePlacement; exports.normalizeProcessVersion = _chunk4PUPGALMcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkK7V27T72cjs.normalizeRetouch; exports.normalizeShapePaint = _chunk4PUPGALMcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunk4PUPGALMcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunk4PUPGALMcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkL3PXFMOFcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunk4PUPGALMcjs.normalizeSubpaths; exports.normalizeText = _chunk4PUPGALMcjs.normalizeText; exports.normalizeTilt = _chunkL3PXFMOFcjs.normalizeTilt; exports.normalizeWetParams = _chunkL3PXFMOFcjs.normalizeWetParams; exports.offsetLayer = _chunk4PUPGALMcjs.offsetLayer; exports.offsetShape = _chunk4PUPGALMcjs.offsetShape; exports.offsetSmartObject = _chunk4PUPGALMcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunk7ISPWEJAcjs.packRgba; exports.packWetParams = _chunkL3PXFMOFcjs.packWetParams; exports.paintPathStroke = _chunkK7V27T72cjs.paintPathStroke; exports.paragraphRanges = _chunkVYW7JBTMcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunk4PUPGALMcjs.parseAdjustmentBlock; exports.parseBlend = _chunk4PUPGALMcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk4PUPGALMcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunkDFFBJV3Ucjs.parseEffectColor; exports.parseLfx2 = _chunk4PUPGALMcjs.parseLfx2; exports.parseLrfx = _chunk4PUPGALMcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePatternBlock = _chunk4PUPGALMcjs.parsePatternBlock; exports.parseSelectionMode = _chunk4PUPGALMcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunk4PUPGALMcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunk4PUPGALMcjs.patchParagraphStyle; exports.patchTextStyle = _chunk4PUPGALMcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkK7V27T72cjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkK7V27T72cjs.pathStrokeDabs; exports.perDabStrength = _chunkK7V27T72cjs.perDabStrength; exports.photoFilterMatrix = _chunk4PUPGALMcjs.photoFilterMatrix; exports.pigment8 = _chunk7ISPWEJAcjs.pigment8; exports.pigmentColor = _chunkL3PXFMOFcjs.pigmentColor; exports.pigmentOf = _chunkL3PXFMOFcjs.pigmentOf; exports.pixelLayerBounds = _chunk4PUPGALMcjs.pixelLayerBounds; exports.pixelLayers = _chunk4PUPGALMcjs.pixelLayers; exports.pixelPigment = _chunkL3PXFMOFcjs.pixelPigment; exports.placeContents = _chunk4PUPGALMcjs.placeContents; exports.placeLayer = _chunk4PUPGALMcjs.placeLayer; exports.placementAt = _chunk4PUPGALMcjs.placementAt; exports.placementBounds = _chunk4PUPGALMcjs.placementBounds; exports.placementGeometry = _chunk4PUPGALMcjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunk4PUPGALMcjs.posterizeValue; exports.presetWarp = _chunk4PUPGALMcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunk4PUPGALMcjs.projectImagePoint; exports.projectImageRect = _chunk4PUPGALMcjs.projectImageRect; exports.projectMaskCoverage = _chunk4PUPGALMcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunk7ISPWEJAcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunk4PUPGALMcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunk4PUPGALMcjs.psdToLayers; exports.pullWarpMesh = _chunkVYW7JBTMcjs.pullWarpMesh; exports.put255 = _chunkL3PXFMOFcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunk4PUPGALMcjs.rangeLightness; exports.rasterContents = _chunk4PUPGALMcjs.rasterContents; exports.rasterMaskFromLegacy = _chunk4PUPGALMcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunk4PUPGALMcjs.rasterizeCoverage; exports.rasterizeDab = _chunkL3PXFMOFcjs.rasterizeDab; exports.rasterizeSmartObject = _chunk4PUPGALMcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunk7ISPWEJAcjs.readDeepRegion; exports.readPixel = _chunk7ISPWEJAcjs.readPixel; exports.readPsd = _chunk4PUPGALMcjs.readPsd; exports.readRegion = _chunk7ISPWEJAcjs.readRegion; exports.readSourceRegion = _chunkK7V27T72cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkDFFBJV3Ucjs.reduceSurface; exports.referencePoint = _chunk4PUPGALMcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunk7ISPWEJAcjs.reflectanceToRgb; exports.removeAlpha = _chunk4PUPGALMcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunk4PUPGALMcjs.removeLayer; exports.removeLayerEffect = _chunk4PUPGALMcjs.removeLayerEffect; exports.removeLayerFilter = _chunk4PUPGALMcjs.removeLayerFilter; exports.removeSmartFilter = _chunk4PUPGALMcjs.removeSmartFilter; exports.renderBrushstroke = _chunkK7V27T72cjs.renderBrushstroke; exports.renderLayerEffects = _chunkDFFBJV3Ucjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunk4PUPGALMcjs.renderShape; exports.renderShapeRect = _chunk4PUPGALMcjs.renderShapeRect; exports.renderSmartObject = _chunk4PUPGALMcjs.renderSmartObject; exports.renderText = _chunk4PUPGALMcjs.renderText; exports.replaceContents = _chunk4PUPGALMcjs.replaceContents; exports.replaceTextRange = _chunk4PUPGALMcjs.replaceTextRange; exports.requireLayer = _chunk4PUPGALMcjs.requireLayer; exports.requireOperation = _chunk4PUPGALMcjs.requireOperation; exports.requireShapeLayer = _chunk4PUPGALMcjs.requireShapeLayer; exports.requireSmartObject = _chunk4PUPGALMcjs.requireSmartObject; exports.requireTypeLayer = _chunk4PUPGALMcjs.requireTypeLayer; exports.requireUnlocked = _chunk4PUPGALMcjs.requireUnlocked; exports.rerender = _chunk4PUPGALMcjs.rerender; exports.rerenderShape = _chunk4PUPGALMcjs.rerenderShape; exports.rerenderText = _chunk4PUPGALMcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunk4PUPGALMcjs.resizeSelection; exports.resizeWarpMesh = _chunkVYW7JBTMcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunk4PUPGALMcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkVYW7JBTMcjs.restyleRange; exports.rgbToGray = _chunk4PUPGALMcjs.rgbToGray; exports.rgbToHsl = _chunk4PUPGALMcjs.rgbToHsl; exports.rgbToReflectance = _chunk7ISPWEJAcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkK7V27T72cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunk4PUPGALMcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunk4PUPGALMcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunk4PUPGALMcjs.sampleLut; exports.sampleToneLut = _chunk4PUPGALMcjs.sampleToneLut; exports.saturationOf = _chunkK7V27T72cjs.saturationOf; exports.scaleLayerEffect = _chunkDFFBJV3Ucjs.scaleLayerEffect; exports.seamlessClone = _chunkK7V27T72cjs.seamlessClone; exports.selectionArea = _chunk4PUPGALMcjs.selectionArea; exports.selectionFromCoverage = _chunk4PUPGALMcjs.selectionFromCoverage; exports.selectionFromPixels = _chunk4PUPGALMcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunk4PUPGALMcjs.selectionToCoverage; exports.selectionToPixels = _chunk4PUPGALMcjs.selectionToPixels; exports.selectionValueAt = _chunk4PUPGALMcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunk4PUPGALMcjs.serializeContents; exports.serializeEffects = _chunk4PUPGALMcjs.serializeEffects; exports.serializeLayer = _chunk4PUPGALMcjs.serializeLayer; exports.serializeLayers = _chunk4PUPGALMcjs.serializeLayers; exports.serializeLayersExternal = _chunk4PUPGALMcjs.serializeLayersExternal; exports.serializePatterns = _chunk4PUPGALMcjs.serializePatterns; exports.serializeSelection = _chunk4PUPGALMcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunk4PUPGALMcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunk4PUPGALMcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunk4PUPGALMcjs.setLayerMask; exports.setLayerProperties = _chunk4PUPGALMcjs.setLayerProperties; exports.setLum = _chunk7ISPWEJAcjs.setLum; exports.setPigmentColor = _chunk7ISPWEJAcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunk4PUPGALMcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunk4PUPGALMcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunk4PUPGALMcjs.setSmartPlacement; exports.shadeTile = _chunkL3PXFMOFcjs.shadeTile; exports.shapeAsPixelLayer = _chunk4PUPGALMcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunk4PUPGALMcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunk4PUPGALMcjs.shapeGeometryBounds; exports.shapeLayers = _chunk4PUPGALMcjs.shapeLayers; exports.shapeOutline = _chunk4PUPGALMcjs.shapeOutline; exports.shapeRenderClip = _chunk4PUPGALMcjs.shapeRenderClip; exports.shiftCoverage = _chunk4PUPGALMcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunk4PUPGALMcjs.smartObjectLayers; exports.smoothCoverage = _chunk4PUPGALMcjs.smoothCoverage; exports.smoothPoints = _chunkL3PXFMOFcjs.smoothPoints; exports.smudgeEffect = _chunkK7V27T72cjs.smudgeEffect; exports.solidSurface = _chunk7ISPWEJAcjs.solidSurface; exports.solveMembrane = _chunkK7V27T72cjs.solveMembrane; exports.spliceRuns = _chunkVYW7JBTMcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkK7V27T72cjs.sponge; exports.spongeEffect = _chunkK7V27T72cjs.spongeEffect; exports.spotHealPixels = _chunkK7V27T72cjs.spotHealPixels; exports.spotHealWindow = _chunkK7V27T72cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkL3PXFMOFcjs.srgbByteToLinear; exports.srgbDecode = _chunk7ISPWEJAcjs.srgbDecode; exports.srgbEncode = _chunk7ISPWEJAcjs.srgbEncode; exports.srgbToLinear = _chunk4PUPGALMcjs.srgbToLinear; exports.standardBlendMode = _chunk7ISPWEJAcjs.standardBlendMode; exports.stepSlotTs = _chunkL3PXFMOFcjs.stepSlotTs; exports.styleAt = _chunkVYW7JBTMcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunk7ISPWEJAcjs.surfaceBytes; exports.surfaceDepth = _chunk7ISPWEJAcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunk7ISPWEJAcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk7ISPWEJAcjs.surfaceFromPixels; exports.surfacesEqual = _chunk7ISPWEJAcjs.surfacesEqual; exports.tempTintToXy = _chunk4PUPGALMcjs.tempTintToXy; exports.temperatureToKelvin = _chunk4PUPGALMcjs.temperatureToKelvin; exports.textIndexAt = _chunkVYW7JBTMcjs.textIndexAt; exports.textMatrix = _chunk4PUPGALMcjs.textMatrix; exports.textOutlines = _chunk4PUPGALMcjs.textOutlines; exports.textRange = _chunk4PUPGALMcjs.textRange; exports.tileCoord = _chunk7ISPWEJAcjs.tileCoord; exports.tileKey = _chunk7ISPWEJAcjs.tileKey; exports.tileRect = _chunk7ISPWEJAcjs.tileRect; exports.tileSamples = _chunk7ISPWEJAcjs.tileSamples; exports.tileSamples16 = _chunk7ISPWEJAcjs.tileSamples16; exports.tileSamples32 = _chunk7ISPWEJAcjs.tileSamples32; exports.tilesInRect = _chunk7ISPWEJAcjs.tilesInRect; exports.tipFalloff = _chunkL3PXFMOFcjs.tipFalloff; exports.tipReach = _chunkL3PXFMOFcjs.tipReach; exports.tipShape = _chunkL3PXFMOFcjs.tipShape; exports.to16From32 = _chunk7ISPWEJAcjs.to16From32; exports.to16From8 = _chunk7ISPWEJAcjs.to16From8; exports.to32From16 = _chunk7ISPWEJAcjs.to32From16; exports.to32From8 = _chunk7ISPWEJAcjs.to32From8; exports.to8From16 = _chunk7ISPWEJAcjs.to8From16; exports.to8From32 = _chunk7ISPWEJAcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunk4PUPGALMcjs.toTextSpace; exports.toneCurve = _chunk4PUPGALMcjs.toneCurve; exports.toneLuts = _chunk4PUPGALMcjs.toneLuts; exports.toneOf = _chunkK7V27T72cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunk4PUPGALMcjs.transformHomography; exports.transformMap = _chunk4PUPGALMcjs.transformMap; exports.transformShapeComponents = _chunk4PUPGALMcjs.transformShapeComponents; exports.transformSurface = _chunkDFFBJV3Ucjs.transformSurface; exports.transformTypeLayer = _chunk4PUPGALMcjs.transformTypeLayer; exports.transformedBounds = _chunkDFFBJV3Ucjs.transformedBounds; exports.transformedBox = _chunk4PUPGALMcjs.transformedBox; exports.transformedPoint = _chunk4PUPGALMcjs.transformedPoint; exports.translateSurface = _chunk7ISPWEJAcjs.translateSurface; exports.typeAsPixelLayer = _chunk4PUPGALMcjs.typeAsPixelLayer; exports.typeFrame = _chunk4PUPGALMcjs.typeFrame; exports.typeFromAnnotation = _chunk4PUPGALMcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunk4PUPGALMcjs.typeLayerName; exports.ungroupLayer = _chunk4PUPGALMcjs.ungroupLayer; exports.uniformTile = _chunk7ISPWEJAcjs.uniformTile; exports.unionRect = _chunk4PUPGALMcjs.unionRect; exports.unprojectCanvasPoint = _chunk4PUPGALMcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunk4PUPGALMcjs.updateLayerEffect; exports.updateLayerFilter = _chunk4PUPGALMcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunk4PUPGALMcjs.updateLayerMaskProps; exports.updateShapeLayer = _chunk4PUPGALMcjs.updateShapeLayer; exports.updateSmartFilter = _chunk4PUPGALMcjs.updateSmartFilter; exports.updateTypeLayer = _chunk4PUPGALMcjs.updateTypeLayer; exports.uvToXy = _chunk4PUPGALMcjs.uvToXy; exports.validateEffectGradient = _chunkDFFBJV3Ucjs.validateEffectGradient; exports.validateLayerEffect = _chunkDFFBJV3Ucjs.validateLayerEffect; exports.validateLayerEffects = _chunkDFFBJV3Ucjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunk4PUPGALMcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunk4PUPGALMcjs.vibranceLinear; exports.vibrancePixel = _chunk4PUPGALMcjs.vibrancePixel; exports.walkDabs = _chunkL3PXFMOFcjs.walkDabs; exports.warpMeshEditPoints = _chunkVYW7JBTMcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkVYW7JBTMcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkVYW7JBTMcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkVYW7JBTMcjs.warpPresetMesh; exports.warpSurface = _chunkDFFBJV3Ucjs.warpSurface; exports.wbMatrix = _chunk4PUPGALMcjs.wbMatrix; exports.wetSimdSupported = _chunkL3PXFMOFcjs.wetSimdSupported; exports.wetSupport = _chunkL3PXFMOFcjs.wetSupport; exports.whiteBalanceFromSample = _chunk4PUPGALMcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunk4PUPGALMcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunk4PUPGALMcjs.withFilterMaskSurface; exports.withNewIds = _chunk4PUPGALMcjs.withNewIds; exports.writeAdjustmentBlock = _chunk4PUPGALMcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunk7ISPWEJAcjs.writeDeepRegion; exports.writeLfx2 = _chunk4PUPGALMcjs.writeLfx2; exports.writePatternBlock = _chunk4PUPGALMcjs.writePatternBlock; exports.writePsd = _chunk4PUPGALMcjs.writePsd; exports.writeRegion = _chunk7ISPWEJAcjs.writeRegion; exports.xyToTempTint = _chunk4PUPGALMcjs.xyToTempTint; exports.xyToUv = _chunk4PUPGALMcjs.xyToUv;
15055
15061
  //# sourceMappingURL=index.cjs.map